arXiv:2610.10443cs.DSOct 2026Cited by 2 papers on PaperVantage
Manuscript Offprint
arXiv:2610.10443
Color Coding for the Sherrington-Kirkpatrick Model
Alina Harbuzova, Saba Lepsveridze, Mahbod Majid, Ankur Moitra
Abstract
We give a polynomial-time algorithm for approximating the partition function of mean-field mixed p-spin models to arbitrarily high accuracy throughout the second-moment regime. This improves the quasipolynomial running time of Bencs et al. [BHL +25] and answers their open question. In particular, our result covers the entire replica-symmetric regime of the Sherrington–Kirkpatrick model. The algorithm is deterministic, runs in time polynomial in n and 1/ε, and succeeds for every typical realization of the disorder.
Our main technical contribution is a new application of color coding to the classical high-temperature expansion developed by Aizenman, Lebowitz, and Ruelle [ALR87] to study fluctuations of the partition function. We combine this approach with the zero-freeness from [BHL +25] to convert additive approximations into multiplicative ones.
∗Supported by the 2026 Apple Scholars in AI/ML PhD fellowship
Contents
1 Introduction 1
1.1 Our Results 2
1.2 Acknowledgements 3
2 Technical overview 3
3 Proof of the main theorem 6
3.1 Controlling the approximation error 8
3.2 Lower bound for the normalized partition function 10
4 Truncation bounds 12
5 Deterministic estimator via color coding 14
5.1 The reduction 15
5.2 Deterministic selection of colorings 16
5.3 Dynamic programming for a fixed coloring 17
A Extension to mixed p-spin models 20
A.1 The ALR expansion 20
A.2 Truncation bounds 21
A.3 Deterministic estimator via color coding 24
A.4 Lower bound for the normalized partition function 28
A.5 Proof of the main theorem 29
1 Introduction
Mean-field spin glasses are random probability distributions introduced half a century ago by Sherrington and Kirkpatrick [SK75] as idealized mathematical models for disordered magnetic materials. Since then, they have become fundamental objects of study at the intersection of statistical physics, high-dimensional inference, and average-case complexity.
A central computational question in this setting is whether the partition function of a typical instance can be approximated efficiently to a prescribed accuracy. To be more precise, we consider mixed p-spin Ising models, whose random Hamiltonians are defined on σ∈{±1}n by
Here, pmax≥2 is a fixed integer, γ2,…,γpmax are fixed real coefficients, and the entries Gi1,…,ip are independent standard Gaussians across all indices. Note that the original Sherrington–Kirkpatrick model corresponds to the special case pmax=2 and γ2=1/2.
Given a Hamiltonian HG and a fixed inverse temperature β≥0, the corresponding Gibbs measure on {±1}n is defined by
dμG,β(σ)∝exp{βHG(σ)}×dρ(σ),
where normalization constant is the partition function is
ZG(β)=Eσ∼ρexp{βHG(σ)}.
Here ρ distributed uniformly on {±1}n. Given G, β, and ε>0, our goal is to efficiently compute an estimate ZG(β) satisfying
ZG(β)ZG(β)−1≤ε
with high probability over G. We are also interested in the range of β for which this task can be performed efficiently.
Much of the theory of spin glasses concerns their physical properties, such as the limiting free energy and replica symmetry breaking [Tal06, Pan13]. Over time, important connections have emerged between the computational and physical phase transitions in these systems.
For example, for the hard-core model on bounded-degree graphs, approximate counting is efficient below the uniqueness threshold and hard in the worst case above it [Wei06, SS14]. Moreover, for the Sherrington–Kirkpatrick model, polynomial-time sampling is possible for every fixed β<1, with vanishing error in both normalized Wasserstein distance [EAMS22, Cel24] and total variation distance [LSS26]. For β>1, however, disorder chaos rules out stable samplers even in normalized Wasserstein distance [EAMS22].
For mixed p-spin models, a natural threshold arises from the second moment of the partition function. To make this precise, define the mixture function
ξ(q)=p=2∑pmaxγp2qp.
Since EG[HG(σ)HG(τ)]=nξ(⟨σ,τ⟩/n), a Gaussian moment calculation and a large-deviation estimate for the overlap gives that
is the entropy. This leads to the second-moment threshold
β2nd:=(0<q≤1infξ(q)I(q))1/2.(3)
For every fixed β>β2nd, the second-moment ratio grows exponentially in n, while for β<β2nd, it remains bounded as n→∞ [BHL +25]. We call this range the second-moment regime.
1.1 Our Results
Our main result gives a deterministic polynomial-time algorithm for approximating the partition function of mixed p-spin Ising models throughout this second-moment regime, with high probability over the disorder.
Theorem 1.1. Fix ξ(q)=∑p=2pmaxγp2qp and 0<β∗<β2nd. There exist a constant C, a sequence 1ζn=o(1), and a deterministic algorithm with the following guarantee.
The algorithm takes as input the disorder G and parameters ε,δ>0, and outputs an estimator ZG(β) for any given real ∣β∣≤β∗ satisfying
PG[∣β∣≤β∗supZG(β)ZG(β)−1≤ε]≥1−ζn−δ.
Evaluating ZG(β) requires at most (n/(εδ))C operations in the exact-arithmetic model. 2
In particular, for the SK model, β2nd=1, so our result gives polynomial-time counting throughout the high-temperature phase.
Our work crucially builds on the result of Bencs, Huang, Lee, Liu, and Regts [BHL +25], who obtained a deterministic quasipolynomial-time algorithm for counting in the same regime. For every fixed radius 0<β∗<β2nd, they prove that there exists ζn=o(1) such that the partition function ZG(z) is nonzero in the complex disk ∣z∣≤β∗, with probability at least 1−ζn. Using this zero-freeness and Barvinok's interpolation method [Bar16], they approximate ZG by truncating the Taylor expansion of logZg at degree Clog(n/ε). Brute force computation of the Taylor coefficients takes nClog(n/ε) time. Theorem 1.1 improves this running time to polynomial.
Our main contribution is to reduce the runtime of this algorithm. The natural idea is to use color coding [AYZ95], which can efficiently evaluate sums indexed by sparse graphs via dynamic programming without enumerating their terms individually. The difficulty is that, even for the
1Here ζn bounds the probability that ZG has a complex zero in the disk at the origin with radius β∗, as given by the zero-freeness theorem of Bencs et al. [BHL +25].
2Arithmetic operations, comparisons, and evaluations of elementary functions have unit cost.
SK model, the Taylor expansion used in [BHL +25] contains terms indexed by multigraphs with high-degree vertices, making it unclear how to apply color coding directly.
We instead apply color coding to the high-temperature expansion of Aizenman, Lebowitz, and Ruelle [ALR87], originally introduced to study fluctuations of the SK partition function. For SK, this expansion writes the partition function as a weighted sum over even subgraphs of the complete graph. Aizenman, Lebowitz, and Ruelle showed that unions of vertex-disjoint cycles give the leading contribution to the sum. While this suffices to study the limiting fluctuations, to obtain a prescribed accuracy, we also retain graphs with few edges and few branching vertices, namely vertices of degree at least four. Once the branching vertices are fixed, every retained graph decomposes into paths joining them and cycles disjoint from them. Color coding and dynamic programming then allow us to evaluate the total weight of these graphs efficiently. We explain the argument in more detail in Section 2.
For mixed p-spin models, we additionally control the number of nonpair interactions. After fixing their incident vertices together with the branching vertices, the remaining computation again reduces to paths and cycles. The full argument is in Section A.
1.2 Acknowledgements
The authors explored several ways to apply color coding to the polynomial used by Bencs et al. [BHL +25] to improve their quasipolynomial running time to polynomial. In the course of this exploration, OpenAI's GPT-6 Astra identified the high-temperature graph expansion as a more convenient object for color coding. The central argument based on this choice is due to GPT-6 Astra. AI assistance was also used to develop arguments and to prepare the manuscript. The authors take responsibility for the mathematical claims, proofs, and citations.
Alina Harbuzova is supported by Schwarzman College of Computing PhD Fellowship.
Concurrent work. Schmidhuber and Zlokapa [SZ26] concurrently and independently obtained deterministic polynomial-time counting algorithms for SK throughout β<1, using closely related graph-expansion and color-coding techniques. For mixtures without any quadratic interactions, however, they use different approach based on cavity method that reaches the static transition threshold βstat≥β2nd. Our result extends color coding argument to general finite mixtures, including quadratic and higher-order interactions together.
The recent OpenAI mathematics release also includes manuscripts on the spectral gap and cutoff of SK Glauber dynamics [Ope26a, Ope26b], obtaining Oβ(nlogn) worst-start mixing at fixed total-variation accuracy for every fixed 0≤β<1, with high probability over the disorder. Their proofs use stochastic localization and estimates for posterior Gibbs measures. The spectral-gap argument also yields randomized polynomial-time approximate counting by making its estimates uniform on compact subcritical temperature intervals and applying standard annealing. Thus these results provide a sampling-based route to counting, whereas our algorithm is deterministic and directly evaluates the high-temperature expansion using color coding. Conversely, our counting theorem does not establish a spectral gap or rapid mixing of Glauber dynamics.
2 Technical overview
In this section, we explain the argument behind Theorem 1.1. For clarity, we present the argument for the SK model; the modifications required for mixed p-spin models are described in Section A.
We fix a target interval ∣β∣≤β∗ with 0<β∗<1. Let Eσ denote the uniform average over {±1}n and recall that our goal is to estimate the partition function
Zg(β)=EσeβHg(σ),
where Hg(σ)=n−1/2∑i<jgijσiσj and (gij)i<j are independent standard Gaussians. Our algorithm approximates instead the normalized partition function
Yg(β)=EgZg(β)Zg(β).
Since the normalization factor EgZg(β)=e(n−1)β2/4 is explicit and easily computable, an estimate for Yg(β) gives the estimate for Zg(β) with the same multiplicative approximation error.
We first express the normalized partition function as an explicit prefactor times a sum over graphs, using the high-temperature expansion of Aizenman, Lebowitz, and Ruelle [ALR87, ALR88]. Denote the set of edges of a complete graph on {1,…,n} by E. We can view the Hamiltonian Hg(σ) as a sum over the edges {i,j}∈E. For each edge {i,j},
The prefactor is positive and computable in polynomial time at each real temperature, so this reduces the task of approximating Yg(β) to approximating P(t(β)). For a subset of edges F⊆E, write tF:=∏{i,j}∈Ftij, with t∅:=1. Then,
Here a subgraph F is called even if every vertex has even degree in F.
The main novelty is to construct an efficiently computable deterministic estimate P satisfying
∣β∣≤β∗supEgP(t(β))−P(t(β))2≤n−D(6)
for any given constant D>0. Before describing P, we explain how the coefficient estimate underlying the additive estimate in (6) lead to the desired multiplicative guarantee in Theorem 1.1.
In Section 3, we convert the estimate leading to (6) into a uniform error guarantee on Yg, which is obtained by multiplying P by the explicit prefactor in (4):
Eg∣β∣≤β∗supYg(β)−Yg(β)2≤n−D.(7)
Finally, to obtain the multiplicative guarantee Yg(β)Yg(β)−1≤ε, we use Markov's inequality to bound
for every ε,γ>0. We then use the zero-freeness theorem of [BHL+25] to bound Pg[inf∣β∣≤β∗∣Yg∣≤γ], thereby reducing our task to bounding sup∣β∣≤β∗EgP(t(β))−P(t(β))2.
We now construct an efficiently computable estimate P. [ALR87] prove that the expansion of P in (5) is dominated by unions of disjoint cycles. To achieve a prescribed accuracy guarantee, we refine this approximation by including graphs F with a small number of branching vertices, that is, vertices of degree at least 4.
Note that the monomials corresponding to distinct graphs F=F′ are orthogonal under the Gaussian disorder due to symmetry: Eg[tFtF′]=0. Consequently, for any family of graphs F, we have
Thus e=v for precisely disjoint union of cycles, while every other graph has e>v, that introduces an additional factor nv−e in the second-moment bound. For our approximation, we retain graphs with at most K edges and fewer than b branching vertices. Thus, we define
In Section 4, we bound the expected squared error Eg∣P(t)−PK,b(t)∣2 uniformly over real ∣β∣≤β∗, as stated in Theorem 4.1. In particular, for every fixed D>0, we can make this error at most n−D by choosing suitable cutoffs
K=OD(logn)andb=OD(1).
Note that if we could efficiently compute PK,b(t), we would be done. However, naive enumeration of FK,b takes quasipolynomial time, since it contains as many graphs. Instead, we construct an efficiently computable deterministic estimate P of PK,b.
To this end, we use the color coding method introduced by Alon, Yuster, and Zwick [AYZ95]. Let h:[n]→[K] be a uniformly random balanced coloring, and call a graph colorful if its vertices have distinct colors. Denoting by pv the probability that a fixed set of v vertices is colorful, we construct the following estimator:
Vh:=F∈FK,b∑p∣V(F)∣1{Fcolorfulunderh}tF.(8)
To obtain a more accurate estimate, we sample T balanced colorings h1,…,hT independently and set
P:=T1t=1∑TVht.
In Section 5, we show that
Eh1,…,hTEg∣P−PK,b∣2≤eO(K)/T≤n−D
for any prescribed D>0, where the last inequality follows from taking a sufficiently large T=poly(n) in the regime K=O(logn).
To obtain a deterministic estimate, we replace the random colorings by deterministic ones, using the method of conditional expectations [ES73, Rag88], see Section 5.2.
It remains to show that the estimate P can be computed efficiently in polynomial time. In particular, it suffices to show that for any given coloring h, Vh can be computed in polynomial time.
Under a fixed coloring h, we group colorful graphs F in FK,b according to their set B(F) of branching vertices. Since ∣B(F)∣<b=O(1), there are at most O(nb)=poly(n) such groups. Note that V(F)∖B(F) decomposes into paths adjacent to the vertices of B and cycles disjoint from B. This allows us to evaluate the weighted sum in each group using dynamic programming in poly(n)eO(K) time, see Section 5.3. In the regime K=O(logn) this gives the desired polynomial-time algorithm.
Organization of the paper. In Section 3, we prove the theorem for pure SK model using the truncation and estimation bounds established in the subsequent sections. Specifically, Section 4 bounds the error from restricting the graph expansion to even graphs with few edges and few branching vertices, while Section 5 presents the deterministic color-coding algorithm. We analyze the estimator in Section 5.1, derandomize the choice of colorings in Section 5.2, and show how to evaluate the estimator efficiently through weighted sums of paths and cycles in Section 5.3.
Section A extends the proof to mixed p-spin models. We derive the corresponding high-temperature expansion in Section A.1, establish the truncation bound in Section A.2, and extend the color-coding estimator and its dynamic programming implementation in Section A.3. We then prove a high-probability lower bound on the normalized partition function in Section A.4 and combine these ingredients to complete the proof in Section A.5.
3 Proof of the main theorem
In this section, we specialize to the pure Sherrington–Kirkpatrick model. We prove the Theorem 1.1 in this case using the results established in subsequent sections. Recall from Section 2 that our main goal is to estimate the graph expansion
P(t)=F⊆EFeven∑tF,withtF={i,j}∈F∏tij,
where, for real inverse temperature β, we write tij=tij(β)=tanh(βgij/n). Section 4 and Section 5 construct P, which also takes the form of a multilinear polynomial in t=(tij){i,j}∈E,
P=F⊆EFeven∑PFtF.
To reason about multilinear polynomials f(t)=∑FfFtF such as P and P, we introduce a weighted norm below.
Definition 3.1. For w>0 and a multilinear polynomial f(t)=∑FfFtF, we define the weighted norm and inner product to be
∥f∥w2:=F∑∣fF∣2w∣F∣,⟨f,h⟩w:=F∑fFhFw∣F∣.(9)
Throughout the proof, we fix constants β∗,λ and R0, such that
β∗<R0<λ<1,anddefinew:=λ/n.(10)
Key observation is that for any β such that ∣β∣<β∗, the entries tij(β) are odd functions of the centered Gaussians gij, so for any F=F′, we have Eg[tF(β)tF′(β)]=0. Hence,
where the last inequality holds for any w≥β2/n. In particular, we have that
Eg∣P(t(β))−P(t(β))∣2≤∥P−P∥w2.
In the remainder of the paper, we fix constants β∗, R0, and λ such that β∗<R0<λ<1 and set
w:=nλ.
Combined, Theorem 4.1 and Theorem 5.1 produce an estimate P(t) satisfying, for every L≥logn,
∥P−P∥w2≤e−L.(11)
Moreover, P can be computed in poly(n)eO(L) arithmetic operations. The role of this section is to show that the approximation in (11) is sufficient for the multiplicative estimation of the partition function and yields the result in Theorem 1.1.
Recall that the normalized partition function can be expressed as
Yg(β)=EgZg(β)∏{i,j}∈Ecosh(βgij/n)⋅P(t),
where the prefactors can be computed in polynomial time. Accordingly, for an estimate P(t), our algorithm computes
Proposition 3.2. Fix 0 < \beta_*} < 1, and let w=λ/n be as above. There exist constants c>0, C≥1 and a sequence ζn→0, depending only on β∗, such that the following holds for all sufficiently large n. Let 0<ε, δ<1/2, and let P(t)=∑F⊆EPFtF be a deterministic multilinear polynomial whose coefficients are independent of g and β, satisfying
∥P−P∥w2≤C−1ε2δc.
For each disorder realization g and ∣β∣≤β∗, in additional O(n2) arithmetic operations, one can compute Yg(β) satisfying
Pg[∣β∣≤β∗supYg(β)Yg(β)−1≤ε]≥1−ζn−δ.
Assuming this proposition, we first complete the proof of the main theorem for the SK model.
Proof of Theorem 1.1 for Sherrington–Kirkpatrick Model. There exists a constant κ>0, such that for any logn≤L≤κn, Theorem 4.1 and Theorem 5.1, applied with an appropriate choice of L′=O(L), can be combined via a triangle inequality to produce an estimate P satisfying
∥P−P∥w2≤e−L.
Moreover, P can be computed in poly(n)eO(L) arithmetic operations. Let c,C>0 be the constants in Theorem 3.2, and choose
L=⌈max{logn,logC+2log(1/ε)+clog(1/δ)}⌉.
Then e−L≤C−1ε2δc, so Theorem 3.2 implies
Pg[∣β∣≤β∗supYg(β)Yg(β)−1≤ε]≥1−ζn−δ.
Moreover, poly(n)eO(L)+O(n2)=poly(n,ε−1,δ−1), which is the running time claimed in Theorem 1.1.
The proof of Theorem 3.2 in Section 3.1 has two parts. The first (Theorem 3.3) converts coefficient error intro a uniform additive error:
Eg∣β∣≤β∗supYg(β)−Yg(β)2≤C∥P−P∥w2.
The second (Theorem 3.5, proved in Section 3.2) gives a uniform high probability lower bound on the modulus of the normalized partition function Yg. This follows from the zero-freeness theorem of [BHL +25], a second-moment upper bound in Theorem 3.7, and Harnack's inequality. Markov's inequality then yields Theorem 3.2.
3.1 Controlling the approximation error
For deterministic multilinear f(t)=∑FaFtF, define
where recall that we chose the constant R0 to satisfy β∗<R0<λ. Plugging these bounds into (14) proves the lemma.
The graph expansion proves LgP=Yg. Denote f:=P−P and note that Lgf=LgP−Yg.
Lemma 3.4. There exists a constant Cerr>0, such that
Eg∣z∣≤β∗sup∣LgP(z)−Yg(z)∣2≤Cerr∥P−P∥w2.
Proof. We use the following standard consequence of Cauchy's integral formula. If F is holomorphic on a neighborhood of the closed disk {∣z∣≤T} and 0<R<T,
We use a lower bound on the normalized partition function Yg(z), uniform over the complex disk ∣z∣≤β∗. This lemma is proved in the subsequent Section 3.2.
Lemma 3.5. Fix a radius R1 with β∗<R1<1. There are constants c,C>0 such that, for every 0<α<1/2,
Pg[∣z∣≤β∗inf∣Yg(z)∣≥C−1αc]≥1−ζn−α,
where ζn→0 depends only on R1 and n.
Fix 0<ε,δ<1/2 and put α:=δ/2, so that each of the two estimates below may fail with probability at most α. Let Cerr≥1 denote the constant in Theorem 3.4 and let c,C>0 be constants from Theorem 3.5. By Markov's inequality and Theorem 3.4,
where the last inequality comes from choosing the constants in Theorem 3.2 so that ∥P−P∥w2≤C−2Cerr−1ε2α1+2c.
On the event that both Theorem 3.5 and the bound in (17) hold, which happens with probability at least 1−ζn−2α=1−ζn−δ,
∣β∣≤β∗supYg(β)LgP(β)−1≤C−1αcεC−1αc=ε.
For real β, LgP(β)=Yg(β), as defined in (12), which concludes the proof.
3.2 Lower bound for the normalized partition function
Lemma 3.5. Fix a radius R1 with β∗<R1<1. There are constants c,C>0 such that, for every 0<α<1/2,
Pg[∣z∣≤β∗inf∣Yg(z)∣≥C−1αc]≥1−ζn−α,
where ζn→0 depends only on R1 and n.
The proof of Theorem 3.5 at the end of this section combines a second-moment bound, Cauchy's integral formula, and Markov's inequality into a uniform upper bound on ∣Yg∣ in the larger disk ∣z∣≤R1 with high probability (Theorem 3.8). Harnack's inequality then combines this upper bound with zero-freeness (Theorem 3.6) and the normalization Yg(0)=1 to yield the desired lower bound on ∣z∣≤β∗.
The zero-free theorem of Bencs et al. [BHL +25] gives the following proposition; we verify the change of the normalization below.
Proposition 3.6 ([BHL +25], Theorem 1.2). The function Yg has no zeros in ∣z∣<R1 with probability at least 1−ζn, where ζn→0 depends only on R1 and n.
Indeed, their ordered-tuple SK Hamiltonian can be written as
Here the Gij are independent standard Gaussians, so the gij,i<j, are independent standard Gaussians and X∼N(0,1/2) is independent of them. In particular,
These multipliers never vanish, so the zero-free theorem of [BHL +25] transfers to Yg without loss.
Lemma 3.7. For every 0≤T<1 and ∣z∣≤T,
Eg∣Yg(z)∣2≤1−∣z∣2e−∣z∣2/2≤1−T21,(20)
Proof. Let σ,τ be independent uniform spin configurations and let ρi=σiτi, so that ρi are independent uniform signs. Gaussian integration, with the self terms canceled by the normalization, gives
Now set T=(1+R1)/2, so that R1<T<1. Since Yg is entire, we may apply (21) with F=Yg and R=R1. Taking expectations, interchanging expectation and integration by Tonelli's theorem, and applying Theorem 3.7, we obtain
Proof of Lemma 3.5. Let CU be the constant from Lemma 3.8 and set M:=CU/α. By that lemma, Theorem 3.6, and the union bound, with probability at least 1−ζn−α, the function Yg has no zeros in ∣z∣<R1 and satisfies sup∣z∣≤R1∣Yg(z)∣≤M.
On this event, the function
u(z):=logM−log∣Yg(z)∣
is nonnegative and harmonic in ∣z∣<R1. Since Yg(0)=1, we have u(0)=logM. Harnack's inequality therefore gives
As outlined in Section 2, we approximate P by truncating the expansion to PK,b. This section upper bounds the resulting squared error in the weighted coefficient norm3 (Theorem 4.1). Concretely, for a graph F⊆E denote the set of supported vertices V(F):={i:degF(i)>0} and the set of branching vertices, i.e. those of degree at least 4, and their number as
B(F):={i:degF(i)≥4},s(F):=∣B(F)∣.
We truncate the expansion P(t)=∑F⊆EtF by only keeping the terms with at most K edges and fewer than b branching vertices. Define the retained family and its polynomial by
3Defined in Section 3, (9) and bound the two terms separately. First, by an argument analogous to that in the proof of Theorem 3.7, we upper bound the total weighted norm ∥P∥w2. Let ρ1,…,ρn be independent uniform signs:
Choose θ>1 with θλ<1 and apply the above bound with weight θw to obtain
Feven∣F∣>K∑w∣F∣≤θ−K(1−θλ)−1/2=Ce−cK≤e−L/2,(25)
where c and C are constants depending only on λ and the last inequality comes from choosing a sufficiently large K=O(L) for a given L.
To bound the second term, fix a particular set S⊆[n] of b vertices and let
MS:=F⊆EevendegF(i)≥4∀i∈S∑w∣F∣,
so that ∑s(F)≥bFevenw∣F∣≤∑S∈(b[n])MS. Fix some θ>1 satisfying wθ2<1 and let qij=wθ1{i∈S}+1{j∈S}. Then, again letting ρ1,…,ρn be independent uniform signs, we can bound
The last step is valid for the choice of θ=1+bc′n for a constant c′>0, such that w(bθ2+n−b)=λ(c′+1)<1. Note that this choice of θ also satisfies θ>1 and wθ2<1 for sufficiently small c′. We conclude by bounding
for a choice of constant C only dependent on λ. Finally, set b:=⌈log(n/(CL+Clog(2C)))L+log(2C)⌉, which is ≤L+log(2C) for sufficiently small κ. Then, blogCbn≥L+log(2C), so
In this section, we construct and analyze a deterministic estimator for the truncated graph expansion from Section 4. Our goal is to find an efficiently computable estimator P such that the squared weighted coefficient error ∥P−PK,b∥w2 is small. Write F:=FK,b and PF:=PK,b.
Proposition 5.1. For every integer L≥logn, one can construct an estimator PF satisfying
∥PF−PF∥w2≤e−L.
Moreover, PF can be computed in poly(n)eO(L) arithmetic operations.
We begin with a sketch of the argument. Naively evaluating PF by enumerating its terms takes nO(K) operations, giving only a quasipolynomial algorithm when K=Θ(logn). To overcome this issue, we use color coding method, introduced by Alon, Yuster, and Zwick [AYZ95].
To sketch the method, consider a uniformly random balanced coloring h:[n]→[K] (balanced means that the color classes have sizes differing by at most one). We call a graph F colorful under h if its vertices V(F) have different colors. We then consider the sum
Vh:=F∈F∑p∣V(F)∣1{Fcolorfulunderh}tF.(27)
Here pv is the probability that a fixed vertex set of size v is colorful. This makes sure that
EhVh=PF.
Although Vh may still contain nO(K) terms, colorfulness allows us to evaluate it without enumerating those terms. In Section 5.3, we construct a dynamic program that computes Vh exactly using
poly(n)eO(K)j=0∑b−1(jn)
operations. This is polynomial in n when K=O(logn) and blog(en/b)=O(logn), which is the regime we are working in.
Once we can evaluate the sum for one coloring, we can repeat the procedure for T independent balanced colorings h1,…,hT and set
(28) where the inequality follows from a simple computation. Thus, for any η>0, choosing T≳8K/η makes the expected squared coefficient error at most η.
This sketches a randomized algorithm for approximating PF. In our real algorithm, however, the colorings are chosen deterministically while preserving the same error bound. We use the method of conditional expectations (see, for example, [ES73, Rag88]).
The section is organized as follows. In Section 5.1, we reduce the proof of Theorem 5.1 to constructing suitable colorings deterministically and efficiently evaluating their associated polynomials Vh. In Section 5.2, we construct these colorings using the method of conditional expectations. Finally, in Section 5.3, we give a dynamic program for evaluating Vh.
5.1 The reduction
In this section, we will prove Theorem 5.1 given Theorem 5.2 and Theorem 5.3 below.
Lemma 5.2. For every integer T≥1, we can deterministically construct balanced colorings h1,…,hT such that, for each t=1,…,T,
i<t∑⟨Vhi,Vht⟩w≤(t−1)∥PF∥w2.(29)
The construction uses poly(n,T)eO(K)∑j=0b−1(jn) operations.
We prove Theorem 5.2 in Section 5.2 with an efficient evaluator from Section 5.3 as an input.
Lemma 5.3. Given any coloring h:[n]→[K], the polynomial Vh can be evaluated exactly using
poly(n)eO(K)j=0∑b−1(jn)
arithmetic operations.
We prove Theorem 5.3 in Section 5.3.
Proof of Theorem 5.1. We first lower bound on pv. Let n1,…,nK be the color-class sizes. Since they are balanced, we have nc≥n/(2K), so
Next, note that every balanced coloring retains a fraction pv of the supports of size v, so the normalization in (27) gives
⟨Vh,PF⟩w=∥PF∥w2.
Since the coefficients of Vh lie in [0,8K] and its monomials belong to F, we also have
∥Vh∥w2≤8K⟨Vh,PF⟩w=8K∥PF∥w2.
Take the colorings supplied by Theorem 5.2 and consider PF as above. First observe that by the identity above, ⟨PF,PF⟩w=T1∑t=1T⟨Vht,PF⟩w=∥PF∥w2. Hence, expanding the squared error
where the last inequality uses ∥PF∥w2≤∥P∥w2≤C from (24). Hence, choosing T=C8KeL gives the required error bound.
Finally, Theorem 5.2 constructs the colorings deterministically, and Theorem 5.3 evaluates each associated polynomial. The total construction and evaluation cost is
poly(n,T)eO(K)j=0∑b−1(jn).
Our cutoff bounds K=O(L), logT=O(L), and ∑j=0b−1(jn)≤exp{O(blog(en/b))}=eO(L), imply that the total number of operations is at most poly(n)eO(L).
5.2 Deterministic selection of colorings
In this section, we show how to control the overlap of each new coloring with the colorings already chosen. A uniformly random balanced coloring typically has small overlap with previous colors. We turn this observation into a deterministic construction by assigning colors vertex by vertex, always preserving a bound on the conditional expectation. The main idea is that these conditional expectations can be computed efficiently by dynamic programming from Section 5.3.
Proof of Theorem 5.2. Fix color-class sizes n1,…,nK differing by at most one and summing to n. All random colorings below are uniform among colorings with these prescribed sizes.
Suppose h1,…,ht−1 have already been chosen. Define
S(h):=i<t∑⟨Vhi,Vh⟩w,
and let H be a fresh random coloring. Unbiasedness and the identity ⟨Vh,PF⟩w=∥PF∥w2 from the preceding subsection give
EHS(H)=i<t∑⟨Vhi,PF⟩w=(t−1)∥PF∥w2.(30)
Thus it suffices to choose h whose overlap is at most this average.
We now assign colors to the vertices one by one in the order 1,…,n, while maintaining the bound on the conditional expectation. Initially χ0=∅ is an empty coloring. For a partial assignment χk:[k]→[K] that has a balanced completion, write
Φ(χk):=EH[S(H)∣H∣[k]=χk].
Note that using the law of total expectation, we have
Therefore, we extend χk from [k] to [k+1] by choosing χk+1(k+1)=c, for the color c with the smallest conditional expectation, so we guarantee that
Φ(χk+1)≤Φ(χk).
Note that if at every step, we can compute the conditional expectations exactly and efficiently, we would guarantee that at the end of this process, we have a deterministic coloring χn, that satisfies S(χn)≤(t−1)∥PF∥w2.
To this end, it suffices that given a coloring h:[n]→[K] and a partial coloring χ:[k]→[K] admitting a balanced completion, we can compute EH[⟨Vh,VH⟩w∣H∣[k]=χ] efficiently. Note that
The probabilities PH[H injective on V(F)∣H∣[k]=χ] only depend on the colors C=χ(V(F)∩[k]) and the size ℓ=∣V(F)∖k∣, and they are explicitly computable. This means that the conditional expectation, can be expressed as
where α:[n]×[n]×2[K]→R is an explicit coefficients that can be computed in poly(n)eO(K) time. Therefore, Theorem 5.4, applied with U=[k], coefficient table α, and edge inputs tij=w, computes each conditional overlap exactly using
poly(n)eO(K)j=0∑b−1(jn)
arithmetic operations. This concludes the proof.
5.3 Dynamic programming for a fixed coloring
We have now established the correctness of the algorithm. It only remains to prove that we can efficiently evaluate the sum Vh from (27) and the conditional overlap under partial coloring (31). We do so by dynamic programming that avoids naive explicit enumeration of all terms.
Theorem 5.4 provides a dynamic programming procedure for evaluating a general class of sums that include both (27) and (31) as special cases.
Proposition 5.4. Let n≥K, b≥1. Fix a full coloring h:[n]→[K], a set U⊆[n], and a partial coloring χ:U→[K]. Let α:[n]×[n]×2[K]→R be any supplied coefficients. Then, for arbitrary t=(te)e∈E, the polynomial
Proof of Theorem 5.4. Fix h,U,χ and the coefficients α. Recall that each graph F∈FK,b has at most K edges, and its branching set B(F):={v∈V(F):degF(v)≥4} has size less than b.
First, we can enumerate all possible sets B(F). There are at most ∑r=0b−1(rn) such sets. Therefore, it is enough to show that, for each fixed set B, we can evaluate
using poly(n)eO(K) arithmetic operations. For the rest of the proof, fix B and write q=∣B∣. We may assume that h is injective on B and that q≤K/2, since otherwise PB(t)=0. Indeed, every vertex in B has degree at least four, whereas the sum of all degrees is at most 2K.
We call the vertices in B terminal vertices. Consider a graph F appearing in the sum above. Every non-terminal vertex of F has degree exactly two. Thus, starting from a terminal, we can follow an edge through non-terminal vertices until we reach another terminal, possibly the one we started from. This partitions the edge set of F into the following pieces:
direct edges between terminal vertices;
paths between distinct terminals, with at least one non-terminal vertex;
paths returning to their starting terminal;
disjoint cycles containing no terminal vertices.
Since F is colorful, its non-terminal vertices have distinct colors, all outside h(B), so they must belong to the set
I:={i∈[n]∖B:h(i)∈/h(B)}.
Now computing PB(t) amounts to summing the weights of all valid arrangements of these pieces. We will first group together graphs F that share the following data:
These data determine all three arguments of α, so it suffices to compute the sum of the edge weights ∏e∈Fte over all F that share these data. We apply the common coefficient α only after this sum has been computed. This is useful because α could be arbitrary.
To carry out this grouping while assembling the pieces, we use commuting formal variables
x,(yc)c∈[K]∖h(B),(va)a∈B,τ,(zc)c∈[K].
We represent the data (e,A,d,j,C) by the formal monomial
The variables are formal and never assigned any numerical values. We store their coefficients, so that the resulting formal polynomial is simply a convenient way to represent a whole table of weighted sums as one algebraic object. Multiplying monomials will then combine the data of two pieces and discard incompatible choices.
Concretely, we impose the relations yc2=0 and zc2=zc because F must be colorful and C should record the set of repetitions. We also only retain the monomials satisfying
And finally, define (ra)a∈B to be I indexed vector such that
(ra)i:=xtai,andr(v):=a∈B∑vara.
With matrices W and D, and vectors (ra)a∈B, we can now conveniently count weighted paths and cycles among interior vertices. For example, for ℓ≥1 we have
Each term follows a walk from a∈B to a′∈B with ℓ interior vertices. The relations yc2=0 remove every walk whose interior colors repeat. Consequently, the surviving terms are precisely the distinct colorful paths from a to a′ that use ℓ internal vertices, and this sum also includes returning paths when a=a′ and ℓ≥2.
We now sum over all possible choices of a single piece, leaving direct edges between terminals for later. Each piece contributes its edge weight together with the formal variables recording its data. Counting each piece once, we obtain the polynomial
Let us explain the three terms. The first term describes all simple cycles with ℓ interior vertices. Every undirected cycle appears 2ℓ times in the trace, once for each starting vertex and traversal direction, so we divide by 2ℓ to fix overcounting.
The second term counts paths a−i−a′ with exactly one interior vertex i. Their endpoints must be distinct, and a<a′ counts each path once. The last term counts paths with at least two interior vertices. Expanding the two copies of r(v) chooses their terminal endpoints. Each path appears twice, in each orientation, so the factor 1/2 counts every such piece once. Terms with more than K edges are discarded by our truncation rule.
Next, we want to assemble these pieces in all possible ways. Accordingly, define
The product ∏a<a′(1+xtaa′vava′) sums over all choices of direct edges within B. On the other hand, each term in HBm chooses an ordered list of m pieces with at least one interior vertex. The relations yc2=0 ensure that surviving pieces have disjoint interior color sets and are therefore distinct. Each collection appears in exactly m! orders, so dividing by m! counts it once.
Thus, GB records the weighted sums for all possible arrangements of pieces. Since the decomposition into pieces is unique, for any retained data (e,A,d,j,C), the coefficient
[xeyAvdτjzC]GB
is the sum of the edge weights of all colorful graphs with branching set B and the given data. Multiplying this coefficient by
α(∣B∣+∣A∣,∣B∩U∣+j,χ(B∩U)∪C)
and summing over the retained terms gives PB(t).
Finally, each polynomial involved has at most M=eO(K) coefficients. Addition takes at most M arithmetic operations, and multiplication takes at most 2M2. The matrices have order at most n, and the expressions above require only polynomially many table additions and multiplications in n and K. Hence, computing GB and applying the final weights takes poly(n)eO(K) arithmetic operations. Summing over the possible choices of B gives the claimed bound.
Proof of Theorem 5.3. Apply Theorem 5.4 with U=∅, the empty map χ, and α(v,m,C)=1/pv. Then (32) is exactly Vh. The probabilities pv are positive and computable in poly(n,K) operations.
A Extension to mixed p-spin models
A.1 The ALR expansion
In this section we give the high-temperature expansion of Aizenman, Lebowitz, and Ruelle [ALR87, ALR88] for the mixed p-spin model in (1). We first group together the terms of the Hamiltonian that give the same spin monomial. This also accounts for the repeated indices in (1).
For an ordered tuple i=(i1,…,ip), let A(i)⊆[n] be the set of indices occurring an odd number of times. Note that σi1…σip=σA(i), where for a set A we denote σA:=∏i∈Aσi. For A⊆[n], define
The couplings JA are independent centered Gaussians, since the sums defining them use disjoint entries of G. Let E be the collection of nonempty interaction sets with positive variance:
E:={A⊆[n]:1≤∣A∣≤pmax,vA>0}.
Then
HG(σ)=J∅+A∈E∑JAσA(36)
For real β, let tA(β):=tanh(βJA). Similarly to the SK model case, for every hyperedge A∈E,
eβJAσA=cosh(βJA)(1+tA(β)σA),
so we can rewrite the normalized partition function
The prefactor is positive for real β and can be computed in O(npmax) operations: indeed, Gaussian integration gives EGZG(z)=enξ(1)z2/2. This reduces the task of approximating YG(β) to approximating P(t(β)). For a subset of hyperedges F⊆E, define tF:=∏A∈FtA, with t∅:=1, and
degF(i):=∣{A∈F:i∈A}∣,V(F):={i:degF(i)>0}.
We call F even if every degF(i) is even. The same identity used in (5) now gives
P(t)=EσA∈E∏(1+tAσA)=F⊆EFeven∑tF.(37)
Fix constants λ, R0, such that
β∗<R0<λ<β2nd.
All constants in this appendix may depend on the mixture ξ and these fixed parameters. We use the coefficient norm in Theorem 3.1, with an interaction-dependent weight in place of w=λ/n.
Definition A.1. Let wA:=λvA and wF:=∏A∈FwA. For a multilinear polynomial f(t)=∑F⊆EfFtF, define
The orthogonality argument in Section 3 applies without change: if F=F′, an interaction in their symmetric difference contributes an odd function of an independent centered Gaussian. Hence, for real ∣β∣≤β∗,
Lemma A.2. There are constants κ>0 and n0 such that, for n≥n0 and logn≤L≤κn, there are integer cutoffs K≥0 and b≥1 with K=O(L) and b=O(log(n/L)L), satisfying
∥P−PK,b∥w2≤e−L.
All constants depend only on the fixed mixture and λ.
Proof. We follow the proof of Theorem 4.1, with one additional tail for r(F). As in (23),
First, we bound the total weighted mass, ∥P∥w2, replacing the SK overlap bound in (24) by its mixed-model analog. For independent uniform signs ρ1,…,ρn, let Sn:=∑i=1nρi.
where we denote ρA:=∏i∈Aρi and use ∑A∈EvAρA=nξ(Sn/n)−v∅. The second-moment estimate of [BHL+25,Proposition 3.4] gives, for every fixed 0≤u<β2nd2,
m≥1supEρexp{muξ(Sm/m)}≤Cu.(43)
The proposition gives the bound for all sufficiently large m; the remaining finitely many values can be included by increasing Cu. By symmetry, the same bound, with an additional factor of two, holds with ∣Sm∣ in place of Sm, which gives
∥P∥w2≤C(44)
for some constant C depending only on ξ and λ.
Choose θ>1 such that θλ<β2nd2. Applying (44) with weights θwA, exactly as in (25), yields
Feven∣F∣>K∑wF≤θ−KFeven∑θ∣F∣wF≤Ce−cK.(45)
To bound the second term, fix a particular set S⊆[n] of b vertices, as in the proof of (26). Set
MS:=FevendegF(i)≥4∀i∈S∑wF,
so that ∑F evenwF≤∑S∈(b[n])MS. Let θ>1 be chosen below and let ai:=θ1{i∈S}. Marking each incidence at a vertex of S gives
where the last inequality follows from ai≥1. Let U:=∑i∈/Sρi and V:=∑i∈Sρi, so that ∑iaiρi=U+θV. Choose η>0 with (1+η)λ<β2nd2. Independence and convexity give
(47) where cη>0 is some constant. (43) upper bounds the first factor by taking m=n−b. For the second factor, note that ξ(q)≤ξ(1)q2 for q∈[0,1], so the Gaussian integration argument in the proof of Theorem 3.7 yields
provided θ2<2bλcηξ(1)n and θ∣V∣/n≤1. Since b≤κ0n, for sufficiently small constants κ0 and c0, we can set
θ2:=1+c0n/b,
satisfying 2λcηξ(1)θ2b/n≤2λcηξ(1)(κ0+c0)<1 and θ∣V∣/n≤κ0+c0≤1. This upper bounds the second factor by a constant and gives MS≤Cθ−4b. Summing over the choices of S, proves, similarly to Theorem 4.1,
Fevens(F)≥b∑wF≤C(bn)θ−4b≤C(Cb/n)b.(48)
It remains to bound the third term. Fix an integer h≥1. Again letting ρ1,…,ρn to be independent signs and Sn=∑iρi, we have
We now upper bound the weights wA. For a fixed A⊆[n] and p≥∣A∣, there are O(n(p−∣A∣)/2) p-tuples i for which A(i)=A. Then, the variances vA depend only on ∣A∣ and satisfy
4After expanding products and exponentials, every resulting spin monomial has expectation zero or one, so increasing nonnegative coefficients can only increase the expectation.
Apply this with m=h,3h and use (x+y)h≤2h−1(xh+yh) for x,y≥0 and h!≥(h/e)h to obtain
Plugging the term-wise bounds (45), (48), and (51) into (41), we obtain
∥P−PK,b∥w2≤Ce−cK+C(Cb/n)b+C(CK/n)b/2.
Choose sufficiently large constants A,A′ and set
K:=⌈AL⌉,b:=⌈log(n/L)A′L⌉.
For sufficiently small κ>0, the assumption logn≤L≤κn ensures K,b≤κ0n and
logCKn≥21logLn,logCbn≥21logLn.
Thus the three terms are at most Ce−cAL, Ce−A′L/2, and Ce−A′L/4, respectively. Taking A,A′ sufficiently large makes each at most e−L/3. Since L/log(n/L)≥1, the cutoffs have the asserted orders. This proves the lemma.
A.3 Deterministic estimator via color coding
In this section, we extend the color-coding construction of Section 5 to a more general setting. Write F:=FK,b and PF:=PK,b for the retained family and its polynomial from (40). The key observation is that every non-pair interaction lies in the small set
B∗(F):=B(F)∪A∈F,∣A∣=2⋃A.
Outside this set, every supported vertex has degree two and is involved only in pair interactions. Thus, after fixing B∗(F), we can reuse the dynamic program developed in Section 5.3 and incorporate the non-pair interactions within the terminal set. Our ultimate goal is to prove the following extension of Theorem 5.1.
Proposition A.3. Let n≥n0 and logn≤L≤κn, and choose K,b as in Theorem A.2. There is a deterministic multilinear polynomial PF, supported on F, such that
∥PF−PF∥w2≤e−L.
Its arithmetic circuit can be constructed and evaluated in poly(n)eO(L) operations and is independent of the disorder and temperature.
We start by setting up the color coding. Since every supported vertex of an even hypergraph has degree at least two, we have
2∣V(F)∣≤i∑degF(i)=A∈F∑∣A∣≤pmaxK.
We therefore use Q:=⌊pmaxK/2⌋ colors. Fix color-class sizes n1,…,nQ differing by at most one and summing to n. All balanced colorings below have these prescribed sizes.
Let pv be the probability that a fixed set of v vertices is colorful under a uniformly random balanced coloring, with p0=1. For h:[n]→[Q], define
As in the pure SK case, we need an evaluator that also allows coefficients depending on a partial coloring. This will let us both evaluate Vh and compute the conditional expectations used to choose the colorings deterministically.
Proposition A.4. Fix integers K,b≥1 and n≥Q, a coloring h:[n]→[Q], a set U⊆[n], a partial coloring χ:U→[Q], and coefficients α:[n]2×2[Q]→R. Then the polynomial
can be evaluated exactly for arbitrary interaction inputs t=(tA)A∈E using poly(n)eO(K)nq∗ arithmetic operations.
Proof. Fix h,U,χ and the coefficients α. For every F∈F, we have ∣B∗(F)∣≤b+bpmax=:q∗. Thus, we can enumerate all possible sets B=B∗(F), and it suffices to show that, for each fixed B, we can evaluate
using poly(n)eO(K) operations. We now fix B and write q=∣B∣. We assume that h is injective on B; otherwise, the sum is empty. The key observation is that all non-pair interactions are contained in B, while every supported vertex outside B has degree two and is incident only to pairs. For this reason, most of the work has already been done in the proof of Theorem 5.4, and the only remaining step is to deal with non-uniform pair interactions within B.
We now adopt the notation used in the proof of Theorem 5.4. First, construct the table GB from (34), using Q colors and inputs tij=t{i,j} (with tij=0 for absent pairs). To keep track of the non-pair interactions, introduce a formal variable u to record the number of non-pair interactions within B, and formal variables ηa for a∈B, with ηa2=ηa, to record the terminal vertices involved in non-pair interactions. Set
Here e is the total number of interactions, r is the number of non-pair interactions, S⊂[Q]∖h(B) is the set of h-colors of the non-terminal vertices, and d is the vector of total terminal degrees. The indices j and C record, respectively, the number of non-terminal vertices in U and their set of χ-colors; M⊆B records the terminals met by non-pair interactions. As before, the relations yc2=0 enforce colorfulness, while the relations zc2=zc allow us to record sets of partial colors.
Finally, these data fully determine the value of α and whether the configuration is valid. For each fixed B, this augmented table has at most
poly(K)22Q+q(qpmaxK+q)=eO(K)
entries, and its construction still takes poly(n)eO(K) operations. Summing over the possible sets B proves the stated bound.
We now use this evaluator to extend the derandomization procedure from Section 5.2 to the mixed model here. The following lemma gives the colorings needed to prove Theorem A.3.
Lemma A.5. Under the setup above, let q∗:=(1+pmax)b. For every integer T≥1, we can construct balanced colorings h1,…,hT such that, for each s∈[T]
i<s∑⟨Vhi,Vhs⟩w≤(s−1)∥PF∥w2.(55)
The construction uses poly(n,T)eO(K)nq∗ arithmetic operations.
Proof. Let H be a uniformly random balanced coloring with the prescribed color-class sizes n1,…,nQ. Fix a coloring h:[n]→[Q] and a partial coloring χ:U→[Q] admitting a balanced completion. For a support S⊆[n] of size at most Q, its conditional probability of being colorful depends only on v=∣S∣, m=∣S∩U∣, and C=χ(S∩U). Define
αχ(v,m,C):=pv2P[HisinjectiveonS∣H∣U=χ],(56)
This expectation is explicit, so the whole table αχ can be computed in poly(n)eO(Q) operations. Now note that for the fixed coloring h,
Theorem A.4, with tA=wA, therefore computes each conditional overlap exactly in poly(n)eO(K)nq∗ time. Suppose now that h1,…,hs−1 have already been selected. For a partial coloring χ:U→[Q] admitting a balanced completion, define
Φs(χ):=EH[i<s∑⟨Vhi,VH⟩w∣H∣U=χ].
Since the weights depend only on interaction sizes, ⟨Vh,PF⟩w is the same for every balanced coloring h; averaging over h shows that it equals ∥PF∥w2. Unbiasedness therefore gives
Φs(∅)=(s−1)∥PF∥w2.
Assign color to vertices in the order 1,…,n. At each step, evaluate Φs for every extension by a color and choose an extension that minimizes it. By the law of total expectation, the current value is a weighted average of the values of these extensions, so the chosen extension does not increase Φs. The resulting coloring hs is balanced and satisfies
At each of the n steps, we consider at most Q colors and compute at most s−1 conditional overlaps per color. Constructing all T colorings therefore requires at most nQT2 conditional overlap evaluations. The cost established above gives the stated running time.
We are now ready to prove Theorem A.3.
Proof of Theorem A.3. The calculation in the proof of Theorem 5.1, with Q in place of K, gives pv>8−Q. Moreover, since wA depends only on the size ∣A∣, for every balanced coloring h we have
⟨Vh,PF⟩w=∥PF∥w2,and∥Vh∥w2≤8Q∥PF∥w2.(58)
Take the deterministic colorings supplied by Theorem A.5 and set
where the last inequality follows from (42). Choosing T=⌈C8QeL⌉ gives the required error bound. To evaluate each Vh, apply Theorem A.4 with U=∅ and α(v,m,C)=1/pv.
It remains to bound the running time. Since Q=O(K)=O(L), we have logT=O(L). Also, q∗=O(b), and the cutoffs in Theorem A.2 give, after decreasing κ if necessary, nq∗=eO(L). Thus both construction and evaluation take poly(n)eO(L) operations. The colorings depend only on F and the weights wA, so the resulting circuit is independent of G and β.
Combining this approximation with the truncation bound yields a single statement valid for every accuracy parameter L≥logn.
Corollary A.6. For every n≥2 and L≥logn, one can deterministically construct a multilinear polynomial PL satisfying
∥PL−P∥w2≤e−L.
Its arithmetic circuit is independent of the disorder and temperature and can be constructed and evaluated in poly(n)eO(L) operations.
Proof. If n≥n0 and L+log2≤κn, apply Theorems A.2 and A.3 with L′≥L+1. The polynomial PF−PF is supported on F, whereas P−PF is supported outside it. Their squared coefficient norms therefore add, giving
∥PF−P∥w2=∥PF−PF∥w2+∥P−PF∥w2≤2e−L′=e−L.
For the remaining values of n, L, use the exact spin average from (37):
PL(t):=P(t)=2−nσ∈{±1}n∑A∈E∏(1+tAσA).
This takes O(2nnpmax) operations. Since either n<n0 or κn<L+1, this cost is also poly(n)eO(L).
A.4 Lower bound for the normalized partition function
In this section, we will prove analogue of Theorem 3.5 in general setting.
Lemma A.7. There are constants c>0, C≥1, and a sequence ζn=o(1) such that, for every 0<α<1/2,
PG[∣z∣≤β∗inf∣YG(z)∣≥C−1αc]≥1−ζn−α.(59)
The constants and the sequence depend only on the mixture and the fixed radii.
Proof. We follow the proof of Theorem 3.5. Recall that [BHL+25,Theorem1.2] gives that
PG[YG(z)=0forall∣z∣<R0]≥1−ζn(60)
for some ζn=o(1). The Gaussian calculation in the proof of Theorem 3.7 gives
EG∣YG(z)∣2=Eρexp{n∣z∣2ξ(Sn/n)},(61)
where Sn=∑iρi for independent uniform signs ρi. Thus (43) bounds this second moment by Cλ on ∣z∣=λ. Applying (21) as in the proof of Theorem 3.8, we obtain
EG∣z∣≤R0sup∣YG(z)∣2≤(1−R0/λ)−2Cλ≤CU,(62)
where CU≥1 is fixed. Hence, by Markov's inequality, sup∣z∣≤R0∣YG(z)∣≤M:=CU/α with probability at least 1−α.
On the intersection with the event in (60), the Harnack argument in the proof of Theorem 3.5, with R0 in place of R1, gives
∣z∣≤β∗inf∣YG(z)∣≥M−2β∗/(R0−β∗)=CU−cαc,
for c=bη∗/(R0−β∗), so the lemma follows with C=CUc.
A.5 Proof of the main theorem
We first extend Theorems 3.3 and 3.4 to the mixed model. For a deterministic multilinear polynomial f(t)=∑F⊆EfFtF, define, as in (13),
Together with tanh(∣z∣2vA)≤R02vA≤λvA=wA, this proves (64). Applying (15) to LG(P−P), exactly as in the proof of Theorem 3.4, proves (65) with Cerr=C0(1−β∗/R0)−2.
Proof of Theorem 1.1. Let c, C be the constants in Theorem A.7, and put a:=C−1(δ/2)c and Cerr be the constant in Theorem A.8.. Choose L=Θ(log(n/(εδ))) so that
Cerre−L≤2δε2a2.
Take PL from Theorem A.6 and set YG:=LGPL. Then, from Theorems A.7 and A.8 and Markov's inequality, we can conclude that
Note that by (37) and (63), this has the same relative error as YG. Moreover, construction and evaluation of the estimator take poly(n)eO(L)+O(npmax)=(n/(εδ))O(1) operations, which concludes the proof.
References
[ALR87] M. Aizenman, J. L. Lebowitz, and D. Ruelle. Some rigorous results on the Sherrington-Kirkpatrick spin glass model. Comm. Math. Phys., 112(1):3–20, 1987. 3, 4, 5, 20
[ALR88] M. Aizenman, J. L. Lebowitz, and D. Ruelle. Some rigorous results on the Sherrington-Kirkpatrick spin glass model. Comm. Math. Phys., 112(1):3–20, 1988. 4, 20
[AYZ95] Noga Alon, Raphael Yuster, and Uri Zwick. Color-coding. J. Assoc. Comput. Mach., 42(4):844–856, 1995. 2, 5, 14
[Bar16] Alexander Barvinok. Combinatorics and complexity of partition functions, volume 30 of Algorithms and Combinatorics. Springer, Cham, 2016. 2
[BHL +25] Ferenc Bencs, Brice Huang, Daniel Z. Lee, Kuikui Liu, and Guus Regts. On zeros and algorithms for disordered systems: mean-field spin glasses, 2025. 2, 3, 5, 8, 10, 22, 28
[Cel24] Michael Celentano. Sudakov-Fernique post-AMP, and a new proof of the local convexity of the TAP free energy. Ann. Probab., 52(3):923–954, 2024. 1
[ES73] P. Erdős and J. L. Selfridge. On a combinatorial game. J. Combinatorial Theory Ser. A, 14:298–301, 1973. 6, 15
[LSS26] Holden Lee, Juspreet Singh Sandhu, and Jonathan Shi. Potential hessian ascent iv: Sampling the sherrington-kirkpatrick model at β<1, 2026. 1
[Ope26a] OpenAI. A spectral gap throughout the high-temperature Sherrington–Kirkpatrick phase. OpenAI Math Release preprint OAI:A-spectral-gap-throughout-the-high-temperature-Sherrington-Kirkpatrick-phase-September-24-2026, 2026. 3
[Ope26b] OpenAI. Cutoff throughout the high-temperature Sherrington–Kirkpatrick phase. OpenAI Math Release preprint OAI:Cutoff-throughout-the-high-temperature-Sherrington-Kirkpatrick-phase-September-24-2026, 2026. 3
[Pan13] Dmitry Panchenko. The Parisi ultrametricity conjecture. Ann. of Math. (2), 177(1):383–393, 2013. 1
[Rag88] Prabhakar Raghavan. Probabilistic construction of deterministic algorithms: approximating packing integer programs. J. Comput. System Sci., 37(2):130–143, 1988. Twenty-Seventh Annual IEEE Symposium on the Foundations of Computer Science (Toronto, ON, 1986). 6, 15
[SK75] David Sherrington and Scott Kirkpatrick. Solvable model of a spin-glass. Phys. Rev. Lett., 35:1792–1796, Dec 1975. 1
[SS14] Allan Sly and Nike Sun. Counting in two-spin models on d-regular graphs. Ann. Probab., 42(6):2383–2416, 2014. 1
[SZ26] Alexander Schmidhuber and Alexander Zlokapa. Polynomial-time classical algorithms for mean-field models up to the glass transition, 2026. 3
[Tal06] Michel Talagrand. The Parisi formula. Ann. of Math. (2), 163(1):221–263, 2006. 1
[Wei06] Dror Weitz. Counting independent sets up to the tree threshold. In STOC'06: Proceedings of the 38th Annual ACM Symposium on Theory of Computing, pages 140–149. ACM, New York, 2006. 1