Enrico M. Malatesta

Could be worse - Random topics in statistical physics, spin glasses, optimization and average case hardness

Chaos in Random Neural Networks

9 August 2026 | E. Malatesta

← All blog posts

I recently went back to the classic paper of Sompolinsky, Crisanti and Sommers on chaos in random neural networks [Sompolinsky, Crisanti and Sommers (1988)], which was revisited in detail in [Crisanti and Sompolinsky (2018)].

The model they considered is a recurrent neural network with random asymmetric couplings. Its remarkable feature is that, using Dynamical Mean Field Theory (DMFT), one can show that in the large-NN limit the collective dynamics reduces to an effective one-neuron stochastic problem. The noise in this effective problem is generated self-consistently by the activity of the rest of the network.

In this first post I want to derive this reduction and the resulting closed equation for the autocorrelation function. I will then show how, in this model, the effective one-neuron problem can be recast as Newton's equation for a fictitious particle moving in a self-consistent potential. This mechanical analogy gives a very transparent way of organizing the formal DMFT solutions: static solutions, periodic solutions, and the special decaying solution associated with the chaotic phase.

Contents
  1. The model
  2. Dynamical Mean Field Theory
  3. The autocorrelation equation
    1. Properties of Δ(τ)\Delta(\tau)
  4. The Newtonian particle analogy
    1. The shape of the potential
    2. Static solutions
    3. Time-dependent solutions
    4. Numerical illustration
    5. Phase Diagram
  5. What's next?

The model

Consider NN continuous variables hi(t)h_i(t) i=1,,Ni=1,\dots,N, representing the post-synaptic potentials of NN neurons. The activity, or output, of neuron ii is

Si(t)=ϕ(ghi(t)). S_i(t)=\phi(g h_i(t)).

Here gg is the gain and ϕ\phi is an odd sigmoidal-shaped function. I will mostly keep the notation general, but the canonical example I will consider is ϕ(x)=tanhx\phi(x)=\tanh x. The dynamics of the post-synaptic potentials are given by the following NN coupled differential equations

dhidt=hi(t)+1Nj=1NJijSj(t). \frac{d h_i}{dt} = -h_i(t)+\frac{1}{\sqrt{N}}\sum_{j=1}^N J_{ij}S_j(t).

The first term is the leak: without any input, hi(t)h_i(t) decays exponentially to zero. The second term is the recurrent input from the rest of the network, which depends on the coupling matrix JijJ_{ij}. Here we will consider random, independent, asymmetric couplings, having mean 0 and variance 1:

EJ[Jij]=0,EJ[Jij2]=1,ij=1,,N \mathbb E_J[J_{ij}]=0, \qquad \mathbb E_J[J_{ij}^2]=1, \qquad \forall i \ne j = 1, \dots, N %J_{ij}\ \text{independent of}\ J_{ji}.

We also set Jii=0J_{ii}=0, which is irrelevant at large NN. The scaling 1/N1/\sqrt{N} in equation (2) maintains each recurrent input of order one as NN\to\infty.

The configuration where all the neurons are silent

hi=0i h_i=0 \qquad \forall i

is always a fixed point. Linearizing around it gives

thi=hi+gNjJijhj. \partial_t h_i = -h_i+\frac{g}{\sqrt{N}}\sum_j J_{ij}h_j.

Since the eigenvalues of J/NJ/\sqrt{N} fill the unit disk in the complex plane at large NN, the rightmost real part of the spectrum of gJ/NgJ/\sqrt{N} is gg. Hence the zero fixed point is linearly stable for g<1g<1 and loses stability at g=1g=1. This simple calculation identifies the transition point, but it does not tell us what happens for g>1g>1. For that we need the nonlinear mean-field theory.

Dynamical Mean Field Theory

Define the recurrent input to neuron ii:

ηi(t)1Nj=1NJij ϕ(ghj(t)). \eta_i(t) \equiv \frac{1}{\sqrt{N}}\sum_{j=1}^N J_{ij} \, \phi(g h_j(t)).

The equation of motion becomes

thi(t)=hi(t)+ηi(t). \partial_t h_i(t)=-h_i(t)+\eta_i(t).

The idea of dynamical mean-field theory (DMFT) is that, at large NN, ηi(t)\eta_i(t) becomes a Gaussian process. In the following we will perform a simple, naive computation, which gives the right equations.

At fixed trajectories {hj(t)}\{h_j(t)\}, ηi(t)\eta_i(t) is a sum of many independent random variables. Its mean and covariance are:

EJ[ηi(t)]=0 ,EJ[ηi(t)ηi(t)]=1Nj=1Nϕ(ghj(t))ϕ(ghj(t))C(t,t). \begin{split} \mathbb E_J[\eta_i(t)]&=0 \,, \\ \mathbb E_J[\eta_i(t)\eta_i(t')] %&= %\sum_{j,k} \mathbb E_J[J_{ij}J_{ik}] S_j(t)S_k(t') \\ &= \frac{1}{N} \sum_{j=1}^N \phi(g h_j(t)) \phi(g h_j(t')) \equiv C(t, t'). \end{split}

At large NN, the empirical average appearing in the covariance self-averages and converges to a deterministic two-time autocorrelation function C(t,t)C(t,t'). The original NN-dimensional network can therefore be reduced to a single effective neuron driven by a Gaussian input η(t)\eta(t) with covariance

η(t)η(t)=C(t,t) . \boxed{ \langle \eta(t)\eta(t')\rangle=C(t,t')\,.}

Here and in the following, \langle\bullet\rangle denotes the average over the effective Gaussian process. The dynamics of the effective neuron is therefore

th(t)=h(t)+η(t) \boxed{ \partial_t h(t)=-h(t)+\eta(t) }

The covariance of the effective noise must be determined self-consistently from the activity of the effective neuron via

C(t,t)=ϕ(gh(t))ϕ(gh(t)). \boxed{ C(t,t') = \left\langle \phi(g h(t))\phi(g h(t')) \right\rangle. }

Thus, the original dynamics of the NN dimensional network has been replaced by a by a stochastic single-neuron problem whose noise statistics are generated self-consistently by the neuron itself. This is the central dynamical mean-field equation.

A small subtlety is hidden in this argument. The trajectories hj(t)h_j(t) are generated by the same coupling matrix JJ, so the factors ϕ(ghj(t))\phi(g h_j(t)) cannot literally be regarded as fixed independently of the couplings JijJ_{ij}. The reason the conclusion is nevertheless correct is the full asymmetry and mean-field scaling of the couplings and can be understood with a cavity argument, see the footnote[1]. The same result can be derived more systematically using the Martin–Siggia–Rose–Janssen–De Dominicis (MSRJD) generating-functional formalism; see [Crisanti and Sompolinsky (2018)]. For a pedagogical introduction to this method in the context of mean-field spin-glass dynamics, see [Castellani and Cavagna (2005)].

The autocorrelation equation

We now focus on a stationary state where two-time quantities like the activity autocorrelation C(t,t)C(t, t') depend only on the time difference τ=tt\tau=t-t'

C(τ)=C(tt) C(\tau) = C(t - t')

Similarly the post-synaptic field autocorrelation

Δ(τ)=h(t)h(t+τ),Δ0Δ(0). \Delta(\tau) = \left\langle h(t')h(t'+\tau)\right\rangle, \qquad \Delta_0 \equiv \Delta(0).

Next, let's take the effective equation (1+t)h(t)=η(t)(1+\partial_t)h(t)=\eta(t), multiply the left and the right hand side by η(t)\eta(t') and take the average with respect to η\eta:

(1+t)(1+t)h(t)h(t)=η(t)η(t). (1+\partial_t)(1+\partial_{t'}) \left\langle h(t)h(t')\right\rangle = \left\langle \eta(t)\eta(t')\right\rangle.

The right and left hand side contain by definition repsectively C(τ)C(\tau) and Δ(τ)\Delta(\tau). Using the fact that t=τ\partial_t=\partial_\tau and t=τ\partial_{t'}=-\partial_\tau one finds that the first order derivative cancel, obtaining

Δ(τ)τ2Δ(τ)=C(τ) \boxed{ \Delta(\tau)-\partial_\tau^2\Delta(\tau)=C(\tau) %\partial_{\tau}^2 \Delta(\tau) = -C(\tau) + \Delta(\tau). }

This is yet not enough, as we need to express CC self-consistently in terms of Δ\Delta. The key simplification is that h(t)h(t) is Gaussian. Indeed since the effective equation (10) is linear in hh the solution can be written as

h(t)=tds e(ts)η(s). h(t)=\int_{-\infty}^t ds\, e^{-(t-s)}\eta(s).

This is a linear functional of a Gaussian process, hence it is itself a Gaussian process. Therefore the pair (h(t),h(t+τ)) (h(t),h(t+\tau)) on which Δ(τ)\Delta(\tau) depends is a two-dimensional Gaussian vector. Its covariance matrix is

Σ(τ)=(Δ0Δ(τ)Δ(τ)Δ0). \Sigma(\tau) = \begin{pmatrix} \Delta_0 & \Delta(\tau) \\ \Delta(\tau) & \Delta_0 \end{pmatrix}.

A two-dimensional Gaussian is completely fixed by this covariance matrix. Therefore C(τ)C(\tau) is a function of Δ(τ)\Delta(\tau) and Δ0\Delta_0:

C(τ)=F(Δ(τ);Δ0). \boxed{ C(\tau)=F(\Delta(\tau);\Delta_0). }

We can represent the two correlated Gaussian variables using three independent standard Gaussians x,y,zx,y,z:

h=Δ0Δ x+Δ z ,h=Δ0Δ y+sign(Δ)Δ z. \begin{split} %h&=\sqrt{\Delta_0-\Delta}\,x+\sqrt{\Delta}\,z, \\ %h'&=\sqrt{\Delta_0-\Delta}\,y+\sqrt{\Delta}\,z. h&=\sqrt{\Delta_0-|\Delta|}\,x+\sqrt{|\Delta|}\,z \,, \\ h'&=\sqrt{\Delta_0-|\Delta|}\,y+\text{sign}(\Delta)\sqrt{|\Delta|}\,z. \end{split}

Then

h2=h2=Δ0,hh=Δ. \langle h^2\rangle=\langle h'^2\rangle=\Delta_0, \qquad \langle hh'\rangle=\Delta.

So we find, using the fact that ϕ\phi is an odd function

F(Δ;Δ0)=sign(Δ)Dz[Dx ϕ(gΔ0Δ x+gΔ z)]2. F(\Delta;\Delta_0) = \mathrm{sign}({\Delta})\int Dz \left[ \int Dx\, \phi\left( g\sqrt{\Delta_0-|\Delta|}\,x + g\sqrt{ |\Delta|}\,z \right) \right]^2.

where we have introduced the notation Dxdx2πex2/2Dx\equiv \frac{dx}{\sqrt{2\pi}}e^{-x^2/2}. The closed DMFT equation is therefore

Δ(τ)Δ¨(τ)=F(Δ(τ);Δ0). \boxed{ \Delta(\tau)-\ddot\Delta(\tau) = F(\Delta(\tau);\Delta_0). }

The unknown is a single function Δ(τ)\Delta(\tau), and all dependence on the nonlinear transfer function is hidden in the scalar function FF.

Properties of Δ(τ)\Delta(\tau)

The equation (15) can be inverted explicitly, using the face that the Green function of the operator 1τ21-\partial_\tau^2 is

G(τ)=12eτ, G(\tau)=\frac{1}{2}e^{-|\tau|},

as (1τ2)G(τ)=δ(τ)(1-\partial_\tau^2)G(\tau)=\delta(\tau). Therefore we find

Δ(τ)=12+dτ eττC(τ). \boxed{ \Delta(\tau) = \frac{1}{2} \int_{-\infty}^{+\infty} d\tau'\, e^{-|\tau-\tau'|} C(\tau'). }

This formula is useful because it gives the properties of Δ\Delta directly. First, Δ\Delta is an even function Δ(τ)=Δ(τ)\Delta(-\tau)=\Delta(\tau) (the same is of course true for CC). Secondly, Δ\Delta is differentiable function with zero derivative in the origin[2]

Δ˙(0)=0. \boxed{ \dot\Delta(0)=0. }

Third, since Δ\Delta is an autocorrelation, it obeys the Cauchy-Schwarz bound

Δ(τ)=h(t)h(t+τ)h(t)2h(t+τ)2=Δ0. |\Delta(\tau)| = |\langle h(t)h(t+\tau)\rangle| \le \sqrt{\langle h(t)^2\rangle\langle h(t+\tau)^2\rangle} = \Delta_0.

Thus acceptable solutions must satisfy

Δ(τ)Δ0. \boxed{ |\Delta(\tau)|\le \Delta_0. }

Collecting everything, the steady-state DMFT solutions are curves Δ(τ)\Delta(\tau) satisfying

Δ(0)=Δ0,Δ˙(0)=0,Δ(τ)Δ0. \Delta(0)=\Delta_0, \qquad \dot\Delta(0)=0, \qquad |\Delta(\tau)|\le \Delta_0.

The initial condition Δ0\Delta_0 must be chosen so that the resulting solution is self-consistent.

The Newtonian particle analogy

Much insight can be gained into the problem by rewriting the DMFT equation (22) as

d2Δdτ2=ΔF(Δ;Δ0)=VΔ \frac{d^2 \Delta}{d \tau^2} = \Delta-F(\Delta;\Delta_0) = -\frac{\partial V}{\partial \Delta}

where we have defined the potential[3]

V(Δ;Δ0)=Δ22+0Δdu F(u;Δ0). \boxed{ V(\Delta;\Delta_0) = -\frac{\Delta^2}{2} + \int_0^\Delta du\,F(u;\Delta_0). }

The DMFT equation therefore turns out to be a Newton's equation for a particle with position Δ\Delta, moving in the time variable τ\tau, in the potential VV starting at position Δ0\Delta_0 with zero velocity. The energy

E=12Δ˙2+V(Δ;Δ0) \boxed{ E = \frac{1}{2}\dot\Delta^2+V(\Delta;\Delta_0) }

is conserved. The important point is that the potential itself depends on Δ0\Delta_0. By changing Δ0\Delta_0 we are not only changing the initial point of the Newtonian particle; we are also changing the shape of the potential in which it moves. We will see how the potential changes very concretely in the next section.

Therefore the problem is self-consistent in a very concrete mechanical sense. We must choose a starting point Δ0\Delta_0, build the potential V(;Δ0)V(\cdot;\Delta_0), release the particle from rest at Δ=Δ0\Delta=\Delta_0, and then check whether the orbit is an admissible autocorrelation.

The shape of the potential

In order to classify the possible solutions to the DMFT equation (29), it is useful to understand how the potential can look like vs Δ\Delta, for each chosen initial condition Δ0\Delta_0.

Start noticing that for an odd transfer function, such as ϕ(x)=tanhx\phi(x)=\tanh x, the function F(Δ;Δ0)F(\Delta;\Delta_0) is odd in Δ\Delta. Therefore the potential V(Δ;Δ0)V(\Delta; \Delta_0) in (30) is an even function of Δ\Delta. Hence it is enough to study its shape when Δ>0\Delta>0.

In the next discussion we will argue that the potential cannot have an arbitrary shape. We can see this by computing the first three derivatives of the potential. Using the fact illustrated in the footnote[3], it is easy to show that, for Δ>0\Delta>0

VΔ=Δ+F(Δ;Δ0), \frac{\partial V}{\partial \Delta} = -\Delta+F(\Delta;\Delta_0), 2VΔ2=1+FΔ=g2Dz[Dx ϕ(gΔ0Δ x+gΔ z)]21 \frac{\partial^2 V}{\partial \Delta^2} = -1+ \frac{\partial F}{\partial \Delta} = g^2 \int Dz \left[ \int Dx\, \phi'\left( g\sqrt{\Delta_0-\Delta}\,x + g\sqrt{\Delta}\,z \right) \right]^2 - 1 3VΔ3=2FΔ2=g4Dz[Dx ϕ(gΔ0Δ x+gΔ z)]2>0. \frac{\partial^3 V}{\partial \Delta^3} = \frac{\partial^2 F}{\partial \Delta^2} = g^4 \int Dz \left[ \int Dx\, \phi''\left( g\sqrt{\Delta_0-\Delta}\,x + g\sqrt{\Delta}\,z \right) \right]^2 >0.

Therefore Δ2V\partial^2_\Delta V is a monotonically increasing function of Δ\Delta for Δ>0\Delta>0. This is a rather strong constraint: the curvature can change sign at most once. As a consequence the potential can only have few qualitative shapes. We can distinguish between them by looking at the sign of the curvature of the potential at the origin. The first possibility is

2VΔ2(0;Δ0)0. \frac{\partial^2 V}{\partial \Delta^2}(0;\Delta_0)\ge0.

Since the curvature is increasing for Δ>0\Delta>0, the potential is convex. Because VV is even, Δ=0\Delta=0 is then the unique minimum. The potential is a single well. The second possibility is

2VΔ2(0;Δ0)<0. \frac{\partial^2 V}{\partial \Delta^2}(0;\Delta_0)<0.

Then Δ=0\Delta=0 is a local maximum. Since the curvature can change sign at most once, the potential can bend upward at only once in the physical interval Δ0>Δ>Δ\Delta_0 > \Delta > \Delta. If ΔV\partial_{\Delta} V crosses zero before the endpoint Δ0\Delta_0, this crossing gives a unique minimum at positive Δ\Delta, and by evenness another minimum at negative Δ\Delta. In that case the potential has the shape of a double well.

If ΔV\partial_{\Delta} V does not cross zero before the endpoint Δ0\Delta_0, then we have a downhill potential as it is monotonically decreasing in the whole interval Δ0>Δ>Δ\Delta_0 > \Delta > \Delta. As shown in the footnote[4] this case only happens when g1g\le 1, which implies that in this regime the DMFT equation admits only the solution Δ=0\Delta=0.

Thus the monotonicity of Δ2V\partial_\Delta^2 V tells us that only very simple shapes are possible: a single well centered at the origin, a double well, or a downhill potential on the admissible interval.

The boundary between the single-well and double-well shapes given by the condition

gDx ϕ(gΔ0 x)=1 \boxed{g \int Dx\, \phi'\left(g\sqrt{\Delta_0}\,x\right) = 1}

In the case of the tanh\tanh function, for small Δ0\Delta_0, the integral is close to one, so if g>1g>1 the curvature at the origin is positive and the potential is a single well. As Δ0\Delta_0 increases, the Gaussian variable gΔ0xg\sqrt{\Delta_0}x explores the saturated part of tanh\tanh, where ϕ=sech2\phi' = \operatorname{sech}^2 is small. The integral decreases, the curvature at the origin eventually becomes negative, and the potential turns into a double well.

Static solutions

The simplest possible solution of the DMFT equation corresponds to an autocorrelation function independent of time

Δ(τ)=Δ0. \Delta(\tau)=\Delta_0.

This corresponds to the particle not moving and sitting at the stationary points of the potential. This gives the condition

Δ0=F(Δ0;Δ0)=Dz ϕ(gΔ0 z)2. \boxed{ \Delta_0=F(\Delta_0;\Delta_0) = \int Dz\,\phi(g\sqrt{\Delta_0}\,z)^2.}

For ϕ(x)=tanhx\phi(x)=\tanh x, Δ0=0\Delta_0=0 is always a solution. This is the silent fixed point of the original network. The argument of the previous subsection show in the footnote[4] shows that for g1g\le1 this is the only admissible stationary DMFT solution. For g>1g>1 equation (39) has also a nonzero solution Δ0>0\Delta_0>0.

Time-dependent solutions

We here analyze other solutions of the DMFT equation (29) for g>1g>1 which are time-dependent. Since the motion conserves energy, at each time the energy stays equal to the initial one corresponding to the one of the particle being at rest at Δ0\Delta_0

E=V(Δ0;Δ0). E=V(\Delta_0;\Delta_0).

Different shapes of the potential lead to different types of formal DMFT solutions. If the initial condition Δ0\Delta_0 is such that V(Δ0;Δ0)0V(\Delta_0; \Delta_0) \ne 0 then the autocorrelation diplays an oscillatory, periodic profile. This corresponds to a limit cycle in the original network. Moreover if V(Δ0;Δ0)>0V(\Delta_0; \Delta_0) > 0, then the Δ(τ)\Delta(\tau) changes sign (when the particle reaches Δ=0\Delta = 0). If instead V(Δ0;Δ0)<0V(\Delta_0; \Delta_0) < 0, then the particle is confined into the positive well of the potential, and the oscillations do not change sign.

There is also a special solution that separates those two regimes when

V(Δ0;Δ0)=0. \boxed{ V(\Delta_0;\Delta_0)=0. }

This solution decays to zero when for τ\tau large

Δ(τ)0asτ. \Delta(\tau)\to0 \qquad \text{as}\qquad \tau\to\infty.

This suggests that the underlying neural dynamics is chaotic, as the networks tends to forget the initial condition.

Numerical illustration

We can clarify the previous classificationn of DMFT solutions, by simply solving (29) numerically for each given initial condition Δ0\Delta_0 and showing the corresponding potential V(Δ;Δ0)V(\Delta; \Delta_0).

module SCS 

using OrdinaryDiffEq, QuadGK, Roots

# ------------------------------------------------------------
# Gaussian integration
# ------------------------------------------------------------

const ∞ = 20.0
const dx = 0.5
const interval = map(x->sign(x)*abs(x)^2, -1:dx:1) .* ∞

G(x) = exp(-x^2/2) / √(2π)

∫D(f, int=interval) = quadgk(z->begin
        r = G(z) .* f(z)
        isfinite(r) ? r : 0.0
    end, int..., atol=1e-5, maxevals=10^5)[1]

# ------------------------------------------------------------
# Transfer function, its derivative and primitive
# ------------------------------------------------------------

ϕ(x) = tanh(x)
∂ϕ(x) = 1 - tanh(x)^2
Φ(x) = abs(x) + log1p(exp(-2abs(x))) - log(2) # Stable version of log(cosh(x))

# ------------------------------------------------------------
# F(Δ; Δ0)
# ------------------------------------------------------------

function F(Δ, Δ0, g)
    abs(Δ) < 1e-12 && return 0.0

    if Δ == Δ0
         return ∫D(z -> ϕ(g * √Δ0 * z)^2)
    end

    A = min(abs(Δ), Δ0)
    a = √(max(Δ0 - A, 0.0))
    b = √A

    m(z) = ∫D(x -> ϕ(g * (a * x + b * z)))

    return sign(Δ) * ∫D(z -> m(z)^2)
end

# ------------------------------------------------------------
# Potential V(Δ; Δ0)
# ------------------------------------------------------------

function V(Δ, Δ0, g)

    m1 = ∫D(x -> Φ(g * √Δ0 * x))

    if Δ == Δ0
        m1 = ∫D(z -> Φ(g * √Δ0 * z))
        m2 = ∫D(z -> Φ(g * √Δ0 * z)^2)
        
        return -0.5 * Δ0^2 + (m2 - m1^2) / g^2
    end

    A = min(abs(Δ), Δ0)
    a = √max(Δ0 - A, 0.0)
    b = √A

    m(z) = ∫D(x -> Φ(g * (a * x + b * z)))

    return - 0.5 * Δ^2 + (∫D(z -> m(z)^2) - m1^2) / g^2
end

# Curvature of the potential at the origin
function Vcurv0(Δ0, g)
    m = ∫D(x -> ∂ϕ(g * √Δ0 * x))
    return g^2 * m^2 - 1
end

# ------------------------------------------------------------
# The three phase-diagram curves
# ------------------------------------------------------------

# Boundary between single-well and double-well potential
function Δ0_boundary(g; Δmin = 1e-9, Δmax = 1.2)
    g < 1 && return NaN

    return find_zero(Δ0 -> Vcurv0(Δ0, g), (Δmin, Δmax), Bisection())
end

# Decaying solution: selects the initial condition such that Δ(τ) → 0 as τ → ∞
function Δ0_decay(g; Δmin = 1e-9, Δmax = 1.2)
    g < 1 && return NaN

    return find_zero(Δ0 -> V(Δ0, Δ0, g), (Δmin, Δmax), Bisection())
end

# Static, fixed point solution
function Δ0_static(g; Δmin=1e-9, Δmax = 1.2)
    g < 1 && return NaN

    return find_zero(Δ0 -> F(Δ0, Δ0, g) - Δ0, (Δmin, Δmax), Bisection())
end

# ------------------------------------------------------------
# Numerical solution of Newton's equation:
#
# Δ'' = Δ - F(Δ; Δ0)
# ------------------------------------------------------------

function rhs!(du, u, p, t)
    Δ, v = u
    Δ0, g = p

    du[1] = v
    du[2] = Δ - F(Δ, Δ0, g)
end

function orbit(Δ0, g; T = 60.0, dt = 0.05)
    init_cond = [Δ0, 0.0]
    tspan = (0.0, T)
    params = (Δ0, g)
    prob = ODEProblem(rhs!, init_cond, tspan, params)
    return solve(prob, Tsit5(); saveat = dt, abstol = 1e-8, reltol = 1e-8)
end


end

We recap here also the three special values of Δ0\Delta_0 given by the conditions:

V(0;Δ0)=0, V''(0;\Delta_0)=0, V(Δ0;Δ0)=0, V(\Delta_0;\Delta_0)=0, V(Δ0;Δ0)=0 V'(\Delta_0; \Delta_0) = 0 %F(\Delta_0;\Delta_0)=\Delta_0.

The first equation defines boundary between the single-well and double-well shapes; the second one selects the decaying solution Δ(τ)0\Delta(\tau) \to 0 for τ\tau \to \infty and finally the third one gives the static solution. Those three conditions are implemented respectively in the functions Δ0_boundary, Δ0_decay and Δ0_static in the julia code above.

In Figure 1 we show an example of the shapes of the potential for g=2g=2 for several values of Δ0\Delta_0. In Figure 2 I show the corresponding trajectories Δ(τ)\Delta(\tau). The script below was used to produce those two figures.

using Plots, Plots.PlotMeasures, LaTeXStrings, Printf
# ------------------------------------------------------------
# Example: g = 2
# ------------------------------------------------------------

g = 2

Δ_boundary = SCS.Δ0_boundary(g)
Δ_decay = SCS.Δ0_decay(g)
Δ_static = SCS.Δ0_static(g)

Δ0s = [Δ_boundary, (Δ_boundary+Δ_decay)/2, Δ_decay, (Δ_decay + Δ_static)/2, Δ_static]

# ------------------------------------------------------------
# Plot potentials
# ------------------------------------------------------------

pV = plot(xlabel = L"\Delta", ylabel = L"V(\Delta;\Delta_0)", legend = (0.45, 0.3), palette = :Set1)

for Δ0 in Δ0s
    Ds = range(-Δ0, Δ0; length = 400)
    lab = latexstring(@sprintf("\\;\\Delta_0=%.3f", Δ0))
    plot!(pV, Ds, [SCS.V(D, Δ0, g) for D in Ds], label = lab)
    scatter!(pV, [Δ0], [SCS.V(Δ0, Δ0, g)], label = false,  primary = false, markersize = 3)
end


hline!(pV, [0.0], color = :black, linestyle = :dash, label = false)

display(pV)


# ------------------------------------------------------------
# Plot Δ(τ)
# ------------------------------------------------------------

Δ0s = [Δ_boundary, (Δ_boundary+Δ_decay)/2, Δ_decay, (Δ_decay + Δ_static)/2, Δ_static]

pD = plot(xlabel = L"\tau", ylabel = L"\Delta(\tau)", legend = false, palette = :Set1)


for Δ0 in Δ0s
    sol = SCS.orbit(Δ0, g; T = 60.0, dt = 0.05)
    plot!(pD, sol.t, [u[1] for u in sol.u])
end

hline!(pD, [0.0], color = :black, linestyle = :dash)

display(pD)
Potentials for several values of Delta0
Figure 1: Self-consistent potentials V(Δ;Δ0)V(\Delta;\Delta_0) for g=2g=2 and several values of Δ0\Delta_0. The dots mark the release points Δ=Δ0\Delta=\Delta_0. For small Δ0\Delta_0 the potential is a single well centered at the origin. Increasing Δ0\Delta_0 changes the curvature at the origin and produces a double-well shape. The value Δ00.481\Delta_0\simeq0.481 corresponds to the zero-energy chaotic solution, while Δ00.530\Delta_0\simeq0.530 is the static solution.
Autocorrelation trajectories for several values of Delta0
Figure 2: Solutions Δ(τ)\Delta(\tau) of the Newtonian DMFT equation (29) for g=2g=2. I have used the same initial conditions as in Figure 1.

Phase Diagram

Finally we can compute the three boundaries given in (43), (44) and (45) for different values of gg and draw a phase diagram in the (Δ0,1/g)(\Delta_0,1/g) plane. This is done in the julia script below, and Figure 3 summarizes the result. Notice that all three curves meet at the transition point g=1g=1, Δ0=0\Delta_0=0.

# ------------------------------------------------------------
# Plot phase diagram
# ------------------------------------------------------------

gs = range(1.001, 100.0; length = 500)

Δ_boundary_curve = Float64[]
Δ_decay_curve = Float64[]
Δ_static_curve = Float64[]

for gval in gs
    push!(Δ_boundary_curve, SCS.Δ0_boundary(gval; Δmin = 1e-8, Δmax = 1.2))
    push!(Δ_decay_curve,   SCS.Δ0_decay(gval;   Δmin = 1e-8, Δmax = 1.2))
    push!(Δ_static_curve,  SCS.Δ0_static(gval;  Δmin = 1e-8, Δmax = 1.2))
end

push!(Δ_boundary_curve, 2/π)
push!(Δ_decay_curve,   2*(1-2/π))
push!(Δ_static_curve,  1.0)
gs = push!(collect(gs), Inf)


plt = plot(xlabel = L"\Delta_0", ylabel = L"1/g", legend = :topright, xlims = (0.0, 1.05), ylims = (0.0, 1.1)  )

plot!(plt, Δ_boundary_curve, 1.0 ./ gs, label = L"\;V''(0;\Delta_0)=0")
plot!(plt, Δ_decay_curve, 1.0 ./ gs, label = L"\;V(\Delta_0;\Delta_0)=0")
plot!(plt, Δ_static_curve, 1.0 ./ gs, label = L"\;F(\Delta_0;\Delta_0)=\Delta_0")

display(plt)
Phase diagram of the one-replica DMFT solutions
Figure 3: Phase diagram in the (Δ0,1/g)(\Delta_0,1/g) plane. The orange curve is defined by V(0;Δ0)=0V''(0;\Delta_0)=0 and separates the single-well and double-well shapes of the potential. The light blue curve is defined by V(Δ0;Δ0)=0V(\Delta_0;\Delta_0)=0 and to the DMFT solution with C(τ)0C(\tau) \to 0 for τ\tau \to \infty. The green curve is defined by F(Δ0;Δ0)=Δ0F(\Delta_0;\Delta_0)=\Delta_0 and corresponds to the static solution. Therefore below the light blue curve the autocorrelation is periodic and sign changing whereas between the light blue and the green curve it is periodic with positive sign. Above the green line there are no non-trivial solutions to the DMFT equation except for Δ(τ)=0\Delta(\tau) = 0. See also [Crisanti and Sompolinsky (2018)].

What's next?

I will deliberately leave two questions for a second post. First, for g>1g>1, the one-replica DMFT equation admits several formal solutions, and one has to understand which of them corresponds to a stable attractor of the original neural network dynamics. We will find out that the only physical DMFT solution is the decaying one. Secondly, one can ask whether this solution is genuinely chaotic. This leads naturally to the computation of the Lyapunov exponent.

[1] Remove neuron ii and denote by hj(i)(t)h_j^{(i)}(t) the trajectories of the remaining network. These cavity trajectories are independent of the couplings JijJ_{ij} entering the removed neuron. Consequently,

ηicav(t)=1NjJijϕ(ghj(i)(t)) \eta_i^{\mathrm{cav}}(t)= \frac{1}{\sqrt N} \sum_j J_{ij}\phi(g h_j^{(i)}(t))

is, at large NN, a Gaussian process with covariance N1jϕ(ghj(i)(t))ϕ(ghj(i)(t))N^{-1}\sum_j\phi(g h_j^{(i)}(t))\phi(g h_j^{(i)}(t')). Adding neuron ii back perturbs each of the other trajectories only by O(N1/2)O(N^{-1/2}). Adding neuron ii back perturbs neuron jj through the connection Jji/NJ_{ji}/\sqrt N. To first order in this perturbation,

δSj(t)=Sj(t)Sj(i)(t)1Nds Rj(t,s) Jji Si(s) , \delta S_j(t) = S_j(t)-S_j^{(i)}(t) \simeq \frac{1}{\sqrt N} \int ds \, R_{j}(t,s) \, J_{ji} \, S_i(s)\,,

where Rj(t,s)R_j(t,s) measures the response of neuron jj at time tt to a perturbation at time ss. Each individual perturbation is therefore of order N1/2N^{-1/2}. Substituting this into the input to neuron ii, ηi(t)=ηicav(t)+δηi(t)\eta_i(t)=\eta_i^{\rm cav} (t)+\delta\eta_i(t), gives

δηi(t)1NjJijJjids Rj(t,s) Si(s) . \delta\eta_i(t) \simeq \frac{1}{N} \sum_{j} J_{ij} J_{ji} \int ds \, R_{j}(t,s) \, S_i(s)\,.

The resulting correction to the input of neuron ii involves products JijJjiJ_{ij}J_{ji}. For fully asymmetric couplings, JijJ_{ij} and JjiJ_{ji} are independent and centered, so these feedback contributions add incoherently and vanish in the large NN limit. Hence the true input and the cavity input coincide to leading order as NN\to\infty. If reciprocal couplings were correlated, this cancellation would not occur and an additional retarded self-interaction term would survive in the effective dynamics.

[2] Differentiating (24) gives

Δ˙(τ)=12[τ+dτ e(ττ)C(τ)τdτ e(ττ)C(τ)]. \dot\Delta(\tau) = \frac{1}{2} \left[ \int_{\tau}^{+\infty}d\tau'\,e^{-(\tau'-\tau)}C(\tau') - \int_{-\infty}^{\tau}d\tau'\,e^{-(\tau-\tau')}C(\tau') \right].

At τ=0\tau=0, using the evenness of CC, the two integrals are equal.

[3] Note that

ΔF(Δ;Δ0)=g2sign(Δ)Dz[Dx ϕ(gΔ0Δ x+gΔ z)]2, \partial_\Delta F(\Delta; \Delta_0) = g^2 \mathrm{sign}(\Delta) \int Dz \left[ \int Dx\, \phi'\left( g\sqrt{\Delta_0-|\Delta|}\,x + g\sqrt{|\Delta|}\,z \right) \right]^2,

i.e. the derivative with respect to Δ\Delta of FF is form the same with the difference that the derivative of the function ϕ\phi is used. Therefore the potential can be written as

V(Δ;Δ0)=Δ22+0Δdu F(u;Δ0). V(\Delta;\Delta_0) = -\frac{\Delta^2}{2} + \int_0^\Delta du\,F(u;\Delta_0).

Therefore denoting by Φ(x)=xdy ϕ(x)\Phi(x) = \int_{-\infty}^x dy \, \phi(x) the primitive of ϕ\phi we can write the potential in terms of the integrated outputs

V(Δ;Δ0)=Δ22+1g2Dz[Dx Φ(gΔ0u x+gu z)]2u=0u=Δ V(\Delta;\Delta_0) = -\frac{\Delta^2}{2} + \frac{1}{g^2} \left. \int Dz \left[ \int Dx\, \Phi\left( g\sqrt{\Delta_0-|u|}\,x + g\sqrt{|u|}\,z \right) \right]^2\right|_{u=0}^{u=\Delta}

[4] For a saturating non-linearity as ϕ(x)=tanhx\phi(x)=\tanh x one finds

0FΔg21 . 0\le \frac{\partial F}{\partial \Delta} \le g^2 \le 1\,.

Moreover, since F(0;Δ0)=0F(0;\Delta_0)=0, for 0<ΔΔ00<\Delta\le\Delta_0, we have that

F(Δ;Δ0)<Δ . F(\Delta;\Delta_0)<\Delta\,.

Hence

VΔ=Δ+F(Δ;Δ0)<0 . \frac{\partial V}{\partial \Delta} = -\Delta+F(\Delta;\Delta_0) <0 \,.

So, below the transition, the potential is strictly decreasing as we move from 00 to Δ0\Delta_0. A particle released from rest at Δ=Δ0\Delta=\Delta_0 feels a positive force which moves it to values larger than Δ0\Delta_0. This is forbidden for an autocorrelation, because any admissible solution must satisfy Δ(τ)Δ0.|\Delta(\tau)|\le\Delta_0. Thus no nonzero solution is possible for g1g\le1. The only admissible stationary DMFT solution is Δ(τ)=0\Delta(\tau)= 0.

References

[1] H. Sompolinsky, A. Crisanti and H. J. Sommers, "Chaos in Random Neural Networks", Physical Review Letters 61, 259–262 (1988).

[2] A. Crisanti and H. Sompolinsky, "Path Integral Approach to Random Neural Networks", arXiv:1809.06042 (2018).

[3] T. Castellani and A. Cavagna, "Spin-Glass Theory for Pedestrians", Journal of Statistical Mechanics: Theory and Experiment 2005, P05012 (2005).

© Enrico M. Malatesta. Last modified: August 09, 2026. Built with Franklin.jl.