Replica-symmetry breaking transitions in the large deviations of the ground-state of a spherical spin-glass

We derive, within the replica formalism, a generalisation of the Crisanti-Sommers formula to describe the large deviation function (LDF) ${\cal L}(e)$ for the speed-$N$ atypical fluctuations of the intensive ground-state energy $e$ of a generic spherical spin-glass in the presence of a random external magnetic field of variance $\Gamma$. We then analyse our exact formula for the LDF in much detail for the Replica symmetric, single step Replica Symmetry Breaking (1-RSB) and Full Replica Symmetry Breaking (FRSB) situations. Our main qualitative conclusion is that the level of RSB governing the LDF may be different from that for the typical ground state. We find that while the deepest ground-states are always controlled by a LDF of replica symmetric form, beyond a finite threshold $e\geq e_{t}$ a replica-symmetry breaking starts to be operative. These findings resolve the puzzling discrepancy between our earlier replica calculations for the $p=2$ spherical spin-glass and the rigorous results by Dembo and Zeitouni which we are able to reproduce invoking an 1-RSB pattern. Finally at an even larger critical energy $e_{c}\geq e_{t}$, acting as a"wall", the LDF diverges logarithmically, which we interpret as a change in the large deviation speed from $N$ to a faster growth. In addition, we show that in the limit $\Gamma \to 0$ the LDF takes non-trivial scaling forms (i) ${\cal L}(e) \sim G((e-e_c)/\Gamma)$ in the vicinity of the wall (ii) ${\cal L}(e) \sim \Gamma^{\eta \nu} F((e-e_{\rm typ})/\Gamma^{\nu})$ in the vicinity of the typical energy, characterised by two new exponents $\eta\geq 1$ and $\nu$ characterising universality classes. Via matching the latter allows us to formulate several conjectures concerning the regime of {\it typical fluctuations}, identified as $e-e_{\rm typ} \sim N^{-1/\eta}$ and $\Gamma \sim N^{-1/(\eta \nu)}$.


A. Model
The properties of high-dimensional random landscapes attracted a lot of attention in recent years. One of the main driving forces behind that interest is a wish to understand universal features of search algorithms aiming to solve high-dimensional non-convex optimization problems, where the cost/loss functions to be optimized are highly irregular or corrugated and may trap the search considerably in the maze of many local minima and saddle points. Examples of such problems are abundant in constraint satisfaction or inference problems [3] as well as loss landscapes in supervised learning [4], and have intimate relations with many problems in economics, biology, chemistry, condensed matter physics, string theory and cosmology, see [5] and [6] for a concise introduction to the problematic and further references.
Among many relevant questions to be studied in this framework, one of the most naturally arising is to characterise statistically the value of the global minimum in some benchmark models of random landscapes. The role of such benchmarks is largely served by the so-called spin glass models, one of the most canonical choices being the Sherrington-Kirkpatrick (SK) model [7,8] asking to minimize a random quadratic form ij J ij S i S j , interpreted in that context as an energy function and called the Hamiltonian, over the hypercube of 2 N vertices parametrized by Ising spin variables S i = ±1, i = 1, . . . , N , with parameters J i<j being independent, identically distributed real Gaussian variables. Another paradigmatic choice is the so-called spherical spin glass model, with aim to optimize a generic Hamiltonian H(x), x ∈ R N assumed to be a mean-zero random Gaussian field with the covariance structure f (q) = Γq + g(q) , g(q) = ∞ r=2 g r q r , Γ ≥ 0 , ∀r ≥ 2 , g r ≥ 0 , q ∈ [0, 1] over the sphere x 2 = N . We suppose that the function g(q) defined as a series above has a radius of convergence larger than unity, and is C ∞ over the interval [0, 1], so that f (1) < +∞. In particular, taking g p = δ p,r /p, the Hamiltonian corresponds to the spherical pure p-spin model subject to a random Gaussian magnetic field with zero mean and variance Γ. With functions to be optimized being random, their values at the global minimum are necessarily random as well, and one of the main goals of the theory is to characterize the whole distribution of such a random variable, traditionally 2 called the ground state energy E min , in the limit of large dimension N 1. One of the possible approaches to such a problem is inspired by ideas from statistical mechanics and aims at extracting the value of the ground state energy per degree of freedom e min = E min /N from the zero temperature limit of the associated free energy. For the case of spherical spin glasses this method amounts to evaluating e min = 1 N min where Z(β) is the partition function at inverse temperature β, defined as with S N −1 being the N -dimensional unit sphere. Similar formulae can be written for the ground energy of SK or any other optimization model with a given cost/loss function. One defines the probability distribution function (PDF) of the ground state energy P(e) = δ(e − e min ) .
In the large N limit, it is well known that the ground state energy per degree of freedom e min is a self-averaging quantity, i.e. tends to a nonrandom limit e min when N → ∞ lim N →+∞ e min = e min .
The aim of this paper is to describe the fluctuations of e min in particular, focusing on the large deviations tails of P(e) which describe atypical fluctuations away from e min . Before describing the method and our results, it is worth reviewing in some details the literature on the average e min , in particular the phenomenon of replica-symmetry breaking (RSB), which will also turn out to be essential to understand the problem at hand.

B. Average ground-state energy
The theoretical physics framework allowing one to compute the limiting free energy associated with the SK model, and thus eventually to extract e min , has been originally developed in a series of pioneering papers by Giorgio Parisi starting from [9]. In those works it has been demonstrated that finding the ground state required introducing the fundamental concept of Replica Symmetry Breaking (RSB), see [10] for a standard introduction. In such framework finding e min amounts to optimizing the so-called Parisi functional with respect to a positive, non-descreasing function x(q), q ∈ [0, 1], and the optimal solution has been predicted to have a part which is continuous in a finite interval q ∈ [a, b] ⊂ [0, 1]. Such solution is then known to describe the situation of the Full Replica Symmetry Breaking (FRSB), which reflects an intricate picture of minima of the associated random landscape informally described as hierarchically organized system of valleys within valleys within valleys, and so on. In such a situation the saddle-points and minima are expected to co-exist at the same level of energy down to the global minimal value, which is predicted to imply, among other things, the gapless spectrum of Hessian around the global minimum, known as the property of "marginal stability". The picture also suggests an extreme sensitivity of the ground state to small changes in random parameters, known as the "disorder chaos", see [10][11][12] for various aspects of all the above-mentioned phenomena.
Note that although originally the Parisi functional was derived using the powerful, but non-rigorous replica method, more recently it was re-derived and analyzed by fully controlled, mathematically rigorous techniques starting from seminal papers by Guerra and Talagrand [13,14], see [15] for a detailed exposition and overview of further developments. In particular, there has been considerable progress towards proving the FRSB nature of the solution at zero temperature [16].
The problem of extracting the ground state energy for the spherical spin glass Hamiltonian turns out to be as rich as that for the Ising case, but appears to be more easily amenable for a detailed and explicit analysis. An analogue of Parisi functional for the mean free energy (and hence for the ground state value e min ) for that model has been derived originally in a seminal work of Crisanti and Sommers [17] using the replica approach. In recent years the Crisanti-Sommers variational problem has been re-derived rigorously [18] and then thoroughly analyzed in various parameter regimes in many mathematical papers, see e.g. [19][20][21][22][23][24]. These studies demonstrated that depending on the choice of parameters the variational problem for the ground state energy may have piecewise-constant solutions, associated with the so-called k-step replica symmetry breaking (k-RSB) pattern, with the case k = 0 corresponding to the simplest Replica Symmetric (RS) solution. In particular, k = 1 is realized generically for all spherical pure p-spin models with p ≥ 3, provided the magnetic field variance Γ is small enough, the picture already predicted in the original Crisanti and Sommers paper [17]. For either pure p = 2 case or any pure case and strong enough magnetic field variance Γ the RS solution is known to hold. Physically, 1RSB type of replica symmetry breaking corresponds to the landscape dominated below certain level by exponentially many isolated minima separated by high barriers, whereas RS solution is to be expected for subexponential (frequently, just finite) number of minima in the landscape [10,11].
Allowing for some mixtures of two different powers in the covariance Eq.(2) may lead to more complicated solutions, like 2-RSB for a mixture of two powers r = 2 and r = 4 with specially chosen coefficients [23,25]. Moreover, taking generic mixtures of two powers (strictly larger than 2) may lead to solution mixing FRSB features with 1-RSB and 2-RSB (called therefore 1-FRSB and 2-FRSB) [24][25][26], but never to pure FRSB solution. The situation for a generic mixture of infinitely many powers is not yet rigorously established, but expected to be of FRSB type. We see therefore that the spherical model allows a very rich behaviour for its ground state problem in the limit N → ∞.
It is necessary to mention that, in the spherical case, the method of Crisanti-Sommers functional for characterizing the ground state value in the limit N → ∞ has certain viable alternatives. The first one is based on exact counting of extrema of the energy functional via the so-called Kac-Rice formula. Such counting has been originally performed in [27][28][29] for a certain type of spin glass models, and independently rediscovered, further developed and successfully applied to studying the spherical pure p-spin glasses, in particular to extracting the ground state value in [30,31]. Further work in this direction lead to a detailed characterization of landscape geometry close to the ground state value, see e.g. [32]. This line of research is closely related to developing the so-called Thouless-Anderson-Palmer approach to free energy of spherical pure p-spin glasses, see [33] for the original physics paper and [34,35] for discussions of the recent efforts in mathematical literature. Another interesting alternative suggested very recently for the spherical pure p-spin is based on the cavity approach [36].
A detailed quantitative discussion of the average (and typical) ground-state energy is given in Appendix A.
C. Fluctuations and large deviations of the ground state energy and aim of the paper While the discussion above shows that the problem of finding equilibrium free energy and then eventually the ground state value e min for a general spherical spin glass model in the limit N → ∞ is by now relatively well-studied, the problem of characterizing the ground state fluctuations for large, but finite N 1 remains scarcely researched. For general spherical mixed even p-spin models with Γ = 0, the extensive ground state energy E min = N e min "superconcentrates", which means that V min = lim N →∞ Var (E min ) /N = 0, whereas for any fixed magnetic field Γ > 0 the above limit is finite and the ground state energy satisfies the Central Limit Theorem [20]. This last fact implicitly suggests that for Γ > 0 the fluctuations of the ground state energy away from e min may actually satisfy a Large Deviation Principle with the speed N , at least in some finite interval of values of e min around e min . This means that, asymptotically at large N , the PDF takes the form P(e) e −N L(e) , N 1 .
where L(e) is the large deviation function (LDF). Computing this quantity explicitly, using a variant of the replica trick, together with establishing the range of value e where L(e) is finite is the main goal of this paper. In particular one expects that L(e = e min ) = 0 such that typical and average value of e min coincide e typ = e min . Let us first discuss the special case of the spherical p = 2 spin model in a random magnetic field. Let us recall that the spherical p = 2 spin model without external field, i.e. Γ = 0, stands out as very special. Indeed, the Hamiltonian in this case can be equivalently written as a quadratic form H(x) = − 1 2 (x, Jx) , with J being a N × N random matrix from the standard Gaussian Orthogonal Ensemble (GOE) [37]. Hence, the ground state energy in this case has a simple alternative description: e min = −λ max is the maximum eigenvalue of a N ×N GOE matrix, which as N → ∞ tends to λ (∞) max = 2, implying e min = −1 for this case (with e.g. g(q) = q 2 /2). This value can be shown to correspond to the simplest replica-symmetric solution to the Crisanti-Sommers variational problem, corroborating with the fact that any quadratic form over the sphere may have only two minima, trivially related by the symmetry x → −x. Further, the classical results in random matrix theory allow to find explicitly the distribution of the ground state value e min := e which, in the large N limit, take the following forms in the three different asymptotic regimes , e + 1 < 0 , N 2/3 F 1 −2N 2/3 (e + 1) , e + 1 = O(N −2/3 ) , e −N 2 Ψ(e) , e + 1 > 0 .
The typical fluctuations are described by F 1 (s), i.e. the GOE Tracy-Widom law [38]. The corresponding regime has a width e + 1 = O(N −2/3 ). The large deviation regimes describe the fluctuations e − e min = e + 1 = O(1) with a speed N for e − e min < 0 and a speed N 2 for e − e min > 0. The rate functions have been obtained explicitly [1,[39][40][41].
With added magnetic field term Γ > 0 in the covariance Eq.(2) the relation of the ground state energy e for the p = 2 spherical model to theory of random matrices becomes less transparent (see [42]), although its limiting value e min is not difficult to find [37,43] as the corresponding optimization problem again allows only a replica-symmetric solution for any Γ ≥ 0. As to the ensuing statistics of fluctuations in the large deviation regime for the free energy and for the ground state energy e, both were a subject of substantial interest in recent years, starting from the physics paper by two of us [1] followed by mathematics papers, first by [2], and then by several others [42,[44][45][46][47][48]. In [1] a variant of the replica trick was employed to calculate the LDF with the speed N , L(e), whose validity for Γ > 0 was found to cover not only the range e < e min , but extended also to a certain positive range of values e min < e < e c,RS . For e > e c,RS the LDF became complex, and it was suggested that this would correspond to a change in the speed of large deviations for e > e c,RS . To a considerable surprise, the subsequent rigorous optimization procedure for random quadratic forms developed in [2] only confirmed the suggested replica-based formula for the LDF in an interval −∞ < e < e L , with e min < e L < e c,RS , whereas a different expression was found to hold for LDF in e ∈ [e L , e c ), with e c = e c,RS . Such an apparent, even if only partial, discrepancy between results of the replica-based calculation and the rigorous optimization is certainly puzzling, and poses a challenge to replica practitioners. Indeed, the collective experience accumulated in the theoretical physics community over several decades makes one to believe that the replica method, being inherently mathematically non-rigorous, is nevertheless trustworthy in results it produces when judiciously applied. The present work stemmed in part from our wish to vindicate the trustworthiness of the replica trick in the large deviation setting, and to apply it for calculation of the LDF beyond the simplest p = 2 case.
In order to compute the large deviation function, we will follow the same replica procedure as employed in [1] and compute first the cumulant generating function φ(s) of e min , resorting to the identity [49] Note that from the definition of φ(s) in Eq. (9) and by a simple application of Jensen's inequality, the function φ(s) must be convex. Inserting the form (7) into (9) we see that so that the large deviation function L(e) is then obtained by inversion of the Legendre transform which can be written as Note that the average and typical ground-state energy can be obtained easily from φ(s) in the high-dimensional limit as In order to derive φ(s) we first compute using saddle point methods in the large N limit of the integer moments of the partition sum Z(β) n , n ∈ N for arbitrary inverse temperature β > 0. Using the framework of replica methods we are able to analytically continue its expression to the regime of interest for large deviations n = s/β with fixed s. The following remark is appropriate here. In a relatively recent paper [50] the authors used not dissimilar technique to address the LDF for the free energy for the spherical p-spin model in a random magnetic field. They did not specifically consider the zero temperature limit, neither associated properties of the ground state, and mainly resorted to analyzing the corresponding equations numerically. We in contrast concentrate on zero temperature limit and present a very explicit analytical expressions for LDF in most of cases of interest. When attempting to compare some of the low temperature results and claims in [50] to our findings, we reveal some qualitative discrepancies in a few cases. Most importantly, our theory generically predicts the threshold value of the ground state energy e c such that for e > e c the associated LDF diverges, signalling of the change in the speed from N to higher powers. We call this threshold a "wall". The paper [50] seems to have no mentioning of such phenomenon. Another point worth mentioning is that although the authors seem to be unaware of the recent activity around p = 2 Large Deviations with magnetic field that we discussed in detail above, they do provide a very nice overview of early physics paper on some aspects relevant to Large Deviations, especially on convexity issues as discussed by Rammal in [51]. It also contained useful references to several attempts to study Large Deviations of the spin glass free energy in a more recent physics literature, such as e.g. [52,53] and [54][55][56] which together with a few other related works, like [57] and [58] we find to be worth of mentioning here for the benefit of a reader interested in this problematic. = eRSB(Γ) shows the transition separating the FRSB phase (in orange) and the RS phase (in blue) determined by the stability criterion of the RS phase. The red line corresponds to the typical value etyp(Γ), which is always smaller than eRSB(Γ) for this model. For e > ec (the energy ec of the "wall" being marked by the vertical green dotted line), the LDF at speed N is infinite and one expects that a LDF with higher speed will describe the green region.
The paper has the following structure. As there are a number of results and we want to discuss them extensively, we provide in the main text only the minimal details for the derivation of our results and relegate the full detailed derivation to the appendices. In Section II we display the main results for the large-deviation function (LDF) L(e) of speed N of the ground-state energy, first for the case p = 2 and then for a general mixture model of spherical spins. In Section III we present the derivation of the optimisation problem allowing to obtain the cumulant generating function (CGF) φ(s), i.e. the generalisation of the Crisanti-Sommers formula, from the expression of the moments of the partition function. In Section IV we discuss our results and mention some open problems. In Appendix A, we recall the known results for the typical and average ground-state energy e typ (Γ) = e min . In Appendix B, we summarise the main results on the cumulant generating function φ(s). In Appendix C, we provide the detailed analysis of the CGF and LDF in the replica-symmetric (RS), full replica-symmetry broken (FRSB) and one-step replica symmetry broken (1RSB) ansatz. In Appendix D, we provide the criteria for stability of the RS and 1RSB ansätze. In Appendix E, we compute explicitly the annealed complexity of minima at fixed energy and compare its expression to the LDF.

II. MAIN RESULTS
A. Spherical 2-spin model in a random magnetic field In this case, corresponding to f (q) = q 2 /2 + Γ q we obtain the following expression for the LDF where the typical energy e typ (Γ), the transition energy coinciding with the RSB threshold e t (Γ) = e RSB (Γ) and the critical threshold e c (acting as a "wall") are given by with e typ < e RSB < e c for Γ > 0. A phase diagram of the LDF is plotted in Fig. 1 and a plot of the LDF L(e) is provided in Fig. 2 for Γ = 0 and Γ = 1/2. The phase transition is of third order in the sense that the function L(e) as well as its first two derivatives L (e) and L (e) are continuous at the transition e → e RSB . As e → e c , the LDF diverges logarithmicaly and one naturally expects that a large deviation function at a larger speed should describe the atypical fluctuations for e ≥ e c . Note that at zero magnetic field (Γ = 0), the RSB phase of L(e) is limited to a single point e = e RSB , where it coincides with the RS expression. A plot of the LDF is given in Fig. 2 for Γ = 0, 1/2.
The expression of L(e) in the first line in Eq. (13) was first obtained from a replica symmetric ansatz in [1] and confirmed by a rigorous result in [2]. Neither the threshold e RSB nor the second line in Eq. (13) appeared in Ref. [1], but were discovered by Dembo and Zeitouni [2] using a rigorous approach to the problem of optimisation of random quadratic form over the sphere. It therefore remained a challenge to derive this expression within the framework of replica computations. It turned out that the transition at e = e RSB can be accounted for as the consequence of the instability of the replica-symmetric solution of Ref. [1] and can be correctly described using the replica-symmetry breaking ansatz. To the best of our knowledge, this is the first manifestation of a replica-symmetry breaking phenomenon for the spherical pure p = 2 spin model. Indeed, it is generally believed that RSB phenomena reflect a positive complexity of the topological landscape, i.e. an exponentially large in N number of stationary points, which is not the case for the 2-spin model: it is strictly less than 2N for any realisation and equal to two for Γ = O(1) in a typical realisation [1,43]. Note that this model is marginal in the sense of RSB such that the cumulant generating function (the Legendre transform of Eq. (13)) can be retrieved either from a FRSB or a 1RSB ansatz.
Before analysing in more details the expression above, let us comment in more detail on the nature of the transition observed in the paper by Dembo and Zeitouni and how it can be understood in relation to the RSB transition observed here. In their paper, Dembo and Zeitouni compute two distinct LDF for the ground state energy of the 2-spin spherical spin model as N increases, they consider both the LDF for a fixed sequence of random matrices J (such that the highest and lowest eigenvalues of J converge to ±2 as N → ∞) as well as the LDF averaged over the GOE distribution of J [59]. In each case, the LDF is computed by averaging with respect to the normal iid components h i 's of the random field and can be expressed as an optimisation problem. Note that the LDF for fixed realisation of J seems out of reach of our replica computation. They show in particular that, as e increases, both LDFs display a freezing transition at e = e RSB in the associated optimisation problem (that we identify here as the RSB transition). The LDF with fixed realisation displays another freezing transition at energy e = e U < e RSB . In addition they show that the two LDF coincide in the range of energy e ∈ [e U , e RSB ] between the two freezing transitions. If both LDFs can be computed for more involved spherical spin-glass models, we expect that the maximum energy for which the two LDF match identifies with the energy e RSB at which the RSB transition occurs, providing a robust criterion to identify this point without requiring replica methods.
Let us return to the analysis of the LDF around the typical ground-state energy e typ . For fixed Γ > 0, the LDF is quadratic in the vicinity of e typ (Γ) = − √ 1 + Γ with For Γ = 0, one finds L(e) = −e √ e 2 − 1 − ln(−e + √ e 2 − 1) for e < e typ (Γ = 0) = e c = −1, which as noted in [1] coincide under the mapping e = −λ max /2, with the LDF of the largest eigenvalue of a GOE matrix. This function can thus be obtained solely from the RS ansatz.
In the limit Γ → 0, there is an interesting crossover which involves the RSB branch as well. In this regime, the energy differences scale in a distinct manner as Γ → 0, i.e.
This naturally leads to two different scaling regimes and functions. The first one describes the regime e−e typ = O(Γ 2 ) and the LDF takes the scaling form with x RSB = 3/8 and the scaling function has continuous two first derivatives at x RSB , which is the mark of third order transition. The first branch, corresponding to the RS phase, was originally derived in [1] (see Eq. (47) there). It is quite interesting to note that the full scaling function F (x) in (18) now extends for x → +∞, while it was thought to be limited to x < 1/2 in its first derivation. Such a scaling function then has the following asymptotic behaviours As was discussed in [1], the asymptotics for x → −∞ agrees with the behaviour of the right-tail of the β = 1 Tracy-Widom distribution (TW), including the 2/3 coefficient of the 3/2 power. It is remarkable that the new RSB branch exhibits a cubic behaviour for x → +∞, which is reminiscent of the cubic left tail of the Tracy-Widom distribution. Note however that the coefficient of the TW left tail is 1/24 rather than the 1/6 found here. We explain below the implications of this remark. As conjectured in [1], and rigorously shown recently [42,47], in presence of a random field of variance Γ ∼ N −1/3 , the distribution of the typical fluctuations of the ground-state energy of the spherical p = 2 spin model converges, as N → ∞, to a a universal one parameter family of distributions denoted p κ (δ), i.e. one has with in particular p 0 (δ) coinciding after a rescaling δ = −ζ/2 with the TW F 1 (ζ). One expects that there will be a matching of the tails of the distributions p κ (δ) within this family for large κ → ∞ and δ → ∞ with the asymptotic behaviour of the large-deviation form P(e) e −N L(e) . A sketch of the different scaling regimes discussed below is given in Fig. 3. The first scaling regime corresponds to The δ > 0 side has been analysed in details in [1]. The large x behaviour of the scaling function, F (x) 2 3 x 3/2 , is compatible with the conjecture that p κ (δ) ∼ e −c+(κ)(−2δ) 3/2 at any fixed κ and that, by matching, c + (κ) 2/3 = c + (0) at large κ. On the other hand, on the δ < 0 side, in the regime −δ/κ 2 → +∞, matching to the x → −∞ cubic behaviour of F (x) on the RSB side leads to p κ (δ) ∼ e − (−2δ) 3 6κ 3 which suggests the following conjecture: the left tail of the distribution p κ (δ) for fixed arbitrary κ = O(1) is cubic and takes the form with c − (0) = 1/24 and c − (κ) ∼ 1/(6κ 3 ) for κ → +∞. This conjecture provides a natural explanation to the mismatch of coefficients of the cubic tail with the TW noted above. Figure 3. Plot of the different scaling regimes at large N describing our conjectures for the distribution of the typical fluctuations pκ(δ) for the spherical 2-spin model with magnetic field in Eq. (20) and its matching for δ, κ → ∞ with our results for the large deviations. The large deviation region for δ = O(N 2/3 ) and κ = O(N 1/3 ) is indicated in green, the semi-circle represents schematically the matching region. The side δ > 0 was described in [1]. The major novelty is the RSB line, indicated as a solid line inside the large deviation regime where it is a true transition, and a dashed line in the typical region where it may signal a (smooth) change of behaviour. Finally the region κ = 0 and δ < 0 with |δ| ∼ N 2/3 is described by the Coulomb gas and has a N 2 speed large deviation (it is "on the other side of the wall"). The vicinity of the wall on the speed N RSB regime is described by yet another scaling behaviour see Eq (23).

RSB
Finally, let us briefly discuss the second scaling regime e − e c = O(Γ) where the Large Deviation Function reads with z RSB = z typ = −1/2. Note that G(z) > 0 for z > z RSB and vanishes cubically for z → z RSB as G(z) ∼ 4 3 (z − z RSB ) 3 , again a third order transition. Also note that the limit x → +∞ of the scaling function F (x) ∼ 4 3 x 3 matches correctly the limit z → z RSB = z typ of the function G(z). In the case z < z RSB , there are sub-leading corrections to the scaling of order Γ 3/2 to Eq. (23) described by B. Large deviations of the ground state energy for a generic mixture model The cumulant generating function (CGF) can be shown to be obtained as where the function z(q) is a real non-decreasing function, satisfying z(q) = s for q ∈ [0, q 0 ) and z(q) ≥ s for q ∈ [q 0 , 1], while the functional Φ(s) reads .

9
Note that in Eq. (25), we have used heuristically that the number of degrees of freedom is n(n − 1)/2 in the problem, i.e. −s/β in our limit of interest and thus we expect that the correct optimisation problem is solved by taking the maximum of the function Φ(s) when s < 0 and the minimum for s > 0. From this general expression, one can recover the typical value of the ground state energy (see Appendix A for a detailed discussion) as The rescaled variance can similarly be computed as where q typ (Γ) is the optimal value of the parameter q 0 in the case where s = 0. For any magnetic field the typical energy belongs to the RS phase such that e typ (Γ ≥ Γ RSB ) = − g (1) + Γ and q typ (Γ ≥ Γ RSB ) = 1.
Finally, as mentioned in the introduction, the large deviation function (LDF) is obtained by taking the Legendre transform of the CGF in Eq. (25), i.e.
Interestingly, one can give a more explicit expression for L(e), valid at any level of replica-symmetry breaking: The parameters q * 0 and s * take values obtained by solving the optimisation problems in Eqs. (25) and (30), and eventually depend on the value of e and on the covariance function f (q) (notably, on the value of Γ). Expressions for their values depend on the level of replica-symmetry breaking and will be given explicitly in the corresponding sections below.
In order to obtain more explicit results, one needs to consider the different regimes of replica-symmetry breaking. There are two relevant scenarios for the emergence of a replica-symmetry broken solution in the optimisation problem for the cumulant generating function above: • If the quadratic form obtained by expanding Φ(s) around its replica-symmetric saddle-point solution becomes unstable, corresponding to (at least) one of its eigenvalues being positive. This is in particular the mechanism driving the transition to the RSB solution in the large-deviations of the spherical 2-spin model discussed above.
• If the replica-symmetry broken solution is stable, and gives a maximum value of Φ(s) for s < 0 (resp. minimum value for s > 0) larger (resp. smaller) than the value obtained within the replica-symmetric scheme.
The criterion determining the type of RSB solution is the same for the cumulant generating function as for the typical value of the ground-state, and involves the Schwarzian derivative of the covariance function: Namely, if S [f ] (q) is positive for any value q ∈ [0, 1], the solution will be obtained within the Full-RSB scheme, while if it is negative for any value q ∈ [0, 1], the solution is obtained within the 1RSB scheme. If S [f ] (q) changes sign on the interval q ∈ [0, 1], the solution is expected to be given by a combination of FRSB solution with one involving a finite number of replica-symmetry breaking steps. In this article, we will only consider the case where the Schwarzian derivative is of the same sign over the whole interval q ∈ [0, 1].
Let us now discuss the various regimes of replica-symmetry breaking separately.

Replica symmetric regime
In the RS regime, the CGF is obtained by solving the optimisation problem in Eq. (25) where one imposes that z(q) = s for all q ∈ [0, 1] (or equivalently q 0 = 1). Considering both the saddle-point equation obtained by optimisation of Φ(s) and the Legendre-transform in Eq. (30), the optimal parameters s * and v * are determined explicitly as a function of e in that phase as where the critical RS energy reads Note that v * and s * become complex for energies e > e c,RS (Γ) but as we will now show, such energies cannot be reached within the RS scheme. The criterion of stability obtained from the negativity of the eigenvalues of the quadratic form in Eq. (32) imposes that the RS expression is stable for (see Appendix D for details) where e RSB (0) < 0 and ∂ Γ e RSB < 0 (see Eq. (C16)). Using the identity e 2 RSB −e 2 c, one obtains that e RSB (Γ) ≤ e c,RS (Γ) for any value of Γ, ensuring that v * and s * are real parameters in the domain of stability of the RS solution. As described above, this criterion is necessary but not sufficient to ensure that the LDF is indeed given by its RS expression. It ensures nonetheless that the LDF is not correctly reproduced by the RS expression for any e ≥ e RSB (Γ).
Using the RS scheme to compute the average (and typical) value of the ground-state e typ (Γ), one obtains the explicit expression (see Appendix A) where the value of Γ RSB can simply be obtained by ensuring marginality of the stability criterion, i.e. e typ (Γ RSB ) = e RSB (Γ RSB ). The rescaled variance of the ground state energy is obtained from Eq. (28) using the fact that the parameter q 0 = 1 is frozen in the RS phase. One can thus replace q typ (Γ ≥ Γ RSB ) = 1 and obtain which is strictly positive for any Γ > g (1) − 2g(1) with Γ RSB ≥ g (1) − 2g(1). Finally, the RS expression of the LDF L(e) is given by .
This function is well-defined for any e ≤ e c,RS (Γ) but, as previously mentioned, it cannot represent the correct LDF for any e ≥ e RSB (Γ). The third derivative L RS (e) > 0 for any e < e c,RS (Γ), hence L RS (e) is an increasing function, which must be positive as L RS (e → −∞) = 1/(g(1) + Γ) > 0. The function L RS (e) is thus convex over the interval e < e c,RS (Γ) and in particular for any e ≤ e RSB (Γ). The function L RS (e) is universal in the sense that it only depends on the values of covariance function f (q) and its first derivative at q = 1 (the energy e RSB (Γ) depends on the second derivative as well). The function L RS (e) vanishes at the value e = e 0,RS (Γ), and this zero is unique in the interval e ≤ e c,RS (Γ). It is given explicitly by   (1))/(Γ + g (1)). One always have that E0,RS(x) ≥ Ec,RS(x), i.e. e0,RS(Γ) ≤ ec,RS(Γ), with the two expressions coinciding only for x = 0 (non-physical) or x = 1/2 (the latter corresponding to Γ = g (1) − 2g (1)). For where the scaling function E 0,RS (x) is obtained as the solution of the equation Note that the RS critical energy takes the same scaling form The study of Eq. (41), plotted in Fig. 4, shows that the scaling function E 0,RS (x) = 1 for any value of x ≥ 1/2. This implies that for any Γ ≥ g (1) − 2g (1), which coincide with a positive rescaled variance V min (Γ) ≥ 0 (see Eq. (38)), the zero takes the simple expression e 0,RS (Γ) = − g (1) + Γ. For x > 1/2, the scaling function E 0,RS (x) does not have a simple analytic expression and thus neither does the zero e 0,RS (Γ) for Γ < g (1) − 2g(1). Random field with Γ ≥ Γ RSB : The RS expression of the LDF L RS (e) is positive in that case and has a unique minimum e typ (Γ) = e 0,RS (Γ) = − g (1) + Γ, where it vanishes L RS (e typ ) = 0. In this case, the LDF is quadratic around the typical energy e typ which is consistent with the central limit theorem proved in [20].
Random field with Γ ≤ Γ RSB : In the regime Γ < Γ RSB , the function L RS (e) is decreasing over the interval e ≤ e RSB (Γ). Clearly, if the zero e 0,RS (Γ) of L RS (e) satisfies e 0,RS (Γ) ≤ e RSB (Γ) then L RS (e RSB ) ≤ 0, and hence the expression of L RS (e) cannot represent a LDF over the whole interval e ≤ e RSB and must be limited to energies e ≤ e 0,RS (Γ).
For models whose replica-symmetry broken phase is of FRSB type, we will show explicitly in the following that L RS (e RSB ) > 0 in the regime Γ < Γ RSB (see Fig. 6 for a sketch of the different energy scales for models with FRSB phase). For models whose replica-symmetry broken phase is of 1RSB type instead, L RS (e RSB ) can take either sign. We will show that there exists a threshold magnetic field 0 ≤ Γ t < Γ RSB , such that for Γ RSB > Γ > Γ t the value L RS (e RSB ) is positive. For 0 < Γ < Γ t , the transition to the RSB regime does not occur at energy e RSB (Γ) but rather at an energy e t (Γ) < e RSB (Γ) satisfying simultaneously e t (Γ) < e 0,RS (Γ) which implies L RS (e t ) > 0 (see Fig. 9 for a sketch of the different energy scales for models with 1RSB phase). Note that there exists an additional threshold  Γ cr ≤ Γ t ≤ Γ RSB such that e RSB (Γ cr ) = e 0,RS (Γ cr ). Thus for any Γ RSB > Γ > Γ cr one has e 0,RS (Γ) > e RSB (Γ) and L RS (e RSB ) > 0 while for Γ cr > Γ in contrast e 0,RS (Γ) < e RSB (Γ) and L RS (e RSB ) < 0.

Fully broken replica-symmetry regime
Let us now consider the RSB phase for models which satisfy i.e. models for which the replica symmetry breaking is of FRSB type. Note that p-spin models with g(q) = q p /p for p > 2 satisfy S [g ] (q) = −p(p − 2)/(2q 2 ) < 0, hence do not belong to this type. The phase diagram of the LDF for a model with FRSB phase is plotted in Fig. 5 and the different energy scales are provided in Fig. 6. In the FRSB regime, the CGF is obtained by solving the optimisation problem in Eq. (25) where one imposes that z(q) is a positive increasing function over the range q ∈ [q 0 , 1]. We find that the optimisation problems in Eqs. (25) and (30) are most easily solved by expressing the optimal parameter s = s * as in terms of the optimal value of q 0 = q * 0 . The parameter v and the function z(q) then take the optimal values (which are actually the same as arise in the optimisation problem for the typical ground-state energy in the FRSB phase, see Finally, the optimal value q * 0 for fixed energy e is obtained by inverting the following parametric expression One can show explicitly that ∂ q * 0 e < 0 (see Appendix C 2 for details). Comparing Eq. (47) and Eq. (36), one can simply conclude that the limit q * 0 → 1 corresponds to e → e RSB (Γ). In the opposite limit q * 0 → 0, one defines the critical energy where we have used that would diverge to +∞ as q → 0, in contradiction with the FRSB condition that z * (q) must be an increasing function of q.
, there is a unique value 0 < q typ (Γ) < 1 of the parameter q * 0 such that The associated value of e through the relation (47) belongs to the finite interval (e RSB (Γ), e c ) and corresponds precisely to the typical ground-state energy (see Appendix A) Note that for Γ = Γ RSB = g (1) − g (1), one can simply check from Eq. (49) that q typ (Γ RSB ) = 1 and Eq. (50) coincides with Eq. (37). The rescaled variance is similarly obtained by simply inserting the value of q typ (Γ) obtained from Eq. (49) into Eq. (28). In the limit Γ → 0, the value q typ (Γ) → 0 such that e typ (Γ) → e c and the rescaled variance V min (Γ) vanishes. This limit will be investigated further in a separate section below. Let us now give the result for the FRSB expression of the LDF, L FRSB (e). The LDF L FRSB (e) describes, through the parametrisation in Eq. (47), the range of energies e ∈ [e RSB , e c ] and reads The transition between the RS and FRSB expressions of the LDF occurs at the energy e = e t (Γ) = e RSB (Γ), corresponding to q * 0 → 1, for any value of Γ. Expanding the difference as e → e RSB , one obtains for any Γ ≥ 0  The transition between the RS and FRSB phases is thus generically of third order in the sense that the third derivative of the LDF L(e) is the lowest order discontinuous derivative at the transition. Note however that precisely for Γ = Γ RSB , the transition is of the fourth order One can check simply that L FRSB (e) = −s * and that which can be shown to be positive from Eq. (C9), such that the LDF L FRSB (e) is convex. For a random field Γ ≤ Γ RSB , the LDF reaches its global minimum, equal to zero for e = e typ (Γ), such that L FRSB (e RSB (Γ)) = L RS (e RSB (Γ)) ≥ L FRSB (e typ (Γ)) = 0. This ensures in particular that, for any value of Γ, the RS expression of the LDF L RS (e) is positive for any energy e ≤ e RSB if the corresponding phase with broken replica symmetry is of FRSB type. A plot of the LDF L(e), both in the RS and FRSB phases, for a representative model is shown in Fig. 7 for several values of Γ.
For positive magnetic field, the LDF diverges logarithmically for e → e c (corresponding to q * 0 → 0) with which hints at the fact that a large deviation of speed larger than N should describe the probability that e > e c . In the range of magnetic field 0 < Γ ≤ Γ RSB , the LDF is quadratic around the typical value e typ which is again consistent with the central limit theorem proved in [20]. For zero magnetic field Γ = 0 we have instead e typ (Γ = 0) = e c and the behaviour of the LDF is quite non-trivial as e → e c . Namely, supposing that the covariance function has the form with r the exponent of the leading correction to the quadratic form, the LDF vanishes as where In particular, for r = 3, the LDF vanishes linearly as L FRSB (e) = z(0)(e c − e) + o(e c − e). The opposite limit r → ∞ corresponds to the spherical 2-spin model, which is marginal S[g ](q) = 0 and for which the RSB branch of the LDF can be obtained either from a FRSB or 1RSB ansatz. In that limit, one can check that L FRSB (e) = 2/3(2(e c − e)) 3/2 + o(e c − e) 3/2 as mentioned above, which smoothly matches the tail of the Tracy-Widom β = 1 distribution. For zero magnetic field, one does not expect a central limit theorem and the distribution of typical fluctuations becomes non-trivial. It is notably the case in this limit r → ∞ where it corresponds to the TW [60]. From the result in Eq. (58) and assuming the simplest possible matching between the large deviation regime e c − e = O(1) and the regime of typical fluctuations, we naturally conjecture that the typical fluctuations of the ground state energy will be of order More precisely we conjecture that the PDF of the ground-state energy P(e) takes the following scaling form in the regime of typical fluctuations 3. One-step replica-symmetry breaking regime Finally we discuss the RSB phase for models which satisfy i.e. for which the replica symmetry breaking pattern is of 1RSB type. The p-spin models with p > 2 for which g(q) = q p /p, satisfy S [g ] (q) = −p(p − 2)/(2q 2 ) < 0, hence belong to this class and will constitute important examples. The phase diagram of the LDF for a model with 1RSB phase is plotted in Fig. 8 and the sketches of different energy scales in the variable e are provided in Fig. 9. In the 1RSB regime, the CGF is obtained by solving the optimisation problem in Eq. (25) where one imposes that z(q) = s for q ∈ [0, q 0 ) and z(q) = m 0 ≥ s for q ∈ (q 0 , 1] is piece-wise constant. As in the FRSB phase, it will be most convenient to express all the optimal value of the different parameters in terms of the optimal value q 0 = q * 0 , i.e. where the function ρ(q) is given by  and together with the function α(q * 0 ) satisfies the self-consistent equation Finally, the value of q * 0 for fixed e is obtained by inverting the parametric expression

17
In the limit q * 0 → 0, the associated critical energy reads where the parameter ρ typ = lim q * 0 →0 [ρ(q * 0 )/α(q * 0 )] is independent of Γ and satisfies For a magnetic field with Γ t satisfying Γ t ≤ Γ RSB , the parametrisation in Eq. (67) is operative for any q * 0 ∈ [0, 1] and describes the range e ∈ [e RSB (Γ), e c ]. In contrast, for 0 < Γ < Γ t , the parametrisation is only operative in a limited range Note that q t = 1 is always a solution of this equation. The range of energy thus described is e ∈ [e t (Γ), e c ], with For convenience, for Γ ≥ Γ t we define the two energies e t (Γ) and e RSB (Γ) to be equal: Let us introduce the function One can thus show that for models with 1RSB phase such that S[g ](q) < 0 for any q ∈ [0, 1] one must have Γ t ≥ 0. In contrast, S[g ](q) > 0 for models with FRSB phase, such that Γ t ≤ 0.
In the regime Γ ≤ Γ RSB , the typical energy e typ (Γ) ∈ [e t (Γ), e c ] and is thus obtained within the 1RSB scheme. The associated value of q typ (Γ) is obtained ensuring that α(q typ (Γ)) = 1 in Eq. (66). The associated value of e typ (Γ) then reads The variance can similarly be obtained by inserting the value of q typ (Γ) obtained from ensuring α(q typ (Γ)) = 1 in Eq.
A plot of the LDF L(e), both in the RS and 1RSB phases, for the 3-spin spherical model is shown in Fig. 10 for several values of Γ. The transition from the RS to the 1RSB expression of the LDF occurs for the energy e = e t (Γ) = e RSB (Γ) for Γ ≥ Γ t while it occurs for e = e t (Γ) < e RSB (Γ) for Γ < Γ t .
Random field Γ ≥ Γ t : The transition between the RS and 1RSB expressions of the LDF occurs at energy e = e t (Γ) = e RSB (Γ), corresponding to q * 0 = 1. Expanding the difference as e → e RSB , one obtains Quite remarkably, inserting the explicit expression of Γ t from Eq. (70), one obtains, up to third order, the same expansion in Eqs. (52) and (76). The transition between the RS and 1RSB phase is thus generically of third order for Γ ≥ Γ t in the sense that the third derivative of the LDF L(e) is the lowest order discontinuous derivative at the transition. Note that at the special value Γ = Γ RSB the transition is again of the fourth order with which takes again the same form as in the FRSB case in Eq. (53). Random field Γ < Γ t : The transition between the RS and 1RSB expressions of the LDF occurs at energy e = e t (Γ) < e RSB (Γ), corresponding to q * 0 = q t < 1. Expanding the difference as e → e t , one obtains where the expression of L 1RSB (e t ) − L RS (e t ) is cumbersome but explicit (see Appendix C 3 for details). The transition between the RS and 1RSB phase is thus of second order for Γ < Γ t in the sense that the second derivative of the LDF L(e) is the lowest order discontinuous derivative at the transition. For any Γ > 0, the LDF diverges logarithmically close to the critical energy e → e c , corresponding to q * 0 ≈ 2(e c − e)/ ρ typ g (1) with α(q * 0 ) ≈ Γ/(2 ρ typ g (1)(e c − e)) and where ρ typ is the solution of Eq. (69), i.e.
It is thus natural to expect that the fluctuations in the range of energies e > e c are described by a LDF with speed larger than N . In the regime of magnetic field 0 < Γ ≤ Γ RSB , the LDF is quadratic about the typical energy This expression is consistent with a typical distribution of energy displaying an exponential tail for N (e typ − e) 1.

Connection between large deviation function and complexities
Let us now discuss briefly the connection between our results for the LDF and the statistics of the number of minima of the potential landscape associated to the spherical spin-glass. Denoting the empirical density of isolated minima of the random landscape as where (at least) one of the e α = e min corresponds to the ground-state energy. Note that an isolated minimum α is defined as a point x α on the N -sphere such that Taking the average, one obtains that Using the definition of the annealed complexity as well as the definition of the large-deviation function one thus obtains the simple bound valid for any energy e. Analysing the annealed complexity, one can check that in the regime Γ ≥ Γ RSB , it is negative and has a unique maximum e typ (Γ) = − g (1) + Γ, where it reaches zero Σ min (e typ (Γ ≥ Γ RSB )) = 0. This bound is thus meaningful for any energy e in this regime. In the regime Γ ≤ Γ RSB instead, the annealed complexity is positive for energies within a finite band of energies e ∈ [E min , E max ] which contains the typical energy, i.e. Σ min (e typ (Γ)) ≥ 0 (see Appendix E for details). As L(e) ≥ 0, the bound is meaningless within the range e ∈ [E min , E max ] and in particular in the vicinity of e typ (Γ). 20 The quenched complexity of minima at fixed energy is defined as and by simple application of Jensen's inequality gives a lower bound for the annealed complexity as well. In addition, this quenched complexity is expected to vanish exactly for e = e typ , similarly to L(e). For the pure p-spin model without external field (discussed in more details in the next section), the annealed and quenched complexities have been shown to coincide exactly [61] for any energy e ≤ e RSB (0) = −2 √ p − 1/p. There are two natural questions that can be asked from our analysis: Does the LDF L(e) and the quenched complexity Ξ min (e) coincide in some finite range of energy, beyond the case of the pure p-spin? Do e t (Γ) or e RSB (Γ) provide the threshold energy below which the quenched and annealed complexity coincide Σ min (e) = Ξ min (e)?
5. The spherical pure p-spin model without magnetic field Let us consider in more details the case of the pure p-spin for Γ = 0, where The typical ground state energy in this case coincides with the critical energy e c , where the LDF diverges for Γ > 0, while it vanishes for Γ = 0. It is given by where the constant ρ typ satisfies the equation Since for Γ = 0 the LDF for the range of energies e ≤ e typ is given by the RS expression, the RSB regime is confined to a single point e = e c = e typ . This case of the spherical model is quite specific as can already be seen from the identity e c,RS = e RSB . Note that for any p > 2, one has that e RSB > e typ (for p = 2, one has e RSB = e typ = −1), thus we expect the RS ansatz for the large-deviation function to be stable around the typical ground-state e typ given by a 1RSB ansatz. As mentioned in the previous sections, the quenched and annealed complexity of minima at fixed energy coincide and match the opposite of the LDF within the RS scheme (see appendix E for details) for any e ≤ Finally, as has been shown explicitly in [62] for p > 2 the distribution of typical fluctuations of the ground-state energy is not given by a Gaussian distribution (as is the case in the presence of a finite external magnetic field Γ) but rather by a Gumbel distribution: the ground state energy behaves at large N as E min N e typ + log(cpN 2 ) 2cp Equivalently one can state that the distribution of the ground state energy takes the scaling form The tail of this distribution takes the exponential form (for e < e typ ) ln P (e) ≈ −N L RS (e typ )(e − e typ ) , (e typ − e) ln N N , which quite obviously matches the behaviour of the large-deviation function L RS (e) as e typ − e 1. We therefore expect the LDF L RS (e) to correctly reproduce the large-deviation function of e min for values e ≤ e typ . As mentioned in the section on the RS phase, the fact that L RS (e) vanishes linearly around the typical value e typ is not restricted to the pure p-spin model. It remains valid for any spherical spin model with zero external magnetic field, for which the typical value e typ corresponds to the 1RSB scheme. It may indicate that the Gumbel distribution for the typical fluctuations of the ground state energy obtained for the pure p-spin extends to these more general situations.
Finally, since it was shown that for Γ > 0 the typical fluctuations of the ground state energy of a generic spherical spin-glass model is described by a Gaussian distribution [20], there should naturally exist a scale of magnetic field, which allows to interpolate between the Gumbel distribution and the Gaussian distribution. More precisely comparing the variance of the ground state energy N Var(e min ) ∼ N Γ 2 for Γ > 0 with the Gumbel fluctuations N Var(e min ) = O(1) for Γ = 0, we surmise that, in the regime the probability distribution takes the scaling form with the scaling function P κ,gp (δ) satisfying uniformly for any δ the asymptotic behaviours where In the above subsections we have considered the generic mixture model for a fixed value of Γ, either Γ > 0 or Γ = 0. We found that for Γ > 0 the LDF takes a quadratic form near the typical value e typ , which is consistent with a Gaussian form for the typical ground state energy fluctuations. For Γ = 0 by contrast we found that the LDF behaves as a power law near e typ with an exponent η which depends on the model and the type of RSB, e.g. η = 1 in the 1RSB case. Two natural questions are thus: (i) how does the LDF interpolates between these two limits as Γ → 0 ? (ii) how does the LDF interpolates with the typical fluctuations ? In this subsection we present our results for the first question, and provide some conjectures about the more difficult second question. Note that the presence of a "wall" at e = e c must necessarily be addressed when dealing with the limit Γ → 0 since for Γ = 0 the two energies e typ (Γ) and e c coincide. We only provide here the main features and a more detailed description can be found in in Appendix C.
Behaviour near the typical value The behaviour of the LDF in the vicinity of the the typical ground-state e typ (Γ) is naturally influenced by the scaling of the rescaled variance V min (Γ) in the limit Γ → 0. This scaling depends on the type of RSB and in the case of FRSB, on the small overlap behaviour of the covariance function g(q) = g 2 q 2 + g r q r + o(q r ) .
For models which are described by a FRSB ansatz, this rescaled variance reads where we define the exponents

22
For these models, the difference e typ (Γ) − e t (Γ) = e typ (Γ) − e RSB (Γ) = O(1) and positive as Γ → 0. In a vicinity of e typ (Γ) of width of order Γ ν , the LDF takes the following scaling form where p is obtained from the leading order behaviours of the covariance function in Eq. (102). The scaling function L FRSB is universal in the sense that it only depends on the small q behaviour of the covariance function and given parametrically in Eqs. (C63-C64). Its asymptotic behaviours read where the values of a − , a 0 , a + are given in Eq. (C65). In particular, the first line matches the typical behaviour for Γ = 0 in Eq. (58), the second line the typical behaviour for Γ > 0 in Eq. (56) and the third line matches the behaviour in the vicinity of the wall, which we will describe below. For models which are described by a 1RSB ansatz, the rescaled variance reads where we remind that 0 For these models, the difference between the typical energy and the transition energy is of order e typ (Γ) − e t (Γ) = −u t Γ 2 > 0. The LDF takes, in a vicinity of e typ (Γ) of order Γ 2 , a scaling form with both an RS and RSB branch where the value of u t is given in Eq. (C121) and of the amplitudes A, B, C are given in (C123). In the notations introduced before, this corresponds to ν = 2 and in addition one finds η = 1. In particular, the limit u → −∞ matches smoothly the typical behaviour for Γ = 0 in Eq. (81), while the behaviour for u → 0 matches the typical behaviour for Γ > 0 in Eq. (80). Finally, the behaviour for u → +∞ matches the behaviour in the vicinity of the wall, see below.
Behaviour near the wall. Let us now discuss the behaviour close to the wall as Γ → 0. First note that the position of the wall e c is independent of Γ. For positive Γ > 0, the LDF diverges close to the wall, i.e. as e → e c , while for Γ = 0 it vanishes at the wall since one has in that case e c = e typ (Γ = 0). A non-trivial scaling function must therefore describe the interpolation between these two situations. It is obtained by considering energies within a range e c − e ∼ Γ and depends on the nature of the RSB phase.
In the FRSB phase, after a proper rescaling, the scaling function is universal with respect to the choice of the covariance in the spherical spin-glass model and reads As z → z typ = −1/2, corresponding to the position of e typ (Γ) for finite Γ, this scaling function vanishes cubically and matches the asymptotic behaviour u → +∞ of the scaling function L FRSB (u) describing the vicinity of e typ (Γ). Note that the region z ≤ z typ = −1/2 can alternatively be described from Eq. (105), where L(e) is parametrically smaller in Γ. As z → 0 instead, the scaling function G(z) diverges logarithmically, thus reproducing the behaviour close to the wall for Γ > 0 in Eq. (55). In the 1RSB phase, after a proper rescaling, the scaling function only depends on the specific model through the parameter w = g 2 /(ρ typ g (1)) and reads As z → z typ = −1/2, corresponding to the position of e typ (Γ) for finite Γ, this scaling function vanishes quadratically (cubically for the special case w = 1/2) and matches the asymptotic behaviour u → +∞ of the scaling function L 1RSB (u) describing the vicinity of e typ . As z → 0 instead, the scaling function G 1RSB (z; w) diverges logarithmically, thus reproducing the behaviour close to the wall for Γ > 0 in Eq. (79).
Matching from large deviations to typical fluctuations. Let us now finally discuss the matching to the regime of typical fluctuations in the limit Γ → 0. For any Γ > 0, the LDF behaves quadratically around its typical value and one naturally expects that the typical distribution of e min is Gaussian, as predicted in [20]. For Γ → 0 instead, one expects a non-trivial typical distribution to emerge. Although the methods of the present paper do not allow to obtain exact results in that regime, one can still propose some natural conjectures from simple considerations of matching.
For models of spherical spin-glasses with a 1RSB phase, a natural conjecture from our analysis is that in the limit N → ∞ with Γ ∼ N −1/2 and for e − e typ (Γ) ∼ 1/N there exists a family of distributions P κ,g (δ) for the typical fluctuations such that where e typ (Γ) is the average ground-state energy including its finite N corrections. In Fig. 11, we show a scheme summarizing the matching and conjectures that we develop below for models with 1RSB phase. In the joint limit δ → ∞ and κ → ∞, assuming a simple matching between our results for the LDF and the typical distribution, one expects that Within the same joint limit, further considering u → −∞ one expects, in particular, that the function P κ,g (δ) displays an exponential tail: while in the opposite limit u → +∞ one expects instead that the function P κ,g (δ) displays a Gaussian tail: The case of the spherical pure p-spin model has been mentioned in the previous section. For models of spherical spin-glasses with a FRSB phase, the natural scaling of Γ as a function of N depends on the behaviour of the covariance function g(q) in Eq. (57) and in particular the value of r. A natural conjecture from our analysis is that in the limit N → ∞ with Γ ∼ N −1/ην , and for e − e typ (Γ) ∼ 1/N 1/η , with η = 3(r − 2)/(2r − 3) and ν = (2r − 3)/(r − 1), there exist a family of distributions P(e) → N 1/η P κ=N 1/(ην) Γ,g δ = N 1/η (e − e typ ) , N → ∞ , where e typ is the average ground-state energy including its finite N corrections. In Fig. 12, we outline the matching schemes and conjectures that we develop below for models with FRSB phase. In the joint limit δ → ∞ and κ → ∞, a simple matching between our results for the LDF and the typical distribution leads to the following conjecture: Within the same joint limit and in the further limit u → −∞, one expects the super-exponential tail of the distribution: while in the opposite limit u → +∞ one instead expects the distribution to display the tail Note that this conjecture takes the same form as that proposed by us for the 2-spin in Eq. (22).

III. DERIVATION OF THE CUMULANT GENERATING FUNCTION
In this section we compute the cumulant generating function φ(s). We start by expressing the integer moments Z(β) n of the partition sum in the large N limit in terms of the overlap matrix integral. We then evaluate the integral using a saddle point method exact for N → +∞. To perform the analytical continuation n = s/β we introduce the Parisi parametrization. The cumulant generating function φ(s) is obtained formally from the solution of the saddle point equations, as well as the LDF L(e). These equations will be solved in detail in the Appendix C, providing explicit expressions for these functions.

A. Integer moments
The integer moments of the partition sum (4) can be expressed as C N,n = (πN ) N n/2 π − n(n−1) where in the second line we have used a standard replica method together with rotational invariance to re-exrpressed the integration over the replicated S n N −1 sphere as an integral over the overlap matrix [1,63] The action Φ n (Q) reads In the large N limit, we expect the integral over Q to be dominated by a saddle-point at Q = Q * leading to the asymptotic behaviour The identity above is valid for any positive integer n N .

B. Parisi scheme
We now suppose that the matrix Q maximising the action Φ n (Q) takes a Parisi block form with k replica-symmetry breaking and parameters The action can be expressed in terms of the positive function Note that one can similarly express [63] 1 In particular, this function satisfies from which one obtains easily The eigenvalues of the matrix Q are simply expressed as Finally, the determinant is obtained as [63] ln det Q = ln λ 0 + n k l=0 where we have performed an integration by part and used that x(q < q 0 ) = n and x(q > q k ) = 1. Thus, the full expression of the action for arbitrary n and β reads .
Supposing that this function can be continued analytically from positive integer n to arbitrary real value, we take the limit β → ∞ of this expression such that It yields where the function z(q) = s for q ∈ [0, q 0 ). In that limit, the cumulant generating function is given by the extremum of this action

27
The extremisation with respect to q 0 and v yield where s.p. stands for the saddle-point solution z = z * , q 0 = q * 0 , v = v * . From the first equation, one obtains that q * 0 = 0 is a solution of the saddle-point equations in the absence of magnetic field Γ = f (0) = 0. However, this solution yields values of v * and z * (q) that are independent of s. For such solution, the cumulant generating function φ(s) is a linear function of s. In the general case, there exist two possible solutions of the first equation, namely where in solving the quadratic equation for the term in the right-hand side obtained from Eq. (144), we have kept the positive root.
Using the second solution (146), one obtains an additional identity from Eq. (144) Inserting the expression in Eq. (146) into the expression of the CGF in Eq. (141), one obtains the following expression , as a function of q * 0 and z * (q) to be determined by extremisation. From this general expression of the CGF, one expects to recover the typical energy by computing where we have used that for s = 0, q * 0 = q typ . Similarly, the variance can be computed as where we have used Eq. (146) as well as Eq. (147). Importantly, from this expression, one can check that the rescaled variance V min (Γ) of the ground-state energy is of order O(1) for any positive magnetic field Γ > 0 but vanishes for zero magnetic field (as q typ (Γ = 0) = 0).
We now turn to the LDF L(e). Supposing that φ(s) is strictly convex and using that L(e) is the Legendre transform of φ(s), one may express the value of s * minimising the action above as where v * , z * (q) and q * 0 are the values that maximise the action Φ(s). A parametric expression for L(e) can then be obtained in terms of s * , determined parametrically from e in Eq. (152), which reads Note that if Eq. (146) holds, this function takes a simpler expression in terms of q * 0 and s * only, i.e.
We have given here some properties of the saddle point equations, and of the resulting functions φ(s) and L(e) which hold generally. To obtain explicit expressions for these functions we need now to determine z * (q) and q * 0 and distinguish between several phases, with either replica symmetry or various forms of replica symmetry breaking. This is done in details in Appendix C.

IV. DISCUSSION AND CONCLUSION
We have demonstrated that the replica method can be successfully employed to compute analytically the full expression of the speed N large-deviation function of the ground-state energy for a generic mean-field spherical spinglass model in a random magnetic field of variance Γ. While depending on the strength of the field the typical (or, which turns out to be the same, mean) value of the ground-state energy is obtained either from a replica-symmetric or replica-symmetry broken Ansatz, the LDF displays for any value of Γ both a branch obtained from a RS ansatz (characterising deviations with lowest ground-state energy) and a branch obtained from a RSB ansatz (which may reduce to a single point for zero magnetic field) characterising deviations with highest ground-state energy. In particular, our results reproduce the expression derived rigorously in [2] for the spherical 2-spin model. A derivation of general LDF results presented in this paper for broader classes of spherical spin-glass model using rigorous methods and identification of the mechanisms responsible for the RSB effects in large deviations constitute an interesting challenge. Beyond a finite critical energy e c , corresponding to the mean value of the ground-state in the absence of external field, the ground state fluctuations are expected instead to be described by a large-deviation function of larger speed. The characterisation of this LDF with higher speed is an interesting open problem. A possible direction to consider is employing replica computations by scaling properly the number of replica with the dimension N as explored in [56].
While for a variance Γ = O(1) the distribution of typical fluctuations takes a simple Gaussian form, one expects a non-trivial distribution to arise by properly rescaling the variance with the dimension N . This problem seems currently to be beyond the reach of replica computations and innovative methods will need to be developed to obtain the typical distribution.
Another problem worth exploring is a derivation of the LDF for a fixed external magnetic field. While the results of the present article could be recovered from the results with fixed magnetic field, taking into account the large deviation function for the norm of the magnetic field, the converse is not true.
Finally, our method can be used to investigate the speed N LDF of the free-energy at positive temperature. One expects that the main qualitative features observed for zero temperature, namely the two branches of the LDF and its logarithmic divergence, will be operative at finite temperature as well. Note that one can expect additional transitions to arise in pure models beyond the critical temperature, where the annealed and quenched free-energy coincide. In particular, this is indicated by the fact of the CDF being linear in a finite range of s and that the LDF vanishes linearly in the vicinity of the typical free-energy.
Data availability satement: The datasets generated during and/or analysed during the current study are available from the corresponding author on reasonable request.
Conflict of interest satement: The authors have no competing interests to declare that are relevant to the content of this article. In this first appendix, let us discuss the behaviour of the typical energy e typ (Γ) = e min as a function of the covariance function and the variance Γ of the magnetic field. The typical and mean-value of the ground-state energy is given by where 0 ≤ q 0 ≤ 1, v is positive and the function z(q) is a real non-negative non-decreasing function of q, satisfying z(q) = 0 for q ∈ [0, q 0 ) and z(q) ≥ 0 for q ∈ [q 0 , 1]. There exists a value of the variance of the random field such that any Γ > Γ RSB , the typical energy e typ (Γ) is obtained within the RS scheme. In that scheme, the optimal parameter q * 0 = q typ = 1, and the function z(q) = 0 for any q ∈ [0, 1]. The typical energy in this scheme is given by In contrast, for Γ ≤ Γ RSB it is obtained from a RSB solution and its expression depends on the level of replicasymmetry breaking. We consider three cases: First case: Full replica symmetry breaking. Assuming that the Schwarzian derivative of f (q) is non-negative, i.e.
then the solution to the optimisation problem is obtained within the full replica-symmetry breaking (FRSB) framework as In fact this can be easily understood, since the derivative of z * (q) has a simple expression in terms of this criterion The optimal value of v is then v * = f (1) −1/2 . The expression of the ground-state energy then reads for Γ ≤ Γ RSB as where q * 0 = q typ is the solution of the equation The solution q typ (Γ) is found by inverting the following function The function Γ FRSB (q typ ) is a non-decreasing function of q typ with Γ FRSB (0) = 0 and Γ FRSB (1) = Γ RSB . In the case of zero magnetic field, the value of q typ = 0. In the limit Γ → Γ RSB , q typ → 1 and one has that f (1) = f (1) = Γ + g (1).
The replica-symmetry is thus recovered and the value of e typ obtained via the FRSB scheme matches the RS result in Eq. (A3). The transition occurring for Γ = Γ RSB is of third order as the value of e typ (Γ) and its first two derivatives are continuous for Γ = Γ RSB while Note that in the case of the 2-spin, the typical value of the energy can also be retrieved through the FRSB scheme by optimising Eq. (A1). In that case, z * (q) = 0 for any q ∈ [0, 1], which simplifies the computation. The optimal value v * = f (1) −1/2 and not f (1) −1/2 and the parameter q 0 plays no role.
Second case: k-step replica symmetry breaking. Assuming instead that the solution is given by taking a finite level k of replica-symmetry breaking. The function z(q) then consists of k number of positive plateaus. In the most important case of one-step replica-symmetry breaking (1RSB), the minimisation can be recast as In this regime, the optimal values of the parameters v and m 0 are given by where the function The remaining saddle-point equation sets the value of q typ . It is conveniently expressed by introducing the function and reads One can show that this equation has at least one solution as the left-hand side is negative and equal to g(1)/g (1)−1 < 0 for q → 0 (for any Γ > 0) while it is positive and equal to for any Γ > Γ RSB . Note that it remains to be shown that there is a single solution. The typical energy can then be expressed for Γ ≤ Γ RSB as .
The transition occurring for Γ = Γ RSB is, as in the case of FRSB, of third order as the value of e typ (Γ) and its first two derivatives are continuous for Γ = Γ RSB while the third derivative satisfies Eq. (A10) as well.
In the limit of zero magnetic field Γ → 0, one finds that q typ = νΓ also vanishes, where the value of ν remains to be determined. The function ρ(q) then reaches a finite value in that limit The value of ν is then determined by inserting this expression into Eq. (A16) and using that µ(q typ ) = µ(0) = g(1)/g (1), i.e.
Similarly, the ground-state typical energy in Eq. (A18) is obtained by using that µ(q typ ) = µ(0) = g(1)/g (1) and that f (q typ )/(q typ f (1)) shares the same limit as ρ(q typ ), given in Eq. (A19), yielding It is important to note that the ground state of the pure p-spin model was first derived in the physics literature and shown to satisfy Eq. (A16) (setting g(q) = q p /p) in [17]. In the past ten years, this statement has been shown rigorously by solving the Crisanti-Sommers optimisation problem in [20] and by showing that it corresponds to the unique minimum of the complexity of stable stationary points in [30].
Marginal cases. Finally, there exist two marginal cases such that the Schwarzian derivative vanishes The 2-spin, where f (q) = q 2 /2 + Γq is one of these cases and has been discussed in details previously. The typical energy e typ can be recovered by considering either of the minimisation problems in the RS (A3), FRSB (A1) or 1RSB (A12) schemes. The other marginal model is given by the logarithmic potential The typical value of the ground-state is and its expression for 0 ≤ Γ ≤ Γ RSB can then be obtained either from working within the FRSB or 1RSB scheme.
Finally, note that as mentioned in the introduction, there exist cases where the Schwarzian changes sign over the interval q ∈ [0, 1], and in that case the typical energy is obtained by a k-FRSB, i.e. a combination of full and a finite number of replica-symmetry breaking [24][25][26]64].

32
Appendix B: Summary of results for the CGF In this appendix, let us now summarise the results for the RS, FRSB and 1RSB expressions of the CGF. It is given in all these different phases by solving the optimisation problem where the function z(q) is a real non-decreasing function, satisfying z(q) = s for q ∈ [0, q 0 ) and z(q) ≥ s for q ∈ [q 0 , 1] such that and the functional Φ(s) reads .

RS phase
The only parameter to optimise is then v, which takes a s-dependent optimal value For any model of spherical spin-glass, this RS solution is unstable for values of the Laplace parameter s ≤ s RSB , where The RS expression of the cumulant generating function is given by This function and the bound s RSB are universal in the sense that they only depend on the values of f (q) and its first two derivatives for q = 1. The CGF is convex over the interval s ≥ s RSB , as one can show explicitly that and s conv,RS ≤ s RSB . The parameter s conv,RS will thus not play any role in the following. Note that only in the case of the pure p-spin does s RSB = s conv,RS . The optimal energy associated to a given value of the Laplace parameter s is obtained by computing and in particular the energy associated to the value s RSB is given by Note that e * ,RS (s) = −φ RS (s) < 0, which ensures that for any s > s RSB , the associated energy e * ,RS (s) < e RSB . If s RSB ≤ 0, which can be shown to coincide with the condition Γ ≥ Γ RSB , where Γ RSB is given in (A2), the typical value of the ground-state is given within the RS scheme and reads e typ = e * ,RS (0) = − f (1) ≤ e RSB . In that case, the rescaled variance can similarly be computed as Let us now describe the different RSB schemes.

FRSB phase
Supposing that the Schwarzian derivative is positive as given in Eq. (A4), the RSB expression of the CGF is given within the FRSB scheme. The phase diagram of the CGF for a representative model with a FRSB phase is shown in Fig. 13. In that phase, the function z(q) is continuous and decreasing over the range [q * 0 , 1], where q * 0 is the optimal value of q 0 . As mentioned when discussing the main results for the LDF, in that phase it is more convenient to express parametrically s as a function of the optimal parameter q 0 = q * 0 as The parameter v and the function z(q) then take the optimal values (which coincide with the values for the typical value of the ground-state in the FRSB phase) This parametrisation ensures both that s ≥ z(q * 0 ) and ∂ q * 0 s ≥ 0 as we show below. In particular, comparing with Eq. (B4), we see that s = s RSB for q * 0 = 1. Also if Γ < Γ RSB , s = 0 for q * 0 = q typ satisfying q typ f (q typ ) = f (q typ ) as obtained in Eq. (A8). In the limit q * 0 → 0, the parameter s → −∞ if the magnetic field Γ > 0 and s → z * (0) = f (3) (0)/(2f (0) 3/2 ) ≥ 0 if Γ = 0. Thus, as q * 0 increases from 0 to 1, the whole range s ≤ s RSB is covered by this parametrisation for positive magnetic field Γ > 0, while only the range [z * (0), s RSB ] is covered for Γ = 0. The implications of this statement are discussed further below.
For models that display this FRSB regime, the transition to the RS regime occurs at the value of the Laplace parameter s = s t (Γ) = s RSB (Γ) for any value of the magnetic field Γ. Hence, the RS regime described in the section above describe exactly the whole range of parameters s ≥ s RSB . Using Eq. (B10), we give the result for the CGF φ FRSB (s) in two equivalent forms Computing the second derivative of the CGF, using the parametrisation in Eq. (B10), yields which, using Eq. (C9), is shown to be strictly positive for any mixed model. Hence this shows that for any mixture model in the full RSB regime φ FRSB (s) is strictly convex. The optimal energy associated to a given value of s is obtained by computing The corresponding to q * 0 → 1, and where s(q * 0 = 0) = −∞ if Γ > 0 and s(q * 0 = 0) = z * (0) if Γ = 0. If Γ < Γ RSB , the FRSB expression of the typical ground state e * ,FRSB (0) = e typ = − q typ f (q typ ) + 1 qtyp dq f (q) is retrieved from Eq. (B14), using the parametrisation (B10) where Γ = q typ g (q typ ) − g (q typ ). In particular, for Γ = 0, one can check that q typ = 0 and e typ (Γ = 0) = e c . Finally, the rescaled variance can be computed as well for 0 < Γ ≤ Γ RSB , and one finds where Γ = q typ g (q typ ) − g (q typ ). For Γ = 0, the rescaled variance vanishes. Finally, in the special case of Γ = 0, the CGF is given by a linear function for any s ≤ z * (0), i.e

1RSB phase
Supposing that the Schwarzian derivative is negative as given in Eq. (A22), the RSB expression of the CGF is given within the 1RSB scheme. The phase diagram of the CGF for a representative model with a 1RSB phase is shown in Fig. 14. In that phase, the function z(q) is constant and given by m 0 ≥ s over the range [q * 0 , 1], where q * 0 is the optimal value of q 0 . As mentioned when discussing the main results for the LDF, in that phase it is more convenient to express parametrically s as a function of the optimal parameter q 0 = q * 0 as where the function α(q * 0 ) satisfies the self-consistent equation with The remaining optimal parameters are then given by For a magnetic field the transition in the CGF from the RS to the RSB regime occurs for s = s t (Γ) = s RSB (Γ), i.e. q * 0 = 1, as a result of the loss of stability of the RS solution. For a magnetic field Γ < Γ t instead, it occurs for a value s = s t (Γ) > s RSB (Γ) such that the CGF coincides in the two different schemes, i.e. φ RS (s t ) = φ 1RSB (s t ). This value of the Laplace parameter is given by with q t < 1 obtained as the solution of For Γ ≥ Γ t , the only solution is q t = 1, and we thus set for convenience q t (Γ ≥ Γ t ) = 1 such that s t (Γ ≥ Γ t ) = s RSB . Note that as Γ → Γ t , q t → 1 and s t → s RSB . In the opposite limit Γ → 0, one has instead that q t ≈ Γ/(ρ typ g (1)−2g 2 ) and s t → (1 − ρ typ )/ ρ typ g (1) ≥ 0, where ρ typ is the solution of the equation The 1RSB expression for the CGF is then given, using the parametrisation (B19-B22-B23) for Laplace parameter s ∈ (−∞, s t )] as The expression of the second derivative φ 1RSB (s) of the CGF is rather long and cumbersome. We are not able to show explicitly that this function is positive but it can be seen numerically on specific examples, and in particular for the p-spin model. The energy e * ,1RSB (s) associated to a given value s of the Laplace parameter reads and lie within the range e ∈ [e t , e c ], where corresponding respectively to the parameters , and with s(q * 0 = 0) → −∞ for Γ > 0 and s(q * 0 = 0) = s t = (1 − ρ typ )/ ρ typ g (1) ≥ 0. Note that e c = e typ (Γ = 0) = e t (Γ = 0) as can be seen by comparing with Eq. (A21) and using the fact that q t ≈ Γ/(ρ typ g (1) − 2g 2 ) as Γ → 0. The range of energies thus described collapses to a single point. For a magnetic field 0 ≤ Γ ≤ Γ RSB , the typical energy belongs to the interval [e t , e c ], with corresponding to q * 0 = q typ satisfying Eq. (A16). In addition, the expression of the second derivative φ 1RSB (s) simplifies considerably for s = 0, allowing to obtain an explicit expression for the rescaled variance In the limit Γ → 0, using that q typ ≈ q t ≈ Γ/(ρ typ g (1) − 2g 2 ), the rescaled variance reads and it thus vanishes for Γ = 0. Finally, in the special case Γ = 0, the CGF is given by a linear function for any s ≤ s t , i.e. φ(s) = −s e c , s ≤ s t = 1 Finally, the LDF is obtained in the regime of stability of the RS solution e ≤ e RSB ≤ e c,RS as This expression only depends on the values of the covariance f (1) and its derivative f (1) at coinciding points. For a sufficiently strong magnetic field Γ ≥ Γ RSB , the typical energy belongs to the RS phase and one can expand the LDF around its minimum as The expression above can be re-written as which matches perfectly the Gaussian tail of the distribution describing the typical fluctuations of the ground state energy. Indeed, the fluctuations of the ground state e min of a spherical spin glass in the presence of a finite magnetic field have been shown to satisfy a central limit theorem [20]. As shown in Appendix E, the expression of the large deviation function in the RS phase L RS (e) matches exactly the opposite of the annealed complexity of minima at fixed energy per degree of freedom e, defined as e typ = e c,RS 2 (g (1) − g(1))ρ typ g(1) into Eq. (C21), one obtains This identity can be understood using the identification L RS (e) = −Σ min (e). As Σ min (e) < 0 for any e < e typ , there is an exponentially small probability to find any minimum with energy e < e typ and if such minimum exists, it would naturally be the global minimum e = e min . At the typical energy e = e typ instead, one expects that there is a sub-exponential number of minima (typically one), such that Σ min (e typ ) = 0. Finally, at energy e > e typ , one expects an exponentially large number of minima such that Σ min (e) > 0 but these minima are not expected to be the global minimum e > e min . For this description to be fully rigorous, one would need to consider the quenched complexity, which describes the typical configurations of the energy landscapes instead of the annealed complexity used here. As the identity described above only holds in the case where Γ = 0, one might suspect that for finite Γ > 0 the quenched and annealed complexity do not change sign at the same value of energy and thus do not coincide.
Let us now consider the replica-symmetry broken phase by first considering the full replica-symmetry broken phase.

Full replica-symmetry broken phase
In the FRSB phase, there is no simplification and the expression of Φ(s) is directly given in Eq. (141). The saddle-point equations are given by Eqs. (143-144) complemented with a third equation, obtained by computing the functional derivative and which must be valid for any q ∈ (q * 0 , 1). One can check that taking the limit q → q * 0 in the above equation yields a result consistent with the first saddle-point equation (143) provided s < z(q * 0 ), and similarly taking the limit q → 1 in the equation above, the equation matches exactly the second saddle-point equation (144). In the FRSB regime, the function z(q) is continuous and strictly increasing in the range q ∈ (q 0 , 1). The solution can be determined by taking the derivative of Eq. (C28) with respect to q, yielding which can simply be re-expressed as Taking an additional derivative, one obtains an explicit expression for the function z(q), which matches exactly its expression when solving for the typical energy of the spherical spin-glass model. Note that for that solution to be consistent with the hypothesis that z(q) is an increasing function, one must ensure that Plugging the expression of z * (q) into Eq. (C30), it yields the expression of v * , which reads v * = 1 and similarly takes the same value as for the typical energy in the FRSB phase. The parameter q * 0 is thus the only parameter depending explicitly on s in the FRSB phase.
Inserting the expressions of z * (q) and v into the first saddle-point equation (143), one obtains There are thus two possible solutions corresponding respectively to Eq. (145) and (146). As we now argue, the correct solution is always given by s = s 2 (q * 0 ). This solution satisfies where .
Using the expressions for v * and z * (q), the CGF φ(s) reads in the FRSB phase where q * 0 is the inverse function of s = s 2 (q * 0 ) ≡ s(q * 0 ) as given in Eq. (C35). This CGF is convex as can be shown by taking the second derivative of this expression with respect to s, which can be shown to be positive using Eq. (C9). The first derivative of the CGF gives the associated value of the energy as One can obviously show that ∂ s e * ,FRSB (s) = −φ FRSB (s) ≤ 0 from Eq. (C41), while ∂ q * 0 e * ,FRSB (s) = −φ FRSB (s) × s 2 (q * 0 ) ≤ 0 using that we have shown above that s 2 (q * 0 ) ≥ 0. For s = 0 (corresponding to q * 0 = q typ with q typ f (q typ ) = f (q typ )) goes to the typical energy For s = s RSB , it goes to e RSB (corresponding to q * 0 = 1). For Γ > 0 it goes to a finite value as s → −∞ (corresponding to q * 0 = 0). Note that the value e c coincides with the typical energy in the absence of magnetic field. Using Eq. (C41) as well as the identity q typ f (q typ ) = f (q typ ), one can further obtain the variance for finite magnetic field as If the covariance function f (q) = g(q) + Γq scales as q → 0 as f (q) = Γq + g 2 q 2 + g p q r + o(q r ) , with r > 2 the exponent of the leading order correction to the quadratic behaviour, one expects that q * typ ≈ Γ r(r − 2)g r and the variance scales as For zero magnetic field, the ground-state energy "superconcentrates" and the variance of e min is o(N −1 ).
Let us now consider the LDF in this regime. In the FRSB regime it is expressed parametrically by fixing e and determining q * 0 from Eq. (C42) and inserting its expression in the LDF given by One can check that for e = e typ , i.e. q * 0 = q typ satisfying q typ f (q typ ) = f (q typ ), the LDF above vanishes. This value corresponds to the unique minimum of L FRSB (e), as can be shown using that L FRSB (e) = −s * ,FRSB (e) vanishes only for e = e typ , i.e. q * 0 = q typ , and that L FRSB (e) = φ FRSB (s * ,FRSB (e)) −1 > 0. This yields in particular that L FRSB (e RSB ) > 0 for Γ < Γ RSB . There are three cases.
Non zero magnetic field Γ > 0. Then one must have that q typ > 0, and expanding the LDF around its minimum, one obtains The LDF diverges logarithmically for finite magnetic field as e → e c (corresponding to q * 0 → 0) with Zero magnetic field Γ = 0. For zero magnetic field Γ = 0, the behaviour of the LDF near its minimum e = e typ = e c , corresponding to q * 0 = q typ = 0, is modified. There are two main cases.
where we remind that z * (0) = f (3) (0) 2f (0) 3/2 . In that case, one expects that the CGF is given in the regime s ∈ (−∞, z * (0)] by the linear function It displays a fifth order phase transition for s = z * (0), namely the function φ FRSB (s) and its fourth first derivatives are continuous for s = z * (0), while its fifth derivative is discontinuous (ii) For models for which f (3) (0) = 0, the scaling exponent of the LDF near its minimum becomes non-trivial: supposing the minimum value of r > 2 such that f (r) (0) > 0 the LDF scales close to its minimum as where ξ r = 2 (C57) 43 This large deviation result is quite remarkable. If we assume the simplest possible matching between the large deviation regime e c − e = O(1) and the regime of typical fluctuations, it leads to the conjecture that the typical fluctuations of the ground state energy will be of order e c − e = O(N −1/η ) with η = 3(r−2) 2r−3 . More precisely we conjecture that the PDF of the ground-state energy P(e) takes the following scaling form in the regime of typical fluctuations Note that the emergence of a non-trivial exponent η is not dissimilar to the occurrence of the exponent 3/2, describing the tail of the Tracy-Widom distribution for the spherical 2-spin model, although here it appears in a full RSB regime. In fact, in the limit where there is no correction to the quadratic behaviour, i.e. r → ∞, the exponent 3/2 and correct prefactor ξ ∞ = 2/3 × 2 3/2 match smoothly the TW tail.
Scaling regime Γ → 0. As Γ → 0, the typical ground state energy approaches e c as In the limit Γ → 0, for energies in the range e ∈ [e c , e typ ], the LDF takes the scaling form with z typ = −1/2. This scaling function is exactly the same as for the spherical 2-spin model, obtained above. In contrast, in this scaling limit, the scaling function G(z) = 0 for z < −1/2. Let now similarly estimate the typical width of fluctuations of energy around e typ allowing to smoothly interpolate between the quadratic behaviour for Γ > 0 and the non-trivial behaviour in Eq. (C56) The typical energy gap between e typ and e c in the limit Γ → 0 in Eq. (C59) is larger than the scale describing this interpolation as 2r − 3 > r − 1 for r > 2. Hence there is a well defined scaling regime which describes the vicinity of e typ for Γ → 0, where the LDF takes the scaling form where the function L FRSB (u) is determined parametrically as L FRSB (u) = (g r r(r − 2)) where x(u) = q * 0 /q typ in that limit Γ → 0. In particular, the function L FRSB (u) has the asymptotic behaviours One can check that the limit u → −∞ (first line) matches the Γ = 0 limit given in (C56), and that the limit u → +∞ (last line) matches the result (C60) and the behaviour of the function G(z) 4 3 (z + 1 2 ) 3 when z → z + typ = − 1 2 + . Finally, the second line matches smoothly the quadratic behaviour of the LDF in Eq. (C51) as e → e typ for Γ > 0.
Expanding the energy difference e − e RSB and L FRSB (e) for q * 0 → 1, one can obtain the Taylor series of L FRSB (e) as e → e RSB . Comparing with that of L RS (e), one can show that the LDF displays a third order phase transition as e → e RSB with For any model such that the Schwarzian derivative S[f ](q) of the derivative of the covariance function f (q) is positive for all q ∈ [0, 1], only the RS and FRSB regimes are required to describe the large deviation function of the ground-state at speed N . Note that there exist models for which the Schwarzian derivative S[f ](q) changes sign over the interval q ∈ [0, 1] and for which the RSB regime in the LDF should be described by an ansatz combining FRSB and 1RSB features. These models are beyond the scope of this article and will not be considered here. An example of model for which the RSB phase is described within the FRSB framework is In Fig. 7, we plot the LDF L(e) for one example of the covariance g(q) in Eq. (C67) (g 4 = 1/48, g 3 = 1/36) with three different values of magnetic field Γ = 0, 1/16, 3/4. For the first two values of Γ, the typical energy e typ , where L(e) = 0, belongs to the FRSB regime while for the third it belongs to the RS regime. In each case, a transition from the RS to the FRSB regime occurs for e = e RSB . For zero magnetic field the LDF vanishes for e c = e typ while for positive magnetic field it diverges logarithmically for e = e c .
In the next section, we will consider models for which the RSB phase is not of FRSB type but of 1RSB type, for which S [f ] (q) < 0 for q ∈ (0, 1).

One-step replica-symmetry broken phase
In the one-step replica-symmetry broken (1RSB) phase, the function z(q) is piece-wise constant with where m 0 ≥ s and the value 0 < q 0 < 1. To obtain the 1RSB expression of the CGF, we need to use Eq. (142) and optimise the functional and there are three parameters to optimise over, namely m 0 ≥ s, v ≥ 0 and q 0 ∈ [0, 1]. The saddle-point equations read Note that the first two saddle-point equations (C70,C71) are recovered by inserting the 1RSB ansatz for z(q) into Eqs. (143-144). The transition to the RS phase occurs either as the optimal value q * 0 → 1 or m * 0 → s. In each of these two cases, one can check that the saddle point equations (C70-C71-C72) and the expression of Φ 1RSB (s) (C69) coincide respectively with the RS saddle-point equation (C2) and the expression of Φ RS (s) in (C1). In order to obtain an expression that differs from the RS expression, we suppose that m * 0 = s. As mentioned for general level of replica-symmetry, the saddle-point equation (C71) thus yields the condition in (146) The saddle-point equation (C70) yields on the other hand the simple identity (147) In order to express our results, it will be convenient to express the CGF parameter s in terms of q * 0 rather than the inverse. We therefore introduce the parametrisation where α(q * 0 ) will be determined by the last saddle-point equation (C72) and the function ρ(q), introduced when presenting the results on the typical energy, reads The parametrisation above ensures that Eqs. (C70-C71) are fulfilled while the remaining equation (C72) yields the following relation between α and q * 0 , where the function Note that the function µ(q) is completely independent of the magnetic field Γ as can be checked by invariance of the above definition when replacing f (q) → f (q) + Γq. As mentioned when considering the typical energy, the function µ(q) is an increasing function of q as can be shown by computing its derivative and using the identities The function µ(q) is monotonously increasing apart from the singular case of the 2-spin, where µ(q) = 1/2 for any value of q, and this will play a role in the analysis below. Thus for any q ∈ [0, 1], one has the function ρ(q) is monotonously decreasing in the interval q ∈ [0, 1], such that its minimum over this interval is reached in q m (Γ ≥ Γ t ) = 1. For a smaller magnetic field Γ < Γ t , the function ρ(q) is decreasing for q smaller than its unique minimum 0 ≤ q m (Γ < Γ t ) < 1 and is increasing for q ≥ q m (Γ). For any positive magnetic field, it diverges at the origin with qρ(q) → Γ/g (1) and reaches a finite value ρ(1) = f (1)/f (1) for q → 1. Finally, the last function α(q) appearing in Eq. (C79) can be shown to satisfy 0 ≤ ρ(q * 0 ) ≤ α(q * 0 ) for any value of q * 0 ∈ [0, 1] in order to ensure that g(1)/g (1) ≤ µ(q * 0 ) ≤ 1/2. Using the same equation, one can also compute explicitly where we have used that µ (q * 0 ) ≥ 0 and 0 ≤ ρ(q * 0 ) ≤ α(q * 0 ). This yields that the function α(q * 0 ) is a decreasing function of q * 0 , at least in the interval [0, q m (Γ)]. In the following, we will show that it will be sufficient to consider the 1RSB solution only in this regime 0 ≤ q * 0 ≤ q m (Γ). Using the parametrisation introduced above, the CGF is expressed within the 1RSB framework as where the value of q * 0 for a fixed s is obtained by inverting Eq. (C75) using the expression of α(q * 0 ) obtained from Eq. (C79).
Computing its first derivative allows to express the associated value of the energy for fixed s, Similarly, one can compute explicitly the second derivative of the CGF but its general expression is rather cumbersome and not given here. Setting instead s = 0, corresponding to q * 0 = q typ , one obtains the rescaled variance, which takes the very simple expression V min (Γ) = lim N →∞ N Var(e min ) = φ 1RSB (0) = g(q typ ) + q typ (Γ − g (q typ )) 2 .
It is quite interesting to note, as already obtained in (150), that the expression of the variance in the RS (C13), FRSB (C45) and 1RSB (C89) schemes takes exactly the same form as a function of q typ . The typical overlap q typ is however obtained in a distinct manner in each of the three schemes: q typ = 1 in the RS scheme, q typ is the solution of q typ f (q typ ) = f (q typ ) in the FRSB scheme, and q typ is the solution of Eq. (C79), i.e. q * 0 → q typ , satisfying α(q typ ) = 1 in the 1RSB scheme.
Using Eq. (C88) above, one can express e in terms of q * 0 and α(q * 0 ), where α(q * 0 ) is obtained from Eq. (C79), and 47 compute explicitly the LDF L 1RSB (e) within the 1RSB framework as For any Γ > 0, in the limit e → e c , corresponding to q * 0 → 0, the LDF diverges logarithmically as For Γ = 0 instead, as we will see in more details below, the 1RSB regime is limited to the single point e = e c = e typ (Γ = 0), where the LDF vanishes.
Let us now discuss in more details the transition from the RS expression to the 1RSB expressions for φ(s) and L(e) and the domain of validity of the above expressions in terms of values of q * 0 . Let us recall that there are two distinct mechanisms prompting a transition from the RSB regime to the RS regime, the parameter q * 0 can reach the value q * 0 = 1 or the parameter m * 0 can reach the value m * 0 = s. The nature of the mechanism at the transition is dictated by the value of the magnetic field Γ.
a. Large magnetic field Γ > Γt 0 = s t , one can thus show that the CGF is continuous φ 1RSB (s t ) = 1 2 s 2 t f (1) + v t s t f (1) + ln The first derivative φ (s) is also continuous at the value of s t with e t = e * ,RS (s Thus, one can similarly show that the LDF and its first derivative is continuous as well at the transition The transition is of second order in this regime and occurs for s = s t , i.e. q = q t with For zero magnetic field Γ → 0, we have that q t → 0 as in Eq. (C104) and where we remind that ρ typ is the solution of Using these identities, one can now check that e t = − 1 g (1) √ ρ typ (g (1) − g(1)) + g(1) √ ρ typ = e typ (Γ = 0) = e c .
However, the Laplace parameter s reaches a finite value at the transition s t = 1 Since q t (Γ = 0) = 0, one thus naturally expects that q * 0 freezes to the value q * 0 = 0 in the whole 1RSB regime, i.e. for s ∈ (−∞, s t ] and thus the CGF takes in that interval a simple linear form φ 1RSB (s) = −s e typ , s ∈ (−∞, s t ]. (C118) Upon Legendre transform, one can check that the 1RSB expression of the LDF associated to this formula only describes the single point e = e typ . The transition in the CGF is again of second order, namely As mentioned in the section on the RS regime, the LDF L RS (e) vanishes linearly at the value e typ with L RS (e typ ) = −s t (see Eq. (81)). One expects that the probability of events e ≥ e typ are characterised by a large deviation with speed larger than N and are out of the scope of the present article. Thus, for zero magnetic field Γ = 0, the LDF is expected to be characterised only by the RS regime L(e) = L RS (e) for all e ≤ e typ . In addition, it vanishes linearly at the typical value instead of the quadratic behaviour observed for positive magnetic field Γ > 0. This linear behaviour is consistent with a distribution of typical fluctuations displaying an exponential tail. As discussed in the main text, the existence of an exponential tail was proven rigorously for the pure p-spin model [62].
d. Scaling regime: Γ → 0 In the regime Γ → 0, the differences between the characteristic energies scale (see bottom left panel in Fig. 9) as e typ − e c = − Γ 2 ρ typ g (1) In the limit Γ → 0, e → e typ , there is a scaling function 1 √ ρ typ − √ ρ typ u , u ≤ u t < 0 , (ρ typ g (1) − 2g 2 )u 2 , u > u t . (C123) The first line in this expression is obtained from the RS solution and corresponds to energy e ≤ e t while the second line is obtained from L 1RSB (e) and describes energies e ≥ e t . This scaling function displays a second order transition for u = K t − K typ in the sense that it is continuous and its first derivative as well at this point. Its asymptotic behaviours as u → −∞ and u → 0 allow to respectively match the linear behaviour of the LDF L(e) ≈ −s t (e − e typ (Γ = 0)) for Γ = 0 and the quadratic behaviour L(e) ≈ (e − e typ (Γ)) 2 /(2V min (Γ)) for finite but small Γ. Close to the wall, i.e. for e → e c , the LDF takes instead a different scaling form L(e) ≈ G 1RSB ρ typ g (1)(e − e c ) Γ ; g 2 ρ typ g (1) , G 1RSB (z; w) = − 1 2 ((1 + 2z) (1 + w(1 + 2z)) + ln(−2z)) , z ∈ [z typ , 0] , with z typ = z t = −1/2. For z < −1/2 one has G 1RSB (z; w) = 0. Note that in the special case w = 1/2, this scaling function is the same as for the FRSB case. This scaling function behaves asymptotically as In particular, the first line matches the logarithmic divergence of the LDF in Eq. (C93) as e → e c for Γ > 0. The second line instead, matches the behaviour of the scaling function L 1RSB (u) for u → +∞.
Remark on stability of the 1RSB solution: To ensure the stability of the 1RSB phase, an analysis of the quadratic form (see Appendix D for details) reveals that both the following eigenvalues must be negative In the limit q * 0 → 1, both these eigenvalues coincide and match the expression of Λ RS in Eq. (C5). Ensuring negativity of the above eigenvalues yields the conditions which can be shown to hold numerically on several important examples (e.g. the p-spin model).

Appendix D: Stability of the RS and 1RSB phases
To determine the stability of the different phases, one needs to consider the eigenvalues of the quadratic variation A around the saddle-point solution Q To ensure stability, this qudratic form must have negative eigenvalues.

RS phase
In the RS phase, The equations for the eigenvalues of the quadratic form read for 0 < Γ < g (1) − 2g(1), i.e. 2f (1) < f (1), while in the converse case e 0,RS = − f (1). Solving for e 0,RS = e RSB , one recovers exactly the same equation as in (E28) and thus the three different values e 0,RS , e 0,− and e RSB cross for Γ = Γ cr . One naturally expects that for any value of Γ, the annealed complexity is positive at the typical value of the energy Σ min (e typ ) ≥ 0 such that e typ ∈ [E min , E max ]. Note that for models for which e typ belongs to the 1RSB phase, e 0,RS = e typ for Γ = 0.