Skip to main content
IOP Publishing logoLink to IOP Publishing
. 2026 Jan 23;59(4):045001. doi: 10.1088/1751-8121/ae38a4

A note on the dynamics of extended-context disordered kinetic spin models

Jacob A Zavatone-Veth 1,*, Cengiz Pehlevan 2
PMCID: PMC12828263  PMID: 41583832

Abstract

Inspired by striking advances in language modeling, there has recently been much interest in developing autogressive sequence models that are amenable to analytical study. In this short note, we consider extensions of simple disordered kinetic glass models from statistical physics. These models have tunable correlations, are easy to sample, and can be solved exactly when the state space dimension is large. In particular, we give an expository derivation of the dynamical mean field theories that describe their asymptotic statistics. We therefore propose that they constitute an interesting set of toy models for autoregressive sequence generation, in which one might study learning dynamics.

Keywords: sequence modeling, dynamical mean field theory, kinetic Ising model

1. Introduction

There has recently been substantial interest in autoregressive sequence modeling, i.e. in models for probability distributions of the form p(st|st−1,…,st−K) for some tokens st and a context length K, as modern large language models (LLMs) are fundamentally of this form [1–3]. Given the striking capabilities of such models, developing a theoretical understanding of how those abilities depend on data structure and model architecture is a pressing goal. From the perspective of the statistical physics of learning, we would like to devise a setting in which we could study how a ‘student’ model learns to imitate sequences generated by a ‘teacher’ of similar architecture [4, 5]. The key challenge is to formulate an interesting yet analytically tractable class of models for distributions of this form. Recent work by Rende et al [6] has shown that a modified Potts model is a suitable candidate for a teacher in the context of masked sequence modeling, but the autoregressive setting is still open.

What are the desiderata that a candidate toy autoregressive sequence model should satisfy? We propose that such a model should be analytically tractable, at least in some limits, be easy to sample numerically, display interesting statistical properties, e.g. tunable temporal correlations, and resemble ‘real-world’ sequence models, either in its structure or in its statistical properties. In this note, we take inspiration from statistical physics [7–10], to propose a simple model satisfying these four desiderata.

2. Inspiration: the kinetic Sherrington–Kirkpatrick (kSK) model

From a physical perspective, a natural starting point is the fully asymmetric kSK model. The kSK model is a Markov chain on {−1,+1}N with

pJ(st|st−1)=exp⁡[−βst⊤Jst−1]∑ut∈{−1,+1}Nexp⁡[−βut⊤Jst−1]

for an inverse temperature β > 0 and a quenched random interaction matrix J with i.i.d. Gaussian elements Jij∼N(0,g2/N). For simplicity, we will focus on the ‘pure’ SK case, where the interactions have mean zero and there is no external magnetic field to bias the state distribution.

After being studied by Crisanti and Sompolinsky [7, 8] in the late 1980 s for various continuous-time dynamics, the discrete-time version of the kSK model has recently emerged as a paradigmatic model for the thermodynamics of nonequilibrium complex systems [9, 10]. Moreover, Bal [11] has observed in a series of blog posts that the kSK model bears a strong structural resemblance to the Attention mechanism used in modern autoregressive language models. At large N the kSK model is amenable to solution by mean-field techniques, and it is easy to sample thanks to the fact that the sites are conditionally independent given the local field ht=−βJst−1, i.e. we have the factorization

pJ(st|st−1)=∏j=1Nexp⁡[st,jht,j]2cosh⁡(ht,j).

However, this model is insufficient for our purposes, because it exhibits single-step decorrelation, i.e. EJ⟨st⋅st+1⟩=0 for all times t, where ⟨⋅⟩ denotes averaging over the random process for some fixed initial condition s0 and a fixed realization of J for a quantity depending on times up to T. This decorrelation follows from a simple symmetry argument. Concretely, we observe that the transformation s~t=−st for t odd, s~t=st for t even, and J~=−J leaves the combined measure in EJ⟨⋅⟩ invariant for any fixed s0. This implies immediately that EJ⟨st⟩=0 for any odd t, and that EJ⟨st⋅st′⟩=0 whenever t and t′ have opposite parity. The reason for the structure of this transformation is that the s0-dependent term in the measure is invariant under flipping the sign of J only if s1 is also negated. This argument implies that one always has one-step decorrelation for this model, i.e. EJ⟨st⋅st+1⟩=0. Single-step decorrelation could be avoided by adding a positive mean to J, so as to encourage alignment between st and st−1, but this does not yield flexibly tunable temporal correlations [10]. We will therefore pursue an alternative approach.

3. Construction of the model

We now introduce the three classes of extended-context models we consider in this work. Consider an N-dimensional state space SN, which we conceptualize as representing the token embedding space of a sequence model. We will take N to be large, consistent with the use of embedding spaces of dimension greater than 10 000 in modern sequence models [2]. Equip SN with a (possibly un-normalized) probability measure σN that is reflection-symmetric, i.e. invariant under s↦−s for all s∈SN. We consider three models:

  • 1.

    Ising: SN={−1,+1}N with σN the uniform counting measure.

  • 2.

    Gaussian: with SN=RN and σN the standard Gaussian measure

  • 3.

    Spherical: SN={s∈RN:‖s‖22=N} and σN the uniform probability measure on the sphere.

Define a Markov chain of order K on SN by the transition probabilities with density

p{Jk}(st|st−1,…st−K)=exp⁡[−βE{Jk}(st;st−1,…,st−K)]∫dσN(ut)exp⁡[−βE{Jk}(ut;st−1,…,st−K)]

with respect to σN, for an inverse temperature β > 0 and an energy function

E{Jk}(st;st−1,…,st−K)=∑k=1Kst⊤Jkst−k

for a set of interaction matrices {Jk}k=1K. Again, we write ⟨⋅⟩ for the average over the random process for some fixed initial sequence s0,…,s1−K, i.e. for a quantity depending on times up to T, we have

⟨⋅⟩=∫∏t=1TdσN(st)(⋅)∏t=1Tp{Jk}(st|st−1,…st−K).

We generalize the fully asymmetric kSK model by taking the interaction matrices Jk to be jointly Gaussian, with zero mean. As a concrete model, we will focus on the case in which the interactions are uncorrelated across sites but possibly correlated across lags, i.e.

EJ[(Jk)ij(Jk′)i′j′]=1Nδii′δjj′Γk,k′

for some correlation matrix Γk,k′3. Our objective is to study the resulting ensemble of random dynamical systems with quenched disorder.

For any context length, all of these models are easy to sample from numerically. In the Ising case, as for the simple kinetic SK model, we have independence of sites conditioned on the local field, as p{Jk}(st|st−1,…st−K)=∏j=1Nexp⁡(st,jht,j)2cosh⁡(βht,j) for ht=−β∑k=1KJkst−k. In the Gaussian case, we have p{Jk}(st|st−1,…st−K)dσN(st)∝exp⁡[−12‖st−ht‖2]dst up to normalization, so here again sites are independent conditioned on the local field. In the spherical case, we see immediately from the expression p{Jk}(st|st−1,…st−K)∝exp⁡[ht⊤st] that, conditioned on the context, st follows a von Mises–Fisher distribution with mean direction μ=−Nht‖ht‖ and concentration parameter κ=‖ht‖N on the N-sphere of radius N. This is easy to sample using standard algorithms [13]. Therefore, all three models satisfy the desideratum of efficient sampling.

4. Dynamical mean-field theory

We now turn to the questions of whether these models are analytically tractable, and if they display interesting statistical behavior. In the limit where N→∞ for fixed T and K, the asymptotic statistics of these models are easy to characterize using standard dynamical field theory (DMFT) approaches from the statistical physics of disordered systems. In particular, we consider the generating function

Z[{bt};{Jk}]=⟨exp⁡[∑t=1Tbt⋅st]⟩.

As usual [7, 8], the fact that Z[{bt};{Jk}]|{bt=0}=1 for any {Jk} implies that the generating function can be averaged directly over the quenched disorder to obtain Z[{bt}]=EJZ[{bt};{Jk}], from which we can immediately compute quenched moments, e.g. EJ⟨st⟩=∂Z[{bt}]/∂bt|{bt=0}.

In the Appendices, we give an expository derivation of the DMFT equations for each variant of the models we consider. For all three models, the DMFT order parameter is the self-averaging two-point function

Ct,t′=EJ⟨1Nst⋅st′⟩,

in terms of which the effective single-site distribution is self-consistently determined. In the Ising-like and spherical models, the Cauchy–Schwarz inequality and triangle inequality together imply that |Ct,t′|⩽1, while in the Gaussian case boundedness is not guaranteed. For all three models, for t,t′=1−K,…,0, Ct,t′ is entirely fixed by the initial condition as Ct,t′=1N∑j=1Nst,jst′,j, while for t=1,…,T and t′=1−K,…,0 we have Ct,t′=0. For brevity, let

Σt,t′=β2∑k,k′=1KΓk,k′Ct−k,t′−k′.

We can now state the results of the DMFT analysis.

4.1. Do we need correlated weights?

Before presenting the details of the DMFT descriptions of each variant of the model at hand, we briefly address the question of what we gain from introducing correlations to the interaction distribution, as the answer for all three model types is the same. In all variants of the model, the DMFT is a causal iterative equation for Ct,t′, with all dependence on previous times being through Σt,t′ as defined in (9). We are interested mostly in the long-time properties of these DMFTs, particularly when they admit stationary solutions of the form Ct,t′=Ct−t′ at long times t,t′≫1. A natural question at this point is whether we really need correlations in weights across lags to get a non-trivial stationary state, i.e. whether we could take Γk,k′=γkδk,k′ and get interesting non-vanishing temporal correlation at long times. As anticipated by the fact that we included correlations in the setup, the answer to this question is no. With Γk,k′=γkδk,k′, we have Σt,t′=β2∑k=1KγkCt−k,t′−k. Under the assumption of stationarity, Ct−k,t′−k=C(t−k)−(t′−k)=Ct−t′, hence Σt,t′=(β2∑k=1Kγk)Ct−t′. This shows that correlations across lags are required to obtain non-trivial stationary correlations. We demonstrate this for a few arbitrarily-chosen example choices of Γk,k′ in figures 1–5, which also show that the DMFT predictions are accurate.

Figure 1.

Figure 1.

Simulation of an Ising-like model with Γk,k′=δk,k′ and K = 25, with N = 5000. (a). State st over time. Times before t = 0 represent the initial condition, which is chosen arbitrarily. (b). Slices through the DMFT autocorrelation function Ct,t−k across time for varying lags k, showing that the DMFT accurately predicts the empirically-measured correlation from a single simulation. The expectation in the DMFT equations is numerically evaluated using 50-point Gauss-Hermite quadrature. We see that autocorrelations at all non-zero lags decay over time. (c). The DMFT autocorrelation function Ct,t′ from a single numerical simulation for which the slices are shown at top right. (d). The corresponding DMFT prediction for the autocorrelation function.

Figure 5.

Figure 5.

Simulations of a spherical model with Γk,k′=δk,k′+r(1−δk,k′)(−1)k+k′ for r = 0.25 and K = 25. Here, β = 1. The top row shows heatmaps of the empirical (a) and DMFT (b) correlation functions Ct,s. The bottom row shows slices through the correlation functions (c).

Figure 4.

Figure 4.

Simulations of a spherical model with Γk,k′=δk,k′+r(1−δk,k′) for r = 0.25 and K = 25. Here, β = 1. The top row shows heatmaps of the empirical (a) and DMFT (b) correlation functions Ct,s. The bottom row shows slices through the correlation functions (c).

4.2. Ising

In the Ising case, we show in appendix A that the DMFT equation is

Ct,t′=Eh∼N(0,Σ)[tanh⁡(ht)tanh⁡(ht′)]

for distinct times t,t′=1,…,T and Ct,t=1. Given the fact that Σt,t′ depends on the covariance only at previous timesteps (9), this recurrence can easily be numerically solved forward in time. The only bottleneck is numerical evaluation of the expectation, which can be performed easily using Gauss-Hermite quadrature, at least at high temperatures (see figures 1 and 2). Here, the single-site generating function is

zj=∑{st,j}t=1TEhjexp⁡[∑t=1Tbt,jst,j]∏t=1Texp⁡(st,jht,j)2cosh⁡(ht,j)

for hj∼N(0,Σ), which describes an Ising system in a self-consistently determined field.

Figure 2.

Figure 2.

As in figure 1, but for an Ising-type model with correlated weights Γk,k′=δk,k′+r(1−δk,k′)(−1)k+k′ for r = 0.1. Unlike for uncorrelated wights in figure 1, the autocorrelation does not decay to zero over time.

4.3. Gaussian

In the Gaussian case, we show in appendix B that we have the DMFT equation

Ct,t′=δt,t′+Σt,t′

for t,t′=1,…,T. For the Gaussian model, the single-site generating functions are simply

zj=exp⁡[12∑t,t′=1TCt,t′bt,jbt′,j].

Again, the causal structure means that the DMFT can be solved forward in time. However, this is now a linear system, which allows greater analytical tractability. That said, the Gaussian model is potentially unstable: if the inverse temperature β is too large then the equal-time correlations Ct,t grow exponentially with time (figure 3). We will return to this issue, and to sufficient conditions for stability, in section 5.

Figure 3.

Figure 3.

Simulations of a Gaussian model with Γk,k′=δk,k′+r(1−δk,k′)(−1)k+k′ for r = 0.1 and K = 4. Here, β = 0.5. The top row shows heatmaps of the normalized empirical (a) and DMFT (b) correlation functions Ct,s/C(t,t)C(s,s). The bottom row shows the exponential growth of C(t,t) (c) and slices through the normalized correlation functions (d).

4.4. Spherical

The development of the DMFT for the spherical model is somewhat more complicated than that for the Ising and Gaussian models due to the global constraint on the norm of the state vector. We show in appendix C how one can derive DMFT equations for this model by applying the replica trick to the normalization terms in the sequence distribution at each timestep. This leads to a DMFT in terms of Ct,t′ and a set of positive scalars Qt, where Ct,t′ satisfies the recursive equation

Ct,t′=1QtQt′(Qtδt,t′+Σt,t′)

for t,t′=1,…,T, and Qt is determined by the self-consistency condition Ct,t=1. One finds that the single-site generating functions are in this case zj=exp⁡[12∑t,t′=1TCt,t′bt,jbt′,j], meaning that the fluctuations are Gaussian. These equations are naturally solved via fixed point iteration. For a fixed Qt, this is a linear recurrence for Ct,t′ which can be solved forward in time. Then, we can compute Qt from the given Ct,t′ using the constraint Ct,t=1. Physically, the scalars Qt are up to a shift the Lagrange multipliers that enforce the norm constraint.

5. Stationary solutions for translation-invariant correlations

As uncorrelated weights do not suffice, we now consider whether we can make analytical progress in solving the DMFT equations in the stationary state for translation-invariant correlations of the form

Γk,k′=Γk−k′.

By symmetry, we of course have Γk=Γ−k, where 1−K⩽k⩽K−1. With this choice, writing τ=t−t′ and k=k−k′, we have

Στ=β2∑k=1−KK−1(K−|k|)ΓkCτ−k

In the Gaussian and spherical cases, this means that the DMFT equations become a linear convolution equation for Ct−t′=cτ:

cτ=1qδτ,0+β2q2∑k=1−KK−1(K−|k|)Γkcτ−k.

In the Gaussian case, the variable q in (17) is fixed to q = 1. In the spherical case, we should have Qt=q assuming stationarity, and we must determine q by imposing the self-consistency condition cτ=0=1 on the solution to (17).

The fact that this equation is linear makes the Gaussian and spherical models more amenable to analytical study than their Ising-type counterpart. In particular, this is a banded symmetric Toeplitz system for cτ, which we can solve using the z-transform. Before studying the solutions to (17), we remark that we may define the inverse temperature β such that Γ0=1. Then, noting that if β = 0 we have cτ=0=1/q, in this limit we should have q = 1. This will allow us to sanity-check our general solution.

5.1. Warm-up: solution for K = 1

As a warm-up, if K = 1, then (17) reduces to

cτ=1qδτ,0+β2q2cτ

which has solution

cτ={q(q2−β2)−1τ=00otherwise.

In the Gaussian case, this equation is stable if β < 1. In the spherical case, imposing the condition that cτ=0=1, we find that q=1+1+4β22. Together, this recovers our previous result that with K = 1 there must be single-step decorrelation.

5.2. Stationary solutions for K > 1

For K > 1, taking a z-transform

C(z)=∑τ=−∞∞z−τcτ

for |z|⩽1 leads to the equation

C(z)=1q+β2q2∑k=1−KK−1(K−|k|)Γkz−kC(θ),

which has formal solution

C(z)=qq2−β2∑k=1−KK−1(K−|k|)Γkz−k
=qq2−Kβ2−β2∑k=1K−1(K−k)Γk(zk+z−k),

using the fact that Γ−k=Γk. Then, we can formally obtain the solution cτ by taking the inverse transform:

cτ=∫−ππdθ2πeiτθC(eiθ)=∫−ππdθ2πeiτθqq2−Kβ2−2β2∑k=1K−1(K−k)Γkcos⁡(kθ).

We can see that, if the denominator of (24) does not vanish, then the system will be stable in the sense that |cτ|<∞ for all τ. In the spherical case, this stability condition is satisfied thanks to the fact that q must be self-consistently determined so as to make the system stable. In the Gaussian case, where q = 1, we must check that β and Γk are chosen so as to make the system stable. By the triangle inequality, a sufficient condition for stability is that

Kβ2+2β2∑k=1K−1(K−k)|Γk|<1,

where we recall that we have defined β2 such that Γ0=1. One interpretation of this condition is that it gives a conservative estimate of the maximum inverse temperature allowed in the Gaussian model:

β<1K+2∑k=1K−1(K−k)|Γk|.

If the temperature is too low, the norm of the state vector may diverge, as shown in the example of figure 3. There, K = 25 and Γk=δk,0+14(1−δk,0), so K+2∑k=1K−1(K−k)|Γk|=175. Thus, the crude estimate above indicates that β<1/175≃0.08 is sufficient to ensure stability; in figure 3 we used β = 1, which evidently exceeds the stability threshold.

For general context lengths K > 1 and correlations Γk, the integral (24) cannot be evaluated in closed form. If K = 1, then C(eiθ)=q/(q2−Kβ2) is constant, and we recover (19). If K = 2, we can make progress because (24) reduces to the arcsine distribution integral

cτ=qq2−2β2∫−ππdθ2πeiτθ1−αcos⁡(θ)

where

α=2β2Γ1q2−2β2.

Assuming −1<α<1, we can explicitly evaluate the integral to obtain

cτ=qq2−2β2(1−α2−1)|τ|α|τ|1−α2.

In the Gaussian case, upon fixing q = 1 we are done. We must only verify that the parameters are chosen such that the system is stable, which requires that |α|<1 and that β2<1/2 such that cτ=0>0. This means that we must have

|Γ1|<min{1,1−2β22β2}

such that |α|<1 and such that the weight covariance matrix (1Γ1Γ11) is positive definite. This threshold is consistent with the sufficient condition for stability that we found above.

In the spherical case, we can use the condition cτ=0=1 to solve for

q=1+4β2+1+8β2+16β4Γ122,

where we use the condition that q|β=0=1 to select the appropriate solution. This leads to a value of

α=4Γ1β21+1+8β2+16β4Γ12,

which satisfies |α|<1, and the simplified form

cτ=(1−α2−1α)|τ|.

Thus, with a two-step context, we now have exponentially-fast decorrelation with a length scale determined by the correlation strength and temperature.

5.3. Reverse-engineering weight correlations to achieve a desired stationary correlation

Instead of choosing Γk and trying to figure out the resulting autocorrelation cτ, we can choose a desired stationary autocorrelation cτ and try to reverse-engineer the required correlations Γk. The latter strategy is more in keeping with the overall goal of this note, which is to design a simple data model with tunable correlations.

We start by re-writing the z=eiθ-space equation for the stationary autocorrelation in a spherical model as

∑k=1−KK−1β2(K−|k|)Γke−ikθ=q2−qC(eiθ),

where we assume that C(eiθ)≠0. Then, we can use the orthogonality of the Fourier modes to extract

Γk=qβ2(K−|k|)(qδk,0−∫−ππdθ2πeikθ1C(eiθ)).

In this, we have two degrees of freedom: our choice of q, and that of β. These parameters are constrained by self-consistency conditions, including the fact that we must have Γ0>0. Moreover, K must be large enough so that all relevant Fourier modes are captured.

For example, suppose that we want to have autocorrelations that decay exponentially with some rate λ > 0:

cτ=e−λ|τ|.

Then, by evaluating (35) we find that we should take K = 2, and

Γk=q2β2(q−coth⁡(λ))δk,0−q2β2csch⁡(λ)δ|k|,1.

Here, we must clearly choose q>coth⁡(λ)>0, so that Γ0 is positive.

But, we can compare this with our previous solution of the self-consistent equation for K = 2. There we set the temperature such that Γ0=1, which means we should take

2β2=q(q−coth⁡(λ))andΓ1=−csch⁡(λ)q−coth⁡(λ).

Substituting these values into (32), we find that α=−sech⁡(λ) for any q>coth⁡(λ), which leads to an autocorrelation

cτ=(1−α2−1α)|τ|=e−λ|τ|.

Thus, provided that we choose q appropriately, everything is self-consistent.

6. Conclusions

We have analyzed the dynamics of a class of vector spin models generalizing the disordered kinetic Ising model, showing the minimal conditions required to obtain non-trivial correlation structure in the stationary state. Our note is a preliminary step towards an analyses of teacher-student learning in these toy autoregressive sequence models [4]. Moreover, the DMFT equations derived here may be of independent interest in the context of nonequilibrium dynamics [14], as they generalize those derived for single-step context (K = 1) models in prior works [9–11].

Acknowledgments

We thank Blake Bordelon for helpful comments on a previous version of this note.

Appendix A. Ising DMFT

Here we give a detailed derivation of the DMFT in the Ising case.

A.1. Averaging over the disorder

We have the quenched generating function

Z[b]=EJZ[b;{Jk}]
=∑{st}t=1Texp⁡[∑t=1Tbt⋅st]EJ∏t=1Tp{Jk}(st|st−1,…st−K)
=∑{st}t=1Texp⁡[∑t=1Tbt⋅st]EJ∏t=1Texp⁡[−β∑k=1Kst⊤Jkst−k]∑utexp⁡[−β∑k=1Kut⊤Jkst−k].

Under the assumption that the interaction matrices are jointly Gaussian, the local fields

ht=−β∑k=1KJkst−k

are jointly Gaussian under the distribution of the disorder, and have mean zero at all times. With the specific assumption that

EJ[(Jk)ij(Jk′)i′j′]=1Nδii′δjj′Γk,k′,

their covariance is

EJ[ht,jht′,j′]=δjj′β2∑k,k′=1KΓk,k′Ct−k,t′−k′,

where we define the temporal correlation function of the state:

Ct,t′=1Nst⊤st′.

As the states are binary, we have

Ct,t=1

at all times.

A.2. Introducing order parameters

We now follow the standard procedure of introducing the correlation functions as order parameters. We enforce the definition of Ct,t′ via Fourier representations of the δ-distribution with Lagrange multipliers C^t,t′, writing

1=∫dC∫dC^exp⁡[−N2∑t,t′=1−KTCt,t′C^t,t′+12∑t,t′=1−KTC^t,t′st⋅st′],

where the integral over C is taken over real symmetric matrices with diagonal elements identically equal to one and the integral over C^ is taken over imaginary symmetric matrices with diagonal elements identically equal to zero. We absorb the factors of 2π required to normalize the δ-distribution into the measure dC^.

We then have

Z=∫dC∫dC^exp⁡[−N2∑t,t′=1−KTCt,t′C^t,t′]×∑{st}t=1TEhexp⁡[∑t=1Tbt⋅st+12∑t,t′=1−KTC^t,t′st⋅st′]∏t=1Texp⁡[st⊤ht]∑utexp⁡[ut⊤ht].

As the fields ht,j are independent and identically distributed across sites j, we have the factorization

∑{st}t=1TEhexp⁡[∑t=1Tbt⋅st+12∑t,t′=1−KTC^t,t′st⋅st′]∏t=1Texp⁡[st⊤ht]∑utexp⁡[ut⊤ht]
=∑{st}t=1TEhexp⁡[∑t=1Tbt⋅st+12∑t,t′=1−KTC^t,t′st⋅st′]∏t=1Texp⁡[st⊤ht]∏j=1N2cosh⁡(ht,j)
=∏j=1Nzj,

where we have defined the single-site generating functions

zj=∑{st,j}t=1TEhjexp⁡[∑t=1Tbt,jst,j+12∑t,t′=1−KTC^t,t′st,jst′,j]∏t=1Texp⁡(st,jht,j)2cosh⁡(ht,j).

This yields

Z=∫dC∫dC^exp⁡[NS],

where

S=−12∑t,t′=1−KTCt,t′C^t,t′+1N∑j=1Nlog⁡zj.

At this point, all site-specific dependence is through the initial conditions, which appear in the single-site term multiplying C^t,t′, and through the sources. As a result, the integrals over the order parameters and Lagrange multipliers should be amenable to saddle-point evaluation at large N.

A.3. The saddle-point equations

We can now determine the saddle-point equations. From ∂S/∂C^t,t′=0, we have the self-consistent equation

Ct,t′=1N∑j=1N⟨st,jst′,j⟩j

for any two distinct times t,t′=1−K,…,T. Here, the single-site average ⟨⋅⟩j is defined via

⟨⋅⟩j=1zj∑{st,j}t=1TEhj(⋅)exp⁡[∑t=1Tbt,jst,j+12∑t,t′=1−KTC^t,t′st,jst′,j]∏t=1Texp⁡(st,jht,j)2cosh⁡(ht,j)|b=0.

One must be a bit careful when considering boundary terms for which t or t′ is less than or equal to zero, as the boundary states are deterministic and fixed by the initial condition. For t,t′=1−K,…,0, Ct,t′ is entirely fixed by the boundary condition as

Ct,t′=1N∑j=1Nst,jst′,j.

Now suppose that t=1,…,T and t′=1−K,…,0. Then, st′,j is fixed by the initial condition, and we have

Ct,t′=1N∑j=1N⟨st,j⟩jst′,j.

Our remaining task is to determine the Lagrange multipliers C^t,t′, recalling that C^t,t=0 by definition. We first remark that the solution

C^t,t′=0

for all t,t′ is consistent with the normalization condition Z = 1 when b = 0, as we then have

zj|b=0=∑{st,j}t=1TEhj∏t=1Texp⁡(st,jht,j)2cosh⁡(ht,j)
=Ehj2cosh⁡(ht,j)2cosh⁡(ht,j)
=1,

and ∑t≠t′C^t,t′Ct,t′=0, which yields Z|b=0=1.

To show this more carefully, we consider the saddle-point equation ∂S/∂Ct,t′=0, which gives

C^t,t′=1N∑j=1N1zj∂zj∂Ct,t′|b=0

for any two distinct times t,t′, where we recall that we have constrained C^t,t′ to be symmetric, which compensates for the factor of 1/2. All of the dependence on Ct,t′ in zj is contained in the covariance of hj, which for any t,t′=1,…,T is

Σt,t′≡EJ[ht,jht′,j]=β2∑k,k′=1KΓk,k′Ct−k,t′−k′.

Then, for any times q,q′=1,…,T and any two distinct times t,t′=1−K,…,T, we have

∂Σq,q′∂Ct,t′=β2∑k,k′=1KΓk,k′δq−k,tδq′−k′,t′

so

1zj∂zj∂Ct,t′|b=0=∑q,q′=1T∂Σq,q′∂Ct,t′1zj∂zj∂Σq,q′|b=0
=β2∑k,k′=1KΓk,k′∑q,q′=1Tδq−k,tδq′−k′,t′1zj∂zj∂Σq,q′|b=0
=β2∑k,k′=1KΓk,k′1{t+k,t′+k′⩾1}1zj∂zj∂Σt+k,t′+k′|b=0.

We can evaluate the required derivatives of expectations using Price’s theorem [15]. However, we must be careful to account for the fact that t + k and t′+k′ might coincide. First, for any distinct times t,t′=1,…,T, we have

∂∂Σt,t′Ehj∏t=1Texp⁡(st,jht,j)2cosh⁡(ht,j)=Ehj∂∂ht,j∂∂ht′,j∏t=1Texp⁡(st,jht,j)2cosh⁡(ht,j)
=Ehj[st,j−tanh⁡(ht,j)][st′,j−tanh⁡(ht′,j)]∏t′′=1Texp⁡(st′′,jht′′,j)2cosh⁡(ht′′,j).

Second, we have the equal-time derivatives

∂∂Σt,tEhj∏t=1Texp⁡(st,jht,j)2cosh⁡(ht,j)=12Ehj∂2∂ht,j2∏t=1Texp⁡(st,jht,j)2cosh⁡(ht,j)
=12Ehj{[st,j−tanh⁡(ht,j)]2−sech⁡(ht,j)2}∏t=1Texp⁡(st,jht,j)2cosh⁡(ht,j).

Putting these results together and using the definition of the single-site average, we find that for any t,t′=1,…,T

1zj∂zj∂Σt,t′|b=0=(1−δt,t′)⟨[st,j−tanh⁡(ht,j)][st′,j−tanh⁡(ht′,j)]⟩j+12δt,t′⟨[st,j−tanh⁡(ht,j)]2−sech⁡(ht,j)2⟩j,

in terms of which we have

C^t,t′=β2∑k,k′=1KΓk,k′1{t+k,t′+k′⩾1}1N∑j=1N1zj∂zj∂Σt+k,t′+k′|b=0

for any two distinct times t,t′. We emphasize that thanks to the constraint on the sum over k and k′, the right-hand-side of this equation does not depend directly on the initial condition; all of the fields that appear are at times greater than or equal to 1.

Then, to show that the solution C^t,t′=0 is self-consistent, we would like to show that the expectations listed above vanish under that assumption. To do so, we will simplify the single-site generating function

zj=∑{st,j}t=1TEhjexp⁡[∑t=1Tbt,jst,j+12∑t,t′=1−KTC^t,t′st,jst′,j]∏t=1Texp⁡(st,jht,j)2cosh⁡(ht,j)

and the resulting single-site averages using a Hubbard-Stratonovich transformation. Noting that C^t,t=0 by construction, we multiply and divide by

exp⁡(12(T+K)ρ)

for a positive real regulating parameter ρ, which gives

zj=e−(T+K)ρ/2∑{st,j}t=1TEhjexp⁡[∑t=1Tbt,jst,j+12∑t,t′=1−KT(ρδt,t′+C^t,t′)st,jst′,j]∏t=1Texp⁡(st,jht,j)2cosh⁡(ht,j).

Then, letting ut,j be a mean-zero Gaussian field with covariance

Euj[ut,jut′,j]=ρδt,t′+C^t,t′,

we have

zj=e−(T+K)ρ/2Ehj,uj∑{st,j}t=1Texp⁡[∑t=1Tbt,jst,j+∑t=1−KTut,jst,j]∏t=1Texp⁡(st,jht,j)2cosh⁡(ht,j)
=e−(T+K)ρ/2Ehj,ujexp⁡[∑t=1−K0ut,jst,j]∏t=1T∑st,jexp⁡(st,jbt,j+st,jht,j+st,jut,j)2cosh⁡(ht,j)
=e−(T+K)ρ/2Ehj,ujexp⁡[∑t=1−K0ut,jst,j]∏t=1Tcosh⁡(bt,j+ht,j+ut,j)cosh⁡(ht,j).

Then, for any two distinct positive times t,t′=1,…,T, we have

⟨st,j⟩j=1zj∂zj∂bt,j|b=0
=1zje−(T+K)ρ/2Evj,uj{exp⁡[∑t=1−K0st,jut,j][∏t′≠tcosh⁡(bt′,j+ht′,j+ut′,j)cosh⁡(ht′,j)]sinh⁡(bt,j+ht,j+ut,j)cosh⁡(ht,j)}|b=0
=⟨tanh⁡(ht,j+ut,j)⟩j,
⟨st,jst′,j⟩j=1zj∂2zj∂bt,j∂bt′,j|b=0
=1zje−(T+K)ρ/2Evj,uj{exp⁡[∑t=1−K0st,jut,j][∏t′′≠t,t′cosh⁡(bt′′,j+ht′′,j+ut′′,j)cosh⁡(ht′′,j)]×sinh⁡(bt,j+ht,j+ut,j)cosh⁡(ht,j)sinh⁡(bt′,j+ht′,j+ut′,j)cosh⁡(ht′,j)}|b=0
=⟨tanh⁡(ht,j+ut,j)tanh⁡(ht′,j+ut′,j)⟩j,

and

⟨st,jtanh⁡(ht′,j)⟩j=1zje−(T+K)ρ/2Evj,uj{exp⁡[∑t=1−K0st,jut,j][∏t′′≠tcosh⁡(bt′′,j+ht′′,j+ut′′,j)cosh⁡(ht′′,j)]×sinh⁡(bt,j+ht,j+ut,j)cosh⁡(ht,j)tanh⁡(ht′,j)}|b=0
=⟨tanh⁡(ht,j+ut,j)tanh⁡(ht′,j)⟩j.

Examining these results, if C^t,t′=0, then the correlations between different ut,j vanish, and we can evaluate all of the expectations over the then independent variables ut,j∼N(0,ρ) using the identity

Ex∼N(0,ρ)sinh⁡(x+y)=eρ/2sinh⁡(y).

In particular, all of the dependence on the regulator ρ drops out—as should happen as it is arbitrary—and we can see that we will then have

⟨st,j⟩j|C^t,t′=0=⟨tanh⁡(ht,j)⟩j,
⟨st,jst′,j⟩j|C^t,t′=0=⟨tanh⁡(ht,j)tanh⁡(ht′,j)⟩j,

and

⟨st,jtanh⁡(ht′,j)⟩j|C^t,t′=0=⟨tanh⁡(ht,j)tanh⁡(ht′,j)⟩j

for any two distinct times t,t′=1,…,T.

Therefore, for any two distinct times t,t′=1,…T, we have

1zj∂zj∂Σt,t′|b=0|C^t,t′=0=⟨[st,j−tanh⁡(ht,j)][st′,j−tanh⁡(ht′,j)]⟩j|C^t,t′=0=0.

We now turn our attention to the t=t′ term

1zj∂zj∂Σt,t|b=0=12⟨[st,j−tanh⁡(ht,j)]2−sech⁡(ht,j)2⟩j.

As st,j is binary, we have

⟨[st,j−tanh⁡(ht,j)]2−sech⁡(ht,j)2⟩j=1−2⟨st,jtanh⁡(ht,j)⟩j+⟨tanh⁡(ht,j)2⟩j−⟨sech⁡(ht,j)2⟩j.

Using the result above, we may write

⟨st,jtanh⁡(ht,j)⟩j=1zje−(T+K)ρ/2Evj,uj{exp⁡[∑t=1−K0st,jut,j][∏t′′≠tcosh⁡(bt′′,j+ht′′,j+ut′′,j)cosh⁡(ht′′,j)]×sinh⁡(bt,j+ht,j+ut,j)cosh⁡(ht,j)tanh⁡(ht,j)}|b=0
=⟨tanh⁡(ht,j+ut,j)tanh⁡(ht,j)⟩j.

From this, and following the logic above for how to evaluate the expectation over ut,j when C^t,t′=0, we have

⟨[st,j−tanh⁡(ht,j)]2−sech⁡(ht,j)2⟩j|C^t,t′=0=1−2⟨tanh⁡(ht,j)2⟩j+⟨tanh⁡(ht,j)2⟩j−⟨sech⁡(ht,j)2⟩j
=⟨1−[tanh⁡(ht,j)2+sech⁡(ht,j)2]⟩j
=0

thanks to the identity tanh⁡(h)2+sech⁡(h)2=1.

Therefore, we conclude that for any two times t,t′=1,…,T, whether equal or not, we have

1zj∂zj∂Σt,t′|b=0|C^t,t′=0=0.

Thus, as the saddle-point equation for C^t,t′ is

C^t,t′=β2∑k,k′=1KΓk,k′1{t+k,t′+k′⩾1}1N∑j=1N1zj∂zj∂Σt+k,t′+k′|b=0,

we find that the solution

C^t,t′=0

is self-consistent, as suggested by the normalization of the generating function.

Moreover, with C^t,t′=0 the single-site generating function simplifies to

zj=∑{st,j}t=1TEhjexp⁡[∑t=1Tbt,jst,j]∏t=1Texp⁡(st,jht,j)2cosh⁡(ht,j)
=Ehj∏t=1Tcosh⁡(bt,j+ht,j)cosh⁡(ht,j)

and the single-site averages simplify accordingly. In particular, for any two distinct times t,t′=1,…,T, we now have

Ct,t′=1N∑j=1N⟨st,jst′,j⟩j
=Eh[tanh⁡(ht)tanh⁡(ht′)],

as the single-site average is now manifestly site-independent. As noted previously, for t,t′=1−K,…,0, Ct,t′ is entirely fixed by the boundary condition as

Ct,t′=1N∑j=1Nst,jst′,j.

Finally, for mixed boundary-bulk correlators with t=1,…,T and t′=1−K,…,0, we have

Ct,t′=1N∑j=1N⟨st,j⟩jst′,j
=1N∑j=1Nst′,jEv[tanh⁡(vt)]
=0.

A.4. Summarizing the DMFT

In summary, we have derived a DMFT for the temporal correlation of the state, defined by the self-consistent equation

Ct,t′=Eh[tanh⁡(ht)tanh⁡(ht′)]

for distinct times t,t′=1,…,T and Ct,t=1, where ht is a zero-mean Gaussian with covariance

Eh[htht′]=β2∑k,k′=1KΓk,k′Ct−k,t′−k′,

For t,t′=1−K,…,0, Ct,t′ is entirely fixed by the initial condition as

Ct,t′=1N∑j=1Nst,jst′,j,

while Ct,t′=0 if t=1,…,T and t′=1−K,…,0.

Appendix B. Gaussian DMFT

We now consider the Gaussian model. Here, we fix a prior over states

st∼N(0,IN),

which in the large-N limit will give a concentrating norm ‖st‖2∼N. Writing the local field at time t as

ht=−β∑k=1KJkst−k

the normalization factor at that time is then

Eut∼N(0,IN)exp⁡[−β∑k=1Kut⊤Jkst−k]=Eut∼N(0,IN)exp⁡[ut⊤ht]
=exp⁡(12‖ht‖2),

which of course factorizes over sites. We can then write the single-step transition density as

p{Jk}(st|st−1,…,st−K)=exp⁡(st⊤ht−12‖ht‖2),

hence the density with respect to Lebesgue measure simply becomes

p{Jk}(st|st−1,…,st−K)dσNds(st)=exp⁡(−12‖st−ht‖2).

B.1. Averaging over the disorder

With this setup, the quenched generating function is

Z[b]=E{st∼N(0,IN)}exp⁡[∑t=1Tbt⋅st]EJexp⁡[∑t=1Tst⊤ht−12∑t=1T‖ht‖2].

As in the Ising case, with the specific assumption that the interaction matrices are zero-mean Gaussian with covariance

EJ[(Jk)ij(Jk′)i′j′]=1Nδii′δjj′Γk,k′,

the local fields are zero-mean Gaussian with covariance

EJ[ht,jht′,j′]=δjj′β2∑k,k′=1KΓk,k′Ct−k,t′−k′,

where we define the temporal correlation function of the state:

Ct,t′=1Nst⊤st′.

However, in this case the norm of the state Ct,t′ is not fixed to unity.

B.2. Introducing order parameters

Again, we enforce the definition of Ct,t′ via Fourier representations of the δ-distribution with Lagrange multipliers C^t,t′, writing

1=∫dC∫dC^exp⁡[−N2∑t,t′=1−KTCt,t′C^t,t′+12∑t,t′=1−KTC^t,t′st⋅st′],

where in this case we include the diagonal elements of Ct,t′ and C^t,t′. Then, everything factors over sites, yielding

Z=∫dC∫dC^exp⁡[NS],

where

S=−12∑t,t′=1−KTCt,t′C^t,t′+1N∑j=1Nlog⁡zj

for single-site generating functions

zj=E{st,j∼N(0,1)}Ehjexp⁡[∑t=1Tbt,jst,j+12∑t,t′=1−KTC^t,t′st,jst′,j+∑t=1Tst,jht,j−12∑t=1Tht,j2].

B.3. The saddle-point equations

We can now determine the saddle-point equations. From ∂S/∂C^t,t′=0, we have the self-consistent equation

Ct,t′=1N∑j=1N⟨st,jst′,j⟩j

for any two (non necessarily distinct) times t,t′=1−K,…,T. Here, the self-consistent average is defined via

⟨⋅⟩j=1zjE{st,j∼N(0,1)}Ehj(⋅)exp⁡[∑t=1Tbt,jst,j+12∑t,t′=1−KTC^t,t′st,jst′,j+∑t=1Tst,jht,j−12∑t=1Tht,j2]|b=0.

Again, one must be careful when considering boundary terms for which t or t′ is less than or equal to zero, as the boundary states are fixed by the initial condition. For t,t′=1−K,…,0, Ct,t′ is entirely fixed by the boundary condition as

Ct,t′=1N∑j=1Nst,jst′,j.

Now suppose that t=1,…,T and t′=1−K,…,0. Then, st′,j is fixed by the initial condition, and we have

Ct,t′=1N∑j=1N⟨st,j⟩jst′,j.

We now consider C^t,t′. As in the Ising case, it is easily seen that having C^t,t′=0 for all times is consistent with the normalization, as we then have

zj|b=0=E{st,j∼N(0,1)}Ehjexp⁡[∑t=1Tst,jht,j−12∑t=1Tht,j2]
=Ehjexp⁡[12∑t=1Tht,j2−12∑t=1Tht,j2]
=1.

As we did in the Ising case, we can show this in greater detail by considering the saddle-point equation ∂S/∂Ct,t′=0, which yields

12C^t,t′=1N∑j=1N1zj∂zj∂Ct,t|b=0

for t=t′ and

C^t,t′=1N∑j=1N1zj∂zj∂Ct,t′|b=0

for t≠t′, where the factor of 1/2 is not present in the off-diagonal terms due to symmetry. Again, writing

Σt,t′≡EJ[ht,jht′,j]=β2∑k,k′=1KΓk,k′Ct−k,t′−k′,

we have

1zj∂zj∂Ct,t′|b=0=β2∑k,k′=1KΓk,k′1{t+k,t′+k′⩾1}1zj∂zj∂Σt+k,t′+k′|b=0.

Applying Price’s theorem [15], we have for any two distinct times t,t′

∂∂Σt,t′Ehjexp⁡[∑t=1Tst,jht,j−12∑t=1Tht,j2]=Ehj∂∂ht,j∂∂ht′,jexp⁡[∑t=1Tst,jht,j−12∑t=1Tht,j2]
=Ehj(st,j−ht,j)(st′,j−ht′,j)exp⁡[∑t=1Tst,jht,j−12∑t=1Tht,j2],

while the equal-time derivatives are

∂∂Σt,tEhjexp⁡[∑t=1Tst,jht,j−12∑t=1Tht,j2]=12Ehj∂2∂ht,j2exp⁡[∑t=1Tst,jht,j−12∑t=1Tht,j2]
=Ehj[(st,j−ht,j)2−1]exp⁡[∑t=1Tst,jht,j−12∑t=1Tht,j2].

Then, using the definition of the single-site average, we have

1zj∂zj∂Σt,t′|b=0=⟨(st,j−ht,j)(st′,j−ht′,j)⟩j

for any two distinct times t,t′=1,…,T, while

1zj∂zj∂Σt,t|b=0=⟨[(st,j−ht,j)2−1]⟩j

for any time t=1,…,T. Thus, as the saddle-point equation gives C^t,t′ as a convex combination of these derivatives, to show that it is self-consistent to have C^t,t′=0 we would like to show that these averages vanish under that assumption. Unlike in the Ising case, this is easily done thanks to the fact that st,j and ht,j are jointly Gaussian even for non-vanishing C^t,t′. Recalling the definition of the single-site average as

⟨⋅⟩j=1zj|b=0E{st,j∼N(0,1)}Ehj(⋅)exp⁡[+12∑t,t′=1−KTC^t,t′st,jst′,j+∑t=1Tst,jht,j−12∑t=1Tht,j2],

we expand the term involving C^t,t′ as

12∑t,t′=1−KTC^t,t′st,jst′,j=12∑t,t′=1TC^t,t′st,jst′,j+∑t=1T∑t′=1−K0C^t,t′st,jst′,j+12∑t,t′=1−K0C^t,t′st,jst′,j.

The term that depends only on the boundary conditions will cancel in the ratio, which leaves

⟨⋅⟩j=1zj|b=0∫ds∫dhexp⁡[−12(sh)⊤J(sh)+(sh)⊤(c0)],

where we define the matrix

J=(IT−C^−IT−ITIT+Σ−1)

and the vector

ct=∑t′=1−K0C^t,t′st′,j.

Completing the square, this implies that the single-site average is computed for

(sh)∼N(J−1(c0),J−1).

Our task is now to invert the block matrix J. Noting that the push-through identity implies that

(IT+Σ−1)−1=IT−(IT+Σ)−1,

the formula for 2×2 block matrix inversion implies that

J−1=(IT−C^−IT−ITIT+Σ−1)−1
=([(IT+Σ)−1−C^]−1BB⊤[IT−(IT+Σ)−1](IT+B))

where we write

B=[(IT+Σ)−1−C^]−1[IT−(IT+Σ)−1]
=[IT−(IT+Σ)C^]−1Σ.

Then, we have

J−1(c0)=([(IT+Σ)−1−C^]−1cB⊤c),

hence

⟨st,j−ht,j⟩j=[(IT+Σ)−1−C^]−1c−B⊤c
=[IT−C^(IT+Σ)]−1c.

Then, noting that

J−1|C^=0=(IT+ΣΣΣΣ,)

we can then see that, if C^t,t′=0 for all t,t′, we have the single-site averages

⟨st,j−ht,j⟩j=0
⟨st,jst′,j⟩j=δt,t′+Σt,t′
⟨st,jht′,j⟩j=Σt,t′
⟨ht,jht′,j⟩j=Σt,t′.

From this, it is easy to see that, for t≠t′,

⟨(st,j−ht,j)(st′,j−ht′,j)⟩j|C^=0=Σt,t′−Σt,t′−Σt′,t+Σt,t′=0,

while

⟨[(st,j−ht,j)2−1]⟩j=1+Σt,t−2Σt,t+Σt,t−1=0.

Therefore, we conclude at last that the C^t,t′=0 solution is consistent with the saddle-point equations, and that under this condition we have

Ct,t′=1N∑j=1N⟨st,jst′,j⟩j
=δt,t′+Σt,t′
=δt,t′+β2∑k,k′=1KΓk,k′Ct−k,t′−k′

for all interior times t,t′=1,…,T, while the boundary terms for t=1,…,T and t′=1−K,…,0 vanish:

Ct,t′=0.

More directly, with C^t,t′=0, the single-site generating function simplifies to

zj=E{st,j∼N(0,1)}Ehjexp⁡[∑t=1Tbt,jst,j+∑t=1Tst,jht,j−12∑t=1Tht,j2]
=E{st,j∼N(0,1)}det(IT+Σ)−1/2exp⁡[∑t=1Tbt,jst,j+12∑t,t′=1Tst,j(IT+Σ−1)−1st,j]
=exp⁡[12∑t,t′=1Tbt,j[IT−(IT+Σ−1)−1]−1bt,j]
=exp⁡[12∑t,t′=1Tbt,j(IT+Σ)bt,j].

Then, we can immediately read off that the site distribution is zero-mean Gaussian, with the covariance claimed above.

B.4. Summarizing the DMFT

To summarize, the DMFT for the Gaussian model is given by

Ct,t′=δt,t′+β2∑k,k′=1KΓk,k′Ct−k,t′−k′

for t,t′=1,…,T,

Ct,t′=0

for t=1,…,T and t′=1−K,…,0, and

Ct,t′=1N∑j=1Nst,jst′,j

for t,t′=1−K,…,0.

Unlike in the Ising case, the equation for Ct,t′ is now purely linear. We observe that some features of this model cannot carry over to the spherical case, as here Ct,t may exceed unity.

Appendix C. Spherical DMFT

We now consider the spherical model. Using the notation introduced above, we can read off that the disorder average leads to the quenched generating function

Z=∫∏t=1TdσN(st)exp⁡[∑t=1Tbt⋅st]Eh∏t=1Texp⁡[st⋅ht]∫dσN(ut)exp⁡[ut⋅ht]

where the local fields

ht=−β∑k=1KJkst−k

are jointly Gaussian under the distribution of the disorder, and have mean zero at all times. With the specific assumption that

EJ[(Jk)ij(Jk′)i′j′]=1Nδii′δjj′Γk,k′,

their covariance is

EJ[ht,jht′,j′]=δjj′β2∑k,k′=1KΓk,k′Ct−k,t′−k′,

where we define the temporal correlation function of the state:

Ct,t′=1Nst⊤st′.

The spherical constraint means that we have

Ct,t=1

at all times.

C.1. Introducing order parameters

As for the other two models, we enforce the definition of Ct,t′ via Fourier representations of the δ-distribution with Lagrange multipliers C^t,t′, writing

1=∫dC∫dC^exp⁡[−N2∑t,t′=1−KTCt,t′C^t,t′+12∑t,t′=1−KTC^t,t′st⋅st′],

where in this case we include the diagonal elements of Ct,t′ and C^t,t′. This yields

Z=∫dC∫dC^exp⁡[−N2∑t,t′=1−KTCt,t′C^t,t′]Eh∫∏t=1TdσN(st)exp⁡[∑t=1Tbt⋅st+12∑t,t′=1−KTC^t,t′st⋅st′]×∏t=1Texp⁡[st⋅ht]∫dσN(ut)exp⁡[ut⋅ht]

Our goal is to factorize

∫∏t=1TdσN(st)exp⁡[∑t=1Tbt⋅st+12∑t,t′=1−KTC^t,t′st⋅st′]∏t=1Texp⁡[st⋅ht]∫dσN(ut)exp⁡[ut⋅ht]

over sites. Given that constant multiplicative factors will cancel thanks to the normalization terms, we can re-write this as

∫∏t=1Tdstδ(N−‖st‖2)exp⁡[∑t=1Tbt⋅st+12∑t,t′=1−KTC^t,t′st⋅st′]∏t=1Texp⁡[st⋅ht]∫dutδ(N−‖ut‖2)exp⁡[ut⋅ht]
=∫∏t=1Tdstδ(N−‖st‖2)exp⁡[∑t=1Tbt⋅st+12∑t,t′=1−KTC^t,t′st⋅st′]×∏t=1Texp⁡[st⋅ht−ρ‖st‖2/2]∫dutδ(N−‖ut‖2)exp⁡[ut⋅ht−ρ‖ut‖2/2]

for any positive ρ, as the spherical constraint enforces that ‖st‖2=‖ut‖2=N for all times t.

At this point, we would like to replace the δ-distributions with their Fourier transforms and interchange the order of integration over the states and Lagrange multipliers, as that would allow us to factor the integral over sites into a product of single-site generating functions. However, the normalizing factor in the denominator means that we cannot proceed so simply. This can be circumvented using the replica trick: we write

1x=limn→0xn−1.

More concretely, we introduce nt−1 copies of the denominator for the tth timestep. As usual, we will proceed for nt−1 a non-negative integer, and then analytically continue the result. Indexing replicas by at=1,…,nt, the state-dependent term above becomes

lim{nt→0}∫∏t=1Tdst∫∏t=1T∏at=1nt−1dutat[∏t=1Tδ(N−‖st‖2)∏at=1ntδ(N−‖utat‖2)]×exp⁡[∑t=1Tbt⋅st+12∑t,t′=1−KTC^t,t′st⋅st′]×exp⁡[∑t=1Tst⋅ht−12ρ∑t=1T‖st‖2+∑t=1T∑at=1nt−1ht⋅utat−12ρ∑t=1T∑at=1nt−1‖utat‖2].

We now replace the δ-distributions with their Fourier transforms, introducing Lagrange multipliers Q^t to enforce the constraints ‖st‖2=N and R^tat to enforce the constraints ‖utat‖2=N. Interchanging the order of integration, this at last allows us to factor the integrals over sites, yielding

Z=∫dC∫dC^∫dQ^∫dR^exp⁡[NS]

for an action

S=−12∑t,t′=1−KTCt,t′C^t,t′+12∑t=1TQ^t+12∑t=1T∑at=1nt−1R^tat+∑j=1Nlog⁡zj,

where

zj=Ehj∫∏t=1Tdst,j∫∏t=1T∏at=1nt−1dut,jatexp⁡[∑t=1Tbt,jst,j+12∑t,t′=1−KTC^t,t′st,jst′,j+∑t=1Tst,jht,j]×exp⁡[−12∑t=1T(ρ+Q^t)(st,j)2+∑t=1T∑at=1nt−1ht,jut,jat−12∑t=1T∑at=1nt−1(ρ+R^tat)(ut,jat)2]

are the single-site generating functions.

C.2. The saddle-point equations

Differentiating with respect to C^t,t′ for any two (perhaps equal) times t,t′=1−K,…,T, we of course have

Ct,t′=1N∑j=1N⟨st,jst′,j⟩j.

Here, the self-consistent average is defined via

⟨⋅⟩j=1zjEhj∫∏t=1Tdst,j∫∏t=1T∏at=1nt−1dut,jat(⋅)exp⁡[∑t=1Tbt,jst,j+12∑t,t′=1−KTC^t,t′st,jst′,j+∑t=1Tst,jht,j]×exp⁡[−12∑t=1T(ρ+Q^t)(st,j)2+∑t=1T∑at=1nt−1ht,jut,jat−12∑t=1T∑at=1nt−1(ρ+R^tat)(ut,jat)2]|b=0.

As in the Ising and Gaussian cases, one must be careful when considering boundary terms for which t or t′ is less than or equal to zero, as the boundary states are fixed by the initial condition. For t,t′=1−K,…,0, Ct,t′ is entirely fixed by the boundary condition as

Ct,t′=1N∑j=1Nst,jst′,j.

Now suppose that t=1,…,T and t′=1−K,…,0. Then, st′,j is fixed by the initial condition, and we have

Ct,t′=1N∑j=1N⟨st,j⟩jst′,j.

Differentiating with respect to Q^t, we have the constraint

1=1N∑j=1N⟨(st,j)2⟩j

while differentiating with respect to R^tat, we have

1=1N∑j=1N⟨(ut,jat)2⟩j

Observing that the auxiliary fields ut,jat couple to ht,j in the same way as st,j, we make a replica-uniform Ansatz for the Lagrange multipliers

R^tat=Q^t.

Then, the integrals over ut,j factor, leaving

zj=Ehj∫∏t=1Tdst,jexp⁡[∑t=1Tbt,jst,j+12∑t,t′=1−KTC^t,t′st,jst′,j+∑t=1Tst,jht,j]exp⁡[−12∑t=1T(ρ+Q^t)(st,j)2]×∏t=1T{∫dut,jexp⁡[ht,jut,j−12(ρ+Q^t)(ut,j)2]}nt−1
=Ehj∫∏t=1Tdst,jexp⁡[∑t=1Tbt,jst,j+12∑t,t′=1−KTC^t,t′st,jst′,j+∑t=1Tst,jht,j]×exp⁡[−12∑t=1T(ρ+Q^t)(st,j)2]∏t=1T{(2πρ+Q^t)1/2exp⁡[12(ht,j)2ρ+Q^t]}nt−1
=nt→0Ehj∫∏t=1Tdst,jexp⁡[∑t=1Tbt,jst,j+12∑t,t′=1−KTC^t,t′st,jst′,j+∑t=1Tst,jht,j]×exp⁡[−12∑t=1T(ρ+Q^t)(st,j)2]×∏t=1T(2πρ+Q^t)−1/2exp⁡[−12(ht,j)2ρ+Q^t].

We can then see that C^t,t′=0 is consistent with normalization.

To show more carefully that these solutions are consistent, we again turn to the saddle point equation for C^t,t′. As in the Ising and Gaussian cases, this gives

12C^t,t=1N∑j=1N1zj∂zj∂Ct,t|b=0

for equal times and

C^t,t′=1N∑j=1N1zj∂zj∂Ct,t′|b=0

for distinct times t≠t′. Once again, we write

Σt,t′≡EJ[ht,jht′,j]=β2∑k,k′=1KΓk,k′Ct−k,t′−k′,

which gives

1zj∂zj∂Ct,t′|b=0=β2∑k,k′=1KΓk,k′1{t+k,t′+k′⩾1}1zj∂zj∂Σt+k,t′+k′|b=0.

Isolating the relevant portion of the single-site generating function, we have for any two distinct times t,t′

∂∂Σt,t′Ehjexp⁡[∑t=1Tht,jst,j+∑t=1T∑at=1nt−1ht,jut,jat]
=Ehj∂∂ht,j∂∂ht′,jexp⁡[∑t=1Tht,jst,j+∑t=1T∑at=1nt−1ht,jut,jat]
=Ehj(st,j+∑at=1nt−1ut,jat)(st′,j+∑at′=1nt′−1ut′,jat′)exp⁡[∑t=1Tht,jst,j+∑t=1T∑at=1nt−1ht,jut,jat]

while the equal-time derivatives are

∂∂Σt,t′Ehjexp⁡[∑t=1Tht,jst,j+∑t=1T∑at=1nt−1ht,jut,jat]
=12Ehj∂2∂ht,j2exp⁡[∑t=1Tht,jst,j+∑t=1T∑at=1nt−1ht,jut,jat]
=12Ehj(st,j+∑at=1nt−1ut,jat)2exp⁡[∑t=1Tht,jst,j+∑t=1T∑at=1nt−1ht,jut,jat].

Using the definition of the single-site average, we then have

1zj∂zj∂Σt,t′|b=0=⟨(st,j+∑at=1nt−1ut,jat)(st′,j+∑at′=1nt′−1ut′,jat′)⟩j

for any two distinct times t,t′, while

1zj∂zj∂Σt,t|b=0=12⟨(st,j+∑at=1nt−1ut,jat)2⟩j

Importantly, in these expectations t and t′ are constrained to be strictly greater than zero.

We can evaluate these expectations using the fact that the single-site distribution of the fields at positive times is in fact Gaussian. We condition on the fields ht,j, set bt,j=0, and consider the joint density of the fields st,j and ut,jat. Defining the matrix

At,t′=(ρ+Q^t)δt,t′−C^t,t′,

for t,t′=1,…,T and the vector

ct,j=∑t′=1−K0C^t,t′st′,j

and using the fact that terms depending on C^t,t′ for both t,t′⩽0 will drop as they contribute a constant, we have that their joint density is given up to normalization as

exp⁡[−12∑t,t′=1TAt,t′st,jst′,j+∑t=1Tst,j(ht,j+ct,j)+∑t=1T∑at=1nt−1ht,jut,jat−12∑t=1T∑at=1nt−1(ρ+R^tat)(ut,jat)2]
=exp⁡[−12∑t,t′=1TAt,t′st,jst′,j+∑t=1Tst,j(ht,j+ct,j)]∏t=1T∏at=1nt−1exp⁡[−12(ρ+R^tat)(ut,jat)2−ht,jut,jat].

We can then see that the replica fields ut,jat are independent from the fields st,j and are independent across replicas and time, with variance

var⁡[ut,jat|hj]=1ρ+R^tat

and mean

E[ut,jat|hj]=1ρ+R^tatht,j.

Similarly, the fields st,j are Gaussian, with covariance

cov⁡[st,j,st′,j|hj]=(A−1)t,t′

and mean

E[st,j|hj]=∑t′=1T(A−1)t,t′(ht,j+ct,j).

Though we can compute the required correlators using these full expressions, we recall that our goal is to show that they vanish provided that C^t,t′=0 and R^tat=Q^t. We will therefore assume that C^t,t′=0, which yields the drastic simplification

cov⁡[st,j,st′,j|hj]|C^t,t′=0=1ρ+Q^tδt,t′,
E[st,j|hj]|C^t,t′=0=1ρ+Q^tht,j.

Using these facts, we can easily compute the unequal-time correlators as

1zj∂zj∂Σt,t′|b=0|C^t,t′=0=⟨(st,j+∑at=1nt−1ut,jat)(st′,j+∑at′=1nt′−1ut′,jat′)⟩j|C^t,t′=0
=⟨st,jst′,j⟩j+∑at=1nt−1⟨ut,jatst′,j⟩j+∑at′=1nt′−1⟨st,jut′,jat′⟩j+∑at=1nt−1∑at′=1nt′−1⟨ut,jatut′,jat′⟩j|C^t,t′=0
=1(ρ+Q^t)(ρ+Q^t′)Ehj[ht,jht′,j]+∑at=1nt−11(ρ+Q^t′)(ρ+R^tat)Ehj[ht,jht′,j]+∑at′=1nt′−11(ρ+Q^t)(ρ+R^t′at′)Ehj[ht,jht′,j]+∑at=1nt−1∑at′=1nt′−11(ρ+R^tat)(ρ+R^t′at′)Ehj[ht,jht′,j]
=(1ρ+Q^t+∑at=1nt−11ρ+R^tat)(1ρ+Q^t′+∑at′=1nt′−11ρ+R^t′at′)Σt,t′

for any two distinct times t,t′, while the equal-time correlators are

21zj∂zj∂Σt,t|b=0=⟨(st,j+∑at=1nt−1ut,jat)2⟩j
=⟨st,jst,j⟩j+2∑at=1nt−1⟨st,jut,jat⟩j+∑at=1nt−1∑at=1nt−1⟨ut,jatut,jat⟩j|C^t,t′=0
=1ρ+Q^t+1(ρ+Q^t)2Ehj[ht,j2]+2∑at=1nt−11(ρ+Q^t)(ρ+R^tat)Ehj[ht,j2]+∑at=1nt−1∑at′=1nt−1(1ρ+R^tatδatat′+1(ρ+R^tat)(ρ+R^tat′)Ehj[ht,j2])
=1ρ+Q^t+∑at=1nt−111+R^tat+(1ρ+Q^t+∑at=1nt−11ρ+R^tat)(1ρ+Q^t′+∑at′=1nt′−11ρ+R^t′at′)Σt,t

From this, we can see immediately that the replica-uniform Ansatz

R^tat=Q^t

gives

1zj∂zj∂Σt,t′|b=0|C^t,t′=0=ntnt′1(ρ+Q^t)(ρ+Q^t′)Σt,t′

and

1zj∂zj∂Σt,t|b=0|C^t,t′=0=nt1ρ+Q^t+nt21(ρ+Q^t)2Σt,t,

which vanish as nt↓0, meaning that the C^t,t′=0 solution is self-consistent in this case.

With C^t,t′=0, the single-site generating function becomes

zj=Ehj∫∏t=1Tdst,jexp⁡[∑t=1Tbt,jst,j−12∑t=1T(ρ+Q^t)(st,j)2+∑t=1Tst,jht,j]×∏t=1T(2πρ+Q^t)−1/2exp⁡[−12(ht,j)2ρ+Q^t].

Defining the diagonal matrix Q by

Qt,t=ρ+Q^t,

we have

zj=(detQ)+1/2∫∏t=1Tdst,j(2π)1/2exp⁡[∑t=1Tbt,jst,j−12∑t=1TQt,t(st,j)2]×(detΣ)−1/2∫∏t=1Tdht,j(2π)1/2exp⁡[−12∑t,t′=1T(Σ−1+Q−1)t,t′ht,jht′,j+∑t=1Tht,jst,j]
=det(Q−1+Q−1ΣQ−1)−1/2×∫∏t=1Tdst,j(2π)1/2exp⁡[∑t=1Tbt,jst,j−12∑t,t′=1T[Q−(Σ−1+Q−1)−1]t,t′st,jst′,j]
=exp⁡[12∑t,t′=1T[Q−1(Q+Σ)Q−1]t,t′bt,jbt′,j],

where we observe that the Woodbury identity implies that

Q−(Σ−1+Q−1)−1=Q(Q+Σ)−1Q.

This gives

Ct,t′=[Q−1(Q+Σ)Q−1]t,t′

for t,t′=1,…,T, which as Q is diagonal reduces to

Ct,t′=1QtQt′(Qtδt,t′+β2∑k,k′=1KΓk,k′Ct−k,t′−k′).

To determine Qt, we use the self-consistency condition

Ct,t=1;

as ρ is arbitrary we can absorb it into the re-definition. Moreover, we have ⟨st,j⟩j=0, hence Ct,t′=0 if t > 0 and t′⩽0.

C.3. Summarizing the DMFT

To summarize, for the spherical model we have obtained a DMFT in terms of the two-point functions

Ct,t′=1Nst⋅st′

and a set of positive scalars Qt, where Ct,t′ satisfies the recursive equation

Ct,t′=1QtQt′(Qtδt,t′+β2∑k,k′=1KΓk,k′Ct−k,t′−k′)

and Qt is determined by the self-consistency condition

Ct,t=1.

These DMFT equations are naturally solved via fixed point iteration. For a fixed Qt, this is a linear recurrence for Ct,t′ which can be solved forward in time. Then, we can compute Qt from the given Ct,t′ using the constraint Ct,t=1. This alternating procedure can be iterated until convergence.

Appendix D. Numerical methods

All simulations were done using MATLAB R2024b (The MathWorks, Natick, MA, USA), and were run on a desktop workstation equipped with an Intel Xeon(R) w5-3525 processor and 128 GB of RAM. They were not compute-intensive, requiring well under one CPU-hour. For the spherical model, we used Sungkyu Jung’s freely available implementation of Wood [13]’s algorithm for sampling from the von Mises-Fisher distribution, available at www.stat.pitt.edu/sungkyu/oldSoftwarePage.html.

Footnotes

3

As in related random matrix problems [12], one could in principle further generalize the analysis to allow non-trivial correlations between the elements of each row of the interaction matrix Jk—i.e. to replace δjj′ with some non-diagonal matrix—but here we focus on the minimal setting with spatially uncorrelated interactions.

Data availability statement

No new data were created or analysed in this study.

Funding acknowledgments

At the time of a completion of an initial version of this work in 2023, J.A.Z.-V. and C.P. were supported by NSF Award DMS-2134 157 and NSF CAREER Award IIS-2239 780. At present, J.A.Z.-V. is supported by the Office of the Director of the National Institutes of Health under Award Number DP5OD037354, and by a Junior Fellowship from the Harvard Society of Fellows. C.P. is presently supported by NSF grant DMS-2134 157, NSF CAREER Award IIS-2239 780, DARPA grant DIAL-FP-038, a Sloan Research Fellowship, and The William F. Milton Fund from Harvard University. C.P.’s work is been made possible in part by a gift from the Chan Zuckerberg Initiative Foundation to establish the Kempner Institute for the Study of Natural and Artificial Intelligence.

References

  • 1.Radford A, et al. Improving language understanding by generative pre-training. OpenAI preprint. 2018. (available at: https://openai.com/index/language-unsupervised/)
  • 2.Brown T, et al. Language models are few-shot learners. In: Larochelle H, Ranzato M, Hadsell R, Balcan M F, Lin H, editors. Advances in Neural Information Processing Systems. vol 33. Curran Associates, Inc.; 2020. pp. pp 1877–901. [Google Scholar]
  • 3.OpenAI et al2023GPT-4 technical report (arXiv:2303.08774)
  • 4.Engel A, den Broeck C V. Statistical Mechanics of Learning. Cambridge University Press; 2001. [Google Scholar]
  • 5.Yue M L, Letey M, Zavatone-Veth J A, Maiti A, Pehlevan C. Asymptotic theory of in-context learning by linear attention. Proc. Natl Acad. Sci. 2025;122:e2502599122. doi: 10.1073/pnas.2502599122. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 6.Rende R, Gerace F, Laio A, Goldt S. Mapping of attention mechanisms to a generalized Potts model. Phys. Rev. Res. 2024;6:023057. doi: 10.1103/PhysRevResearch.6.023057. [DOI] [Google Scholar]
  • 7.Crisanti A, Sompolinsky H. Dynamics of spin systems with randomly asymmetric bonds: Langevin dynamics and a spherical model. Phys. Rev. A. 1987;36:4922–39. doi: 10.1103/PhysRevA.36.4922. [DOI] [PubMed] [Google Scholar]
  • 8.Crisanti A, Sompolinsky H. Dynamics of spin systems with randomly asymmetric bonds: Ising spins and Glauber dynamics. Phys. Rev. A. 1988;37:4865–74. doi: 10.1103/PhysRevA.37.4865. [DOI] [PubMed] [Google Scholar]
  • 9.Miguel Aguilera S A M, Shimazaki H. A unifying framework for mean-field theories of asymmetric kinetic Ising systems. Nat. Commun. 2021;12:1197. doi: 10.1038/s41467-021-20890-5. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 10.Aguilera M, Igarashi M, Shimazaki H. Nonequilibrium thermodynamics of the asymmetric Sherrington-Kirkpatrick model. Nat. Commun. 2023;14:3685. doi: 10.1038/s41467-023-39107-y. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 11.Bal M. Spin-model transformers online blog post. 2023. (available at: https://mcbal.github.io/post/spin-model-transformers/)
  • 12.Zavatone-Veth J A, Pehlevan C. Replica method for eigenvalues of real Wishart product matrices. SciPost Phys. Core. 2023;6:026. doi: 10.21468/SciPostPhysCore.6.2.026. [DOI] [Google Scholar]
  • 13.Wood A T A. Simulation of the von Mises-Fisher distribution. Commun. Stat. - Simul. Comput. 1994;23:157–64. doi: 10.1080/03610919408813161. [DOI] [Google Scholar]
  • 14.Mézard M. Spin glass theory and its new challenge: structured disorder. Indian J. Phys. 2024;98:3757–68. doi: 10.1007/s12648-023-03029-8. [DOI] [Google Scholar]
  • 15.Price R. A useful theorem for nonlinear devices having Gaussian inputs. IRE Trans. Inf. Theory. 1958;4:69–72. doi: 10.1109/TIT.1958.1057444. [DOI] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Data Availability Statement

No new data were created or analysed in this study.


Articles from Journal of Physics. A, Mathematical and Theoretical are provided here courtesy of IOP Publishing

RESOURCES