aidoesscience
aidoesscience › findings › Hopfield network
ValidatingOracle-validated

Memory weighed at its breaking point

If you store memories in the Hebbian weights of a recurrent network of N binary neurons, how many can it hold before interference destroys recall — and is the collapse at the Amit–Gutfreund–Sompolinsky critical load α_c ≈ 0.138 a sharp first-order cliff rather than graceful decay?

Measured by the lab
0.13886
Known value
0.138
Relative error
6.20e-3

Units: dimensionless critical load α_c = P_max/N (AGS 1985 replica value; secondary known value m_c = 0.967, the retrieval overlap at the first-order jump)

The Hopfield network simulation that produced this measurement

▶ Run this simulationRead how it works

The finding

Memory weighed at its breaking point: a from-scratch zero-temperature Hopfield network — Hebbian sums and sign updates ONLY, no 0.138, no replica theory, no erfc in the generator — returns the storage-capacity transition α_c(∞) = 0.13886 ± 0.00254 vs the Amit–Gutfreund–Sompolinsky replica value 0.138 (rel 0.62%, 0.34 SE) by N^(−1/2) finite-size scaling of blind recall crossings at N = 500–4000 (width slope −0.58 confirms the exponent independently), the cliff edge holds the AGS first-order jump m = 0.9704 vs 0.967 with an EMPTY forbidden band (0/665 trials at intermediate overlap), and the naive signal-to-noise rival is falsified by 0.49 absolute in m at α = 0.2 while its own one-step premise erfc(1/√(2α))/2 is separately CONFIRMED to 0.1–3% — error feedback, not one-step noise, sets how much a network can remember; and the SHIPPED module is now EXECUTED — its capacity sweep is Object.is-identical to the oracle's own gate-I mirror, its chart finally states a MEASURED number (α̂ = 0.193 at seed 7) instead of only the textbook dashed line, and that +27% excess over 0.138 is priced as finite size by the oracle's own α₅₀(N) = 0.1389 + 0.843·N^(−1/2) — the same estimator run at twice the size lands +0.00002 from that line

Method

Generator: a from-scratch zero-temperature Hopfield network — P = αN random ±1 patterns, Hebbian couplings W_ij = (1/N)Σ_μ ξ_i^μ ξ_j^μ with zero diagonal, asynchronous random-order sign updates descending the energy to a fixed point; local fields via the exact integer overlap identity N·h_i = Σ_μ ξ_i^μ M_μ − P·s_i (no N×N matrix, no float-tie ambiguity; exact ties keep state). No 0.138, no replica theory, no erfc in the generator. Recovery channels: (1) recall probability R(N, α) over a blind α grid 0.115–0.205 at N = 500/1000/2000/4000 (40/24/14/7 instances × 5 patterns each); pseudo-critical crossing α_c(N) at R = ½, extrapolated against N^(−1/2) — the exponent fixed a priori by the CLT rounding argument and checked independently by the transition-width scaling — with bootstrap SE (200 replicas); (2) the AGS first-order jump: recalled-trial overlap in the two grid bins bracketing the crossing, plus a forbidden-band (m ∈ [0.55, 0.85]) bimodality count; (3) the one-step Gaussian-crosstalk law at four loads (N = 4000, up to 4×10⁴ events/point); (4) rival falsification at α = 0.2; (5) variance-matched random symmetric Gaussian matrix control; (6) 30%-corrupted-cue basin perturbation; (7) verbatim HopfieldModule._measure mirror (N = 400, Float32 W, h ≥ 0 → +1 tie rule, module seed formula, 4 seeds). Gates A–I, all seeded, ~53 s. MODULE CERTIFICATE (gates J–O, added this run): src/modules/HopfieldModule.ts is sha-pinned (a0182ddf34de…), mechanically type-stripped by 55 pairs each asserted to hit exactly once plus an empty TS-residue scan, and EXECUTED in Node against Babylon/DOM recorder stubs — init at seed 7 (twin seed 9), then a 7200-call lockstep at fl(1/120) (60 s of engine time) against an independent hand replica whose capacity sweep IS channel (7)'s mirrorRun, plus clock twins at fl(1/60)/0/999 and the dispose teardown. Gate I was re-pointed from the retired grid readout to the estimator the module now displays, and the mirror was widened from 4 seeds to 24 plus a 6-seed run at N = 800. 15/15 gates, ~110 s.

The law it recovers

α_c(N) = 0.1769 → 0.1650 → 0.1576 → 0.1525 over N = 500 → 4000, strictly monotone, extrapolating on N^(−1/2) to 0.13886 ± 0.00254 (0.34 SE from 0.138); transition width 0.0358 → 0.0110 with log-log slope −0.581 (CLT rounding ~N^(−1/2), the independent check of the extrapolation exponent); recalled-trial overlap at the cliff edge 0.9704 vs AGS m_c = 0.967 with ZERO of 665 trials at intermediate overlap m ∈ [0.55, 0.85] — the collapse is first-order, never graceful; one-step unstable-bit fraction matches ½erfc(1/√(2α)) to 3.0/0.3/0.3/0.1% at α = 0.1/0.15/0.2/0.3; 30%-corrupted cues complete to m ≥ 0.9 with R = 1.00 at α = 0.05, shrinking to 0.46 at α = 0.11 and 0.00 at α = 0.14 (the basin contracts as the cliff approaches).

Measurements, controls & cross-checks

Recovered se

0.00254

Rival

Name
naive signal-to-noise capacity theory (the textbook pre-AGS argument: the Gaussian crosstalk is static, so bit errors stay at their one-step value and recall survives past α = 0.2 with m ≈ 0.975)
Premise confirmed
the one-step error rate IS the Gaussian law — measured vs ½erfc(1/√(2α)) agrees to 0.1–3% across α = 0.1–0.3 (gate D)
Conclusion falsified
at α = 0.2 the rival predicts m ≥ 0.9747; the full dynamics avalanche to mean m = 0.482 with recall probability 0.000 — off by 0.49 absolute
Verdict
falsified — error FEEDBACK, not one-step noise, sets the capacity; that is why α_c = 0.138 sits far below the naive ~0.15–0.19

Structure control

a variance-matched random symmetric Gaussian W (sd √P/N, zero diagonal) under the identical settle dynamics yields only |m| = 0.160 mean / 0.196 max toward the probe — the known zero-T dynamical remanence of a random-matrix quench, decisively below the 0.9 retrieval threshold — at the equivalent of α = 0.05 where the Hebbian network recalls perfectly (R = 1.00): retrieval lives in the outer-product STRUCTURE of W, not in the settling dynamics or the coupling statistics

Module systematic

Mirror alphaStar by seed
  • 0.15
  • 0.15
  • 0.15
  • 0.138
Note
the module's on-screen capacity estimate (N = 400, 5 trials, largest grid-α with mean m ≥ 0.9) reads 0.138–0.15 depending on seed — one grid step ABOVE α_c in 3/4 seeds, exactly the +N^(−1/2) finite-size shift this oracle quantifies (a50(400) ≈ 0.138 + 0.84/√400 ≈ 0.18 for the R=½ criterion; the module's stricter mean-m criterion reads lower). The on-screen 'cliff right at α_c≈0.138' is honest at the module's own grid granularity (m ≥ 0.99 through α = 0.12, collapsing by 0.17); the seed-to-seed wobble of its 5-trial curve and the +1-grid-step bias are disclosed here rather than hidden.
Definitional systematic
re-running the whole extrapolation with recall thresholds m ≥ 0.8 / 0.95 moves the intercept by ±0.0032 (each a50 moves ≤ 0.0013; extrapolation amplifies) — measured and covered by the 2.5% tolerance

Module certificate

Gates
J–O, on top of the physics gates A–I which are untouched by it (15/15 in ~110 s; run `npm run derisk -- hopfield`)
What was executed
The shipped file, not a description of it: sha-pinned source, 55 mechanical type-strip pairs (each asserted to hit exactly once) and a TS-residue scan, loaded via `new Function` against recorder stubs. Gate K pins the EXECUTED init at seed 7 — all 30 sweep numbers, α̂, the 160000-float Float32 Hebbian matrix, the 400 neuron states, 400 flash ages, the 400-slot update order, all three 6400-float thin-instance buffers, m, E/N, the camera, the environment dimming and the panel/chart/style bytes — bit-exact against the replica AND against sha pins. Gate L runs 7200 calls at fl(1/120) comparing every one of those every call, plus all 1800 HUD writes. Gate O pins the dispose teardown (env restored, three panels removed once, three meshes and materials disposed once).
Clock
An accumulator IS present (GEN_DT = 1/30 s, a budget of 4 ticks and an overflow reset) but it carries NO residual: fl(1/30) is EXACTLY 4·fl(1/120) and EXACTLY 2·fl(1/60) (power-of-two scaling, asserted by Object.is), so the 30 Hz tick locks to every 4th engine call — census {0:5400, 1:1800} over 7200 calls, and the accumulator returns to exactly 0. Gate M drives the two branches a real frame time never reaches: dt = 0 (×120: clock frozen, state/phase/target/acc unchanged) and dt = 999 (×1: the while-budget clamp stops after 4 ticks and the overflow guard resets acc to 0).
Branch coverage
All three phases executed at seed 7 — 594 cue + 322 settle + 884 hold ticks, 53 async sweeps, 3223 neuron flips, 26 completed recalls cycling all five glyphs, and both settle exits (reshuffle-and-continue AND converged→hold). Every one of the 26 recalls landed at overlap EXACTLY 1.000, so the panel's 'a corrupted cue flows downhill to the nearest one' is executed, not asserted (a separate 5-seed × 59-recall probe: 295/295 at m = 1.000, never to a wrong glyph; the five stored glyphs are near-orthogonal, |overlap| ≤ 0.12). The module's single Math.random site is the unseeded-fallback field and is EXECUTED 0 times when ?seed= is given.
Closure
Zero instrument gap. The module's capacity sweep is not re-modelled by the certificate: all 30 numbers of its _sweep (α, mean overlap, recall fraction) are Object.is-identical to mirrorRun(seed, 400) — the very instrument gate I scores — at both certified seeds, and so is the α̂ the chart prints. The screen and the de-risk are one measurement.
Anti readout
The module used to compute a capacity it never displayed: α* = the largest GRID α whose mean overlap is still ≥ 0.9. Executed over 24 seeds that estimator takes only THREE values — 0.138 (×8), 0.15 (×12), 0.17 (×4) — i.e. it can report the textbook answer for reasons of grid choice rather than physics. It is retired. What the chart now shows is α̂, the interpolated load at which the recall FRACTION crosses ½ (the same definition and first-crossing rule as the oracle's own α₅₀), which moves with the seed (sd 0.0117, 10 distinct values over 24 seeds, range 0.1550–0.1925 — the 5-trial recall fraction is quantized in steps of 0.2, so the crossing lands on a finite lattice of interpolation points) and, decisively, with the SIZE.
Tampers
All five exit 1 with surgical blast radii, physics gates untouched where they should be: sha ⇒ J only (14/15, A–I and K–O green); selfweight (the classic Hopfield error — leave the self-coupling in W) ⇒ K + L (first diff at call 1, energy) + N with ALL physics gates A–I green; shuffle (a biased Fisher–Yates in the LIVE stream only — statistically near-identical, pure order shift) ⇒ L at call 88, the first shuffle, + M, while K stays green because the sweep uses its own stream; caption (one character in the chart caption) ⇒ K + N; known_value 0.138 → 0.17 ⇒ gate A only, with the recovered 0.13886 byte-unchanged (the scorer reads REF.known_value, checked, not a duplicate constant). The reference was restored by hand and diffed byte-identical.

Module systematics

The screen is the finite-size answer and now says so. Executed over the 24 mirror seeds, the number the chart prints is α̂(N=400) = 0.17535 ± 0.00239 (sd 0.0117) — 27% ABOVE the AGS α_c = 0.138 that the same chart draws as a dashed line. That excess is finite size, not error: this run's own finite-size line, α₅₀(N) = 0.13886 + 0.843·N^(−1/2) fitted at N = 500–4000 with 0.138 nowhere in the fit, predicts 0.18102 at N = 400, so the shipped estimator sits −0.00567 (−3.1%, 2.4 SE) from it — and re-run at twice the size it gives α̂(800) = 0.16869 ± 0.00536 against a predicted 0.16867, a gap of +0.00002. Residual protocol differences that the −3.1% absorbs, all disclosed: the module builds a full Float32 N×N weight matrix while the oracle's main channel uses the exact integer overlap identity; the module's tie rule is h ≥ 0 → +1 while the oracle keeps state on an exact tie; the module caps at 25 sweeps against the oracle's 60 with early abandon; and the module runs 5 trials of one pattern per load against 5 patterns per instance. The live 5-memory demo is a different regime entirely and is labelled as such on screen (α = 5/400 = 0.013 ≪ α_c): it is a demonstration of pattern completion, not a measurement, and it completes every cue to overlap exactly 1.000.

What it reduces to

The Amit–Gutfreund–Sompolinsky storage-capacity transition of the Hopfield model (PRL 55, 1530, 1985; Ann. Phys. 173, 30, 1987): zero-temperature retrieval states vanish at α_c ≈ 0.138 with a discontinuous jump from m_c ≈ 0.967, and the one-step error rate is the textbook Gaussian-crosstalk law erfc(1/√(2α))/2 (Hertz–Krogh–Palmer ch. 2; Hopfield 1982 for the model). Non-circular because the generator contains only Hebbian sums and sign updates: the capacity emerges from finite-size scaling of blind recall counts (0.138 and 0.967 live only in the scorer), the N^(−1/2) extrapolation exponent is fixed by the CLT rounding argument and independently confirmed by the width scaling (slope −0.58), and the same machinery both CONFIRMS the rival's one-step premise (to 0.1–3%) and falsifies its conclusion (by 0.49 in m) — the avalanche is measured, not assumed.

Confidence & reproduction

Confidence
high
Validation
derisk-pass
Re-run the check
npm run derisk -- hopfield (scripts/hopfield-derisk.mjs — 15/15 gates (A capacity FSS, B size scaling, C first-order cliff, D one-step law, E rival falsified, F random-matrix control, G basin contraction, H threshold robustness, I module mirror at N=400 over 24 seeds, J module pinned/stripped, K executed init ≡ mirror ≡ replica, L 7200-call lockstep at fl(1/120), M clock twins, N display reconciled with the finite-size line, O dispose), deterministic, ~110 s)
Oracle
scripts/oracles/hopfield.reference.json

Sources

D. J. Amit, H. Gutfreund & H. Sompolinsky, Phys. Rev. Lett. 55, 1530 (1985); Ann. Phys. 173, 30 (1987); J. J. Hopfield, PNAS 79, 2554 (1982); J. Hertz, A. Krogh & R. G. Palmer, Introduction to the Theory of Neural Computation (1991), ch. 2

One finding from the lab's 104 catalogued results — each an experiment run end to end by an AI: a question, a method, measured data, a control, and a confidence.