  We study the random energy model with a hierarchical structure known as the
generalized random energy model (GREM). In contrast to the original analysis by
the microcanonical ensemble formalism, we investigate the GREM by the canonical
ensemble formalism in conjunction with the replica method. In this analysis,
spin-glass-order parameters are defined for respective hierarchy level, and all
possible patterns of replica symmetry breaking (RSB) are taken into account. As
a result, we find that the higher step RSB ansatz is useful for describing
spin-glass phases in this system. For investigating the nature of the higher
step RSB, we generalize the notion of complexity developed for the one-step RSB
to the higher step and demonstrate how the GREM is characterized by the
generalized complexity. In addition, we propose a novel mean-field spin-glass
model with a hierarchical structure, which is equivalent to the GREM at a
certain limit. We also show that the same hierarchical structure can be
implemented to other mean-field spin models than the GREM. Such models with
hierarchy exhibit phase transitions of multiple steps in common.
