# Replica-Symmetry Breaking Transitions in the Large Deviations of the Ground-State of a Spherical Spin-Glass

Bertrand Lacroix-A-Chez-Toine, Yan V Fyodorov, Pierre Le Doussal

► To cite this version:

Bertrand Lacroix-A-Chez-Toine, Yan V Fyodorov, Pierre Le Doussal. Replica-Symmetry Breaking Transitions in the Large Deviations of the Ground-State of a Spherical Spin-Glass. Journal of Statistical Physics, 2024, 191, pp.11. 10.1007/s10955-024-03232-9. http://dx.doi.org/10.1007/s10955-024-03232-9

HAL Id: hal-04980274

https://hal.science/hal-04980274v1

Submitted on 6 Mar 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Replica-Symmetry Breaking Transitions in the Large Deviations of the Ground-State of a Spherical Spin-Glass

Bertrand Lacroix-A-Chez-Toine<fnref n="1" /> ID · Yan V. Fyodorov<fnref n="1" /> · Pierre Le Doussal<fnref n="2" />

Received: 28 June 2023 / Accepted: 5 January 2024 / Published online: 27 January 2024
© The Author(s) 2024

## Abstract

We derive, within the replica formalism, a generalisation of the Crisanti–Sommers formula to describe the large deviation function (LDF) $\mathcal{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 \ge 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 (Fyodorov and Le Doussal in J Stat Phys 154:466, 2014) and the rigorous results by Dembo and Zeitouni (J Stat Phys 159:1306, 2015) which we are able to reproduce invoking an 1-RSB pattern. Finally at an even larger critical energy $e_c \ge 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) $\mathcal{L}(e) \sim G((e - e_c)/\Gamma)$ in the vicinity of the wall (ii) $\mathcal{L}(e) \sim \Gamma^{\eta\nu} F((e - e_{typ})/\Gamma^{\nu})$ in the vicinity of the typical energy, characterised by two new exponents $\eta \ge 1$ and $\nu$ characterising universality classes. Via matching the latter allows us to formulate several conjectures concerning the regime of typical fluctuations, identified as $e - e_{typ} \sim N^{-1/\eta}$ and $\Gamma \sim N^{-1/(\eta\nu)}$.

**Keywords** Disordered systems · Spin glasses · Large deviations · Phase transition

Communicated by Chiara Cammarota.

<footnote>✉ Bertrand Lacroix-A-Chez-Toine
bertrand.lact@gmail.com</footnote>

<footnote n="1">¹ Department of Mathematics, King's College London, London WC2R 2LS, UK</footnote>

<footnote n="2">² Laboratoire de Physique de l'Ecole Normale Supérieure, ENS, Université PSL, CNRS, Sorbonne Université, Université de Paris, 75005 Paris, France</footnote>
# 1 Introduction

## 1.1 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 [1] as well as loss landscapes in supervised learning [2], and have intimate relations with many problems in economics, biology, chemistry, condensed matter physics, string theory and cosmology, see [3] and [4] 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 [5, 6] asking to minimize a random quadratic form $\sum_{i,j} 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 = \pm 1$, $i = 1, \dots, 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(\mathbf{x})$, $\mathbf{x} \in \mathbb{R}^N$ assumed to be a mean-zero random Gaussian field with the covariance structure

$$ \overline{H(\mathbf{x})H(\mathbf{y})} = N f\left(\frac{\mathbf{x} \cdot \mathbf{y}}{N}\right), \qquad (1) $$

$$ f(q) = \Gamma q + g(q), \quad g(q) = \sum_{r=2}^{\infty} g_r q^r, \quad \Gamma \ge 0, \quad \forall r \ge 2, \quad g_r \ge 0, \quad q \in [0, 1] \quad (2) $$

over the sphere $\mathbf{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_\infty$ over the interval $[0, 1]$, so that $f'(1) < +\infty$. In particular, taking $g_p = \delta_{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 $\Gamma$.

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 called the ground-state energy $E_{\min}$, in the limit of large dimension $N \gg 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} = \frac{1}{N} \min_{\mathbf{x} \in \mathbb{R}^N; \mathbf{x}^2=N} H(\mathbf{x}) = - \lim_{\beta \to \infty} \frac{1}{N\beta} \ln Z(\beta), \qquad (3) $$

where $Z(\beta)$ is the partition function at inverse temperature $\beta$, defined as

$$ Z(\beta) = \int_{\sqrt{N}S_{N-1}} d\mathbf{x} e^{-\beta H(\mathbf{x})} = \int_{\mathbb{R}^N} d\mathbf{x} \delta(\mathbf{x}^2 - N) e^{-\beta H(\mathbf{x})}, \qquad (4) $$
with $S_{N-1}$ being the $N$-dimensional unit sphere. Similar formulae can be written for the ground-state energy of SK or any other optimisation model with a given cost/loss function. One defines the probability distribution function (PDF) of the ground-state energy

$$ \mathcal{P}(e) = \bar{\delta}(e - e_{\min}). \qquad (5) $$

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 $\bar{e}_{\min}$ when $N \to \infty$

$$ \lim_{N \to +\infty} e_{\min} = \bar{e}_{\min}. \qquad (6) $$

The aim of this paper is to describe the fluctuations of $e_{\min}$ in particular, focusing on the large deviations tails of $\mathcal{P}(e)$ which describe atypical fluctuations away from $\bar{e}_{\min}$. Before describing the method and our results, it is worth reviewing in some details the literature on the average $\bar{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.

## 1.2 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 $\bar{e}_{\min}$, has been originally developed in a series of pioneering papers by Giorgio Parisi starting from [7]. In those works it has been demonstrated that finding the ground-state required introducing the fundamental concept of Replica Symmetry Breaking (RSB), see [8] for a standard introduction. In such framework finding $\bar{e}_{\min}$ amounts to optimizing the so-called Parisi functional with respect to a positive, non-decreasing function $x(q)$, $q \in [0, 1]$, and the optimal solution has been predicted to have a part which is continuous in a finite interval $q \in [a, b] \subset [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 [8–10] 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 [11, 12], see [13] 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 [14].

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 $\bar{e}_{\min}$) for that model has been derived originally in a seminal work of Crisanti and Sommers [15] using the replica approach. In recent years the Crisanti–Sommers variational problem has been re-derived rigorously [16] and then thoroughly analyzed in various parameter regimes in many mathematical papers, see e.g.
[17–22]. These studies demonstrated that depending on the choice of parameters the varia-
tional 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 real-
ized generically for all spherical pure $p$-spin models with $p \ge 3$, provided the magnetic
field variance $\Gamma$ is small enough, the picture already predicted in the original Crisanti and
Sommers paper [15]. For either pure $p = 2$ case or any pure case and strong enough magnetic
field variance $\Gamma$ the RS solution is known to hold. Physically, 1RSB type of replica symme-
try 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 [8, 9].

Allowing for some mixtures of two different powers in the covariance Eq. (2) may lead to more complicated solutions as first noticed in [23] and obtained in [24, 25], like 2-RSB for a mixture of two powers $r = 2$ and $r = 4$ with specially chosen coefficients [21, 26]. 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) [22, 26, 27], but never to pure FRSB solution. The situation for a generic mixture of infinitely many powers is not yet rigorously established, but expected again to mix features from a finite number of RSB and FRSB types. We see therefore that the spherical model allows a very rich behaviour for its ground-state problem in the limit $N \to \infty$.

It is necessary to mention that, in the spherical case, the method of Crisanti–Sommers
functional for characterising the ground-state value in the limit $N \to \infty$ 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 [28–30] 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 average ground-state energy in [31, 32]. Further work in this direction lead to a detailed
characterisation of landscape geometry close to the ground-state value, see e.g. [33]. 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 [34] for the original physics
paper and [35, 36] 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 [37].

A detailed quantitative discussion of the average (and typical) ground-state energy is given
in Appendix A.

1.3 Fluctuations and Large Deviations of the Ground-State Energy and Aim of the Paper

While the discussion above shows that the problem of finding the equilibrium free-energy
and then eventually the ground-state energy $\overline{e}_{\min}$ for a general spherical spin-glass model
in the limit $N \to \infty$ is by now relatively well-studied, the problem of characterizing the
ground-state fluctuations for large, but finite $N \gg 1$ remains scarcely researched. For general
spherical mixed even $p$-spin models with $\Gamma = 0$, the extensive ground-state energy $E_{\min} =$
$Ne_{\min}$ “superconcentrates”, which means that $\mathcal{V}_{\min} = \lim_{N \to \infty} \text{Var}(E_{\min})/N = 0$, whereas
for any fixed magnetic field $\Gamma > 0$ the above limit is finite and the ground-state energy
satisfies the Central Limit Theorem [18]. This last fact implicitly suggests that for $\Gamma > 0$ the
fluctuations of the ground-state energy away from $\overline{e}_{\min}$ may actually satisfy a Large Deviation
Principle with speed $N$, at least in some finite interval of values of $e_{min}$ around $\overline{e_{min}}$. This means that, asymptotically at large $N$, the PDF takes the form

$$ \mathcal{P}(e) \approx e^{-N\mathcal{L}(e)}, \quad N \gg 1. \qquad (7) $$

where $\mathcal{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 $\mathcal{L}(e)$ is finite is the main goal of this paper. In particular one expects that $\mathcal{L}(e = \overline{e_{min}}) = 0$ such that typical and average value of $e_{min}$ coincide $e_{typ} = \overline{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. $\Gamma = 0$, stands out as very special. Indeed, the Hamiltonian in this case can be equivalently written as a quadratic form $H(\mathbf{x}) = -\frac{1}{2}(\mathbf{x}, J\mathbf{x})$, with $J$ being a $N \times N$ random matrix from the standard Gaussian Orthogonal Ensemble (GOE) [38]. Hence, the ground-state energy in this case has a simple alternative description: $e_{min} = -\lambda_{max}^{(N)}/2$ where $\lambda_{max}^{(N)}$ is the maximum eigenvalue of a $N \times N$ GOE matrix, which as $N \to \infty$ tends to $\lambda_{max}^{(\infty)} = 2$, implying $\overline{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 the fact that any quadratic form over the sphere may have only two minima, trivially related by the symmetry $\mathbf{x} \to -\mathbf{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

$$ \mathcal{P}(e) \approx \begin{cases} e^{-N\mathcal{L}(e)} & , \quad e + 1 < 0, \\ N^{2/3} \mathcal{F}'_1(-2N^{2/3}(e+1)) & , \quad e + 1 = O(N^{-2/3}), \\ e^{-N^2\Psi(e)} & , \quad e + 1 > 0. \end{cases} \qquad (8) $$

The typical fluctuations are described by $\mathcal{F}'_1(s)$, i.e. the GOE Tracy–Widom law [39]. The corresponding regime has a width $e + 1 = O(N^{-2/3})$. The large deviation regimes describe the fluctuations $e - \overline{e_{min}} = e + 1 = O(1)$ with a speed $N$ for $e - \overline{e_{min}} < 0$ and a speed $N^2$ for $e - \overline{e_{min}} > 0$. The rate functions have been obtained explicitly [40–43].

With added magnetic field term $\Gamma > 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 [44]), although its limiting value $\overline{e_{min}}$ is not difficult to find [38, 45] as the corresponding optimization problem again allows only a replica-symmetric solution for any $\Gamma \ge 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 [42] followed by mathematics papers, first by [47], and then by several others [44, 46, 48–51]. In [42] a variant of the replica trick was employed to calculate the LDF with the speed $N$, $\mathcal{L}(e)$, whose validity for $\Gamma > 0$ was found to cover not only the range $e < \overline{e_{min}}$, but extended also to a certain positive range of values $\overline{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 [47] only confirmed the suggested replica-based formula for the LDF in an interval $-\infty < e < e_L$, with $\overline{e_{min}} < e_L < e_{c,RS}$, whereas a different expression was found to hold for LDF in $e \in [e_L, e_c)$, with $e_c \neq 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 [42] and compute first the cumulant generating function $\phi(s)$ of $e_{\min}$, resorting to the identity<fnref n="1" />

$$ \phi(s) = \lim_{N \to \infty} \frac{1}{N} \ln \overline{e^{-Nse_{\min}}} = \lim_{N \to \infty} \frac{1}{N} \ln \lim_{\beta \to \infty} \overline{e^{-Ns(-\frac{1}{N\beta} \ln Z)}} = \lim_{N \to \infty} \frac{1}{N} \ln \lim_{\beta \to \infty} \overline{Z^{s/\beta}}, \quad (9) $$

Note that from the definition of $\phi(s)$ in Eq. (9) and by a simple application of Jensen's inequality, the function $\phi(s)$ must be convex. Inserting the form (7) into (9) we see that

$$ \phi(s) = - \min_{e \in \mathbb{R}} [se + \mathcal{L}(e)] \quad (10) $$

so that the large deviation function $\mathcal{L}(e)$ is then obtained by inversion of the Legendre transform which can be written as

$$ \mathcal{L}(e) = - \min_{s \in \mathbb{R}} [se + \phi(s)]. \quad (11) $$

Note that the average and typical ground-state energy can be obtained easily from $\phi(s)$ in the high-dimensional limit as

$$ e_{\text{typ}} = \overline{e_{\min}} = -\phi'(0). \quad (12) $$

In order to derive $\phi(s)$ we first compute using saddle point methods in the large $N$ limit of the integer moments of the partition sum $\overline{Z}(\beta)^n$, $n \in \mathbb{N}$ for arbitrary inverse temperature $\beta > 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/\beta$ with fixed $s$.

The following remark is appropriate here. In a relatively recent paper [52] 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 [52] 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 [52] 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 [53]. 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. [54, 55] and [56–58] which together with a few other related works, like [59] and [60] we find to be worth of

<footnote n="1">¹ See a nice historical exposition of this and related identities in [52].</footnote>
<figure><img src="image_2.png" /><figcaption>**Fig. 1** Phase diagram of the LDF $\mathcal{L}(e)$ in Eq. (13) for the spherical 2-spin model in the plane $(e, \Gamma)$. The dashed black line $e_t(\Gamma) = e_{\text{RSB}}(\Gamma)$ shows the transition separating the RSB 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 $e_{\text{typ}}(\Gamma)$, which is always smaller than $e_{\text{RSB}}(\Gamma)$ for this model. For $e > e_c$ (the energy $e_c$ 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 (Color figure online)</figcaption></figure>

mentioning here for the benefit of a reader interested in this problematic. See also [61] for a pedagogical introduction on large deviations for disordered systems.

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 Sect. 2 we display the main results for the large-deviation function (LDF) $\mathcal{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 Sect. 3 we present the derivation of the optimisation problem allowing to obtain the cumulant generating function (CGF) $\phi(s)$, i.e. the generalisation of the Crisanti–Sommers formula, from the expression of the moments of the partition function. In Sect. 4 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_{\text{typ}}(\Gamma) = \bar{e}_{\text{min}}$. In Appendix B, we summarise the main results on the cumulant generating function $\phi(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.

# 2 Main Results

## 2.1 Spherical 2-Spin Model in a Random Magnetic Field

In this case, corresponding to $f(q) = q^2/2 + \Gamma q$ we obtain the following expression for the LDF
<figure><img src="image_3.png" /><figcaption>Fig. 2 Plot of the large deviation function $\mathcal{L}(e)$ in Eq. (13) for the spherical 2-spin model with a random field of variance $\Gamma = 0$ (left) and $\Gamma = 1/2$ (right). For $\Gamma = 1/2$, the vertical black dashed line represents the value of $e_{\text{RSB}}$ separating on its left the RS regime where $\mathcal{L}(e) = \mathcal{L}_{\text{RS}}(e)$ plotted in blue and on its right the RSB regime where $\mathcal{L}(e) = \mathcal{L}_{\text{RSB}}(e)$ plotted in orange. The solid red line marks the value $e_{\text{typ}}$ and the dotted green line, the value of $e_c$ where the LDF diverges logarithmically [see Eq. (14)]. For $\Gamma = 0$, all these values coincide and the RSB phase is limited to the single point $e = e_{\text{typ}}$</figcaption></figure>

$$ \mathcal{L}(e) = \begin{cases} \frac{e \left( e\Gamma + (1+\Gamma)\sqrt{e^2 - \frac{1+2\Gamma}{1+\Gamma}} \right)}{1+2\Gamma} & , \quad e \le e_t , \\ -\ln\left(\frac{-e\sqrt{1+\Gamma} + \sqrt{e^2(1+\Gamma) - (1+2\Gamma)}}{1+2\Gamma}\right) & , \quad e \le e_t , \\ \frac{(2(1+e)+\Gamma)(2(1+e)+3\Gamma)}{4\Gamma^2} - \frac{1}{2}\ln\left(-\frac{2(1+e)}{\Gamma}\right) & , \quad e_t \le e \le e_c , \end{cases} \quad (13) $$

where the typical energy $e_{\text{typ}}(\Gamma)$, the transition energy coinciding with the RSB threshold $e_t(\Gamma) = e_{\text{RSB}}(\Gamma)$ and the critical threshold $e_c$ (acting as a “wall”) are given by

$$ e_{\text{typ}}(\Gamma) = -\sqrt{1+\Gamma}, \quad e_{\text{RSB}}(\Gamma) = -\left(1+\frac{\Gamma}{2(1+\Gamma)}\right), \quad e_c = -1, \quad (14) $$

with $e_{\text{typ}} < e_{\text{RSB}} < e_c$ for $\Gamma > 0$. A phase diagram of the LDF is plotted in Fig. 1 and a plot of the LDF $\mathcal{L}(e)$ is provided in Fig. 2 for $\Gamma = 0$ and $\Gamma = 1/2$. The phase transition is of third order in the sense that the function $\mathcal{L}(e)$ as well as its first two derivatives $\mathcal{L}'(e)$ and $\mathcal{L}''(e)$ are continuous at the transition $e \to e_{\text{RSB}}$. As $e \to e_c$, the LDF diverges logarithmically and one naturally expects that a large deviation function at a larger speed should describe the atypical fluctuations for $e \ge e_c$. Note that at zero magnetic field ($\Gamma = 0$), the RSB phase of $\mathcal{L}(e)$ is limited to a single point $e = e_{\text{RSB}}$, where it coincides with the RS expression. A plot of the LDF is given in Fig. 2 for $\Gamma = 0, 1/2$.

The expression of $\mathcal{L}(e)$ in the first line in Eq. (13) was first obtained from a replica symmetric ansatz in [42] and confirmed by a rigorous result in [47]. Neither the threshold $e_{\text{RSB}}$ nor the second line in Eq. (13) appeared in Ref. [42], but were discovered by Dembo and Zeitouni [47] 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_{\text{RSB}}$ can be accounted for as the consequence of the instability of the replica-symmetric solution of Ref. [42] 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 $\Gamma = O(1)$ in a typical realisation [42, 45]. 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 [see Eq. (33) and paragraph below].

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 $H(\mathbf{x}) = -\sum_{i,j} J_{ij}x_i x_j - \sum_i h_i x_i$: 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 $\pm 2$ as $N \to \infty$) as well as the LDF averaged over the GOE distribution of $J$.<fnref n="2" /> 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 \in [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 $\Gamma > 0$, the LDF is quadratic in the vicinity of $e_{typ}(\Gamma) = -\sqrt{1 + \Gamma}$ with

$$ \mathcal{L}(e) = \frac{(e + \sqrt{1 + \Gamma})^2}{\Gamma} + \frac{(1 + \Gamma)^{3/2}}{3\Gamma^3} (e + \sqrt{1 + \Gamma})^3 + O((e + \sqrt{1 + \Gamma})^4). \quad (15) $$

For $\Gamma = 0$, one finds $\mathcal{L}(e) = -e\sqrt{e^2 - 1} - \ln(-e + \sqrt{e^2 - 1})$ for $e < e_{typ}(\Gamma = 0) = e_c = -1$, which as noted in [42] coincide under the mapping $e = -\lambda_{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 $\Gamma \to 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 $\Gamma \to 0$, i.e.

$$ e_c - e_{typ} = \frac{\Gamma}{2} + O(\Gamma^2) \quad (16) $$

$$ e_{RSB} - e_{typ} = \frac{3\Gamma^2}{8} + O(\Gamma^3). \quad (17) $$

This naturally leads to two different scaling regimes and functions. The first one describes the regime $e - e_{typ} = O(\Gamma^2)$ and the LDF takes the scaling form

$$ \mathcal{L}(e) \approx \Gamma^3 F \left( \frac{e - e_{typ}}{\Gamma^2} \right), $$

<footnote n="2">² Note that Dembo and Zeitouni use the notation 'quenched' for a fixed realisation of $J$ and 'annealed' for results averaged over the distribution of $J$ but these notations do not exactly cover the standard use of these terms in the disordered system community.</footnote>
$$F(x) = \begin{cases} \frac{2}{3} (\sqrt{1-2x} - 1 + x(3-2\sqrt{1-2x})), & x \in (-\infty, x_{\text{RSB}}], \\ \frac{(1+8x)^3}{384}, & x \in [x_{\text{RSB}}, +\infty), \end{cases} \quad (18)$$

with $x_{\text{RSB}} = 3/8$ and the scaling function has continuous two first derivatives at $x_{\text{RSB}}$, which is the mark of third order transition. The first branch, corresponding to the RS phase, was originally derived in [42] [see Eq. (47) there]. It is quite interesting to note that the full scaling function $F(x)$ in (18) now extends for $x \to +\infty$, 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

$$F(x) = \begin{cases} \frac{2}{3}(-2x)^{3/2}, & x \to -\infty, \\ \frac{1}{6}(2x)^3, & x \to +\infty. \end{cases} \quad (19)$$

As was discussed in [42], the asymptotics for $x \to -\infty$ agrees with the behaviour of the right-tail of the $\beta = 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 \to +\infty$, 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 [42], and rigorously shown recently [44, 50], in presence of a random field of variance $\Gamma \sim 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 \infty$, to a universal one parameter family of distributions denoted $p_\kappa(\delta)$, i.e. one has

$$\mathcal{P}(e) \to N^{2/3} p_{\kappa=N^{1/3}\Gamma} (\delta = N^{2/3}(e - e_{\text{typ}})), \quad N \to \infty, \quad (20)$$

with in particular $p_0(\delta)$ coinciding after a rescaling $\delta = -\zeta/2$ with the TW $F'_1(\zeta)$. One expects that there will be a matching of the tails of the distributions $p_\kappa(\delta)$ within this family for large $\kappa \to \infty$ and $\delta \to \infty$ with the asymptotic behaviour of the large-deviation form $\mathcal{P}(e) \asymp e^{-N\mathcal{L}(e)}$. A sketch of the different scaling regimes discussed below is given in Fig. 3. The first scaling regime corresponds to

$$p_{\kappa}(\delta) \sim e^{-\kappa^3 F(x=\frac{\delta}{\kappa^2})}, \quad \kappa \to \infty, \quad |\delta| \to \infty. \quad (21)$$

The $\delta > 0$ side has been analysed in details in [42]. The large $x$ behaviour of the scaling function, $F(x) \simeq \frac{2}{3}x^{3/2}$, is compatible with the conjecture that $p_\kappa(\delta) \sim e^{-c_+(\kappa)(-2\delta)^{3/2}}$ at any fixed $\kappa$ and that, by matching, $c_+(\kappa) \simeq 2/3 = c_+(0)$ at large $\kappa$. On the other hand, on the $\delta < 0$ side, in the regime $-\delta/\kappa^2 \to +\infty$, matching to the $x \to -\infty$ cubic behaviour of $F(x)$ on the RSB side leads to $p_\kappa(\delta) \sim e^{-\frac{(-2\delta)^3}{6\kappa^3}}$ which suggests the following conjecture: the left tail of the distribution $p_\kappa(\delta)$ for fixed arbitrary $\kappa = O(1)$ is cubic and takes the form

$$p_{\kappa}(\delta) \sim e^{-c_{-}(\kappa)(-2\delta)^{3}}, \quad \delta \to -\infty, \quad (22)$$

with $c_-(0) = 1/24$ and $c_-(\kappa) \sim 1/(6\kappa^3)$ for $\kappa \to +\infty$. This conjecture provides a natural explanation to the mismatch of coefficients of the cubic tail with the TW noted above.
<figure><img src="image_4.png" /><figcaption>**Fig. 3** Plot of the different scaling regimes at large *N* describing our conjectures for the distribution of the typical fluctuations *p*<sub>κ</sub>(*δ*) 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<sup>2/3</sup>) and *κ* = *O*(N<sup>1/3</sup>) is indicated in green, while the white region represents the tail region for the typical fluctuations and show the separation of scales. The side *δ* > 0 was described in [42]. The radial lines represent schematically the equations *δ* = *x*κ<sup>2</sup> for fixed values of *x*. 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. It separates the region where the RS ansatz is operative (blue lines) to its left and the region where the RSB ansatz is operative (orange lines) to its right. Finally the region *κ* = 0 and *δ* < 0 with |*δ*| ~ N<sup>2/3</sup> is described by the Coulomb gas and has a N<sup>2</sup> 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)</figcaption></figure>

Finally, let us briefly discuss the second scaling regime $e - e_c = O(\Gamma)$ where the Large Deviation Function reads

$$
\mathcal{L}(e) \approx G\left(\frac{e - e_c}{\Gamma}\right), \quad G(z) = \begin{cases} 0, & z \in (-\infty, z_{\text{RSB}}], \\ -\frac{1}{4}(3 + 8z + 4z^2 + 2\ln(-2z)), & z \in [z_{\text{RSB}}, 0], \end{cases} \tag{23}
$$

with $z_{\text{RSB}} = z_{\text{typ}} = -1/2$. Note that $G(z) > 0$ for $z > z_{\text{RSB}}$ and vanishes cubically for $z \to z_{\text{RSB}}$ as $G(z) \sim \frac{4}{3}(z - z_{\text{RSB}})^3$, again a third order transition. Also note that the limit $x \to +\infty$ of the scaling function $F(x) \sim \frac{4}{3}x^3$ matches correctly the limit $z \to z_{\text{RSB}} = z_{\text{typ}}$ of the function $G(z)$. In the case $z < z_{\text{RSB}}$, there are sub-leading corrections to the scaling of order $\Gamma^{3/2}$ to Eq. (23) described by

$$
\mathcal{L}(e) \approx \Gamma^{3/2} \hat{G} \left( \frac{e - e_c}{\Gamma} \right), \quad \hat{G}(z) = \frac{2}{3} (-2z - 1)^{3/2}, \quad z < z_{\text{RSB}} = \frac{1}{2}. \qquad (24)
$$

2.2 Large Deviations of the Ground-State Energy for a Generic Mixture Model

The cumulant generating function (CGF) can be shown to be obtained as

$$
\phi(s) = \begin{cases} \max_{z(q), q_0, v} \Phi(s), & s < 0, \\ 0, & s = 0, \\ \min_{z(q), q_0, v} \Phi(s), & s > 0, \end{cases} \qquad (25)
$$
where the function $z(q)$ is a real non-decreasing function, satisfying $z(q) = s$ for $q \in [0, q_0)$ and $z(q) \ge s$ for $q \in [q_0, 1]$, while the functional $\Phi(s)$ reads

$$ \Phi(s) = \frac{s}{2} \left[ sf(q_0) + v f'(1) + \int_{q_0}^{1} dq \, z(q) f'(q) \right] \\ + \frac{1}{2} \left[ \ln \left( sq_0 + v + \int_{q_0}^{1} dq \, z(q) \right) - \ln \left( v + \int_{q_0}^{1} dq \, z(q) \right) \right] \\ + \frac{s}{2} \int_{q_0}^{1} \frac{dq}{v + \int_{q}^{1} dr \, z(r)} . \qquad (26) $$

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/\beta$ in our limit of interest and thus we expect that the correct optimisation problem is solved by taking the maximum of the function $\Phi(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

$$ e_{\text{typ}}(\Gamma) = \overline{e_{\min}} = -\phi'(0). \qquad (27) $$

The rescaled variance can similarly be computed as

$$ V_{\min}(\Gamma) = \lim_{N \to \infty} N \text{Var}(e_{\min}) = \phi''(0) = g(q_{\text{typ}}(\Gamma)) + \frac{\Gamma - g'(q_{\text{typ}}(\Gamma))}{2}, \qquad (28) $$

where $q_{\text{typ}}(\Gamma)$ is the optimal value of the parameter $q_0$ in the case where $s = 0$. For any magnetic field

$$ \Gamma \ge \Gamma_{\text{RSB}} = g''(1) - g'(1), \qquad (29) $$

the typical energy belongs to the RS phase such that $e_{\text{typ}}(\Gamma \ge \Gamma_{\text{RSB}}) = -\sqrt{g'(1) + \Gamma}$ and $q_{\text{typ}}(\Gamma \ge \Gamma_{\text{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.

$$ \mathcal{L}(e) = - \min_{s \in \mathbb{R}} [se + \phi(s)]. \qquad (30) $$

Interestingly, one can give a more explicit expression for $\mathcal{L}(e)$, valid at any level of replica-symmetry breaking:

$$ \mathcal{L}(e) = \frac{s_*^2}{4} (2f(q_0^*) - q_0^* f'(q_0^*)) + \frac{s_* q_0^* f'(q_0^*)}{4} \sqrt{\frac{4}{q_0^* f'(q_0^*)} + s_*^2} \\ - \ln \left[ \frac{\sqrt{q_0^* f'(q_0^*)}}{2} \left( s_* + \sqrt{\frac{4}{q_0^* f'(q_0^*)} + s_*^2} \right) \right]. \qquad (31) $$

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 $\Gamma$). 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 $\Phi(s)$ around its replica-symmetric saddle-point solution

$$A_{(ab),(cd)} = \frac{\delta^2 \Phi_n(Q)}{\delta Q_{ab} \delta Q_{cd}} \Big|_{Q=Q_{RS}^*} \quad (32)$$

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 $\Phi(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:

$$S[f'](q) = S[g'](q) = \frac{f^{(4)}(q)}{f''(q)} - \frac{3}{2} \left( \frac{f^{(3)}(q)}{f''(q)} \right)^2. \quad (33)$$

Namely, if $S[f'](q)$ is positive for any value $q \in [0, 1]$, the solution will be obtained within the Full-RSB scheme, while if it is negative for any value $q \in [0, 1]$, the solution is obtained within the 1RSB scheme. If $S[f'](q)$ changes sign on the interval $q \in [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 \in [0, 1]$. As we will show in the following, for models with a FRSB phase, only the first of the above two scenarios is operative for the emergence of replica-symmetry breaking. For models with a 1RSB phase instead, both scenarios may occur, and the relevant scenario depends on the value of the variance $\Gamma$ of the magnetic field (see section on 1RSB below for more details).

Let us now discuss the various regimes of replica-symmetry breaking separately.

### 2.2.1 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 \in [0, 1]$ (or equivalently $q_0 = 1$). Considering both the saddle-point equation obtained by optimisation of $\Phi(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

$$\begin{aligned} v_* &= -\frac{e + \sqrt{e^2 - e_{c,RS}^2}}{2(g'(1) - g(1))}, & s_* &= \\ &= \frac{1}{2(g'(1) - g(1))} \left[ 2e + \frac{g'(1) + \Gamma}{g(1) + \Gamma} \left( -e + \sqrt{e^2 - e_{c,RS}^2} \right) \right], & \end{aligned} \quad (34)$$
where the critical RS energy reads

$$e_{c,RS}(\Gamma) = -2\sqrt{f(1)\left(1 - \frac{f(1)}{f'(1)}\right)} = -2\sqrt{(g'(1) - g(1))\frac{g(1) + \Gamma}{g'(1) + \Gamma}} \quad (35)$$

Note that $v_*$ and $s_*$ become complex valued for energies $e > e_{c,RS}(\Gamma)$ 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)

$$\begin{aligned} \Lambda_{RS} &= g''(1) - \frac{1}{v_*^2} \le 0, \quad \text{thus} \quad e \le e_{RSB}(\Gamma) \\ &= -\frac{1}{\sqrt{g''(1)}} \left[ g'(1) - g(1) + g''(1) \frac{g(1) + \Gamma}{g'(1) + \Gamma} \right], \end{aligned} \quad (36)$$

where $e_{RSB}(0) < 0$ and $\partial_\Gamma e_{RSB} < 0$ [see Eq. (C16)]. Using the identity $e_{RSB}^2 - e_{c,RS}^2 = \frac{1}{g''(1)}[g(1) - g'(1) + g''(1)\frac{g(1)+\Gamma}{g'(1)+\Gamma}]^2$, one obtains that $e_{RSB}(\Gamma) \le e_{c,RS}(\Gamma)$ for any value of $\Gamma$, 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 \ge e_{RSB}(\Gamma)$.

Using the RS scheme to compute the average (and typical) value of the ground-state $e_{typ}(\Gamma)$, one obtains the explicit expression (see Appendix A)

$$e_{typ}(\Gamma) = \bar{e}_{\min} = -\sqrt{g'(1) + \Gamma}, \quad \Gamma \ge \Gamma_{RSB} = g''(1) - g'(1), \quad (37)$$

where the value of $\Gamma_{RSB}$ can simply be obtained by ensuring marginality of the stability criterion, i.e. $e_{typ}(\Gamma_{RSB}) = e_{RSB}(\Gamma_{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 (at leading order in $1/\beta$) in the RS phase. One can thus replace $q_{typ}(\Gamma \ge \Gamma_{RSB}) = 1$ and obtain

$$\mathcal{V}_{\min}(\Gamma) = \lim_{N \to \infty} N \text{Var}(e_{\min}) = g(1) + \frac{\Gamma - g'(1)}{2}, \quad \Gamma \ge \Gamma_{RSB} = g''(1) - g'(1), \quad (38)$$

which is strictly positive for any $\Gamma > g'(1) - 2g(1)$ with $\Gamma_{RSB} \ge g'(1) - 2g(1)$.

Finally, the RS expression of the LDF $\mathcal{L}(e)$ is given by

$$\begin{aligned} \mathcal{L}_{RS}(e) = & -\frac{2(g(1) + \Gamma)}{g'(1) + \Gamma} \frac{e^2}{e_{c,RS}^2} + \frac{e}{e_{c,RS}^2} \left( e - \sqrt{e^2 - e_{c,RS}^2} \right) \\ & - \ln \left( \frac{e - \sqrt{e^2 - e_{c,RS}^2}}{e_{c,RS}} \right) + \frac{1}{2} \ln \frac{g(1) + \Gamma}{g'(1) - g(1)}. \end{aligned} \quad (39)$$

This function is well-defined for any $e \le e_{c,RS}(\Gamma)$ but, as previously mentioned, it cannot represent the correct LDF for any $e \ge e_{RSB}(\Gamma)$. The third derivative $\mathcal{L}_{RS}^{(3)}(e) > 0$ for any $e < e_{c,RS}(\Gamma)$, hence $\mathcal{L}_{RS}''(e)$ is an increasing function, which must be positive as $\mathcal{L}_{RS}''(e \to -\infty) = 1/(g(1)+\Gamma) > 0$. The function $\mathcal{L}_{RS}(e)$ is thus convex over the interval $e < e_{c,RS}(\Gamma)$ and in particular for any $e \le e_{RSB}(\Gamma)$. The function $\mathcal{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}(\Gamma)$ depends on the second derivative as well). The function $\mathcal{L}_{RS}(e)$ vanishes
<figure><img src="image_5.png" /><figcaption>Fig. 4 Plot of the rescaled zero $\mathcal{E}_{0,RS}(x)$ (in blue), solution of Eq. (41), and the scaling function $\mathcal{E}_{c,RS}(x) = 2\sqrt{x(1-x)}$ (in orange) as a function of $x = (\Gamma + g(1))/(\Gamma + g'(1))$. One always have that $\mathcal{E}_{0,RS}(x) \ge \mathcal{E}_{c,RS}(x)$, i.e. $e_{0,RS}(\Gamma) \le e_{c,RS}(\Gamma)$, with the two expressions coinciding only for $x = 0$ (non-physical) or $x = 1/2$ (the latter corresponding to $\Gamma = g'(1) - 2g(1)$). For $x > 1/2$, it takes the simple constant value $\mathcal{E}_{0,RS}(x) = 1$. Note that $\partial_{\Gamma}x = (g'(1) - g(1))/(\Gamma + g'(1))^2 > 0$ with $x = g(1)/g'(1)$ for $\Gamma = 0, x = 1/2$ for $\Gamma = g'(1) - 2g(1) \ge 0$ and $x \to 1$ as $\Gamma \to \infty$</figcaption></figure>

at the value $e = e_{0,RS}(\Gamma)$, and this zero is unique in the interval $e \le e_{c,RS}(\Gamma)$. It is given explicitly by

$$e_{0,RS}(\Gamma) = -\sqrt{g'(1) + \Gamma} \mathcal{E}_{0,RS} \left( \frac{\Gamma + g(1)}{\Gamma + g'(1)} \right), \quad (40)$$

where the scaling function $\mathcal{E}_{0,RS}(x)$ is obtained as the solution of the equation

$$\mathcal{E}_{0,RS}(x) \frac{\mathcal{E}_{0,RS}(x)(1-2x) + \sqrt{\mathcal{E}_{0,RS}(x)^2 - 4x(1-x)}}{4x(1-x)} - \ln \left( \frac{\mathcal{E}_{0,RS}(x) + \sqrt{\mathcal{E}_{0,RS}(x)^2 - 4x(1-x)}}{2x} \right) = 0. \quad (41)$$

Note that the RS critical energy takes the same scaling form

$$e_{c,RS}(\Gamma) = -\sqrt{g'(1) + \Gamma} \mathcal{E}_{c,RS} \left( \frac{\Gamma + g(1)}{\Gamma + g'(1)} \right), \quad \mathcal{E}_{c,RS}(x) = -2\sqrt{x(1-x)}. \quad (42)$$

The study of Eq. (41), plotted in Fig. 4, shows that the scaling function $\mathcal{E}_{0,RS}(x) = 1$ for any value of $x \ge 1/2$. This implies that for any $\Gamma \ge g'(1) - 2g(1)$, which coincide with a positive rescaled variance $\mathcal{V}_{\min}(\Gamma) \ge 0$ [see Eq. (38)], the zero takes the simple expression $e_{0,RS}(\Gamma) = -\sqrt{g'(1) + \Gamma}$. For $x > 1/2$, the scaling function $\mathcal{E}_{0,RS}(x)$ does not have a simple analytic expression and thus neither does the zero $e_{0,RS}(\Gamma)$ for $\Gamma < g'(1) - 2g(1)$.

**Random field with $\Gamma \ge \Gamma_{RSB}$:** The RS expression of the LDF $\mathcal{L}_{RS}(e)$ is positive in that case and has a unique minimum $e_{typ}(\Gamma) = e_{0,RS}(\Gamma) = -\sqrt{g'(1) + \Gamma}$, where it vanishes $\mathcal{L}_{RS}(e_{typ}) = 0$. In this case, the LDF is quadratic around the typical energy $e_{typ}$

$$\mathcal{L}_{RS}(e) = \frac{(e - e_{typ})^2}{2\mathcal{V}_{\min}(\Gamma)} + O((e - e_{typ})^3), \quad (43)$$

which is consistent with the central limit theorem proved in [18].
<figure><img src="image_6.png" /><figcaption>**Fig. 5** Phase diagram for the LDF for the spherical spin model in Eq. (C67) in the plane $e, \Gamma$. The dashed black line $e_t(\Gamma) = e_{RSB}(\Gamma)$ (as the equality always hold for models with FRSB) 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 $e_{typ}(\Gamma)$, which crosses the line $e_t(\Gamma)$ for $\Gamma = \Gamma_{RSB}$ (marked by a horizontal red dotted line). For $e > e_c$ (the energy $e_c$ 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</figcaption></figure>

**Random field with $\Gamma \le \Gamma_{RSB}$:** In the regime $\Gamma < \Gamma_{RSB}$, the function $\mathcal{L}_{RS}(e)$ is decreasing over the interval $e \le e_{RSB}(\Gamma)$. Clearly, if the zero $e_{0,RS}(\Gamma)$ of $\mathcal{L}_{RS}(e)$ satisfies $e_{0,RS}(\Gamma) \le e_{RSB}(\Gamma)$ then $\mathcal{L}_{RS}(e_{RSB}) \le 0$, and hence the expression of $\mathcal{L}_{RS}(e)$ cannot represent a LDF over the whole interval $e \le e_{RSB}$ and must be limited to energies $e \le e_{0,RS}(\Gamma)$.

For models whose replica-symmetry broken phase is of FRSB type, we will show explicitly in the following that $\mathcal{L}_{RS}(e_{RSB}) > 0$ in the regime $\Gamma < \Gamma_{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, $\mathcal{L}_{RS}(e_{RSB})$ can take either sign. We will show that there exists a threshold magnetic field $0 \le \Gamma_t < \Gamma_{RSB}$, such that for $\Gamma_{RSB} > \Gamma > \Gamma_t$ the value $\mathcal{L}_{RS}(e_{RSB})$ is positive. The transition to the RSB phase will be shown to stem from the first scenario (instability of the RS solution) mentioned above. For $0 < \Gamma < \Gamma_t$, the transition to the RSB regime does not occur at energy $e_{RSB}(\Gamma)$ but rather at an energy $e_t(\Gamma) < e_{RSB}(\Gamma)$ satisfying simultaneously $e_t(\Gamma) < e_{0,RS}(\Gamma)$ which implies $\mathcal{L}_{RS}(e_t) > 0$ (see Fig. 9 for a sketch of the different energy scales for models with 1RSB phase). The transition to the RSB phase will be shown to stem from the second scenario mentioned above. Note that there exists an additional threshold $\Gamma_{cr} \le \Gamma_t \le \Gamma_{RSB}$ such that $e_{RSB}(\Gamma_{cr}) = e_{0,RS}(\Gamma_{cr})$. Thus for any $\Gamma_{RSB} > \Gamma > \Gamma_{cr}$ one has $e_{0,RS}(\Gamma) > e_{RSB}(\Gamma)$ and $\mathcal{L}_{RS}(e_{RSB}) > 0$ while for $\Gamma_{cr} > \Gamma$ in contrast $e_{0,RS}(\Gamma) < e_{RSB}(\Gamma)$ and $\mathcal{L}_{RS}(e_{RSB}) < 0$.

### 2.2.2 Fully Broken Replica-Symmetry Regime

Let us now consider the RSB phase for models which satisfy

$$ \forall q \in [0, 1], \quad S[f'](q) = S[g'](q) = \frac{g^{(4)}(q)}{g''(q)} - \frac{3}{2} \left( \frac{g^{(3)}(q)}{g''(q)} \right)^2 \ge 0, \quad (44) $$

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
<figure><img src="image_7.png" /><figcaption>**Fig. 6** Sketch of the energy scales for different values of $\Gamma$ for models with a FRSB phase. The typical and average energy $e_{typ}(\Gamma) = \bar{e}_{min}$ is the unique zero of the LDF, i.e. $\mathcal{L}(e_{typ}(\Gamma)) = 0$, while $e_{0,RS}(\Gamma)$ is the unique zero of the RS expression of the LDF, i.e. $\mathcal{L}_{RS}(e_{0,RS}(\Gamma)) = 0$. These energy coincide $e_{typ}(\Gamma) = e_{0,RS}(\Gamma)$ for $\Gamma > \Gamma_{RSB}$ while $e_{typ}(\Gamma) \neq e_{0,RS}(\Gamma)$ for $0 < \Gamma < \Gamma_{RSB}$. The critical energy $e_c$ corresponds to the “wall”, i.e. the energy beyond which fluctuations of $e_{min}$ are described by a LDF with speed $\gg N$. The transition between the RS and FRSB phase occurs at the transition energy $e_t(\Gamma)$ while the RS expression of the LDF is unstable for energies $e > e_{RSB}(\Gamma)$. These energies coincide $e = e_{RSB}(\Gamma) = e_t(\Gamma)$ for any $\Gamma > 0$. Finally for $\Gamma = 0$, the typical energy $e_{typ}(0)$ and critical energy $e_c$ coincide</figcaption></figure>

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 \in [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

$$s_* = \frac{1}{\sqrt{g''(q_0^*)}} \left( \frac{g''(q_0^*)}{g'(q_0^*) + \Gamma} - \frac{1}{q_0^*} \right), \quad (45)$$

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 Appendix A)

$$v_* = \frac{1}{\sqrt{g''(1)}}, \quad z_*(q) = \frac{g^{(3)}(q)}{2g''(q)^{3/2}}, \quad q \in [q_0^*, 1]. \quad (46)$$

Finally, the optimal value $q_0^*$ for fixed energy $e$ is obtained by inverting the following parametric expression

$$e = -\phi'(s_*) = -\left( \frac{1}{\sqrt{g''(q_0^*)}} \left( g'(q_0^*) - \frac{g(q_0^*)}{q_0^*} \right) + \frac{g(q_0^*) + \Gamma q_0^*}{g'(q_0^*) + \Gamma} \sqrt{g''(q_0^*)} + \int_{q_0^*}^{1} dq \sqrt{g''(q)} \right). \quad (47)$$

One can show explicitly that $\partial_{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^* \to 1$ corresponds to $e \to e_{RSB}(\Gamma)$. In the opposite limit $q_0^* \to 0$, one defines the critical energy

$$e_c = - \int_0^1 dq \sqrt{g''(q)}, \quad (48)$$

where we have used that $g(0) = g'(0) = 0$ while $g''(0) = 2g_2 > 0$. Indeed, if it were that $g''(0) = 0$ the function $z_*(q)$ would diverge to $+\infty$ as $q \to 0$, in contradiction with the FRSB condition that $z_*(q)$ must be an increasing function of $q$.
If $0 < \Gamma < \Gamma_{\text{RSB}} = g''(1) - g'(1)$, there is a unique value $0 < q_{\text{typ}}(\Gamma) < 1$ of the parameter $q_0^*$ such that

$$ \Gamma = q_{\text{typ}}(\Gamma)g''(q_{\text{typ}}(\Gamma)) - g'(q_{\text{typ}}(\Gamma)). \quad (49) $$

The associated value of $e$ through the relation (47) belongs to the finite interval $(e_{\text{RSB}}(\Gamma), e_c)$ and corresponds precisely to the typical ground-state energy (see Appendix A)

$$ e_{\text{typ}}(\Gamma) = \overline{e_{\text{min}}} = - \left( q_{\text{typ}}(\Gamma) \sqrt{g''(q_{\text{typ}}(\Gamma))} + \int_{q_{\text{typ}}(\Gamma)}^{1} dq \sqrt{g''(q)} \right), \quad \Gamma \le \Gamma_{\text{RSB}}. \quad (50) $$

Note that for $\Gamma = \Gamma_{\text{RSB}} = g''(1) - g'(1)$, one can simply check from Eq. (49) that $q_{\text{typ}}(\Gamma_{\text{RSB}}) = 1$ and Eq. (50) coincides with Eq. (37). The rescaled variance is similarly obtained by simply inserting the value of $q_{\text{typ}}(\Gamma)$ obtained from Eq. (49) into Eq. (28). In the limit $\Gamma \to 0$, the value $q_{\text{typ}}(\Gamma) \to 0$ such that $e_{\text{typ}}(\Gamma) \to e_c$ and the rescaled variance $\overline{e}_{\text{min}}(\Gamma)$ 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, $\mathcal{L}_{\text{FRSB}}(e)$. The LDF $\mathcal{L}_{\text{FRSB}}(e)$ describes, through the parametrisation in Eq. (47), the range of energies $e \in [e_{\text{RSB}}, e_c]$ and reads

$$ \mathcal{L}_{\text{FRSB}}(e) = \frac{1}{2} \left[ \frac{f(q_0^*)}{f''(q_0^*)} \left( \frac{f''(q_0^*)}{f'(q_0^*)} - \frac{1}{q_0^*} \right)^2 + 1 - \frac{f'(q_0^*)}{q_0^* f''(q_0^*)} - \ln \left( \frac{q_0^* f''(q_0^*)}{f'(q_0^*)} \right) \right]. \quad (51) $$

The transition between the RS and FRSB expressions of the LDF occurs at the energy $e = e_t(\Gamma) = e_{\text{RSB}}(\Gamma)$, corresponding to $q_0^* \to 1$, for any value of $\Gamma$. Expanding the difference as $e \to e_{\text{RSB}}$, one obtains for any $\Gamma \ge 0$

$$ \begin{aligned} \mathcal{L}_{\text{FRSB}}(e) - \mathcal{L}_{\text{RS}}(e) & = - \frac{f'(1)^3 f''(1)^{5/2} (\Gamma - \Gamma_{\text{RSB}}) (e - e_t)^3}{3 (f(1) (f''(1) + f'(1)) - f'(1)^2)^3 (f'(1) (f^{(3)}(1) + 2f''(1)) - 2f''(1)^2) + O(e - e_t)^4}. \end{aligned} \quad (52) $$

The transition between the RS and FRSB phases is thus generically of third order in the sense that the third derivative of the LDF $\mathcal{L}(e)$ is the lowest order discontinuous derivative at the transition. Note however that precisely for $\Gamma = \Gamma_{\text{RSB}}$, the transition is of the fourth order

$$ \begin{aligned} \mathcal{L}_{\text{FRSB}}(e) - \mathcal{L}_{\text{RS}}(e) & = - \frac{2g''(1)^3 (e - e_t)^4}{3g^{(3)}(1) (g''(1) - 2(g'(1) - g(1)))^4} + O(e - e_t)^5, \\ \Gamma & = \Gamma_{\text{RSB}}. \end{aligned} \quad (53) $$

One can check simply that $\mathcal{L}'_{\text{FRSB}}(e) = -s_*$ and that

$$ \mathcal{L}''_{\text{FRSB}}(e) = \frac{f'(q_0^*) + q_0^* f''(q_0^*)}{f(q_0^*)(f'(q_0^*) + q_0^* f''(q_0^*)) - q_0^* f'(q_0^*)^2} \ge 0, \quad (54) $$

which can be shown to be positive from Eq. (C9), such that the LDF $\mathcal{L}_{\text{FRSB}}(e)$ is convex. For a random field $\Gamma \le \Gamma_{\text{RSB}}$, the LDF reaches its global minimum, equal to zero for $e = e_{\text{typ}}(\Gamma)$, such that $\mathcal{L}_{\text{FRSB}}(e_{\text{RSB}}(\Gamma)) = \mathcal{L}_{\text{RS}}(e_{\text{RSB}}(\Gamma)) \ge \mathcal{L}_{\text{FRSB}}(e_{\text{typ}}(\Gamma)) = 0$. This ensures in particular that, for any value of $\Gamma$, the RS expression of the LDF $\mathcal{L}_{\text{RS}}(e)$ is positive for any energy $e \le e_{\text{RSB}}$ if the corresponding phase with broken replica symmetry is of FRSB type. A plot of the LDF $\mathcal{L}(e)$, both in the RS and FRSB phases, for a representative model is shown in Fig. 7 for several values of $\Gamma$.
<figure><img src="image_8.png" /><figcaption>Fig. 7 Plot of the large deviation function $\mathcal{L}(e)$ for the covariance function in Eq. (C67) with $g_4 = 1/48$, $g_3 = 1/36$ and three different values of $\Gamma = 0$ (top left), $\Gamma = 1/16$ (top right) and $\Gamma = 3/4$ (bottom). The vertical black dashed line represents the value of $e_{\text{RSB}}$ separating on its left the RS regime where $\mathcal{L}(e) = \mathcal{L}_{\text{RS}}(e)$ plotted in blue and on its right the FRSB regime where $\mathcal{L}(e) = \mathcal{L}_{\text{FRSB}}(e)$ plotted in orange. The vertical solid red line marks the value $e_{\text{typ}}$, where $\mathcal{L}(e_{\text{typ}}) = 0$ while the vertical green dotted line marks the value $e_c$ where the LDF diverges for $\Gamma > 0$ (for $\Gamma = 0$, $e_{\text{typ}} = e_c$). The typical value of the ground-state $e_{\text{typ}}$ belongs to the RS phase for $\Gamma > \Gamma_{\text{RSB}} = 1/4$</figcaption></figure>

For positive magnetic field, the LDF diverges logarithmically for $e \to e_c$ (corresponding to $q_0^* \to 0$) with

$$ \mathcal{L}_{\text{FRSB}}(e) = -\frac{1}{2} \ln \frac{2\sqrt{2g_2}(e_c - e)}{\Gamma} - \frac{3}{4} + O(e_c - e), \quad \Gamma > 0, \qquad (55) $$

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 < \Gamma \le \Gamma_{\text{RSB}}$, the LDF is quadratic around the typical value $e_{\text{typ}}$

$$ \mathcal{L}_{\text{FRSB}}(e) = \frac{(e - e_{\text{typ}})^2}{2V_{\min}(\Gamma)} + O((e - e_{\text{typ}})^3), \qquad (56) $$

which is again consistent with the central limit theorem proved in [18]. For zero magnetic field $\Gamma = 0$ we have instead $e_{\text{typ}}(\Gamma = 0) = e_c$ and the behaviour of the LDF is quite non-trivial as $e \to e_c$. Namely, supposing that the covariance function has the form

$$ f(q) = \Gamma q + g(q), \quad g(q) = g_2 q^2 + g_r q^r + o(q^r), \qquad (57) $$

with $r$ the exponent of the leading correction to the quadratic form, the LDF vanishes as

$$ \mathcal{L}_{\text{FRSB}}(e) = \xi_r (e_c - e)^{\eta_r} + o((e_c - e)^{\eta_r}), \quad 1 \le \eta_r = \frac{3(r-2)}{2r-3} \le \frac{3}{2}, \qquad (58) $$
where

$$ \xi_r = 2^{\frac{r-12}{2(2r-3)}} \left( \frac{r(2r-3)}{r-2} \right)^{\frac{3(r-2)}{2r-3}} \frac{(r-3)^{-\frac{r-3}{2r-3}} (r(r-2)g_r)^{\frac{3}{2r-3}}}{3rg_2^{\frac{3r}{2(2r-3)}}} \quad (59) $$

In particular, for $r = 3$, the LDF vanishes linearly as $\mathcal{L}_{\text{FRSB}}(e) = z(0)(e_c - e) + o(e_c - e)$. In that case, the continuous FRSB solution $z(q)$ reaches a constant value $z(0)$ as $q \to 0$, and thus takes a similar form to the plateau solution $z(q) = m$ one would obtain for a 1RSB ansatz as $q \to 0$. As the behaviour of the LDF in Eq. (58) depends solely on the behaviour of the solution $z(q)$ in the vicinity of $q \to 0$, one may expect that the LDF in the FRSB and 1RSB ansätze display the same linear behaviour. This will be confirmed below when discussing results for the 1RSB ansatz. It is also worth noting that, supposing that the covariance function $g(q)$ in Eq. (57) only displays even powers of $q$, one naturally obtains that $r = 4$ and the LDF displays, in the vicinity of the typical value $e_c$, the same power-law behaviour as in a quite distinct model, namely the Sherrington-Kirkpatrick (SK) model [56]

$$ \mathcal{L}_{\text{FRSB}}(e) = \frac{5}{3} 10^{1/5} \left( \frac{\sqrt{g_2}}{g_4} (e_c - e) \right)^{6/5} + o(e_c - e)^{6/5}, \quad r = 4. \quad (60) $$

Note that parameters playing a role equivalent to $g_2$, $g_4$ in the SK model are difficult to identify, preventing a more detailed comparison between the approximate pre-factor obtained in [56] and our exact result. Interestingly, in contrast to our results for the spherical model, the authors of [56] suggested that the LDF of the ground-state energy is always given by a FRSB ansatz for the SK model while the LDF of the free-energy displays, while beyond a finite temperature, both an RS and FRSB branch, separated by a third order transition, in full agreement with the conclusions of our study [see Eq. (52)]. Finally, the limit $r \to \infty$ 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 $\mathcal{L}_{\text{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 $\beta = 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 \to \infty$ where it corresponds to the TW [62]. 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 $e_c - e = O(N^{-1/\eta_r})$ with $\eta_r = \frac{3(r-2)}{2r-3}$. More precisely we conjecture that the PDF of the ground-state energy $\mathcal{P}(e)$ takes the following scaling form in the regime of typical fluctuations

$$ \mathcal{P}(e) = N^{1/\eta_r} p(N^{1/\eta_r}(e - e_c)), \quad \text{where } p(\delta) \sim e^{-\xi_r |\delta|^{\eta_r}}, \quad \delta \to -\infty. \quad (61) $$

The behaviour in Eq. (58) and the conjecture above is arguably the central result of this paper.

### 2.2.3 One-Step Replica-Symmetry Breaking Regime

Finally we discuss the RSB phase for models which satisfy

$$ \forall q \in [0, 1], \quad S[f')(q) = S[g')(q) = \frac{g^{(4)}(q)}{g''(q)} - \frac{3}{2} \left( \frac{g^{(3)}(q)}{g''(q)} \right)^2 \le 0, \quad (62) $$
<figure><img src="image_9.png" /><figcaption>**Fig. 8** Phase diagram for the LDF for the 3-spin model in the plane *e*, Γ. The black dashed line $e_t(\Gamma)$ shows the transition separating the 1RSB phase (in orange) and the RS phase (in blue). The red line corresponds to the typical value $e_{typ}(\Gamma)$, which crosses the line $e_t(\Gamma)$ for $\Gamma = \Gamma_{RSB}$ (marked by a horizontal red dotted line). The criterion of stability of the RS phase yields the dashed blue line $e_{RSB}(\Gamma)$ but only coincides with the correct transition line $e_t(\Gamma)$ for $\Gamma > \Gamma_t$ (marked by a horizontal purple dotted line) as it is not the correct scenario for the transition for any $\Gamma < \Gamma_t$ and one has $e_t(\Gamma) < e_{RSB}(\Gamma)$. For $e > e_c$ (the energy $e_c$ 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. Note that for $\Gamma = 0$, the LDF only has a RS phase as the 1RSB phase is reduced to the single point $e_{typ}(0) = e_t(0) = e_c$</figcaption></figure>

<figure><img src="image_10.png" /><figcaption>**Fig. 9** Sketch of the energy scales for different values of $\Gamma$ for models with a 1RSB phase. The typical and average energy $e_{typ}(\Gamma) = \bar{e}_{min}$ is the unique zero of the LDF, i.e. $\mathcal{L}(e_{typ}(\Gamma)) = 0$, while $e_{0,RS}(\Gamma)$ is the unique zero of the RS expression of the LDF, i.e. $\mathcal{L}_{RS}(e_{0,RS}(\Gamma)) = 0$. These energy coincide $e_{typ}(\Gamma) = e_{0,RS}(\Gamma)$ for $\Gamma > \Gamma_{RSB}$ while $e_{typ}(\Gamma) \neq e_{0,RS}(\Gamma)$ for $0 < \Gamma < \Gamma_{RSB}$. The critical energy $e_c$ corresponds to the “wall”, i.e. the energy beyond which fluctuations of $e_{min}$ are described by a LDF with speed $\gg N$. The transition between the RS and 1RSB phase in the large deviation function occurs at the transition energy $e_t(\Gamma)$ while the RS expression of the LDF is unstable for energies $e > e_{RSB}(\Gamma)$. These energies coincide $e = e_{RSB}(\Gamma) = e_t(\Gamma)$ for $\Gamma > \Gamma_t$ while $e_t(\Gamma) > e_{RSB}(\Gamma)$ for $\Gamma < \Gamma_t$. Finally for $\Gamma = 0$, the transition energy $e_t(0)$, typical energy $e_{typ}(0)$, zero of the RS expression $e_{0,RS}(0)$ and critical energy $e_c$ all coincide</figcaption></figure>

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 \in [0, q_0)$ and $z(q) = m_0 \ge s$ for $q \in (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.

$$s_* = \frac{1}{\sqrt{q_0^* f'(q_0^*)}} \left( \frac{1}{\sqrt{\alpha(q_0^*)}} - \sqrt{\alpha(q_0^*)} \right), \qquad (63)$$

$$v_* = \rho(q_0^*) \sqrt{\frac{q_0^*}{f'(q_0^*) \alpha(q_0^*)}}, \qquad (64)$$

$$m_0^* = \frac{1}{1 - q_0^*} \sqrt{\frac{q_0^* \rho(q_0^*)}{f'(q_0^*)}} \left( \sqrt{\frac{\alpha(q_0^*)}{\rho(q_0^*)}} - \sqrt{\frac{\rho(q_0^*)}{\alpha(q_0^*)}} \right), \qquad (65)$$

where the function $\rho(q)$ is given by

$$\rho(q) = \frac{(1-q)(g'(q) + \Gamma)}{(g'(1) - g'(q))q}, \qquad (66)$$

and together with the function $\alpha(q_0^*)$ satisfies the self-consistent equation

$$\mu(q_0^*) = \rho(q_0^*) \frac{\rho(q_0^*) - \alpha(q_0^*) - \alpha(q_0^*) \ln(\rho(q_0^*)/\alpha(q_0^*))}{(\alpha(q_0^*) - \rho(q_0^*))^2}, \\ \mu(q) = \frac{1}{g'(1) - g'(q)} \left( \frac{g(1) - g(q)}{1 - q} - g'(q) \right). \qquad (67)$$

Finally, the value of $q_0^*$ for fixed $e$ is obtained by inverting the parametric expression

$$e = -\phi'(s_*) = \frac{(1 - q_0^*)\mu(q_0^*)f'(1) - f(1) + [f(1) - \mu(q_0^*)f'(1) - (1 - \mu(q_0^*))f'(q_0^*)]\alpha(q_0^*)}{\sqrt{q_0^* f'(q_0^*) \alpha(q_0^*)}}. \qquad (68)$$

In the limit $q_0^* \to 0$, the associated critical energy reads

$$e_c = - \frac{1}{\sqrt{g'(1)}} \left( \sqrt{\rho_{\text{typ}}(g'(1) - g(1))} + \frac{g(1)}{\sqrt{\rho_{\text{typ}}}} \right), \qquad (69)$$

where the parameter $\rho_{\text{typ}} = \lim_{q_0^* \to 0} [\rho(q_0^*) / \alpha(q_0^*)]$ is independent of $\Gamma$ and satisfies

$$\frac{g(1)}{g'(1)} = \rho_{\text{typ}} \frac{\rho_{\text{typ}} - 1 - \ln \rho_{\text{typ}}}{(1 - \rho_{\text{typ}})^2}. \qquad (70)$$

For a magnetic field

$$\Gamma \ge \Gamma_t = \frac{2g''(1)^2}{2g''(1) + g^{(3)}(1)} - g'(1), \qquad (71)$$

with $\Gamma_t$ satisfying $\Gamma_t \le \Gamma_{\text{RSB}}$, the parametrisation in Eq. (68) is operative for any $q_0^* \in [0, 1]$ and describes the range $e \in [e_{\text{RSB}}(\Gamma), e_c]$. In contrast, for $0 < \Gamma < \Gamma_t$, the parametrisation is only operative in a limited range $q_0^* \in [0, q_t(\Gamma)]$, where the value of $q_t(\Gamma)$ is obtained such that $m_0^* = s$ and the 1RSB solution $z_*(q) = s$ for $q \in [0, q_0^*)$ and $z_*(q) = m_0^*$ for $q \in (q_0^*, 1)$ becomes effectively RS. The expression of $q_t(\Gamma)$ is obtained as the smallest positive solution of

$$\mu(q_t) = (\Gamma + g'(q_t)) \frac{\Gamma(1 - q_t) + g'(q_t) - q_t g'(1) - q_t(\Gamma + g'(1)) \ln \frac{\Gamma + g'(q_t)}{q_t(\Gamma + g'(1))}}{(\Gamma(1 - q_t) + g'(q_t) - q_t g'(1))^2}. \qquad (72)$$
Note that $q_t = 1$ is always a solution of this equation. The range of energy thus described is $e \in [e_t(\Gamma), e_c]$, with

$$e_t(\Gamma) = - \frac{q_t f(1)f'(1) + ((1-q_t)f'(1) - f(1))f'(q_t)}{\sqrt{(1-q_t)q_t f'(q_t)f'(1)(f'(1) - f'(q_t))}} < e_{\text{RSB}}(\Gamma), \quad \Gamma < \Gamma_t. \quad (73)$$

For convenience, for $\Gamma \ge \Gamma_t$, we define the two energies $e_t(\Gamma)$ and $e_{\text{RSB}}(\Gamma)$ to be equal: $e_t(\Gamma \ge \Gamma_t) = e_{\text{RSB}}(\Gamma \ge \Gamma_t)$. Let us introduce the function

$$\begin{align}
w(q) &= \frac{2qg''(q)^2}{2g''(q) + qg^{(3)}(q)} - g'(q) \quad \text{which satisfies } w(0) = 0, w(1) = \Gamma_t, \nonumber \\
w'(q) &= \frac{2q^2g''(q)^3}{(2g''(q) + qg^{(3)}(q))^2} S[g')(q), \tag{74}
\end{align}$$

with $2q^2g''(q)^3/(2g''(q) + qg^{(3)}(q))^2 > 0$. One can thus show that for models with 1RSB phase such that $S[g')(q) < 0$ for any $q \in [0, 1]$ one must have $\Gamma_t \ge 0$. In contrast, $S[g')(q) > 0$ for models with FRSB phase, such that $\Gamma_t \le 0$.

In the regime $\Gamma \le \Gamma_{\text{RSB}}$, the typical energy $e_{\text{typ}}(\Gamma) \in [e_t(\Gamma), e_c]$ and is thus obtained within the 1RSB scheme. The associated value of $q_{\text{typ}}(\Gamma)$ is obtained ensuring that $\alpha(q_{\text{typ}}(\Gamma)) = 1$ in Eq. (67). The associated value of $e_{\text{typ}}(\Gamma)$ then reads

$$\begin{align}
e_{\text{typ}}(\Gamma) &= \bar{e}_{\min} \nonumber \\
&= -\frac{q_{\text{typ}}(\Gamma)\mu(q_{\text{typ}}(\Gamma))(\Gamma + g'(1)) + (1 - \mu(q_{\text{typ}}(\Gamma)))(\Gamma + g'(q_{\text{typ}}(\Gamma)))}{\sqrt{q_{\text{typ}}(\Gamma)(\Gamma + g'(q_{\text{typ}}(\Gamma)))}}, \quad \Gamma \le \Gamma_{\text{RSB}}. \tag{75}
\end{align}$$

The variance can similarly be obtained by inserting the value of $q_{\text{typ}}(\Gamma)$ obtained from ensuring $\alpha(q_{\text{typ}}(\Gamma)) = 1$ in Eq. (67) into Eq. (28).

Let us now give the result for the 1RSB expression of the LDF, $\mathcal{L}_{1\text{RSB}}(e)$. The energy $e$ is now fixed and parametrised in terms of $q_0^*$ and $\alpha(q_0^*)$ as in Eq. (68). The LDF $\mathcal{L}_{1\text{RSB}}(e)$ thus describes parametrically the range of energies $e \in [e_t(\Gamma), e_c]$ and reads

$$\mathcal{L}_{1\text{RSB}}(e) = \frac{1}{2} \left( 1 - \alpha(q_0^*) + \ln \alpha(q_0^*) + \frac{g(q_0^*) + \Gamma q_0^*}{q_0^*(g'(q_0^*) + \Gamma)} \frac{(1 - \alpha(q_0^*))^2}{\alpha(q_0^*)} \right). \quad (76)$$

A plot of the LDF $\mathcal{L}(e)$, both in the RS and 1RSB phases, for the 3-spin spherical model is shown in Fig. 10 for several values of $\Gamma$. The transition from the RS to the 1RSB expression of the LDF occurs for the energy $e = e_t(\Gamma) = e_{\text{RSB}}(\Gamma)$ for $\Gamma \ge \Gamma_t$ while it occurs for $e = e_t(\Gamma) < e_{\text{RSB}}(\Gamma)$ for $\Gamma < \Gamma_t$.

**Random field $\Gamma \ge \Gamma_t$:** The transition between the RS and 1RSB expressions of the LDF occurs at energy $e = e_t(\Gamma) = e_{\text{RSB}}(\Gamma)$, corresponding to $q_0^* = 1$. Expanding the difference as $e \to e_{\text{RSB}}$, one obtains

$$\mathcal{L}_{1\text{RSB}}(e) - \mathcal{L}_{\text{RS}}(e) = \frac{\sqrt{g''(1)} (\Gamma + g'(1))^3 (g'(1) + \Gamma_t) (\Gamma - \Gamma_{\text{RSB}})}{6(\Gamma_t - \Gamma) ((\Gamma + g(1))g''(1) + (g(1) - g'(1)) (\Gamma + g'(1)))^3} (e - e_t)^3 + O((e - e_t)^4). \quad (77)$$

Quite remarkably, inserting the explicit expression of $\Gamma_t$ from Eq. (71), one obtains, up to third order, the same expansion in Eqs. (52) and (77). The transition between the RS and 1RSB phase is thus generically of third order for $\Gamma \ge \Gamma_t$ in the sense that the third derivative
<figure><img src="image_11.png" /><figcaption>Fig. 10 Plot of the large deviation function $\mathcal{L}(e)$ for the 3-spin model for $\Gamma = 0$ (top left), $\Gamma = 0.15$ (top right), $\Gamma = 0.75$ (bottom left) and $\Gamma = 1.8$ (bottom right). For $\Gamma > 0$, the vertical black dashed line represents the value of $e_t$ separating on its left the RS regime where $\mathcal{L}(e) = \mathcal{L}_{RS}(e)$ plotted in blue and on its right the RSB regime where $\mathcal{L}(e) = \mathcal{L}_{1RSB}(e)$ plotted in orange. While for $\Gamma > \Gamma_t = 1/3$, the values $e_t$ and $e_{RSB}$ coincide, $e_t < e_{RSB}$ in the converse case. The solid red line marks the value $e_{typ}$ and the dotted green line, the value of $e_c$ where the LDF diverges logarithmically. The typical value of the ground-state $e_{typ}$ belongs to the RS phase for $\Gamma > \Gamma_{RSB} = 1$. For $\Gamma = 0$, the values $e_c$, $e_{typ}$, $e_t$ coincide and the 1RSB phase is limited to the single point $e = e_{typ}$</figcaption></figure>

of the LDF $\mathcal{L}(e)$ is the lowest order discontinuous derivative at the transition. Note that at the special value $\Gamma = \Gamma_{RSB}$ the transition is again of the fourth order with

$$ \mathcal{L}_{1RSB}(e) - \mathcal{L}_{RS}(e) = - \frac{2g''(1)^3(e - e_t)^4}{3g^{(3)}(1)(g''(1) - 2g'(1) - g(1)))^4} + O((e - e_t)^5), \quad \Gamma = \Gamma_{RSB}, \quad (78) $$

which takes again the same form as in the FRSB case in Eq. (53).

**Random field $\Gamma < \Gamma_t$:** The transition between the RS and 1RSB expressions of the LDF occurs at energy $e = e_t(\Gamma) < e_{RSB}(\Gamma)$, corresponding to $q_0^* = q_t < 1$. Expanding the difference as $e \to e_t$, one obtains

$$ \mathcal{L}_{1RSB}(e) - \mathcal{L}_{RS}(e) = \frac{\mathcal{L}''_{1RSB}(e_t) - \mathcal{L}''_{RS}(e_t)}{2} (e - e_t)^2 + O((e - e_t)^3), \quad (79) $$

where the expression of $\mathcal{L}''_{1RSB}(e_t) - \mathcal{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 $\Gamma < \Gamma_t$ in the sense that the second derivative of the LDF $\mathcal{L}(e)$ is the lowest order discontinuous derivative at the transition.

For any $\Gamma > 0$, the LDF diverges logarithmically close to the critical energy $e \to e_c$, corresponding to $q_0^* \approx 2(e_c - e)/\sqrt{\rho_{typ}g'(1)}$ with $\alpha(q_0^*) \approx \Gamma/(2\sqrt{\rho_{typ}g'(1)}(e_c - e))$ and
where $\rho_{typ}$ is the solution of Eq. (70), i.e.

$$ \mathcal{L}_{1RSB}(e) \approx \frac{1}{2} \ln \frac{2\sqrt{\rho_{typ}g'(1)(e_c - e)}}{\Gamma} - \frac{1}{2} - \frac{g_2}{2g'(1)\rho_{typ}}, \quad e \to e_c. \quad (80) $$

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 < \Gamma \le \Gamma_{RSB}$, the LDF is quadratic about the typical energy

$$ \mathcal{L}_{1RSB}(e) = \frac{(e - e_{typ})^2}{2\nu_{\min}(\Gamma)} + O((e - e_{typ})^3), \quad \Gamma > 0, \quad (81) $$

which is consistent with a central limit theorem and a typical distribution taking a Gaussian expression.

For $\Gamma = 0$ instead, one can show explicitly that $e_t(\Gamma = 0) = e_{typ}(\Gamma = 0) = e_c$ and the 1RSB expression for the LDF is valid only for the single value $e = e_c$. The behaviour of the LDF in the vicinity of $e_{typ}(\Gamma = 0) = e_c$ is described by the RS expression instead. The typical energy $e_{typ}(\Gamma = 0) = e_c = e_{0,RS}(\Gamma = 0)$ coincides with the unique zero of $\mathcal{L}_{RS}(e)$, defined in Eq. (40), and the LDF behaves linearly in the vicinity of the typical energy

$$ \mathcal{L}(e) = \mathcal{L}'_{RS}(e_{typ})(e - e_{typ}) + O((e - e_{typ})^2), \quad \Gamma = 0. \quad (82) $$

This expression is consistent with a typical distribution of energy displaying an exponential tail for $N(e_{typ} - e) \gg 1$. Note finally that the behaviour in Eq. (82) can be expressed as $\mathcal{L}(e) = z(0)(e - e_{typ}) + O((e - e_{typ})^2)$, where $z(0) = s_t = m_0^*$, which takes a fully similar form as in the FRSB ansatz Eq. (58) in the special case where $r = 3$.

### 2.2.4 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

$$ n_{\min}(e) = \sum_{\alpha:\minima} \delta(e - e_{\alpha}), \quad (83) $$

where (at least) one of the $e_\alpha = e_{\min}$ corresponds to the ground-state energy. Note that an isolated minimum $\alpha$ is defined as a point $\mathbf{x}_\alpha$ on the $N$-sphere such that

$$ H(\mathbf{x}_{\alpha}) = e_{\alpha}, \quad \nabla H(\mathbf{x}_{\alpha}) = \mathbf{0}, \quad \min_{\mathbf{x}:\mathbf{x}^2=1} [\mathbf{x} \cdot \nabla^2 H(\mathbf{x}_{\alpha}) \cdot \mathbf{x}] > 0. \quad (84) $$

Taking the average, one obtains that

$$ \overline{n_{\min}(e)} = \sum_{\alpha:\minima} \overline{\delta(e - e_{\alpha})} \ge \mathcal{P}(e) = \overline{\delta(e - e_{\min})}. \quad (85) $$

Using the definition of the annealed complexity

$$ \Sigma_{\min}(e) = \lim_{N \to \infty} \frac{1}{N} \ln \overline{n_{\min}(e)}, \quad (86) $$

as well as the definition of the large-deviation function

$$ \mathcal{L}(e) = - \lim_{N \to \infty} \frac{1}{N} \ln \mathcal{P}(e), \quad (87) $$
one thus obtains the simple bound

$$ \mathcal{L}(e) \geq -\Sigma_{\min}(e), \qquad (88) $$

valid for any energy $e$. Analysing the annealed complexity, one can check that in the regime $\Gamma \geq \Gamma_{RSB}$, it is negative and has a unique maximum $e_{typ}(\Gamma) = -\sqrt{g'(1) + \Gamma}$, where it reaches zero $\Sigma_{min}(e_{typ}(\Gamma \geq \Gamma_{RSB})) = 0$. This bound is thus meaningful for any energy $e$ in this regime. In the regime $\Gamma \leq \Gamma_{RSB}$ instead, the annealed complexity is positive for energies within a finite band of energies $e \in [\mathcal{E}_{min}, \mathcal{E}_{max}]$ which contains the typical energy, i.e. $\Sigma_{min}(e_{typ}(\Gamma)) \geq 0$ (see Appendix E for details). As $\mathcal{L}(e) \geq 0$, the bound is meaningless within the range $e \in [\mathcal{E}_{min}, \mathcal{E}_{max}]$ and in particular in the vicinity of $e_{typ}(\Gamma)$.

From our results on the RS scheme, one can further show that (see appendix E for details) the bound in equation (88) becomes an equality in the regime where the LDF is given by its RS expression, i.e.

$$ \mathcal{L}_{RS}(e) = -\Sigma_{\min}(e), \quad e \le e_t(\Gamma). \qquad (89) $$

The quenched complexity of minima at fixed energy is defined as

$$ \Xi_{\min}(e) = \lim_{N \to \infty} \frac{1}{N} \ln n_{\min}(e) \le \Sigma_{\min}(e), \qquad (90) $$

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 $\mathcal{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 [63] for any energy $e \le e_{RSB}(0) = -2\sqrt{p-1}/p$.

There are two natural questions that can be asked from our analysis: Does the LDF $\mathcal{L}(e)$ and the quenched complexity $\Xi_{\min}(e)$ coincide in some finite range of energy, beyond the case of the pure p-spin? Do $e_t(\Gamma)$ or $e_{RSB}(\Gamma)$ provide the threshold energy below which the quenched and annealed complexity coincide $\Sigma_{min}(e) = \Xi_{min}(e)$?

### 2.2.5 The Spherical Pure p-Spin Model Without Magnetic Field

Let us consider in more details the case of the pure p-spin for $\Gamma = 0$, where

$$ f(q) = g(q) = \frac{q^p}{p}. \qquad (91) $$

The typical ground-state energy in this case coincides with the critical energy $e_c$, where the LDF diverges for $\Gamma > 0$, while it vanishes for $\Gamma = 0$. It is given by

$$ e_{typ} = e_c = \frac{e_{RSB}}{2} \left( \sqrt{(p-1)\rho_{typ}} + \frac{1}{\sqrt{(p-1)\rho_{typ}}} \right) \ge e_{RSB}, \qquad (92) $$

$$ e_{c,RS} = e_{RSB} = -\frac{2}{p}\sqrt{p-1}, \qquad (93) $$

where the constant $\rho_{typ}$ satisfies the equation

$$ \frac{1}{p} = \rho_{typ} \frac{\rho_{typ} - 1 - \ln \rho_{typ}}{(1 - \rho_{typ})^2}. \qquad (94) $$

Since for $\Gamma = 0$ the LDF for the range of energies $e \le 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 section, 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 \le e_{typ}$

$$ \mathcal{L}_{RS}(e) = -\Sigma_{\min}(e) = -\Xi_{\min}(e) = -\frac{1}{2}\ln(p-1) + \frac{p-2}{p} \frac{e^2}{e_{RSB}^2} - \frac{e}{e_{RSB}^2}\sqrt{e^2 - e_{RSB}^2} - \ln\left(\frac{e - \sqrt{e^2 - e_{RSB}^2}}{e_{RSB}}\right). \quad (95) $$

Finally, as has been shown explicitly in [64] 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 $\Gamma$) but rather by a Gumbel distribution: the ground-state energy behaves at large $N$ as $E_{\min} \approx Ne_{typ} + \frac{\log(Nc_p^2)}{2c_p} - K_0 - \frac{G}{c_p}$, where $G$ is a standard Gumbel random variable with cumulative distribution $e^{-e^{-G}}$, $K_0$ is a constant of order unity and

$$ c_p = \Sigma'_{\min}(e_{typ}) = -\mathcal{L}'_{RS}(e_{typ}) = s_*(e_{typ}) > 0. \quad (96) $$

Equivalently one can state that the distribution of the ground-state energy takes the scaling form

$$ \mathcal{P}(e) \approx Nc_p G \left( -Nc_p(e - e_{typ}) + \frac{\ln(Nc_p^2)}{2} - K_0 c_p \right), \quad \mathcal{G}(\epsilon) = \exp(-\epsilon - e^{-\epsilon}), \quad (97) $$

The tail of this distribution takes the exponential form (for $e < e_{typ}$)

$$ \ln \mathcal{P}(e) \approx -N \mathcal{L}'_{RS}(e_{typ})(e - e_{typ}), \quad (e_{typ} - e) \gg \frac{\ln N}{N}, \quad (98) $$

which quite obviously matches the behaviour of the large-deviation function $\mathcal{L}_{RS}(e)$ as $e_{typ} - e \ll 1$. We therefore expect the LDF $\mathcal{L}_{RS}(e)$ to correctly reproduce the large-deviation function of $e_{min}$ for values $e \le e_{typ}$. As mentioned in the section on the 1RSB phase [see Eq. (82)], the fact that $\mathcal{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 $\Gamma > 0$ the typical fluctuations of the ground-state energy of a generic spherical spin-glass model is described by a Gaussian distribution [18], 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\text{Var}(e_{min}) \sim N\Gamma^2$ for $\Gamma > 0$ with the Gumbel fluctuations $N\text{Var}(e_{min}) = O(1)$ for $\Gamma = 0$, we surmise that, in the regime

$$ N \to \infty, \quad \Gamma \to 0, \quad \text{with} \quad N^{1/2}\Gamma = \kappa = O(1), \quad (99) $$

the probability distribution takes the scaling form

$$ \mathcal{P}(e) \to N^{-1} P_{\kappa=N^{1/2}\Gamma, g_p} (\delta = N(e - e_{typ}(\Gamma))), \quad N \to \infty, \quad (100) $$
with the scaling function $P_{\kappa,g_p}(\delta)$ satisfying uniformly for any $\delta$ the asymptotic behaviours

$$P_{\kappa,g_p}(\delta) \rightarrow \begin{cases} P_{0,g_p}(\delta) = e^{-e^{\delta}+\delta}, & \kappa \rightarrow 0, \\ \frac{1}{\kappa} P_{\infty,g_p}\left(\frac{\delta}{\kappa}\right), & \kappa \rightarrow \infty, \end{cases} \quad (101)$$

where

$$P_{\infty,g_p}(x) = \sqrt{\frac{\rho_{\text{typ}}}{\pi}} e^{-\sqrt{\rho_{\text{typ}}}x^2}, \quad (102)$$

and we remind that $\rho_{\text{typ}}$ is the solution of Eq. (94). Note that the conjectured form of the function in Eq. (101) describing the typical fluctuations of the ground-state of the spherical $p > 2$ spin model behaves quite differently for finite $\kappa$ than the function describing the typical fluctuations of the 2-spin in Eq. (20).

### 2.2.6 Scaling form for $\Gamma \rightarrow 0$ and Matching to Typical Fluctuations

In the above subsections we have considered the generic mixture model for a fixed value of $\Gamma$, either $\Gamma > 0$ or $\Gamma = 0$. We found that for $\Gamma > 0$ the LDF takes a quadratic form near the typical value $e_{\text{typ}}$, which is consistent with a Gaussian form for the typical ground-state energy fluctuations. For $\Gamma = 0$ by contrast we found that the LDF behaves as a power law near $e_{\text{typ}}$ with an exponent $\eta$ which depends on the model and the type of RSB, e.g. $\eta = 1$ in the 1RSB case. Two natural questions are thus: (i) how does the LDF interpolates between these two limits as $\Gamma \rightarrow 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 $\Gamma \rightarrow 0$ since for $\Gamma = 0$ the two energies $e_{\text{typ}}(\Gamma)$ and $e_c$ coincide. We only provide here the main features and a more detailed description can be found in Appendix C.

**Behaviour near the typical value** The behaviour of the LDF in the vicinity of the typical ground-state $e_{\text{typ}}(\Gamma)$ is naturally influenced by the scaling of the rescaled variance $\mathcal{V}_{\text{min}}(\Gamma)$ in the limit $\Gamma \rightarrow 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). \quad (103)$$

For models which are described by a FRSB ansatz, this rescaled variance reads

$$\mathcal{V}_{\text{min}}(\Gamma) = \frac{g_r}{2}(r-1)(r-2) \left( \frac{\Gamma}{g_r r(r-2)} \right)^{\frac{r}{r-1}} \sim \Gamma^{\nu_r(2-\eta_r)}, \quad \Gamma \rightarrow 0, \quad (104)$$

where we define the exponents

$$\eta_r = \frac{3(r-2)}{2r-3}, \quad \nu_r = \frac{2r-3}{r-1}. \quad (105)$$

For these models, the difference $e_{\text{typ}}(\Gamma) - e_l(\Gamma) = e_{\text{typ}}(\Gamma) - e_{\text{RSB}}(\Gamma) = O(1)$ and positive as $\Gamma \rightarrow 0$. In a vicinity of $e_{\text{typ}}(\Gamma)$ of width of order $\Gamma^{\nu_r}$, the LDF takes the following scaling form

$$\mathcal{L}(e) = \Gamma^{\eta_r} L_{\text{FRSB}} \left( \frac{e - e_{\text{typ}}(\Gamma)}{\Gamma^{\nu_r}} \right), \quad (106)$$
where $r$ is obtained from the leading order behaviours of the covariance function in Eq. (103). The scaling function $L_{\text{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

$$L_{\text{FRSB}}(u) \approx \begin{cases} a_{-}|u|^{\eta_{r}}, & u \to -\infty, \\ a_{0}u^{2}, & u \to 0, \\ a_{+}u^{3}, & u \to +\infty, \end{cases} \qquad (107)$$

where the values of $a_{-}$, $a_{0}$, $a_{+}$ are given in Eq. (C65). In particular, the first line matches the typical behaviour for $\Gamma = 0$ in Eq. (58), the second line the typical behaviour for $\Gamma > 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

$$\mathcal{V}_{\min}(\Gamma) = \frac{\Gamma^2}{2(\rho_{\text{typ}}g'(1) - 2g_2)} + O(\Gamma^3), \qquad (108)$$

where we remind that $0 \le \rho_{\text{typ}} \le 1$ is the solution of $g(1)/g'(1) = \rho_{\text{typ}}(\rho_{\text{typ}} - 1 - \ln \rho_{\text{typ}})/(1 - \rho_{\text{typ}})^2$. For these models, the difference between the typical energy and the transition energy is of order $e_{\text{typ}}(\Gamma) - e_{t}(\Gamma) = -u_{t}\Gamma^2 > 0$. The LDF takes, in a vicinity of $e_{\text{typ}}(\Gamma)$ of order $\Gamma^2$, a scaling form with both an RS and RSB branch

$$\mathcal{L}(e) \approx \Gamma^2 L_{1\text{RSB}} \left( \frac{e - e_{\text{typ}}(\Gamma)}{\Gamma^2} \right), \quad L_{1\text{RSB}}(u) = \begin{cases} A - B u, & u \le u_t < 0, \\ C u^2, & u > u_t, \end{cases} \qquad (109)$$

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 $\nu = 2$ and in addition one finds $\eta = 1$. In particular, the limit $u \to -\infty$ matches smoothly the typical behaviour for $\Gamma = 0$ in Eq. (82), while the behaviour for $u \to 0$ matches the typical behaviour for $\Gamma > 0$ in Eq. (81). Finally, the behaviour for $u \to +\infty$ 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 $\Gamma \to 0$. First note that the position of the wall $e_c$ is independent of $\Gamma$. For positive $\Gamma > 0$, the LDF diverges close to the wall, i.e. as $e \to e_c$, while for $\Gamma = 0$ it vanishes at the wall since one has in that case $e_c = e_{\text{typ}}(\Gamma = 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 \sim \Gamma$ 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

$$\mathcal{L}(e) \approx G \left( \frac{\sqrt{2g_2}(e - e_c)}{\Gamma} \right), \\ G(z) = \begin{cases} 0, & z \in (-\infty, z_{\text{typ}}), \\ -\frac{1}{4}(3 + 8z + 4z^2 + 2\ln(-2z)), & z \in [z_{\text{typ}}, 0]. \end{cases} \qquad (110)$$
<figure><img src="image_12.png" /><figcaption>**Fig. 11** Plot of the different scaling regimes at large *N* describing our conjectures for the distribution of the typical fluctuations $P_κ(δ)$ for models with a 1RSB phase with magnetic field in Eq. (113) and its matching for $δ, κ → ∞$ with our results for the large deviations. The large deviation region for $δ = O(N)$ and $κ = O(N^{1/2})$ is indicated in green, while the white region represents the tail region for the typical fluctuations and show the separation of scales. The radial lines represent schematically the equations $δ = uκ^2$ for fixed values of *u*. The transition line is 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. It separates the region where the RS ansatz is operative (blue lines) to its left and the region where the RSB ansatz is operative (orange lines) to its right. The vicinity of the wall on the speed *N* RSB regime is described by yet another scaling behaviour see Eq (111)</figcaption></figure>

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. (106), where $\mathcal{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

$$ \mathcal{L}(e) \approx G_{1\text{RSB}} \left( \frac{\sqrt{\rho_{\text{typ}}g'(1)}(e - e_c)}{\Gamma} ; \frac{g_2}{\rho_{\text{typ}}g'(1)} \right), \quad (111) $$

$$ G_{1\text{RSB}}(z; w) = \begin{cases} 0 & , \quad z \in (-\infty, z_{\text{typ}}), \\ -\frac{1}{2}((1+2z)(1+w(1+2z)) + \ln(-2z)) & , \quad z \in [z_{\text{typ}}, 0]. \end{cases} \quad (112) $$

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. (80).

**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 [18]. 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 \to \infty$ with $\Gamma \sim N^{-1/2}$ and for $e - e_{typ}(\Gamma) \sim 1/N$ there exists a family of distributions $P_{\kappa,g}(\delta)$ for the typical fluctuations such that

$$ \mathcal{P}(e) \to N P_{\kappa=N^{1/2}\Gamma,g}(\delta = N(e - e_{typ}(\Gamma))), \quad N \to \infty, \quad (113) $$

where $e_{typ}(\Gamma)$ 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 $\delta \to \infty$ and $\kappa \to \infty$, assuming a simple matching between our results for the LDF and the typical distribution, one expects that

$$ P_{\kappa,g}(\delta) \sim e^{-\kappa^2 L_{1RSB} \left(u = \frac{\delta}{\kappa^2}\right)}, \quad \kappa \to \infty, \quad |\delta| \to \infty, \quad u = \frac{\delta}{\kappa^2} = O(1). \quad (114) $$

Within the same joint limit, further considering $u \to -\infty$ one expects, in particular, that the function $P_{\kappa,g}(\delta)$ displays an exponential tail:

$$ P_{\kappa,g}(\delta) \sim e^{-B|\delta|}, \quad \kappa \to +\infty, \quad \delta \to -\infty, \quad u = \frac{\delta}{\kappa^2} \to -\infty, \quad (115) $$

while in the opposite limit $u \to +\infty$ one expects instead that the function $P_{\kappa,g}(\delta)$ displays a Gaussian tail:

$$ P_{\kappa,g}(\delta) \sim e^{-C \frac{\delta^2}{\kappa^2}}, \quad \kappa \to +\infty, \quad \delta \to +\infty, \quad u = \frac{\delta}{\kappa^2} \to +\infty. \quad (116) $$

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 $\Gamma$ 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 \to \infty$ with $\Gamma \sim N^{-1/\eta_r v_r}$, and for $e - e_{typ}(\Gamma) \sim 1/N^{1/\eta_r}$, with $\eta_r = 3(r-2)/(2r-3)$ and $v_r = (2r-3)/(r-1)$, there exist a family of distributions

$$ \mathcal{P}(e) \to N^{1/\eta_r} P_{\kappa=N^{1/(\eta_r v_r)}\Gamma,g}(\delta = N^{1/\eta_r}(e - e_{typ})), \quad N \to \infty, \quad (117) $$

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 $\delta \to \infty$ and $\kappa \to \infty$, a simple matching between our results for the LDF and the typical distribution leads to the following conjecture:

$$ P_{\kappa,g}(\delta) \sim e^{-\kappa^{\eta_r} v_r} L_{\text{FRSB}} \left(u = \frac{\delta}{\kappa^{\eta_r}}\right), \quad \kappa \to \infty, \quad |\delta| \to \infty, \quad u = \frac{\delta}{\kappa^{\eta_r}} = O(1). \quad (118) $$

Within the same joint limit and in the further limit $u \to -\infty$, one expects the super-exponential tail of the distribution:

$$ P_{\kappa,g}(\delta) \sim e^{-a_- |\delta|^{\eta_r}}, \quad \kappa \to +\infty, \quad \delta \to -\infty, \quad u = \frac{\delta}{\kappa^{\eta_r}} \to -\infty, \quad (119) $$

while in the opposite limit $u \to +\infty$ one instead expects the distribution to display the tail

$$ P_{\kappa,g}(\delta) \sim e^{-a_+ \frac{\delta^3}{\kappa^3}}, \quad \kappa \to +\infty, \quad \delta \to +\infty, \quad u = \frac{\delta}{\kappa^{\eta_r}} \to +\infty. \quad (120) $$

Note that this conjecture takes the same form as that proposed by us for the 2-spin in Eq. (22).
<figure><img src="image_13.png" /><figcaption>Fig. 12 Plot of the different scaling regimes at large N describing our conjectures for the distribution of the typical fluctuations $P_\kappa(\delta)$ for models with a FRSB phase with magnetic field in Eq. (117) and its matching for $\delta, \kappa \to \infty$ with our results for the large deviations. The large deviation region for $\delta = O(N^{1/\eta})$ and $\kappa = O(N^{1/(\eta\nu)})$ is indicated in green, while the white region represents the tail region for the typical fluctuations and show the separation of scales. The radial lines represent schematically the equations $\delta = u\kappa^\nu$ for fixed values of $u$. The vicinity of the wall on the speed N RSB regime is described by yet another scaling behaviour see Eq (110)</figcaption></figure>

## 3 Derivation of the Cumulant Generating Function

In this section we compute the cumulant generating function $\phi(s)$. We start by expressing the integer moments $\overline{Z(\beta)^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 +\infty$. To perform the analytical continuation $n = s/\beta$ we introduce the Parisi parametrization. The cumulant generating function $\phi(s)$ is obtained formally from the solution of the saddle point equations, as well as the LDF $\mathcal{L}(e)$. These equations will be solved in detail in the Appendix C, providing explicit expressions for these functions.

### 3.1 Integer Moments

The integer moments of the partition sum (4) can be expressed as

$$ \overline{Z(\beta)^n} = \int \sqrt{N} S_{N-1} \prod_{a=1}^{n} d\mathbf{x}_a \overline{e^{-\beta \sum_{a=1}^{n} H(\mathbf{x}_a)}} = \int \sqrt{N} S_{N-1} \prod_{a=1}^{n} d\mathbf{x}_a e^{\frac{N\beta^2}{2} \sum_{a,b} f\left(\frac{\mathbf{x}_a \cdot \mathbf{x}_b}{N}\right)} \quad (121) $$

$$ = C_{N,n} N^{-n} \int_{Q>0} dQ \prod_{a=1}^{n} \delta(1 - Q_{aa}) (\det Q)^{-\frac{n+1}{2}} e^{N \Phi_n(Q)}, \quad (122) $$

$$ C_{N,n} = (\pi N)^{Nn/2} \frac{\pi^{\frac{n(n-1)}{4}}}{\prod_{k=0}^{n-1} \Gamma\left(\frac{N-k}{2}\right)}, \quad (123) $$

where in the second line we have used a standard replica method together with rotational invariance to re-express the integration over the replicated $S_{N-1}^n$ sphere as an integral over the overlap matrix [42, 65]

$$ Q_{ab} = \frac{\mathbf{x}_a \cdot \mathbf{x}_b}{N}, \quad Q_{aa} = 1, \quad a, b = 1, \dots, n. \quad (124) $$
The action $\Phi_n(Q)$ reads

$$ \Phi_n(Q) = \frac{1}{2} \left[ \beta^2 \sum_{a,b} f(Q_{ab}) + \ln \det Q \right]. \qquad (125) $$

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

$$ \overline{Z(\beta)^n} \approx 2^{-n/2} (2\pi)^{n/2} (2N-n-1) N^{n(n-3)/4} e^{\frac{Nn}{2}} \frac{(\det Q_*)^{-\frac{n+1}{2}}}{\sqrt{\det A}} e^{N\phi_n}, \qquad (126) $$

$$ \phi_n = \max_{Q>0, Q_{aa}=1} \Phi_n(Q) = \Phi_n(Q_*) , \qquad (127) $$

$$ A_{(ab),(cd)} = \frac{\delta^2 \Phi_n(Q)}{\delta Q_{ab} \delta Q_{cd}} \Big|_{Q=Q^*} = f''(Q^*_{ab}) \delta_{(ab),(cd)} - (Q^{*-1})_{ac} (Q^{*-1})_{bd} \\ -(Q^{*-1})_{ad} (Q^{*-1})_{bc}. \qquad (128) $$

The identity above is valid for any positive integer $n \ll N$.

## 3.2 Parisi Scheme

We now suppose that the matrix $Q$ maximising the action $\Phi_n(Q)$ takes a Parisi block form with $k$ replica-symmetry breaking and parameters

$$ 1 = q_{k+1} \ge q_k \ge \cdots \ge q_0 \ge 0, \qquad (129) $$

$$ n = m_0 \ge m_1 \ge \cdots \ge m_{k+1} = 1. \qquad (130) $$

The action can be expressed in terms of the positive function

$$ x(q) = n + \sum_{l=0}^{k} (m_{l+1} - m_l) \Theta(q - q_l). \qquad (131) $$

Note that one can similarly express [65]

$$ \frac{1}{x(q)} = \frac{1}{n} + \sum_{l=0}^{k} \left( \frac{1}{m_{l+1}} - \frac{1}{m_l} \right) \Theta(q - q_l). \qquad (132) $$

In particular, this function satisfies

$$ x'(q) = \sum_{l=0}^{k} (m_{l+1} - m_l) \delta(q - q_l), \quad -\frac{x'(q)}{x(q)^2} = \sum_{l=0}^{k} \left( \frac{1}{m_{l+1}} - \frac{1}{m_l} \right) \delta(q - q_l), \quad (133) $$

from which one obtains easily

$$ \begin{aligned} \sum_{a,b} f(Q_{ab}) &= n \left[ f(1) + \sum_{l=0}^{k} (m_l - m_{l+1}) f(q_l) \right] = n \left[ f(1) - \int_{q_{0-}}^{1} dq \, x'(q) f(q) \right] \\ &= n^2 f(q_0) + n \int_{q_0}^{1} dq \, x(q) f'(q). \end{aligned} \qquad (134) $$
The eigenvalues of the matrix $Q$ are simply expressed as

$$ \lambda_i = 1 - q_{i-1}m_i - \sum_{l=i}^{k} (m_{l+1} - m_l)q_l \\ = \int_{q_{i-1}}^{1} x(q)dq, \quad d_i = n \left( \frac{1}{m_i} - \frac{1}{m_{i-1}} \right), \quad i = 1, \dots, k+1, \quad (135) $$

$$ \lambda_0 = nq_0 + \lambda_1 = nq_0 + \int_{q_0}^{1} dq \, x(q), \quad d_0 = 1. \quad (136) $$

Finally, the determinant is obtained as [65]

$$ \ln \det Q = \ln \lambda_0 + n \sum_{l=0}^{k} \left( \frac{1}{m_{l+1}} - \frac{1}{m_l} \right) \ln \lambda_{l+1} = \ln \lambda_0 + n \sum_{l=0}^{k} \left( \frac{1}{m_{l+1}} - \frac{1}{m_l} \right) \ln \left( \int_{q_l}^{1} dq \, x(q) \right) \quad (137) $$

$$ = \ln \left( nq_0 + \int_{q_0}^{1} dq \, x(q) \right) - n \int_{q_0-}^{q_k+} \frac{dq \, x'(q)}{x(q)^2} \ln \left( \int_{q}^{1} dr \, x(r) \right) \quad (138) $$

$$ = \ln \left( nq_0 + \int_{q_0}^{1} dq \, x(q) \right) - \ln \left( \int_{q_0}^{1} dq \, x(q) \right) + n \ln(1 - q_k) + n \int_{q_0}^{q_k} \frac{dq}{\int_{q}^{1} dr \, x(r)}, \quad (139) $$

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 $\beta$ reads

$$ \Phi_n = \frac{n\beta^2}{2} \left[ n f(q_0) + f(1) - f(q_k) + \int_{q_0}^{q_k} dq \, x(q) f'(q) \right] + \frac{n}{2} \ln(1 - q_k) \\ + \frac{1}{2} \left[ \ln \left( nq_0 + 1 - q_k + \int_{q_0}^{q_k} dq \, x(q) \right) - \ln \left( 1 - q_k + \int_{q_0}^{q_k} dq \, x(q) \right) \right] \\ + \frac{n}{2} \int_{q_0}^{q_k} \frac{dq}{1 - q_k + \int_{q}^{q_k} dr \, x(r)}. \quad (140) $$

Supposing that this function can be continued analytically from positive integer $n$ to arbitrary real value, we take the limit $\beta \to \infty$ of this expression such that

$$ n\beta = s = O(1), \quad 0 \le q_0 \le 1, \quad \beta(1-q_k) = v = O(1), \quad \beta x(q) = z(q) = O(1). \quad (141) $$

It yields

$$ \lim_{\beta \to \infty} \Phi_{s/\beta} = \Phi(s) = \frac{s}{2} \left[ s f(q_0) + v f'(1) + \int_{q_0}^{1} dq \, z(q) f'(q) \right] \\ + \frac{1}{2} \left[ \ln \left( s q_0 + v + \int_{q_0}^{1} dq \, z(q) \right) - \ln \left( v + \int_{q_0}^{1} dq \, z(q) \right) \right] \\ + \frac{s}{2} \int_{q_0}^{1} \frac{dq}{v + \int_{q}^{1} dr \, z(r)}, \quad (142) $$
where the function $z(q) = s$ for $q \in [0, q_0)$. In that limit, the cumulant generating function is given by the extremum of this action

$$ \phi(s) = \begin{cases} \max_{z(q), q_0, v} \Phi(s) , & s < 0, \\ 0 , & s = 0, \\ \min_{z(q), q_0, v} \Phi(s) , & s > 0. \end{cases} \qquad (143) $$

The extremisation with respect to $q_0$ and $v$ yield

$$ \partial_{q_0} \Phi(s)|_{\text{s.p.}} = \frac{s}{2}(s - z_*(q_0^*)) \left( f'(q_0^*) - \frac{q_0^*}{(v_* + \int_{q_0^*}^1 dq \, z_*(q))(sq_0^* + v_* + \int_{q_0^*}^1 dq \, z_*(q))} \right) = 0, \qquad (144) $$

$$ \partial_v \Phi(s)|_{\text{s.p.}} = \frac{s}{2} \left( f'(1) - \int_{q_0^*}^1 \frac{dq}{(v_* + \int_{q_0^*}^1 dr \, z_*(r))^2} - \frac{q_0^*}{(v_* + \int_{q_0^*}^1 dq \, z_*(q))(sq_0^* + v_* + \int_{q_0^*}^1 dq \, z_*(q))} \right) = 0, \qquad (145) $$

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 $\Gamma = 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 $\phi(s)$ is a linear function of $s$. In the general case, there exist two possible solutions of the first equation, namely

$$ s = z_*(q_0^*) \qquad (146) $$

or

$$ v_* + \int_{q_0^*}^1 dq \, z_*(q) = \frac{q_0^*}{2} \left( -s + \sqrt{\frac{4}{q_0^* f'(q_0^*)} + s^2} \right). \qquad (147) $$

where in solving the quadratic equation for the term in the right-hand side obtained from Eq. (145), we have kept the positive root.

Using the second solution (147), one obtains an additional identity from Eq. (145)

$$ \int_{q_0^*}^1 \frac{dq}{(v_* + \int_q^1 dr \, z_*(r))^2} = f'(1) - f'(q_0^*). \qquad (148) $$

Inserting the expression in Eq. (147) into the expression of the CGF in Eq. (142), one obtains the following expression

$$ \phi(s) = \frac{s}{2} \left[ sf(q_0^*) + \frac{f'(1)q_0^*}{2} \left( -s + \sqrt{\frac{4}{q_0^* f'(q_0^*)} + s^2} \right) - \int_{q_0^*}^1 dq \, z_*(q) [f'(1) - f'(q)] \right. \\ \left. + \ln \left( \frac{s\sqrt{q_0^* f'(q_0^*)} + \sqrt{4 + q_0^* f'(q_0^*)s^2}}{2} \right) \right] $$
$$ + \frac{s}{2} \int_{q_0^*}^{1} \frac{dq}{\frac{q_0^*}{2} \left( -s + \sqrt{\frac{4}{q_0^* f'(q_0^*)} + s^2} \right) - \int_{q_0^*}^{q} dr \, z_*(r)}, \quad (149) $$

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

$$ \begin{aligned} e_{\text{typ}} &= \overline{e_{\text{min}}} = -\phi'(s=0) \\ &= -\frac{1}{2} \left( \sqrt{\frac{q_{\text{typ}}}{f'(q_{\text{typ}})}} [f'(1) + f'(q_{\text{typ}})] - \int_{q_{\text{typ}}}^{1} dq \, z_*(q) [f'(1) - f'(q)] \right. \\ & \qquad \left. + \int_{q_{\text{typ}}}^{1} \frac{dq}{\sqrt{\frac{q_{\text{typ}}}{f'(q_{\text{typ}})} - \int_{q_{\text{typ}}}^{q} dr \, z_*(r)}} \right), \end{aligned} \quad (150) $$

where we have used that for $s=0$, $q_0^* = q_{\text{typ}}$. Similarly, the variance can be computed as

$$ \begin{aligned} V_{\min}(\Gamma) &= \lim_{N \to \infty} N \text{Var}(e_{\min}) = \phi''(s=0) = f(q_{\text{typ}}) - \frac{q_{\text{typ}} f'(q_{\text{typ}})}{2} \\ &= \frac{1}{2} \left[ \Gamma q_{\text{typ}} - \sum_{r=2}^{\infty} (r-2) g_r q_{\text{typ}}^r \right], \end{aligned} \quad (151) $$

where we have used Eq. (147) as well as Eq. (148). Importantly, from this expression, one can check that the rescaled variance $V_{\min}(\Gamma)$ of the ground-state energy is of order $O(1)$ for any positive magnetic field $\Gamma > 0$ but vanishes for zero magnetic field (as $q_{\text{typ}}(\Gamma = 0) = 0$).

We now turn to the LDF $\mathcal{L}(e)$. Supposing that $\phi(s)$ is strictly convex and using that $\mathcal{L}(e)$ is the Legendre transform of $\phi(s)$,

$$ \mathcal{L}(e) = - \min_{s \in \mathbb{R}} [se + \phi(s)], \quad (152) $$

one may express the value of $s_*$ minimising the action above as

$$ e = -\phi'(s_*) = -\frac{1}{2} \left( 2s_* f(q_0^*) + v_* f'(1) + \int_{q_0^*}^{1} dq \, z_*(q) f'(q) \right. \\ \left. + \int_{q_0^*}^{1} \frac{dq}{v_* + \int_{q}^{1} dr \, z_*(r)} + \frac{q_0^*}{s_* q_0^* + v_* + \int_{q_0^*}^{1} dq \, z_*(q)} \right), \quad (153) $$

where $v_*, z_*(q)$ and $q_0^*$ are the values that maximise the action $\Phi(s)$. A parametric expression for $\mathcal{L}(e)$ can then be obtained in terms of $s_*$, determined parametrically from $e$ in Eq. (153), which reads

$$ \mathcal{L}(e) = s_* \phi'(s_*) - \phi(s_*) = \frac{1}{2} \left[ s_*^2 f(q_0^*) + \frac{q_0^* s_*}{s_* q_0^* + v_* + \int_{q_0^*}^{1} dq \, z_*(q)} \right] $$
$$-\ln\left(1 + \frac{q_0^* s_*}{v_* + \int_{q_0^*}^1 dq \, z_*(q)}\right). \qquad (154)$$

Note that if Eq. (147) holds, this function takes a simpler expression in terms of $q_0^*$ and $s_*$ only, i.e.

$$\mathcal{L}(e) = \frac{s_*^2}{4} (2f(q_0^*) - q_0^* f'(q_0^*)) + \frac{s_* q_0^* f'(q_0^*)}{4} \sqrt{\frac{4}{q_0^* f'(q_0^*)} + s_*^2} \\ - \ln \left[ \frac{\sqrt{q_0^* f'(q_0^*)}}{2} \left( s_* + \sqrt{\frac{4}{q_0^* f'(q_0^*)} + s_*^2} \right) \right]. \qquad (155)$$

We have given here some properties of the saddle point equations, and of the resulting functions $\phi(s)$ and $\mathcal{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.

## 4 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 spin-glass model in a random magnetic field of variance $\Gamma$. 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 $\Gamma$ 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 [47] for the spherical 2-spin model. A derivation of general LDF results presented in this paper for broader classes of spherical spin-glass models 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 higher 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 [58].

While for a variance $\Gamma = 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 (see [56] for a study of the SK model, [52] for a first work on the p-spin and [66] for large-deviations in the context of the Franz-Parisi potential). 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 CGF being linear in a finite range of s and that the LDF vanishes linearly in the vicinity of the typical free-energy.

**Acknowledgements** B. Lacroix-A-Chez-Toine would like to thank P. Vivo for a discussion which helped to initiate the present reasearch and V. Ros for useful communications. Y. V. Fyodorov and P. Le Doussal acknowledge O. Zeitouni and J. Baik for stimulating interest in the work and useful discussions at various stages of this project. The research by B. Lacroix-A-Chez-Toine and Y. V. Fyodorov was supported by the EPSRC Grant EP/V002473/1 Random Hessians and Jacobians: theory and applications. P. Le Doussal thanks King's College London for hospitality.

**Data availability** The datasets generated during and/or analysed during the current study are available from the corresponding author on reasonable request.

## Declarations

**Conflict of interest** The authors have no competing interests to declare that are relevant to the content of this article.

**Open Access** This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

## Appendix A: Typical Ground-State Energy for Generic Mixture Model

In this first appendix, let us discuss the behaviour of the typical energy $e_{typ}(\Gamma) = \overline{e_{min}}$ as a function of the covariance function and the variance $\Gamma$ of the magnetic field. The typical and mean-value of the ground-state energy is given by

$$e_{typ}(\Gamma) = \overline{e_{min}} = -\frac{1}{2} \min_{v \in \mathbb{R}^+, q_0 \in [0,1], z(q)} \left[ v f'(1) + \int_{q_0}^{1} dq \, z(q) f'(q) + \frac{q_0}{v + \int_{q_0}^{1} dq \, z(q)} + \int_{q_0}^{1} \frac{dq}{v + \int_{q}^{1} dr \, z(r)} \right], \quad (A1)$$

where $0 \le q_0 \le 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 \in [0, q_0)$ and $z(q) \ge 0$ for $q \in [q_0, 1]$. There exists
a value of the variance of the random field

$$ \Gamma_{\text{RSB}} = g''(1) - g'(1) = \sum_{r=2}^{\infty} r(r-2)g_r, \qquad (\text{A2}) $$

such that any $\Gamma > \Gamma_{\text{RSB}}$, the typical energy $e_{\text{typ}}(\Gamma)$ is obtained within the RS scheme. In that scheme, the optimal parameter $q_0^* = q_{\text{typ}} = 1$, and the function $z(q) = 0$ for any $q \in [0, 1]$. The typical energy in this scheme is given by

$$ e_{\text{typ}}(\Gamma) = -\frac{1}{2} \min_{v \in \mathbb{R}^+} \left[ v f'(1) + \frac{1}{v} \right] = -\sqrt{f'(1)} = -\sqrt{g'(1)} + \Gamma, \quad \Gamma \ge \Gamma_{\text{RSB}}. \qquad (\text{A3}) $$

In contrast, for $\Gamma \le \Gamma_{\text{RSB}}$ it is obtained from a RSB solution and its expression depends on the level of replica-symmetry breaking. We consider three cases:

**First case: Full replica symmetry breaking** Assuming that the Schwarzian derivative of $f'(q)$ is non-negative, i.e.

$$ S[f'](q) = \frac{f^{(4)}(q)}{f''(q)} - \frac{3}{2} \left( \frac{f^{(3)}(q)}{f''(q)} \right)^2 \ge 0, \quad q \in [0, 1], \qquad (\text{A4}) $$

then the solution to the optimisation problem is obtained within the full replica-symmetry breaking (FRSB) framework as

$$ z_{*}(q) = \frac{f^{(3)}(q)}{2f''(q)^{3/2}} \ge 0, \quad q \in [q_{\text{typ}}, 1]. \qquad (\text{A5}) $$

In fact this can be easily understood, since the derivative of $z_*(q)$ has a simple expression in terms of this criterion

$$ z'_{*}(q) = \frac{S[f'](q)}{2\sqrt{f''(q)}} \ge 0, \quad q \in [q_{\text{typ}}, 1]. \qquad (\text{A6}) $$

The optimal value of $v$ is then $v_* = f''(1)^{-1/2}$. The expression of the ground-state energy then reads for $\Gamma \le \Gamma_{\text{RSB}}$ as

$$ \begin{aligned} e_{\text{typ}}(\Gamma) &= -\frac{1}{2} \min_{q_0 \in [0, 1]} \left[ \frac{f'(q_0) + q_0 f''(q_0)}{\sqrt{f''(q_0)}} + 2 \int_{q_0}^{1} dq \sqrt{f''(q)} \right] \\ &= - \left[ q_{\text{typ}} \sqrt{f''(q_{\text{typ}})} + \int_{q_{\text{typ}}}^{1} dq \sqrt{f''(q)} \right], \end{aligned} \qquad (\text{A7}) $$

where $q_0^* = q_{\text{typ}}$ is the solution of the equation

$$ (q_{\text{typ}} f''(q_{\text{typ}}) - f'(q_{\text{typ}})) z(q_{\text{typ}}) = 0. \qquad (\text{A8}) $$

The solution $q_{\text{typ}}(\Gamma)$ is found by inverting the following function

$$ \Gamma = \Gamma_{\text{FRSB}}(q_{\text{typ}}) = q_{\text{typ}} g''(q_{\text{typ}}) - g'(q_{\text{typ}}) = \sum_{r \ge 2} r(r-2) g_r q_{\text{typ}}^{r-1}. \qquad (\text{A9}) $$

The function $\Gamma_{\text{FRSB}}(q_{\text{typ}})$ is a non-decreasing function of $q_{\text{typ}}$ with $\Gamma_{\text{FRSB}}(0) = 0$ and $\Gamma_{\text{FRSB}}(1) = \Gamma_{\text{RSB}}$. In the case of zero magnetic field, the value of $q_{\text{typ}} = 0$. In the limit $\Gamma \to \Gamma_{\text{RSB}}$, $q_{\text{typ}} \to 1$ and one has that $f''(1) = f'(1) = \Gamma + g'(1)$. The replica-symmetry is thus recovered and the value of $e_{\text{typ}}$ obtained via the FRSB scheme matches the RS result
in Eq. (A3). The transition occurring for $\Gamma = \Gamma_{\text{RSB}}$ is of third order as the value of $e_{\text{typ}}(\Gamma)$ and its first two derivatives are continuous for $\Gamma = \Gamma_{\text{RSB}}$ while

$$e_{\text{typ}}^{(3)}(\Gamma_{\text{RSB}}^{+}) - e_{\text{typ}}^{(3)}(\Gamma_{\text{RSB}}^{-}) = \frac{1}{24g''(1)^{3/2}g^{(3)}(1)}. \quad (\text{A10})$$

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 \in [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

$$S[f'](q) = \frac{f^{(4)}(q)}{f''(q)} - \frac{3}{2} \left( \frac{f^{(3)}(q)}{f''(q)} \right)^2 \le 0, \quad q \in [0, 1], \quad (\text{A11})$$

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

$$e_{\text{typ}}(\Gamma) = -\frac{1}{2} \min_{v, m_0 \in \mathbb{R}^+, q_0 \in [0, 1]} \left[ v f'(1) + m_0(f(1) - f(q_0)) + \frac{q_0}{v + m_0(1 - q_0)} + \frac{1}{m_0} \ln \left( 1 + \frac{m_0(1 - q_0)}{v} \right) \right]. \quad (\text{A12})$$

In this regime, the optimal values of the parameters $v$ and $m_0$ are given by

$$v_* = \rho(q_{\text{typ}}) \sqrt{\frac{q_{\text{typ}}}{f'(q_{\text{typ}})}}, \quad m_0^* = \frac{1 - \rho(q_{\text{typ}})}{1 - q_{\text{typ}}} \sqrt{\frac{q_{\text{typ}}}{f'(q_{\text{typ}})}}, \quad (\text{A13})$$

where the function

$$\rho(q) = \frac{(1-q)f'(q)}{(f'(1)-f'(q))q}. \quad (\text{A14})$$

The remaining saddle-point equation sets the value of $q_{\text{typ}}$. It is conveniently expressed by introducing the function

$$\mu(q) = \frac{1}{f'(1) - f'(q)} \left( \frac{f(1) - f(q)}{1 - q} - f'(q) \right), \quad (\text{A15})$$

and reads

$$\mu(q_{\text{typ}}) - \rho(q_{\text{typ}}) \frac{\rho(q_{\text{typ}}) - 1 - \ln \rho(q_{\text{typ}})}{(1 - \rho(q_{\text{typ}}))^2} = 0. \quad (\text{A16})$$

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 \to 0$ (for any $\Gamma > 0$) while it is positive and equal to

$$\frac{1}{2} - (g'(1) + \Gamma) \frac{g'(1) + \Gamma - g''(1) - \ln[(g'(1) + \Gamma)/g''(1)]}{(g''(1) - g'(1) - \Gamma)^2}, \quad (\text{A17})$$

for any $\Gamma > \Gamma_{\text{RSB}}$. Note that it remains to be shown that there is a single solution.

The typical energy can then be expressed for $\Gamma \le \Gamma_{\text{RSB}}$ as

$$e_{\text{typ}}(\Gamma) = - \sqrt{f'(1)\mu(q_{\text{typ}})(1 - \mu(q_{\text{typ}}))} \left( \sqrt{\frac{f'(q_{\text{typ}})(1 - \mu(q_{\text{typ}}))}{q_{\text{typ}}f'(1)\mu(q_{\text{typ}})}} + \sqrt{\frac{q_{\text{typ}}f'(1)\mu(q_{\text{typ}})}{f'(q_{\text{typ}})(1 - \mu(q_{\text{typ}}))}} \right). \quad (\text{A18})$$
The transition occurring for $\Gamma = \Gamma_{RSB}$ is, as in the case of FRSB, of third order as the value of $e_{typ}(\Gamma)$ and its first two derivatives are continuous for $\Gamma = \Gamma_{RSB}$ while the third derivative satisfies Eq. (A10) as well.

In the limit of zero magnetic field $\Gamma \to 0$, one finds that $q_{typ} = \nu\Gamma$ also vanishes, where the value of $\nu$ remains to be determined. The function $\rho(q)$ then reaches a finite value in that limit

$$ \rho(q_{typ}) = \rho_{typ} = \frac{1 + 2g_2\nu}{g'(1)\nu}, \quad \Gamma \to 0. \qquad (A19) $$

The value of $\nu$ is then determined by inserting this expression into Eq. (A16) and using that $\mu(q_{typ}) = \mu(0) = g(1)/g'(1)$, i.e.

$$ \frac{g(1)}{g'(1)} = \rho_{typ} \frac{\rho_{typ} - 1 - \ln \rho_{typ}}{(1 - \rho_{typ})^2}. \qquad (A20) $$

Similarly, the ground-state typical energy in Eq. (A18) is obtained by using that $\mu(q_{typ}) = \mu(0) = g(1)/g'(1)$ and that $f'(q_{typ})/(q_{typ}f'(1))$ shares the same limit as $\rho(q_{typ})$, given in Eq. (A19), yielding

$$ e_{typ}(\Gamma = 0) = -\frac{1}{\sqrt{g'(1)}} \left( \sqrt{\rho_{typ}}(g'(1) - g(1)) + \frac{g(1)}{\sqrt{\rho_{typ}}} \right). \qquad (A21) $$

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 [15]. In the past ten years, this statement has been shown rigorously by solving the Crisanti–Sommers optimisation problem in [18] and by showing that it corresponds to the unique minimum of the complexity of stable stationary points in [31].

**Marginal cases.** Finally, there exist two marginal cases such that the Schwarzian derivative vanishes

$$ S[f'](q) = \frac{f^{(4)}(q)}{f''(q)} - \frac{3}{2} \left( \frac{f^{(3)}(q)}{f''(q)} \right)^2 = 0, \quad q \in [0, 1]. \qquad (A22) $$

The 2-spin, where $f(q) = q^2/2 + \Gamma 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

$$ f(q) = -y \ln(1 - aq) + (\Gamma - ya)q = \Gamma q + y \sum_{r \ge 2} (aq)^r, \quad 0 < a < 1. \qquad (A23) $$

The typical value of the ground-state is

$$ e_{typ}(\Gamma) = \begin{cases} \sqrt{y} \left[ \ln(1-a) - \sqrt{\frac{\Gamma}{ay}} + \ln \left( 1 + \sqrt{\frac{\Gamma}{ay}} \right) \right], & 0 \le \Gamma \le \Gamma_{RSB} = \frac{ya^3}{(1-a)^2}, \\ -\sqrt{\frac{ya^2}{1-a} + \Gamma}, & \Gamma \ge \Gamma_{RSB} \end{cases} \qquad (A24) $$

and its expression for $0 \le \Gamma \le \Gamma_{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 \in [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 [22, 26, 27, 67].

## 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

$$ \phi(s) = \begin{cases} \max_{z(q), q_0, v} \Phi(s) , & s < 0, \\ 0 , & s = 0, \\ \min_{z(q), q_0, v} \Phi(s) , & s > 0, \end{cases} \qquad (B1) $$

where the function $z(q)$ is a real non-decreasing function, satisfying $z(q) = s$ for $q \in [0, q_0)$ and $z(q) \ge s$ for $q \in [q_0, 1]$ such that and the functional $\Phi(s)$ reads

$$ \Phi(s) = \frac{s}{2} \left[ sf(q_0) + v f'(1) + \int_{q_0}^{1} dq \, z(q) f'(q) \right] \\ + \frac{1}{2} \left[ \ln \left( sq_0 + v + \int_{q_0}^{1} dq \, z(q) \right) - \ln \left( v + \int_{q_0}^{1} dq \, z(q) \right) \right] \\ + \frac{s}{2} \int_{q_0}^{1} \frac{dq}{v + \int_{q}^{1} dr \, z(r)}. \qquad (B2) $$

### B.1 RS Phase

The only parameter to optimise is then $v$, which takes a $s$-dependent optimal value

$$ v_* = \frac{1}{2} \left( -s + \sqrt{\frac{4}{f'(1)} + s^2} \right). \qquad (B3) $$

For any model of spherical spin-glass, this RS solution is unstable for values of the Laplace parameter $s \le s_{RSB}$, where

$$ s_{\text{RSB}} = \frac{1}{\sqrt{f'(1)}} \left( \sqrt{\frac{f''(1)}{f'(1)}} - \sqrt{\frac{f'(1)}{f''(1)}} \right). \qquad (B4) $$

The RS expression of the cumulant generating function is given by

$$ \phi_{\text{RS}}(s) = \frac{s^2}{4} (2f(1) - f'(1)) + \frac{s f'(1)}{4} \sqrt{\frac{4}{f'(1)} + s^2} \\ + \ln \left[ \frac{\sqrt{f'(1)}}{2} \left( s + \sqrt{\frac{4}{f'(1)} + s^2} \right) \right], \quad s \ge s_{\text{RSB}}. \qquad (B5) $$
<figure><img src="image_14.png" /><figcaption>Fig. 13 Phase diagram for the CGF for the spherical spin model in Eq. (C67) in the plane s, Γ. The dashed black line $s_t(\Gamma) = s_{RSB}(\Gamma)$ 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 $s = 0$, which crosses the line $s_t(\Gamma)$ for $\Gamma = \Gamma_{RSB}$ (marked by a horizontal red dotted line). Note that there is no change of speed for the CGF, as the “wall” is relegated to $s \to -\infty$</figcaption></figure>

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 \ge s_{RSB}$, as one can show explicitly that

$$ \phi''_{RS}(s) = f(1) - \frac{f'(1)}{2} \left( 1 - \frac{s\sqrt{f'(1)}}{\sqrt{4+s^2f'(1)}} \right) \ge 0, \\ s \ge s_{\text{conv,RS}} = \frac{2f(1) - f'(1)}{\sqrt{f(1)f'(1)(f'(1) - f(1))}}, \quad (B6) $$

and $s_{\text{conv,RS}} \le s_{RSB}$. The parameter $s_{\text{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_{\text{conv,RS}}$. The optimal energy associated to a given value of the Laplace parameter $s$ is obtained by computing

$$ e_{*,RS}(s) = -\phi'_{RS}(s) = -\frac{1}{2} \left( s(2f(1) - f'(1)) + \sqrt{f'(1)(4+s^2f'(1))} \right), \quad (B7) $$

and in particular the energy associated to the value $s_{RSB}$ is given by

$$ e_{RSB} = e_{*,RS}(s_{RSB}) = -\frac{1}{\sqrt{f''(1)}} \left[ f'(1) + f(1) \left( \frac{f''(1)}{f'(1)} - 1 \right) \right]. \quad (B8) $$

Note that $e'_{*,RS}(s) = -\phi''_{RS}(s) < 0$, which ensures that for any $s > s_{RSB}$, the associated energy $e_{*,RS}(s) < e_{RSB}$. If $s_{RSB} \le 0$, which can be shown to coincide with the condition $\Gamma \ge \Gamma_{RSB}$, where $\Gamma_{RSB}$ is given in (A2), the typical value of the ground-state is given within the RS scheme and reads $e_{\text{typ}} = e_{*,RS}(0) = -\sqrt{f'(1)} \le e_{RSB}$. In that case, the rescaled variance can similarly be computed as

$$ V_{\min}(\Gamma) = \lim_{N \to \infty} N \text{Var}(e_{\min}) = \phi''_{RS}(0) = g(1) + \frac{\Gamma - g'(1)}{2}, \quad \Gamma \ge \Gamma_{RSB}. \quad (B9) $$

Let us now describe the different RSB schemes.
## B.2 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

$$s = \frac{1}{\sqrt{g''(q_0^*)}} \left( \frac{g''(q_0^*)}{g'(q_0^*) + \Gamma} - \frac{1}{q_0^*} \right). \qquad (B10)$$

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)

$$v_* = \frac{1}{\sqrt{g''(1)}}, \quad z_*(q) = \frac{g^{(3)}(q)}{2g''(q)^{3/2}}, \quad q \in [q_0^*, 1]. \qquad (B11)$$

This parametrisation ensures both that $s \ge z(q_0^*)$ and $\partial_{q_0^*} s \ge 0$ as we show below. In particular, comparing with Eq. (B4), we see that $s = s_{\text{RSB}}$ for $q_0^* = 1$. Also if $\Gamma < \Gamma_{\text{RSB}}$, $s = 0$ for $q_0^* = q_{\text{typ}}$ satisfying $q_{\text{typ}} f''(q_{\text{typ}}) = f'(q_{\text{typ}})$ as obtained in Eq. (A8). In the limit $q_0^* \to 0$, the parameter $s \to -\infty$ if the magnetic field $\Gamma > 0$ and $s \to z_*(0) = f^{(3)}(0)/(2f''(0)^{3/2}) \ge 0$ if $\Gamma = 0$. Thus, as $q_0^*$ increases from 0 to 1, the whole range $s \le s_{\text{RSB}}$ is covered by this parametrisation for positive magnetic field $\Gamma > 0$, while only the range $[z_*(0), s_{\text{RSB}}]$ is covered for $\Gamma = 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(\Gamma) = s_{\text{RSB}}(\Gamma)$ for any value of the magnetic field $\Gamma$. Hence, the RS regime described in the section above describe exactly the whole range of parameters $s \ge s_{\text{RSB}}$. Using Eq. (B10), we give the result for the CGF $\phi_{\text{FRSB}}(s)$ in two equivalent forms

$$\begin{aligned} \phi_{\text{FRSB}}(s) &= \frac{s}{2} \left[ sf(q_0^*) + \frac{f'(q_0^*)}{\sqrt{f''(q_0^*)}} + 2 \int_{q_0^*}^{1} dq \sqrt{f''(q)} \right] + \frac{1}{2} \ln \left( 1 + s q_0^* \sqrt{f''(q_0^*)} \right) \\ &= \frac{f''(q_0^*) q_0^* - f'(q_0^*)}{2q_0^* f'(q_0^*) \sqrt{f''(q_0^*)}} \left[ \frac{f(q_0^*)(f''(q_0^*) q_0^* - f'(q_0^*)) + q_0^* f'(q_0^*)^2}{q_0^* f'(q_0^*) \sqrt{f''(q_0^*)}} + 2 \int_{q_0^*}^{1} dq \sqrt{f''(q)} \right] \\ &\quad + \frac{1}{2} \ln \left( \frac{q_0^* f''(q_0^*)}{f'(q_0^*)} \right). \end{aligned} \qquad (B12)$$

Computing the second derivative of the CGF, using the parametrisation in Eq. (B10), yields

$$\phi''_{\text{FRSB}}(s) = f(q_0^*) - \frac{q_0^* f'(q_0^*)^2}{q_0^* f''(q_0^*) + f'(q_0^*)}, \qquad (B13)$$

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 $\phi_{\text{FRSB}}(s)$ is strictly convex. The optimal energy associated to a given value of $s$ is obtained by computing

$$e_{*, \text{FRSB}}(s) = -\phi'_{\text{FRSB}}(s) = -\left( \frac{f(q_0^*)}{\sqrt{f''(q_0^*)}} \left( \frac{f''(q_0^*)}{f'(q_0^*)} - \frac{1}{q_0^*} \right) \right)$$
$$ + \frac{f'(q_0^*)}{\sqrt{f''(q_0^*)}} + \int_{q_0^*}^{1} dq \sqrt{f''(q)} \), \quad s \le s_{\text{RSB}}. \qquad (\text{B14}) $$

The identity $e'_{*,\text{FRSB}}(s) = -\phi''_{\text{FRSB}}(s) \le 0$ ensures that $e_{*,\text{FRSB}}(s) \ge e_{\text{RSB}}$ for all $s \le s_{\text{RSB}}$. The range of energies thus described by (B14) belong to a finite interval $[e_{\text{RSB}}, e_c]$, where

$$ e_{*,\text{FRSB}}(s = s_{\text{RSB}}) = e_{\text{RSB}} = -\frac{1}{\sqrt{f''(1)}} \left[ f'(1) + f(1) \left( \frac{f''(1)}{f'(1)} - 1 \right) \right], \quad (\text{B15}) $$

corresponding to $q_0^* \to 1$, and

$$ e_{*,\text{FRSB}}(s \to s(q_0^* = 0)) = e_c = -\int_0^1 dq \sqrt{f''(q)}, \qquad (\text{B16}) $$

where $s(q_0^* = 0) = -\infty$ if $\Gamma > 0$ and $s(q_0^* = 0) = z_*(0)$ if $\Gamma = 0$. If $\Gamma < \Gamma_{\text{RSB}}$, the FRSB expression of the typical ground-state $e_{*,\text{FRSB}}(0) = e_{\text{typ}} = -[q_{\text{typ}}\sqrt{f''(q_{\text{typ}})} + \int_{q_{\text{typ}}}^{1} dq \sqrt{f''(q)}]$ is retrieved from Eq. (B14), using the parametrisation (B10) where $\Gamma = q_{\text{typ}}g''(q_{\text{typ}}) - g'(q_{\text{typ}})$. In particular, for $\Gamma = 0$, one can check that $q_{\text{typ}} = 0$ and $e_{\text{typ}}(\Gamma = 0) = e_c$. Finally, the rescaled variance can be computed as well for $0 < \Gamma \le \Gamma_{\text{RSB}}$, and one finds

$$ \begin{aligned} V_{\min}(\Gamma) &= \lim_{N \to \infty} N \text{Var}(e_{\min}) = \phi''_{\text{FRSB}}(0) \\ &= g(q_{\text{typ}}) + \frac{\Gamma - g'(q_{\text{typ}})}{2} > 0, \quad 0 < \Gamma \le \Gamma_{\text{RSB}}, \end{aligned} \qquad (\text{B17}) $$

where $\Gamma = q_{\text{typ}}g''(q_{\text{typ}}) - g'(q_{\text{typ}})$. For $\Gamma = 0$, the rescaled variance vanishes.

Finally, in the special case of $\Gamma = 0$, the CGF is given by a linear function for any $s \le z_*(0)$, i.e

$$ \phi(s) = -s e_c, \quad s \le z_*(0) = \frac{g^{(3)}(0)}{2g''(0)^{3/2}}. \qquad (\text{B18}) $$

## B.3 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 \ge 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

$$ s_* = \frac{1}{\sqrt{q_0^* f'(q_0^*)}} \left( \frac{1}{\sqrt{\alpha(q_0^*)}} - \sqrt{\alpha(q_0^*)} \right), \qquad (\text{B19}) $$

where the function $\alpha(q_0^*)$ satisfies the self-consistent equation

$$ \mu(q_0^*) = \rho(q_0^*) \frac{\rho(q_0^*) - \alpha(q_0^*) - \alpha(q_0^*) \ln(\rho(q_0^*)/\alpha(q_0^*))}{(\alpha(q_0^*) - \rho(q_0^*))^2}, \qquad (\text{B20}) $$

with

$$ \mu(q) = \frac{1}{g'(1) - g'(q)} \left( \frac{g(1) - g(q)}{1 - q} - g'(q) \right) \quad \text{and} \quad \rho(q) = \frac{(1 - q)(g'(q) + \Gamma)}{(g'(1) - g'(q))q}. $$
<figure><img src="image_15.png" /><figcaption>Fig. 14 Phase diagram for the CGF for the 3-spin model in the plane $s, \Gamma$. The black line $s_t(\Gamma)$ shows the transition separating the 1RSB phase (in orange) and the RS phase (in blue). The red line corresponds to the typical value $s = 0$, which crosses the line $s_t(\Gamma)$ for $\Gamma = \Gamma_{RSB}$ (marked by a horizontal red dotted line). The criterion of stability of the RS phase yields the dashed blue line $s_{RSB}(\Gamma)$ but only coincides with the correct transition line $s_t(\Gamma)$ for $\Gamma > \Gamma_t$ (marked by a horizontal purple dotted line). Note that there is no change of speed for the CGF, as the “wall” is relegated to $s \to -\infty$</figcaption></figure>

(B21)

The remaining optimal parameters are then given by

$$v_* = \rho(q_0^*) \sqrt{\frac{q_0^*}{f'(q_0^*) \alpha(q_0^*)}}, \qquad (B22)$$

$$m_0^* = \frac{1}{1 - q_0^*} \sqrt{\frac{q_0^* \rho(q_0^*)}{f'(q_0^*)} \left( \sqrt{\frac{\alpha(q_0^*)}{\rho(q_0^*)}} - \sqrt{\frac{\rho(q_0^*)}{\alpha(q_0^*)}} \right)}. \qquad (B23)$$

For a magnetic field

$$\Gamma \ge \Gamma_t = \frac{2g''(1)^2}{2g''(1) + g^{(3)}(1)} - g'(1), \qquad (B24)$$

the transition in the CGF from the RS to the RSB regime occurs for $s = s_t(\Gamma) = s_{RSB}(\Gamma)$, i.e. $q_0^* = 1$, as a result of the loss of stability of the RS solution. For a magnetic field $\Gamma < \Gamma_t$ instead, it occurs for a value $s = s_t(\Gamma) > s_{RSB}(\Gamma)$ such that the CGF coincides in the two different schemes, i.e. $\phi_{RS}(s_t) = \phi_{1RSB}(s_t)$. This value of the Laplace parameter is given by

$$s_t(\Gamma) = \frac{1}{\sqrt{q_t f'(q_t)}} \left( \sqrt{\frac{f'(1) - f'(q_t)}{(1 - q_t) f'(1)}} - \sqrt{\frac{(1 - q_t) f'(1)}{f'(1) - f'(q_t)}} \right) > s_{RSB}(\Gamma), \quad \Gamma < \Gamma_t, \qquad (B25)$$

with $q_t < 1$ obtained as the solution of

$$\mu(q_t) = f'(q_t) \frac{f'(q_t) - q_t f'(1) - q_t f'(1) \ln f'(q_t)/(q_t f'(1))}{(f'(q_t) - q_t f'(1))^2}. \qquad (B26)$$

For $\Gamma \ge \Gamma_t$, the only solution is $q_t = 1$, and we thus set for convenience $q_t (\Gamma \ge \Gamma_t) = 1$ such that $s_t (\Gamma \ge \Gamma_t) = s_{RSB}$. Note that as $\Gamma \to \Gamma_t$, $q_t \to 1$ and $s_t \to s_{RSB}$. In the opposite limit $\Gamma \to 0$, one has instead that $q_t \approx \Gamma/(\rho_{typ}g'(1) - 2g_2)$ and $s_t \to (1 - \rho_{typ})/\sqrt{\rho_{typ}g'(1)} \ge 0$,
where $\rho_{typ}$ is the solution of the equation

$$ \frac{g(1)}{g'(1)} = \rho_{typ} \frac{\rho_{typ} - 1 - \ln \rho_{typ}}{(1 - \rho_{typ})^2}. \qquad (B27) $$

The 1RSB expression for the CGF is then given, using the parametrisation (B19–B22–B23) for Laplace parameter $s \in (-\infty, s_t]$ as

$$ \phi_{1RSB}(s) = \frac{1}{4} \left( 1 + \frac{f(q_0^*) - q_0^* f(1)}{q_0^*(1 - q_0^*) f'(q_0^*)} + 2 \frac{f(q_0^*) - f(1) - (q_0^* - 1) f'(1)}{q_0^*(f'(1) - f'(q_0^*))} \right) q_0^* f'(q_0^*) s^2 \\ + \frac{1}{4} \left( -1 + 2 \frac{f(q_0^*) - f(1) - (q_0^* - 1) f'(1)}{q_0^*(f'(1) - f'(q_0^*))} \right. \\ \left. + \frac{f(1) - f(q_0^*)}{(1 - q_0^*) f'(q_0^*)} \right) s \sqrt{q_0^* f'(q_0^*) (4 + q_0^* f'(q_0^*) s^2)} \\ + \ln \left( \frac{s \sqrt{q_0^* f'(q_0^*)} + \sqrt{4 + q_0^* f'(q_0^*) s^2}}{2} \right). \qquad (B28) $$

The expression of the second derivative $\phi''_{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

$$ \begin{aligned} e_{*,1RSB}(s) &= -\phi'_{1RSB}(s) \\ &= \frac{(1 - q_0^*)\mu(q_0^*)f'(1) - f(1) + [f(1) - \mu(q_0^*)f'(1) - (1 - \mu(q_0^*))f'(q_0^*)]\alpha(q_0^*)}{\sqrt{q_0^* f'(q_0^*)}\alpha(q_0^*)} \end{aligned} \qquad (B29) $$

and lie within the range $e \in [e_t, e_c]$, where

$$ e_{*,1RSB}(s_t) = e_t = - \frac{((1 - q_t)f'(1) - f(1))f'(q_t) + f(1)q_t f'(1)}{\sqrt{q_t f'(1) f'(q_t)}(1 - q_t)(f'(1) - f'(q_t))}, \qquad (B30) $$

corresponding respectively to the parameters $q_0^* = q_t$, $\alpha(q_t) = (1 - q_t)f'(1)/(f'(1) - f'(q_t))$, and

$$ e_c = e_{*,1RSB}(s \to s(q_0^* = 0)) = - \frac{1}{\sqrt{g'(1)}} \left( \sqrt{\rho_{typ}}(g'(1) - g(1)) + \frac{g(1)}{\sqrt{\rho_{typ}}} \right), \qquad (B31) $$

with $s(q_0^* = 0) \to -\infty$ for $\Gamma > 0$ and $s(q_0^* = 0) = s_t = (1 - \rho_{typ})/\sqrt{\rho_{typ}g'(1)} \ge 0$. Note that $e_c = e_{typ}(\Gamma = 0) = e_t(\Gamma = 0)$ as can be seen by comparing with Eq. (A21) and using the fact that $q_t \approx \Gamma/(\rho_{typ}g'(1) - 2g_2)$ as $\Gamma \to 0$. The range of energies thus described collapses to a single point. For a magnetic field $0 \le \Gamma \le \Gamma_{RSB}$, the typical energy belongs to the interval $[e_t, e_c]$, with

$$ \begin{aligned} e_{*,1RSB}(s = 0) &= - \frac{q_{typ}(f(1) - f(q_{typ}))f'(1) + ((1 - q_{typ})^2 f'(1) - f(1) + f(q_{typ}))f'(q_{typ})}{(1 - q_{typ})\sqrt{q_{typ}f'(q_{typ})}(f'(1) - f'(q_{typ}))}, \end{aligned} \qquad (B32) $$
corresponding to $q_0^* = q_{typ}$ satisfying Eq. (A16). In addition, the expression of the second derivative $\phi''_{1RSB}(s)$ simplifies considerably for $s = 0$, allowing to obtain an explicit expression for the rescaled variance

$$ \mathcal{V}_{\min}(\Gamma) = \lim_{N \to \infty} N \text{Var}(e_{\min}) = \phi''_{1\text{RSB}}(0) = g(q_{\text{typ}}) + \frac{\Gamma - g'(q_{\text{typ}})}{2} > 0, \quad 0 < \Gamma \le \Gamma_{\text{RSB}}. \qquad (B33) $$

In the limit $\Gamma \to 0$, using that $q_{typ} \approx q_t \approx \Gamma/(\rho_{typ}g'(1) - 2g_2)$, the rescaled variance reads

$$ \mathcal{V}_{\min}(\Gamma) = \frac{\Gamma^2}{2(\rho_{\text{typ}}g'(1) - 2g_2)} + O(\Gamma^3), \qquad (B34) $$

and it thus vanishes for $\Gamma = 0$.

Finally, in the special case $\Gamma = 0$, the CGF is given by a linear function for any $s \le s_t$, i.e.

$$ \phi(s) = -s e_c, \quad s \le s_t = \frac{1}{\sqrt{g'(1)}} \left( \frac{1}{\sqrt{\rho_{\text{typ}}}} - \sqrt{\rho_{\text{typ}}} \right). \qquad (B35) $$

# Appendix C: Analysis of the Different Phases

Let us now consider the expression of the large-deviation function and the stability in the different phases, namely replica-symmetric (RS), one-step replica symmetry broken (1RSB) and fully replica-symmetry broken phases (FRSB).

## C.1 Replica-Symmetric Phase

In the replica-symmetric (RS) phase, the function $z(q) = s$ for any $q \in [0, 1]$, which is equivalent to taking the limit $q_0 \to 1$. This yields a particularly simple expression for the functional to optimise

$$ \Phi_{\text{RS}}(s) = \frac{s}{2}(sf(1) + v f'(1)) + \frac{1}{2} \ln \left(1 + \frac{s}{v}\right). \qquad (C1) $$

Only the parameter $v$ is to be optimised, such that it satisfies the equation

$$ \partial_v \Phi_{\text{RS}}|_{v=v_*} = \frac{s}{2} \left( f'(1) - \frac{1}{v_*(s+v_*)} \right), \qquad (C2) $$

in agreement with Eq. (145) for the choice $z_*(q) = s$ for all $q \in [0, 1]$. From this expression, we obtain

$$ v = \frac{1}{2} \left( -s + \sqrt{\frac{4}{f'(1)} + s^2} \right), \qquad (C3) $$

which matches exactly the expression in Eq. (147) in the RS regime where $q_0^* = 1$. The cumulant generating function reads in the RS phase

$$ \phi_{\text{RS}}(s) = \frac{s^2}{4}(2f(1) - f'(1)) + \frac{sf'(1)}{4}\sqrt{\frac{4}{f'(1)} + s^2} $$
$$+ \ln \left[ \frac{\sqrt{f'(1)}}{2} \left( s + \sqrt{\frac{4}{f'(1)} + s^2} \right) \right]. \qquad (C4)$$

An analysis of the eigenvalues of the quadratic form $A_{(ab),(cd)}^{\text{RS}} = \frac{\delta^2 \Phi_n(Q)}{\delta Q_{ab} \delta Q_{cd}} \bigg|_{Q=Q_{\text{RS}}} \text{ defined in Eq. (128) reveals that the replica symmetric phase is stable for (see Appendix D for details)}$

$$\Lambda^{\text{RS}} = f''(1) - \frac{1}{v_*^2} < 0, \qquad (C5)$$

which gives a lower bound on the value of $s$ for the validity of the RS expression $\phi_{\text{RS}}(s)$ of the CGF

$$s \ge s_{\text{RSB}} = \frac{1}{\sqrt{f'(1)}} \left( \sqrt{\frac{f''(1)}{f'(1)}} - \sqrt{\frac{f'(1)}{f''(1)}} \right). \qquad (C6)$$

One can check that the third derivative of $\phi_{\text{RS}}(s)$ is positive

$$\phi_{\text{RS}}^{(3)}(s) = 2 \left( \frac{4}{f'(1)} + s^2 \right)^{3/2} > 0, \qquad (C7)$$

such that its second derivative is a growing function of $s$. For $s = s_{\text{RSB}}$, it reaches the value

$$\phi_{\text{RS}}''(s_{\text{RSB}}) = f(1) - \frac{f'(1)^2}{f'(1) + f''(1)}. \qquad (C8)$$

In order to show that this quantity is non-negative, one can use the nice identity (specialising to the case $q=1$)

$$\begin{aligned} & \frac{1}{2q} (x \partial_x - y \partial_y)^2 \bigg|_{x=y=q} f(x) f(y) = f(q)(q f''(q) + f'(q)) - q f'(q)^2 \\ & = \frac{1}{2} \sum_{r,p=2}^{\infty} g_r g_p (r-p)^2 q^{r+p-1} + \Gamma \sum_{r=2}^{\infty} g_r (r-1)^2 q^r \ge 0, \quad g_r \ge 0. \end{aligned} \qquad (C9)$$

Thus its value for $s = s_{\text{RSB}}$ gives a positive lower bound $\phi_{\text{RS}}''(s) \ge \phi_{\text{RS}}''(s_{\text{RSB}}) \ge 0$. Note that only in the case of the pure p-spin without magnetic field does one have $\phi_{\text{RS}}''(s_{\text{RSB}}) = 0$, this quantity is strictly positive for any other model. The function $\phi_{\text{RS}}(s)$ is thus convex throughout its domain of stability $s \ge s_{\text{RSB}}$. For fixed value of $s$, one can compute the associated energy $e_{*,\text{RS}} \equiv e_{*,\text{RS}}(s)$ given by

$$e_{*,\text{RS}}(s) = -\phi_{\text{RS}}'(s) = -sf(1) - \frac{f'(1)}{2} \left( -s + \sqrt{\frac{4}{f'(1)} + s^2} \right), \quad s \ge s_{\text{RSB}}. \qquad (C10)$$

In particular, if $s_{\text{RSB}} \le 0$, which using the expression $f(q) = g(q) + \Gamma q$ in Eq. (2), is equivalent to having a strong enough magnetic field

$$\Gamma \ge \Gamma_{\text{RSB}} = g''(1) - g'(1) = \sum_{r=2}^{\infty} r(r-2) g_r, \qquad (C11)$$

the typical and minimum energy can be recovered as

$$\bar{e}_{\text{min}} = e_{\text{typ}} = e_{*,\text{RS}}(0) = -\sqrt{g'(1) + \Gamma}, \quad \Gamma \ge \Gamma_{\text{RSB}}. \qquad (C12)$$
If that condition is met, one can compute higher-order cumulants from $\phi_{RS}(s)$ and in particular the rescaled variance

$$ \mathcal{V}_{\min}(\Gamma) = \lim_{N \to \infty} N \mathrm{Var}(e_{\min}) = \phi_{\mathrm{RS}}''(0) = g(1) + \frac{\Gamma - g'(1)}{2}, \quad \Gamma \ge \Gamma_{\mathrm{RSB}}. \quad (C13) $$

Note that $\Gamma_{RSB} \ge g'(1) - 2g(1)$ and the variance is thus always positive for $\Gamma \ge \Gamma_{RSB}$.

Let us now consider the LDF $\mathcal{L}(e)$ in the RS regime. The function $\mathcal{L}_{\mathrm{RS}}(e)$ is given by the Legendre transform of the function $\phi_{\mathrm{RS}}(s)$. As the function $e_{*,\mathrm{RS}}(s)$ is a strictly increasing function of $s$ (unless for the pure $p$-spin that will be considered separately), the identity in Eq. (C10) can be inverted exactly to express $s_* \equiv s_*(e)$ in terms of $e$ as

$$ \begin{aligned} s_{*,\mathrm{RS}}(e) &= -\mathcal{L}_{\mathrm{RS}}'(e) \\ &= \frac{1}{2(f'(1) - f(1))} \left[ 2e + \frac{f'(1)}{f(1)} \left( -e + \sqrt{e^2 - 4f(1) \left( 1 - \frac{f(1)}{f'(1)} \right)} \right) \right], \quad e \le e_{\mathrm{RSB}}. \end{aligned} \quad (C14) $$

where the condition of stability given by the lower bound $s_* \ge s_{\mathrm{RSB}}$ translates in terms of $e$ into the upper bound

$$ e \le e_{\mathrm{RSB}} = - \frac{1}{\sqrt{f''(1)}} \left[ f'(1) + f(1) \left( \frac{f''(1)}{f'(1)} - 1 \right) \right] < 0. \quad (C15) $$

The value $e_{\mathrm{RSB}}$ is a decreasing function of $\Gamma$ and is negative for $\Gamma = 0$,

$$ \begin{aligned} e_{\mathrm{RSB}}(\Gamma = 0) &= -\frac{1}{g'(1)\sqrt{g''(1)}} \sum_{k, p \ge 2} g_k g_p [kp + k(k-2)] < 0, \\ \partial_{\Gamma} e_{\mathrm{RSB}} &= -\frac{\sqrt{g''(1)}}{(\Gamma + g'(1))^2} \sum_{k \ge 2} g_k (k-1). \end{aligned} \quad (C16) $$

One can additionally show that

$$ e_{\mathrm{RSB}} \le e_{c,\mathrm{RS}} = -2\sqrt{f(1)\left(1 - \frac{f(1)}{f'(1)}\right)} < 0, \quad (C17) $$

by using the identity

$$ e_{\mathrm{RSB}}^2 - e_{c,\mathrm{RS}}^2 = \frac{1}{f''(1)} \left[ f'(1) - f(1) \left( \frac{f''(1)}{f'(1)} + 1 \right) \right]^2 \ge 0. \quad (C18) $$

Only for the pure $p$-spin model does one have that $e_{\mathrm{RSB}} = e_{c,\mathrm{RS}}$. Inserting the expression of $s_*$ into that of $v_*$, one similarly obtains

$$ v_* = - \frac{e + \sqrt{e^2 - e_{c,\mathrm{RS}}^2}}{2(f'(1) - f(1))}. \quad (C19) $$

Finally, the LDF is obtained in the regime of stability of the RS solution $e \le e_{\mathrm{RSB}} \le e_{c,\mathrm{RS}}$ as

$$ \begin{aligned} \mathcal{L}_{\mathrm{RS}}(e) &= -\min_{s \in \mathbb{R}} [se + \phi_{\mathrm{RS}}(s)] = s_* \phi_{\mathrm{RS}}'(s_*) - \phi_{\mathrm{RS}}(s_*) \\ &= \frac{1}{2} \left( s_*^2 f(1) + \frac{s_*}{s_* + v_*} - \ln \left( 1 + \frac{s_*}{v_*} \right) \right) \end{aligned} $$
$$
\begin{align}
&= \frac{s_*^2}{4} (2f(1) - f'(1)) + \frac{s_* f'(1)}{4} \sqrt{\frac{4}{f'(1)} + s_*^2} \nonumber \\
&\quad - \ln \left[ \frac{\sqrt{f'(1)}}{2} \left( s_* + \sqrt{\frac{4}{f'(1)} + s_*^2} \right) \right] \tag{C20} \\
&= -\frac{2f(1)}{f'(1)} \frac{e^2}{e_{c,RS}^2} + \frac{e}{e_{c,RS}^2} \left( e - \sqrt{e^2 - e_{c,RS}^2} \right) \nonumber \\
&\quad - \ln \left( \frac{e - \sqrt{e^2 - e_{c,RS}^2}}{e_{c,RS}} \right) + \frac{1}{2} \ln \frac{f(1)}{f'(1) - f(1)}. \tag{C21}
\end{align}
$$

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 $\Gamma \ge \Gamma_{RSB}$, the typical energy belongs to the RS phase and one can expand the LDF around its minimum as

$$ \mathcal{L}_{\text{RS}}(e) = \frac{(e + \sqrt{f'(1)})^2}{2f(1) - f'(1)} + o\left(e + \sqrt{f'(1)}\right)^2, \quad \Gamma \ge \Gamma_{\text{RSB}}. \qquad \text{(C22)} $$

The expression above can be re-written as

$$ N \mathcal{L}_{\text{RS}}(e) \approx \frac{(e - \bar{e}_{\min})^2}{2\mathcal{V}_{\min}(\Gamma)}, \quad |e - \bar{e}_{\min}| \ll 1, \qquad \text{(C23)} $$

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 [18].

As shown in Appendix E, the expression of the large deviation function in the RS phase $\mathcal{L}_{\text{RS}}(e)$ matches exactly the opposite of the annealed complexity of minima at fixed energy per degree of freedom $e$, defined as

$$ \Sigma_{\min}(e) = \lim_{N \to \infty} \frac{1}{N} \ln \overline{n_{\min}(e)} = -\mathcal{L}_{\text{RS}}(e), \qquad \text{(C24)} $$

where $n_{\min}(e)$ is the density of minima of the Hamiltonian $H(\mathbf{x})$ for a fixed value $e = H(\mathbf{x})/N$. In the replica-symmetric phase, as $\Sigma_{\min}(e) < 0$ for any $e \ne e_{\text{typ}}$, the probability to find a minimum of the Hamiltonian at an energy $e \ne e_{\text{typ}}$ is exponentially small and the LDF describing its occurrence is given by $-\Sigma_{\min}(e)$. As there is typically a single minimum of the Hamiltonian in the RS phase, if there is a minimum at energy $e \le e_{\text{RSB}}$, it must be the global minimum of the Hamiltonian. Hence the LDF describing its occurrence is $\mathcal{L}(e)$ and the identity in Eq. (C24) must hold.

For $\Gamma = 0$, and if $e_{\text{typ}}$ is given within the 1RSB scheme, one can additionally show that

$$ \mathcal{L}_{\text{RS}}(e_{\text{typ}}) = -\Sigma_{\min}(e_{\text{typ}}) = 0. \qquad \text{(C25)} $$

Indeed, inserting the expression given by Eq. (A18)

$$ e_{\text{typ}} = \frac{e_{c,RS}}{2} \left( \sqrt{\frac{(g'(1) - g(1))\rho_{\text{typ}}}{g(1)}} + \sqrt{\frac{g(1)}{(g'(1) - g(1))\rho_{\text{typ}}}} \right), $$
$$ \frac{g(1)}{g'(1)} = \rho_{\text{typ}} \frac{\rho_{\text{typ}} - 1 - \ln \rho_{\text{typ}}}{(1 - \rho_{\text{typ}})^2}, \qquad (\text{C26}) $$

into Eq. (C21), one obtains

$$ \mathcal{L}_{\text{RS}}(e_{\text{typ}}) = \frac{1}{2} \left[ \ln \rho_{\text{typ}} + (1 - \rho_{\text{typ}}) + \frac{g(1)}{g'(1)} \frac{(1 - \rho_{\text{typ}})^2}{\rho_{\text{typ}}} \right] = 0. \qquad (\text{C27}) $$

This identity can be understood using the identification $\mathcal{L}_{\text{RS}}(e) = -\Sigma_{\text{min}}(e)$. As $\Sigma_{\text{min}}(e) < 0$ for any $e < e_{\text{typ}}$, there is an exponentially small probability to find any minimum with energy $e < e_{\text{typ}}$ and if such minimum exists, it would naturally be the global minimum $e = e_{\text{min}}$. At the typical energy $e = e_{\text{typ}}$ instead, one expects that there is a sub-exponential number of minima (typically one), such that $\Sigma_{\text{min}}(e_{\text{typ}}) = 0$. Finally, at energy $e > e_{\text{typ}}$, one expects an exponentially large number of minima such that $\Sigma_{\text{min}}(e) > 0$ but these minima are not expected to be the global minimum $e > e_{\text{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 $\Gamma = 0$, one might suspect that for finite $\Gamma > 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.

## C.2 Full Replica-Symmetry Broken Phase

In the FRSB phase, there is no simplification and the expression of $\Phi(s)$ is directly given in Eq. (142). The saddle-point equations are given by Eqs. (144–145) complemented with a third equation, obtained by computing the functional derivative

$$ \left. \frac{\delta \Phi(s)}{\delta z(q)} \right|_{\text{s.p.}} = \frac{s}{2} \left( f'(q) - \int_{q_0^*}^q \frac{dr}{\left(v_* + \int_r^1 dt \, z_*(t)\right)^2} - \frac{q_0^*}{\left(v_* + \int_{q_0^*}^1 dq \, z_*(q)\right) \left(s q_0^* + v_* + \int_{q_0^*}^1 dq \, z_*(q)\right)} \right) = 0, \quad (\text{C28}) $$

and which must be valid for any $q \in (q_0^*, 1)$. One can check that taking the limit $q \to q_0^*$ in the above equation yields a result consistent with the first saddle-point equation (144) provided $s < z(q_0^*)$, and similarly taking the limit $q \to 1$ in the equation above, the equation matches exactly the second saddle-point equation (145). In the FRSB regime, the function $z(q)$ is continuous and strictly increasing in the range $q \in (q_0, 1)$. The solution can be determined by taking the derivative of Eq. (C28) with respect to $q$, yielding

$$ f''(q) = \frac{1}{\left(v_* + \int_q^1 dr \, z_*(r)\right)^2}, \quad q \in (q_0^*, 1], \qquad (\text{C29}) $$

which can simply be re-expressed as

$$ v_* + \int_q^1 dr \, z_*(r) = \frac{1}{\sqrt{f''(q)}}, \quad q \in (q_0^*, 1]. \qquad (\text{C30}) $$
Taking an additional derivative, one obtains an explicit expression for the function $z(q)$,

$$z_*(q) = \frac{f^{(3)}(q)}{2f''(q)^{3/2}}, \quad q \in (q_0^*, 1], \qquad (C31)$$

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

$$z'_*(q) = \frac{S[f'](q)}{2\sqrt{f''(q)}} = \frac{1}{2f''(q)^{5/2}} \left[ f''(q)f^{(4)}(q) - \frac{3}{2}f^{(3)}(q)^2 \right] \ge 0, \quad q \in (q_0^*, 1]. \qquad (C32)$$

Plugging the expression of $z_*(q)$ into Eq. (C30), it yields the expression of $v_*$, which reads

$$v_* = \frac{1}{\sqrt{f''(1)}}, \qquad (C33)$$

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 (144), one obtains

$$\left(s - \frac{f^{(3)}(q_0^*)}{2f''(q_0^*)^{3/2}}\right) \left(f'(q_0^*) - \frac{q_0^* f''(q_0^*)}{s\sqrt{f''(q_0^*)}q_0^* + 1}\right) = 0. \qquad (C34)$$

There are thus two possible solutions

$$s_1(q_0^*) = \frac{f^{(3)}(q_0^*)}{2f''(q_0^*)^{3/2}} \quad \text{or} \quad s_2(q_0^*) = \frac{1}{\sqrt{q_0^* f'(q_0^*)}} \left( \sqrt{\frac{q_0^* f''(q_0^*)}{f'(q_0^*)}} - \sqrt{\frac{f'(q_0^*)}{q_0^* f''(q_0^*)}} \right), \qquad (C35)$$

corresponding respectively to Eqs. (146) and (147). As we now argue, the correct solution is always given by $s = s_2(q_0^*)$. This solution satisfies

$$\begin{aligned} s'_2(q_0^*) &= \left( \frac{g''(q_0^*)}{g'(q_0^*) + \Gamma} + \frac{1}{q_0^*} \right) (z_*(q_0^*) - s_2(q_0^*)) \\ &= \frac{(\Gamma + g'(q_0^*) + q_0^* g''(q_0^*)) (\Gamma - \Gamma_0(q_0^*))}{2g''(q_0^*) q_0^*^2 (\Gamma + g'(q_0^*))^2 (2g''(q_0^*) + q_0^* g^{(3)}(q_0^*))}, \end{aligned} \qquad (C36)$$

where

$$\Gamma_0(q_0^*) = -g'(q_0^*) + \frac{2q_0^* g''(q_0^*)}{2g''(q_0^*) + g^{(3)}(q_0^*)}. \qquad (C37)$$

One can show that $\Gamma_0(0) = 0$, $\Gamma_0(1) = \Gamma_t$ and

$$\Gamma'_0(q_0^*) = - \frac{2q_0^* g''(q_0^*)}{(2g''(q_0^*) + q_0^* g^{(3)}(q_0^*))^2} S[g'](q_0^*) \le 0. \qquad (C38)$$

Thus, one obtains that for any $q_0^* \in [0, 1]$, one has $\Gamma_0(q_0^*) \le 0$ which ensures that for any $\Gamma \ge 0$ the solution $s'_2(q_0^*) \ge 0$ and $s_2(q_0^*) \le z_*(q_0^*)$. The solution $s_2(q_0^*)$ can take either sign and satisfies $s_2(q_{typ}) = 0$, thus we expect that this is the correct solution.

Using the expressions for $v_*$ and $z_*(q)$, the CGF $\phi(s)$ reads in the FRSB phase

$$\phi_{\text{FRSB}}(s) = \frac{s}{2} \left[ s f(q_0^*) + \frac{f'(q_0^*)}{\sqrt{f''(q_0^*)}} + 2 \int_{q_0^*}^{1} dq \sqrt{f''(q)} \right] + \frac{1}{2} \ln \left( 1 + s q_0^* \sqrt{f''(q_0^*)} \right), \qquad (C39)$$
$$ = \frac{q_0^* f''(q_0^*) - f'(q_0^*)}{2q_0^* f'(q_0^*) \sqrt{f''(q_0^*)}} \left[ \frac{f(q_0^*) (q_0^* f''(q_0^*) - f'(q_0^*)) + q_0^* f'(q_0^*)^2}{q_0^* f'(q_0^*) \sqrt{f''(q_0^*)}} + 2 \int_{q_0^*}^{1} dq \sqrt{f''(q)} \right] \\ + \frac{1}{2} \ln \left( \frac{q_0^* f''(q_0^*)}{f'(q_0^*)} \right). \quad (C40) $$

where $q_0^*$ is the inverse function of $s = s_2(q_0^*) \equiv 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$,

$$ \phi''_{\text{FRSB}}(s) = f(q_0^*) - \frac{q_0^* f'(q_0^*)^2}{f'(q_0^*) + q_0^* f''(q_0^*)} \ge 0, \quad (C41) $$

which can be shown to be positive using Eq. (C9). The first derivative of the CGF gives the associated value of the energy as

$$ e_{*,\text{FRSB}}(s) = -\phi'_{\text{FRSB}}(s) = -\left[ \int_{q_0^*}^{1} dq \sqrt{f''(q)} + \frac{1}{\sqrt{f''(q_0^*)}} \left( f'(q_0^*) + f(q_0^*) \left( \frac{f''(q_0^*)}{f'(q_0^*)} - \frac{1}{q_0^*} \right) \right) \right]. \quad (C42) $$

One can obviously show that $\partial_s e_{*,\text{FRSB}}(s) = -\phi''_{\text{FRSB}}(s) \le 0$ from Eq. (C41), while $\partial_{q_0^*} e_{*,\text{FRSB}}(s) = -\phi''_{\text{FRSB}}(s) \times s_2'(q_0^*) \le 0$ using that we have shown above that $s_2'(q_0^*) \ge 0$. For $s = 0$ (corresponding to $q_0^* = q_{\text{typ}}$ with $q_{\text{typ}}f''(q_{\text{typ}}) = f'(q_{\text{typ}})$) goes to the typical energy

$$ e_{\text{typ}} = e_{*,\text{FRSB}}(s=0) = -\left[ \int_{q_{\text{typ}}}^{1} dq \sqrt{f''(q)} + q_{\text{typ}} \sqrt{f''(q_{\text{typ}})} \right]. \quad (C43) $$

For $s = s_{\text{RSB}}$, it goes to $e_{\text{RSB}}$ (corresponding to $q_0^* = 1$). For $\Gamma > 0$ it goes to a finite value

$$ e_c = \lim_{s \to -\infty} e_{*,\text{FRSB}}(s) = - \int_0^1 dq \sqrt{f''(q)}, \quad (C44) $$

as $s \to -\infty$ (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_{\text{typ}}f''(q_{\text{typ}}) = f'(q_{\text{typ}})$, one can further obtain the variance for finite magnetic field as

$$ \mathcal{V}_{\min}(\Gamma) = \lim_{N \to \infty} N \text{Var}(e_{\min}) = \phi''_{\text{FRSB}}(0) = g(q_{\text{typ}}) + \frac{q_{\text{typ}}(\Gamma - g'(q_{\text{typ}}))}{2}. \quad (C45) $$

If the covariance function $f(q) = g(q) + \Gamma q$ scales as $q \to 0$ as

$$ f(q) = \Gamma q + g_2 q^2 + g_p q^r + o(q^r), \quad (C46) $$

with $r > 2$ the exponent of the leading order correction to the quadratic behaviour, one expects that

$$ q_{\text{typ}}^* \approx \left( \frac{\Gamma}{r(r-2)g_r} \right)^{\frac{1}{r-1}}, \quad \Gamma \to 0, \quad (C47) $$

and the variance scales as

$$ \mathcal{V}_{\min}(\Gamma) = \lim_{N \to \infty} N \text{Var}(e_{\min}) = \frac{g_r}{2} (r-1)(r-2) \left( \frac{\Gamma}{g_r r(r-2)} \right)^{\frac{r}{r-1}}, \quad \Gamma \to 0. \quad (C48) $$
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

$$ \mathcal{L}_{\text{FRSB}}(e) = s_* \phi'_{\text{FRSB}}(s_*) - \phi_{\text{FRSB}}(s_*) = \frac{1}{2} \left[ s_*^2 f(q_0^*) + 1 - \frac{1}{1 + s_* q_0^* \sqrt{f''(q_0^*)}} - \ln \left( 1 + s_* q_0^* \sqrt{f''(q_0^*)} \right) \right] \quad (C49) $$

$$ = \frac{1}{2} \left[ \frac{f(q_0^*)}{f''(q_0^*)} \left( \frac{f''(q_0^*)}{f'(q_0^*)} - \frac{1}{q_0^*} \right)^2 + 1 - \frac{f'(q_0^*)}{q_0^* f''(q_0^*)} - \ln \left( \frac{q_0^* f''(q_0^*)}{f'(q_0^*)} \right) \right] . \quad (C50) $$

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 $\mathcal{L}_{\text{FRSB}}(e)$, as can be shown using that $\mathcal{L}'_{\text{FRSB}}(e) = -s_{*,\text{FRSB}}(e)$ vanishes only for $e = e_{typ}$, i.e. $q_0^* = q_{typ}$, and that $\mathcal{L}''_{\text{FRSB}}(e) = \phi''_{\text{FRSB}}(s_{*,\text{FRSB}}(e))^{-1} > 0$. This yields in particular that $\mathcal{L}_{\text{FRSB}}(e_{\text{RSB}}) > 0$ for $\Gamma < \Gamma_{\text{RSB}}$. There are three cases.

Non zero magnetic field $\Gamma > 0$. Then one must have that $q_{typ} > 0$, and expanding the LDF around its minimum, one obtains

$$ \mathcal{L}_{\text{FRSB}}(e) = \frac{(e - e_{\text{typ}})^2}{2\mathcal{V}_{\min}(\Gamma)} + o((e - e_{\text{typ}})^2), \quad \Gamma > 0. \quad (C51) $$

The LDF diverges logarithmically for finite magnetic field as $e \to e_c$ (corresponding to $q_0^* \to 0$) with

$$ \mathcal{L}_{\text{FRSB}}(e) = -\frac{1}{2} \ln \frac{2\sqrt{2g_2}(e_c - e)}{\Gamma} - \frac{3}{4} + O(e_c - e), \quad \Gamma > 0. \quad (C52) $$

Zero magnetic field $\Gamma = 0$. For zero magnetic field $\Gamma = 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.

(i) Supposing that $g_3 = 3!f^{(3)}(0) > 0$ as well as $g_4 = 4!f^{(4)}(0) > 0$ (ensuring that the Schwarzian derivative appearing in Eq. (C32) is positive), one can expand the expression of $e$ in Eq. (C42) and (C50) for $q_0^* \to 0$. One obtains that both $e_c - e$ and $\mathcal{L}_{\text{FRSB}}(e)$ scale as $q_0^{*4}$, and one thus obtains the following linear behaviour

$$ \mathcal{L}_{\text{FRSB}}(e) = z_*(0)(e_c - e) + o(e_c - e), \quad \Gamma = 0, \quad e < e_c, \quad (C53) $$

where we remind that $z_*(0) = \frac{f^{(3)}(0)}{2f''(0)^{3/2}}$. In that case, one expects that the CGF is given in the regime $s \in (-\infty, z_*(0)]$ by the linear function

$$ \phi_{\text{FRSB}}(s) = -s e_c. \quad (C54) $$

It displays a fifth order phase transition for $s = z_*(0)$, namely the function $\phi_{\text{FRSB}}(s)$ and its fourth first derivatives are continuous for $s = z_*(0)$, while its fifth derivative is discontinuous

$$ \phi_{\text{FRSB}}^{(5)}(s = z_*(0)_-) = 0 \neq \phi_{\text{FRSB}}^{(5)}(s = z_*(0)_+) = \frac{9 f''(0)^{3/2} f^{(3)}(0)}{160 S[g'](0)^3} > 0. \quad (C55) $$
(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

$$ \mathcal{L}_{\text{FRSB}}(e) = \xi_r (e_c - e)^\eta + o(e_c - e)^\eta, \quad \eta = \frac{3(r-2)}{2r-3}, \qquad (\text{C56}) $$

where

$$ \xi_r = 2^{\frac{r-12}{2(2r-3)}} \left( \frac{r(2r-3)}{r-2} \right)^{\frac{3(r-2)}{2r-3}} \frac{(r-3)^{-\frac{r-3}{2r-3}} (r(r-2)g_r)^{\frac{3}{2r-3}}}{3rg_2^{\frac{3r}{2(2r-3)}}}. \qquad (\text{C57}) $$

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/\eta})$ with $\eta_r = \frac{3(r-2)}{2r-3}$. More precisely we conjecture that the PDF of the ground-state energy $\mathcal{P}(e)$ takes the following scaling form in the regime of typical fluctuations

$$ \mathcal{P}(e) = N^{1/\eta_r} p(N^{1/\eta_r}(e - e_c)), \quad \text{where } p(\delta) \sim e^{-\xi_r |\delta|^{\eta_r}}, \quad \delta \to -\infty. \qquad (\text{C58}) $$

Note that the emergence of a non-trivial exponent $\eta$ 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 \to \infty$, the exponent $3/2$ and correct prefactor $\xi_\infty = 2/3 \times 2^{3/2}$ match smoothly the TW tail.

**Scaling regime** $\Gamma \to 0$. As $\Gamma \to 0$, the typical ground-state energy approaches $e_c$ as

$$ e_{\text{typ}} - e_c \approx -\frac{\Gamma}{2\sqrt{2g_2}} + o(\Gamma). \qquad (\text{C59}) $$

In the limit $\Gamma \to 0$, for energies in the range $e \in [e_c, e_{\text{typ}}]$, the LDF takes the scaling form

$$ \begin{gathered} \mathcal{L}(e) \approx G\left(\frac{\sqrt{2g_2}(e - e_c)}{\Gamma}\right), \\ G(z) = -\frac{1}{4}(3 + 8z + 4z^2 + 2\ln(-2z)), \quad z \in [z_{\text{typ}}, 0], \end{gathered} \qquad (\text{C60}) $$

with $z_{\text{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_{\text{typ}}$ allowing to smoothly interpolate between the quadratic behaviour for $\Gamma > 0$ and the non-trivial behaviour in Eq. (C56)

$$ (e_{\text{typ}}(\Gamma = 0) - e)^{\frac{3(r-2)}{2r-3}} \sim \frac{(e_{\text{typ}}(\Gamma) - e)^2}{V_{\min}(\Gamma)} \Rightarrow e_{\text{typ}}(\Gamma) - e \sim \Gamma^{\frac{2r-3}{r-1}}. \qquad (\text{C61}) $$

The typical energy gap between $e_{\text{typ}}$ and $e_c$ in the limit $\Gamma \to 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_{\text{typ}}$ for $\Gamma \to 0$, where the LDF takes the scaling form

$$ \mathcal{L}(e) = \Gamma^{\frac{3(r-2)}{r-1}} L_{\text{FRSB}} \left( \frac{e - e_{\text{typ}}(\Gamma)}{\Gamma^{\frac{2r-3}{r-1}}} \right), \qquad (\text{C62}) $$
where the function $L_{\text{FRSB}}(u)$ is determined parametrically as

$$L_{\text{FRSB}}(u) = (g_r r(r-2))^{\frac{3}{r-1}} \frac{(1-x(u)^{r-1})^2 ((r-3)x(u)^{r-1} + 2r)}{96rg_2^3 x(u)^3} \quad (\text{C63})$$

$$-u = \frac{(r(r-2)g_r)^{\frac{1}{r-1}}}{8\sqrt{2}g_2^{3/2}x(u)} \left( \frac{(r-3)(r-2)}{r(2r-3)} x(u)^{2(r-1)} + \frac{r(r-1)-4}{r(r-2)} x(u)^{r-1} + \frac{(r-1)^2}{(2r-3)(r-2)} x(u) - 2 \right), \quad (\text{C64})$$

where $x(u) = q_0^*/q_{\text{typ}}$ in that limit $\Gamma \to 0$.

In particular, the function $L_{\text{FRSB}}(u)$ has the asymptotic behaviours

$$L_{\text{FRSB}}(u) \approx \begin{cases} 2 \frac{r-12}{2(2r-3)} \left( \frac{r(2r-3)}{r-2} \right)^{\frac{3(r-2)}{2r-3}} \frac{(r-3)^{-\frac{r-3}{2r-3}} (r(r-2)g_r)^{\frac{3}{2r-3}}}{3rg_2^{\frac{3r}{2(2r-3)}}} |u|^{\frac{3(r-2)}{2r-3}}, & u \to -\infty, \\ \frac{g_2^{3/2} r (r(r-2)g_r)^{\frac{1}{r-1}}}{r-1} u^2, & u \to 0, \\ \frac{8\sqrt{2}}{3} g_2^{3/2} u^3, & u \to +\infty, \end{cases} \quad (\text{C65})$$

One can check that the limit $u \to -\infty$ (first line) matches the $\Gamma = 0$ limit given in (C56), and that the limit $u \to +\infty$ (last line) matches the result (C60) and the behaviour of the function $G(z) \simeq \frac{4}{3}(z + \frac{1}{2})^3$ when $z \to z_{\text{typ}}^+ = -\frac{1}{2}^+$. Finally, the second line matches smoothly the quadratic behaviour of the LDF in Eq. (C51) as $e \to e_{\text{typ}}$ for $\Gamma > 0$.

Expanding the energy difference $e - e_{\text{RSB}}$ and $L_{\text{FRSB}}(e)$ for $q_0^* \to 1$, one can obtain the Taylor series of $L_{\text{FRSB}}(e)$ as $e \to e_{\text{RSB}}$. Comparing with that of $L_{\text{RS}}(e)$, one can show that the LDF displays a third order phase transition as $e \to e_{\text{RSB}}$ with

$$\mathcal{L}_{\text{FRSB}}(e) - \mathcal{L}_{\text{RS}}(e) = - \frac{f'(1)^3 f''(1)^{5/2} (f'(1) - f''(1))(e - e_{\text{RSB}})^3}{3 (f'(1)(f''(1) + f'(1)) - f'(1)^2)^3 (f'(1)(f'''(1) + 2f''(1)) - 2f''(1)^2) + o(e - e_{\text{RSB}})^3}. \quad (\text{C66})$$

For any model such that the Schwarzsian derivative $S[f'](q)$ of the derivative of the covariance function $f'(q)$ is positive for all $q \in [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 Schwarzsian derivative $S[f'](q)$ changes sign over the interval $q \in [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

$$\begin{aligned} f(q) &= \Gamma q + g(q), \quad g(q) = \frac{q^2}{2} + g_3 q^3 + g_4 q^4, \quad 0 \le g_4 \le \frac{1}{24}, \\ 0 \le g_3 &\le \frac{2}{3} \left( \sqrt{g_4(1-8g_4)} - 4g_4 \right). \end{aligned} \quad (\text{C67})$$
In Fig. 7, we plot the LDF $\mathcal{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 $\Gamma = 0, 1/16, 3/4$. For the first two values of $\Gamma$, the typical energy $e_{typ}$, where $\mathcal{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 \in (0, 1)$.

### C.3 One-Step Replica-Symmetry Broken Phase

In the one-step replica-symmetry broken (1RSB) phase, the function $z(q)$ is piece-wise constant with

$$z(q) = \begin{cases} s, & 0 \le q < q_0, \\ m_0, & q_0 \le q < 1, \end{cases} \qquad (C68)$$

where $m_0 \ge s$ and the value $0 < q_0 < 1$. To obtain the 1RSB expression of the CGF, we need to use Eq. (143) and optimise the functional

$$\Phi_{1\text{RSB}}(s) = \frac{1}{2} \left[ m_0 s f(1) + v s f'(1) + s(s - m_0) f(q_0) + \frac{s}{m_0} \ln \left( 1 + \frac{m_0(1 - q_0)}{v} \right) \right. \\ \left. + \ln \left( 1 + \frac{s q_0}{v + m_0(1 - q_0)} \right) \right], \qquad (C69)$$

and there are three parameters to optimise over, namely $m_0 \ge s, v \ge 0$ and $q_0 \in [0, 1]$. The saddle-point equations read

$$\partial_v \Phi_{1\text{RSB}}|_{\text{s.p.}} = \frac{s}{2} \left( f'(1) - \frac{1 - q_0^*}{v(v + m_0^*(1 - q_0^*))} - \frac{q_0^*}{(v + m_0^*(1 - q_0^*)) (v + m_0^*(1 - q_0^*) + s q_0^*)} \right) = 0, \qquad (C70)$$

$$\partial_{q_0} \Phi_{1\text{RSB}}|_{\text{s.p.}} = \frac{s(s - m_0^*)}{2} \left( f'(q_0^*) - \frac{q_0^*}{(v + m_0^*(1 - q_0^*)) (v + m_0^*(1 - q_0^*) + s q_0^*)} \right) = 0, \qquad (C71)$$

$$\partial_{m_0} \Phi_{1\text{RSB}}|_{\text{s.p.}} = \frac{s}{2} \left( f(1) - f(q_0^*) - \frac{1}{m_0^{*2}} \ln \left( 1 + \frac{m_0^*(1 - q_0^*)}{v} \right) \right. \\ \left. + \frac{(1 - q_0^*)(v + s q_0^* + m_0^*(1 - 2q_0^*))}{m_0^*(v + m_0^*(1 - q_0^*)) (v + m_0^*(1 - q_0^*) + s q_0^*)} \right) = 0. \qquad (C72)$$

Note that the first two saddle-point equations (C70,C71) are recovered by inserting the 1RSB ansatz for $z(q)$ into Eqs. (144–145). The transition to the RS phase occurs either as the optimal value $q_0^* \to 1$ or $m_0^* \to s$. In each of these two cases, one can check that the saddle point equations (C70–C71–C72) and the expression of $\Phi_{1\text{RSB}}(s)$ (C69) coincide respectively with the RS saddle-point equation (C2) and the expression of $\Phi_{\text{RS}}(s)$ in (C1). In order to obtain an expression that differs from the RS expression, we suppose that $m_0^* \neq s$. As mentioned for general level of replica-symmetry, the saddle-point equation (C71) thus yields the condition
in (147)

$$v_* + \int_{q_0^*}^1 dq \, z_*(q) = v_* + (1 - q_0^*)m_0^* = \frac{q_0^*}{2} \left( -s + \sqrt{\frac{4}{q_0^* f'(q_0^*)} + s^2} \right). \quad (C73)$$

The saddle-point equation (C70) yields on the other hand the simple identity (148)

$$\int_{q_0^*}^1 \frac{dq}{(v_* + \int_q^1 dr \, z_*(r))^2} = \frac{1 - q_0^*}{v_*(v_* + (1 - q_0^*)m_0^*)} = f'(1) - f'(q_0^*). \quad (C74)$$

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

$$s = \frac{1}{\sqrt{q_0^* f'(q_0^*)}} \left( \frac{1}{\sqrt{\alpha(q_0^*)}} - \sqrt{\alpha(q_0^*)} \right), \quad (C75)$$

$$v_* = \rho(q_0^*) \sqrt{\frac{q_0^*}{f'(q_0^*) \alpha(q_0^*)}}, \quad (C76)$$

$$m_0^* = \frac{1}{1 - q_0^*} \sqrt{\frac{q_0^* \rho(q_0^*)}{f'(q_0^*)}} \left( \sqrt{\frac{\alpha(q_0^*)}{\rho(q_0^*)}} - \sqrt{\frac{\rho(q_0^*)}{\alpha(q_0^*)}} \right), \quad (C77)$$

where $\alpha(q_0^*)$ will be determined by the last saddle-point equation (C72) and the function $\rho(q)$, introduced when presenting the results on the typical energy, reads

$$\rho(q) = \frac{(1-q)f'(q)}{(f'(1) - f'(q))q}. \quad (C78)$$

The parametrisation above ensures that Eqs. (C70–C71) are fulfilled while the remaining equation (C72) yields the following relation between $\alpha$ and $q_0^*$,

$$\mu(q_0^*) = \rho(q_0^*) \frac{\rho(q_0^*) - \alpha(q_0^*) - \alpha(q_0^*) \ln(\rho(q_0^*)/\alpha(q_0^*))}{(\alpha(q_0^*) - \rho(q_0^*))^2}, \quad (C79)$$

where the function

$$\mu(q) = \frac{1}{f'(1) - f'(q)} \left( \frac{f(1) - f(q)}{1 - q} - f'(q) \right). \quad (C80)$$

Note that the function $\mu(q)$ is completely independent of the magnetic field $\Gamma$ as can be checked by invariance of the above definition when replacing $f(q) \rightarrow f(q) + \Gamma q$. As mentioned when considering the typical energy, the function $\mu(q)$ is an increasing function of $q$ as can be shown by computing its derivative

$$\mu'(q) = \frac{(f'(1) - f'(q))(f(1) - f(q) - (1-q)f'(q)) + (1-q)((1-q)f'(1) - f(1) + f(q))f''(q)}{(1-q)^2(f'(1) - f'(q))^2}, \quad (C81)$$

and using the identities

$$f(1) - f(q) - (1 - q)f'(q) = (1 - q) \sum_{p=2}^{\infty} g_p \sum_{k=0}^{p-1} (q^k - q^{p-1}) \geq 0, \quad (C82)$$
$$ (1 - q)f'(1) - f(1) + f(q) = (1 - q) \sum_{p=2}^{\infty} g_p \sum_{k=0}^{p-1} (1 - q^k) \geq 0. \qquad (C83) $$

The function $\mu(q)$ is monotonously increasing apart from the singular case of the 2-spin, where $\mu(q) = 1/2$ for any value of $q$, and this will play a role in the analysis below. Thus for any $q \in [0, 1]$, one has

$$ 0 < \mu(0) = \frac{g(1)}{g'(1)} \leq \mu(q) \leq \mu(1) = \frac{1}{2}. \qquad (C84) $$

Note that $g'(1) - 2g(1) = \sum_{r \geq 2} (r-2)g_r \geq 0$, such that $g(1)/g'(1) \leq 1/2$.

Let us now consider the function $\rho(q)$ appearing in Eq. (C79). For a magnetic field

$$ \Gamma \geq \Gamma_t = \frac{2g''(1)^2}{2g''(1) + g^{(3)}(1)} - g'(1), \quad \text{where} \quad \Gamma_{\text{RSB}} > \Gamma_t, \qquad (C85) $$

the function $\rho(q)$ is monotonously decreasing in the interval $q \in [0, 1]$, such that its minimum over this interval is reached in $q_m(\Gamma \geq \Gamma_t) = 1$. For a smaller magnetic field $\Gamma < \Gamma_t$, the function $\rho(q)$ is decreasing for $q$ smaller than its unique minimum $0 \leq q_m(\Gamma < \Gamma_t) < 1$ and is increasing for $q \geq q_m(\Gamma)$. For any positive magnetic field, it diverges at the origin with $q\rho(q) \to \Gamma/g'(1)$ and reaches a finite value $\rho(1) = f'(1)/f''(1)$ for $q \to 1$.

Finally, the last function $\alpha(q)$ appearing in Eq. (C79) can be shown to satisfy $0 \leq \rho(q_0^*) \leq \alpha(q_0^*)$ for any value of $q_0^* \in [0, 1]$ in order to ensure that $g(1)/g'(1) \leq \mu(q_0^*) \leq 1/2$. Using the same equation, one can also compute explicitly

$$ \frac{\alpha'(q_0^*)}{\alpha(q_0^*)} = \frac{\rho'(q_0^*)}{\rho(q_0^*)} - \frac{(\alpha(q_0^*) - \rho(q_0^*))^3 \mu'(q_0^*)}{\alpha(q_0^*) \rho(q_0^*) [2(\rho(q_0^*) - \alpha(q_0^*)) - (\alpha(q_0^*) + \rho(q_0^*)) \ln(\rho(q_0^*)/\alpha(q_0^*))]} \\ \leq \frac{\rho'(q_0^*)}{\rho(q_0^*)}, \qquad (C86) $$

where we have used that $\mu'(q_0^*) \geq 0$ and $0 \leq \rho(q_0^*) \leq \alpha(q_0^*)$. This yields that the function $\alpha(q_0^*)$ is a decreasing function of $q_0^*$, at least in the interval $[0, q_m(\Gamma)]$. In the following, we will show that it will be sufficient to consider the 1RSB solution only in this regime $0 \leq q_0^* \leq q_m(\Gamma)$.

Using the parametrisation introduced above, the CGF is expressed within the 1RSB framework as

$$ \begin{aligned} \phi_{\text{1RSB}}(s) &= \frac{1}{2} \left[ m_0^* s f(1) + v_* s f'(1) + s(s - m_0^*) f(q_0^*) + \frac{s}{m_0^*} \ln \left( 1 + \frac{m_0^* (1 - q_0^*)}{v_*} \right) \right. \\ & \qquad \left. + \ln \left( 1 + \frac{s q_0^*}{v_* + m_0^* (1 - q_0^*)} \right) \right], \\ &= \frac{1}{4} \left( 1 + \frac{f(q_0^*) - q_0^* f(1)}{q_0^* (1 - q_0^*) f'(q_0^*)} + 2 \frac{f(q_0^*) - f(1) - (q_0^* - 1) f'(1)}{q_0^* (f'(1) - f'(q_0^*))} \right) q_0^* f'(q_0^*) s^2 \\ & \qquad + \frac{1}{4} \left( -1 + 2 \frac{f(q_0^*) - f(1) - (q_0^* - 1) f'(1)}{q_0^* (f'(1) - f'(q_0^*))} \right. \\ & \qquad \left. + \frac{f(1) - f(q_0^*)}{(1 - q_0^*) f'(q_0^*)} \right) s \sqrt{q_0^* f'(q_0^*) (4 + q_0^* f'(q_0^*) s^2)} \\ & \qquad \left. + \ln \left( \frac{s \sqrt{q_0^* f'(q_0^*)} + \sqrt{4 + q_0^* f'(q_0^*) s^2}}{2} \right) \right], \end{aligned} \qquad (C87) $$
where the value of $q_0^*$ for a fixed $s$ is obtained by inverting Eq. (C75) using the expression of $\alpha(q_0^*)$ obtained from Eq. (C79).

Computing its first derivative allows to express the associated value of the energy for fixed $s$,

$$e_{*, \text{1RSB}}(s) = -\phi'_{\text{1RSB}}(s) = \frac{(1 - q_0^*)\mu(q_0^*)f'(1) - f(1) + [f(1) - \mu(q_0^*)f'(1) - (1 - \mu(q_0^*))f'(q_0^*)]\alpha(q_0^*)}{\sqrt{q_0^* f'(q_0^*)\alpha(q_0^*)}} \quad (C88)$$

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_{\text{typ}}$, one obtains the rescaled variance, which takes the very simple expression

$$\mathcal{V}_{\min}(\Gamma) = \lim_{N \to \infty} N \text{Var}(e_{\min}) = \phi''_{\text{1RSB}}(0) = g(q_{\text{typ}}) + \frac{q_{\text{typ}}(\Gamma - g'(q_{\text{typ}}))}{2} \quad (C89)$$

It is quite interesting to note, as already obtained in (151), 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_{\text{typ}}$. The typical overlap $q_{\text{typ}}$ is however obtained in a distinct manner in each of the three schemes: $q_{\text{typ}} = 1$ in the RS scheme, $q_{\text{typ}}$ is the solution of $q_{\text{typ}}f''(q_{\text{typ}}) = f'(q_{\text{typ}})$ in the FRSB scheme, and $q_{\text{typ}}$ is the solution of Eq. (C79), i.e. $q_0^* \to q_{\text{typ}}$, satisfying $\alpha(q_{\text{typ}}) = 1$ in the 1RSB scheme.

In the limit $\Gamma \to 0$, the typical overlap $q_{\text{typ}} \approx \Gamma/(\rho_{\text{typ}}g'(1) - 2g_2)$, where $\rho_{\text{typ}} = \rho(q_{\text{typ}})$ is the solution of Eq. (C79) satisfying $\alpha(q_{\text{typ}}) = 1$ in the limit $q_{\text{typ}} \to 0$, and the variance scales as

$$\mathcal{V}_{\min}(\Gamma) = \frac{\Gamma^2}{2(\rho_{\text{typ}}g'(1) - 2g_2)} + O(\Gamma^3). \quad (C90)$$

Using Eq. (C88) above, one can express $e$ in terms of $q_0^*$ and $\alpha(q_0^*)$, where $\alpha(q_0^*)$ is obtained from Eq. (C79), and compute explicitly the LDF $\mathcal{L}_{\text{1RSB}}(e)$ within the 1RSB framework as

$$\mathcal{L}_{\text{1RSB}}(e) = - \min_{s \le s_{\text{RSB}}} [se + \phi_{\text{1RSB}}(s)] = s_* \phi'_{\text{1RSB}}(s_*) - \phi_{\text{1RSB}}(s_*) \quad (C91)$$

$$= \frac{s_*^2}{4} (2f(q_0^*) - q_0^* f'(q_0^*)) + \frac{s_* q_0^* f'(q_0^*)}{4} \sqrt{\frac{4}{q_0^* f'(q_0^*)} + s_*^2} \\ - \ln \left[ \frac{\sqrt{q_0^* f'(q_0^*)}}{2} \left( s_* + \sqrt{\frac{4}{q_0^* f'(q_0^*)} + s_*^2} \right) \right], \\ = \frac{1}{2} \left( 1 - \alpha(q_0^*) + \ln \alpha(q_0^*) + \frac{f(q_0^*)}{q_0^* f'(q_0^*)} \frac{(1 - \alpha(q_0^*)^2)}{\alpha(q_0^*)} \right) . \quad (C92)$$

For any $\Gamma > 0$, in the limit $e \to e_c$, corresponding to $q_0^* \to 0$, the LDF diverges logarithmically as

$$\mathcal{L}_{\text{1RSB}}(e) \approx \frac{1}{2} \ln \frac{2\sqrt{\rho_{\text{typ}}g'(1)(e_c - e)}}{\Gamma} - \frac{1}{2} - \frac{g_2}{2g'(1)\rho_{\text{typ}}}, \quad e \to e_c. \quad (C93)$$

For $\Gamma = 0$ instead, as we will see in more details below, the 1RSB regime is limited to the single point $e = e_c = e_{\text{typ}}(\Gamma = 0)$, where the LDF vanishes.
Let us now discuss in more details the transition from the RS expression to the 1RSB expressions for $\phi(s)$ and $\mathcal{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 $\Gamma$.

### C.3.1 Large Magnetic Field $\Gamma > \Gamma_t$

For large magnetic field

$$ \Gamma \geq \Gamma_t = \frac{2g''(1)^2}{2g''(1) + g^{(3)}(1)} - g'(1), \qquad (C94) $$

the transition from the RS to the RSB phase occurs when the parameter $q_0^*$ reaches the value $q_0^* = 1$ at the transition. In terms of values of $s$ when considering $\phi(s)$ and of $e$ when considering $\mathcal{L}(e)$, these transitions thus occur respectively for $s = s_{RSB}$ and $e = e_{RSB}$ (as already predicted within the RS framework), which take the value

$$ \begin{aligned} s_{RSB} &= \frac{1}{\sqrt{f'(1)}} \left( \sqrt{\frac{f''(1)}{f'(1)}} - \sqrt{\frac{f'(1)}{f''(1)}} \right), \\ e_{RSB} &= -\frac{1}{\sqrt{f''(1)}} \left[ f'(1) - f(1) + f(1) \frac{f''(1)}{f'(1)} \right]. \end{aligned} \qquad (C95) $$

These formulae can easily be shown to coincide with the expressions of Eqs. (C75–C79–C88) for $q_0^* = 1$, where $\mu(1) = 1/2$ and $\rho(1) = \alpha(1) = f'(1)/f''(1)$. Expanding the value of $q_0^*$ in the regime $s \to s_{RSB}$, one finds

$$ q_0^* = 1 - \frac{(g'(1) + \Gamma)^2 (g'(1) + \Gamma_t) (s_{RSB} - s)}{\sqrt{g''(1)(\Gamma - \Gamma_t)} (g''(1) + g'(1) + \Gamma)} + O(s - s_{RSB})^2. \qquad (C96) $$

Expanding the expressions of $\phi_{1RSB}(s)$ and $\phi_{RS}(s)$ about $s = s_{RSB}$, one can show that the transition of the CGF occurring for $s = s_{RSB}$ is of third order with

$$ \phi_{1RSB}(s) - \phi_{RS}(s) = \frac{\sqrt{g''(1)} (\Gamma + g'(1))^3 (\Gamma_t + g'(1)) (\Gamma_{RSB} - \Gamma)}{6 (\Gamma - \Gamma_t) (\Gamma + g''(1) + g'(1))^3} (s - s_{RSB})^3 + O(s - s_{RSB})^4. \qquad (C97) $$

Expanding similarly the functions $\mathcal{L}_{1RSB}(e)$ and $\mathcal{L}_{RS}(e)$, one can similarly obtain that the transition is of third order with

$$ \mathcal{L}_{1RSB}(e) - \mathcal{L}_{RS}(e) = \frac{\sqrt{g''(1)} (\Gamma + g'(1))^3 (g'(1) + \Gamma_t) (\Gamma - \Gamma_{RSB})}{6(\Gamma_t - \Gamma) ((\Gamma + g(1))g''(1) + (g(1) - g'(1)) (\Gamma + g'(1)))^3} (e - e_{RSB})^3 + O(e - e_{RSB})^4. \qquad (C98) $$

The divergence of the prefactor in both expressions for $\Gamma = \Gamma_t$ is related to the change in the order of the transition that will be considered in more details in the next section. Exactly for $\Gamma_{RSB}$, the transition is instead of fourth order. Let us now consider the nature of the transition for $\Gamma < \Gamma_t$.
### C.3.2 Low Magnetic Field

In the regime

$$ \Gamma_t = \frac{2g''(1)^2}{2g''(1) + g^{(3)}(1)} - g'(1) > \Gamma > 0, \qquad (C99) $$

the transition from the 1RSB to the RS transition occurs when the parameter $m_0^*$ reaches $s$. At this transition, the value of $q_0^* = q_t(\Gamma) < 1$. Equating the expressions of $s$ and $m_0^*$, one can express explicitly $\alpha$ as a function of $q_t(\Gamma)$ at the transition as

$$ \alpha(q_t) = \frac{(1 - q_t)f'(1)}{f'(1) - f'(q_t)} = \frac{q_t f'(1)\rho(q_t)}{f'(q_t)}. \qquad (C100) $$

Inserting this expression for $\alpha(q_t)$ into Eq. (C79), the value of $q_t$ can then be obtained by solving the self-consistent equation

$$ \begin{aligned} \mu(q_t) &= \frac{1}{f'(1) - f'(q_t)} \left( \frac{f(1) - f(q_t)}{1 - q_t} - f'(q_t) \right) \\ &= f'(q_t) \frac{f'(q_t) - q_t f'(1) - q_t f'(1) \ln[f'(q_t)/(q_t f'(1))]}{(f'(q_t) - q_t f'(1))^2}. \end{aligned} \qquad (C101) $$

Clearly, $q_t = 1$ is always a solution of the above equation and will be the correct solution for $\Gamma \ge \Gamma_t$. For $0 < \Gamma < \Gamma_t$, an additional solution exists, satisfying $0 < q_t < 1$. Expanding the value of $q_t$ as $\Gamma \to \Gamma_t$, one obtains

$$ q_t(\Gamma) = 1 - \frac{2(g^{(3)}(1) + 2g''(1))^2}{g''(1)(3g^{(3)}(1)^2 - 2g^{(4)}(1)g''(1))}(\Gamma_t - \Gamma) + O(\Gamma - \Gamma_t)^2. \qquad (C102) $$

Note that the denominator in that expression is proportional to $-S[g'](1)$, which is positive for models displaying a 1RSB phase (it would be negative for models displaying FRSB). A similar expansion of the value $q_m(\Gamma)$ where the function $\rho(q)$ reaches its minimum yields instead

$$ q_m(\Gamma) = 1 - \frac{3(g^{(3)}(1) + 2g''(1))^2}{2g''(1)(3g^{(3)}(1)^2 - 2g^{(4)}(1)g''(1))}(\Gamma_t - \Gamma) + O(\Gamma - \Gamma_t)^2, \qquad (C103) $$

such that in the vicinity of $\Gamma = \Gamma_t$ at least, $q_t(\Gamma) \le q_m(\Gamma)$.

In the opposite limit $\Gamma \to 0$, one must have that

$$ q_t(\Gamma) = \frac{\Gamma}{g'(1)\rho_{typ} - 2g_2} + O(\Gamma^2). \qquad (C104) $$

Assuming that the function $g(q) \approx g_2q^2 + g_r q^r$ with $r > 2$, one obtains instead

$$ q_m(\Gamma) \approx \frac{\Gamma^{\frac{1}{r-1}}}{r(r-2)g_r} + O(\Gamma^2), \qquad (C105) $$

such that as $\Gamma \to 0$, one has $q_m(\Gamma) \ge q_t(\Gamma)$ as well. We expect that this inequality holds for any value of $\Gamma$.

For $\Gamma \le \Gamma_t$, the transition of the CGF does not occur at the value $s_{RSB}$ but at the value

$$ s_t = \frac{1}{\sqrt{q_t f'(q_t)}} \left( \sqrt{\frac{f'(1) - f'(q_t)}{(1 - q_t) f'(1)}} - \sqrt{\frac{(1 - q_t) f'(1)}{f'(1) - f'(q_t)}} \right) \ge s_{RSB}. \qquad (C106) $$
Note that for $\Gamma \ge \Gamma_t$, as $q_t = 1$ the expression above coincides with $s_{RSB}$. At the transition, the parameter $v = v_t$ is continuous

$$ 
\begin{aligned}
v_t &= \frac{1}{2} \left( -s_t + \sqrt{\frac{4}{f'(1)} + s_t^2} \right) = \rho(q_t) \sqrt{\frac{q_t}{f'(q_t)\alpha(q_t)}} \\
&= \sqrt{\frac{\rho(q_t)}{f'(1)}} = \sqrt{\frac{(1-q_t)f'(q_t)}{(f'(1)-f'(q_t))q_t f'(1)}}.
\end{aligned} 
\quad (C107) $$

Using that, at the transition $m_0^* = s_t$, one can thus show that the CGF is continuous

$$ \phi_{1RSB}(s_t) = \frac{1}{2} \left[ s_t^2 f(1) + v_t s_t f'(1) + \ln \left( \frac{s_t + v_t}{v_t} \right) \right] = \phi_{RS}(s_t). \quad (C108) $$

The first derivative $\phi'(s)$ is also continuous at the value of $s_t$ with

$$ 
\begin{aligned}
e_t &= e_{*,RS}(s_t) = -\phi'_{RS}(s_t) = -\left(v_t(f'(1) - f(1)) + \frac{f(1)}{v_t f'(1)}\right) \quad (C109) \\
&= e_{*,1RSB}(s_t) = -\phi'_{1RSB}(s_t) = -\frac{f(1)(q_t f'(1) - f'(q_t)) + (1-q_t)f'(q_t)f'(1)}{\sqrt{q_t f'(q_t)f'(1)(f'(1)-f'(q_t))(1-q_t)}}.
\end{aligned} 
\quad (C110) $$

Thus, one can similarly show that the LDF and its first derivative is continuous as well at the transition

$$ \mathcal{L}_{RS}(e_t) = s_t \phi'_{RS}(s_t) - \phi_{RS}(s_t) = \mathcal{L}_{1RSB}(e_t) = s_t \phi'_{1RSB}(s_t) - \phi_{1RSB}(s_t). \quad (C111) $$

The transition is of second order in this regime and occurs for $s = s_t$, i.e. $q = q_t$ with

$$ 
\begin{aligned}
\phi''_{1RSB}(s_t) &= \frac{f'(1)f'(q_t)(2(q_t-1)\mu(q_t)f'(1)(3q_t\mu(q_t)-2q_t-\mu(q_t)+1)+f(1)(q_t(q_t+4\mu(q_t)-2)-2\mu(q_t)+2))}{-2q_t\mu(q_t)f'(1)^2+f'(1)(q_t(q_t+4\mu(q_t)-2)-2\mu(q_t)+2)f'(q_t)-q_t f'(q_t)^2} \\
&\quad + \frac{-2q_t\mu(q_t)f'(1)^2((q_t-1)\mu(q_t)f'(1)+f(1))-f'(q_t)^2((q_t-1)f'(1)(q_t(1-2\mu(q_t))^2-2(\mu(q_t)-1)^2)+f(1)q_t)}{-2q_t\mu(q_t)f'(1)^2+f'(1)(q_t(q_t+4\mu(q_t)-2)-2\mu(q_t)+2)f'(q_t)-q_t f'(q_t)^2}.
\end{aligned} 
\quad (C112) $$

which can be shown numerically to be positive on different examples. While this expression is quite cumbersome, one can check explicitly that for $q_t \to 1$, $\mu(q_t) \to 1/2$ and this expression coincides with $\phi''_{RS}(s_t = s_{1RSB}) = f(1) - f'(1)^2/(f'(1) + f''(1))$. Note that $\mathcal{L}''_{1RSB}(e_t) = 1/\phi''_{1RSB}(s_t)$. On the other hand, one can compute explicitly

$$ \mathcal{L}''_{RS}(e_t) = \frac{2}{e_{c,RS}} \left( 1 - \frac{2f(1)}{f'(1)} - \frac{e_t}{\sqrt{e_t^2 - e_{c,RS}^2}} \right). \quad (C113) $$

### C.3.3 Zero Magnetic Field $\Gamma = 0$

For zero magnetic field $\Gamma \to 0$, we have that $q_t \to 0$ as in Eq. (C104) and

$$ \lim_{\Gamma \to 0} \rho(q_t) = \lim_{\Gamma \to 0} \frac{f'(q_t)}{q_t f'(1)} = \rho_{\text{typ}}, \quad \lim_{\Gamma \to 0} \left( \frac{\alpha(q_t) - 1}{\Gamma} \right) = -\frac{1 - \rho_{\text{typ}}}{\rho_{\text{typ}} g'(1) - 2g_2}, \quad (C114) $$
where we remind that $\rho_{typ}$ is the solution of

$$ \frac{g(1)}{g'(1)} = \rho_{typ} \frac{\rho_{typ} - 1 - \ln \rho_{typ}}{(1 - \rho_{typ})^2}. \qquad (C115) $$

Using these identities, one can now check that

$$ e_t = - \frac{1}{\sqrt{g'(1)}} \left( \sqrt{\rho_{typ}}(g'(1) - g(1)) + \frac{g(1)}{\sqrt{\rho_{typ}}} \right) = e_{typ}(\Gamma = 0) = e_c. \qquad (C116) $$

However, the Laplace parameter $s$ reaches a finite value at the transition

$$ s_t = \frac{1}{\sqrt{g'(1)}} \left( \frac{1}{\sqrt{\rho_{typ}}} - \sqrt{\rho_{typ}} \right). \qquad (C117) $$

Since $q_t(\Gamma = 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 \in (-\infty, s_t]$ and thus the CGF takes in that interval a simple linear form

$$ \phi_{1RSB}(s) = -s e_{typ}, \quad s \in (-\infty, s_t]. \qquad (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

$$ \phi_{1RSB}(s) - \phi_{RS}(s) = -\rho_{typ}g'(1) \left[ \frac{\rho_{typ} - 1 - \ln \rho_{typ}}{(1 - \rho_{typ})^2} - \frac{1}{1 + \rho_{typ}} \right] (s - s_t)^2 + O((s - s_t)^3). \qquad (C119) $$

As mentioned in the section on the RS regime, the LDF $\mathcal{L}_{RS}(e)$ vanishes linearly at the value $e_{typ}$ with $\mathcal{L}'_{RS}(e_{typ}) = -s_t$ [see Eq. (82)]. One expects that the probability of events $e \ge 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 $\Gamma = 0$, the LDF is expected to be characterised only by the RS regime $\mathcal{L}(e) = \mathcal{L}_{RS}(e)$ for all $e \le e_{typ}$. In addition, it vanishes linearly at the typical value instead of the quadratic behaviour observed for positive magnetic field $\Gamma > 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 [64].

### C.3.4 Scaling Regime: $\Gamma \to 0$

In the regime $\Gamma \to 0$, the differences between the characteristic energies scale (see bottom left panel in Fig. 9) as

$$ e_{typ} - e_c = - \frac{\Gamma}{2\sqrt{\rho_{typ}g'(1)}} + K_{typ}\Gamma^2 + O(\Gamma)^3, \qquad (C120) $$

$$ e_t - e_{typ} = u_t \Gamma^2 + O(\Gamma)^3, \quad u_t = - \frac{1 - \rho_{typ}}{2\sqrt{\rho_{typ}g'(1)}(\rho_{typ}g'(1) - 2g_2)} \le 0. \qquad (C121) $$

In the limit $\Gamma \to 0$, $e \to e_{typ}$, there is a scaling function

$$ \mathcal{L}(e) \approx \Gamma^2 L_{1RSB} \left( \frac{e - e_{typ}}{\Gamma^2} \right) \qquad (C122) $$