← All entries
Paper2026#1439

Simulating Training Spikes of Deep Neural Networks by Layer-wise Random Feature Models

Summary

A mechanism paper for training spikes — the sharp temporary train+validation loss surges in LLM pretraining. Diagnostic starting point: ordinary loss fluctuations are driven by data shuffling and reproduce identically across seeds, but spikes occur at DIFFERENT steps for runs differing only in initialization, so spikes are not caused by a single bad data point and outlier removal cannot fully fix them. TOY MODEL (PLRF): a Power-Law Random Feature model — fixed random Gaussian features feeding linear regression, inputs power-law scaled with exponent α. Two necessary conditions for spikes in PLRF: (1) heavy-tailed data (large α) and (2) learning rate near the divergence threshold. At α=0.3 raising the LR just diverges cleanly; at α=0.9 BOTH SGD and Adam produce genuine spikes before divergence (claimed as the first explicit link between training spikes and heavy-tailed data). MECHANISM: decompose the iterate into deterministic full-batch descent plus a random walk accumulating stochastic gradient noise. Concentration of measure makes the loss concentrate on its expectation IFF α ≤ 0.5 (equivalently Σλ_i diverges for eigenvalues λ_i ∝ i^(−2α)); for α > 0.5 a few very large eigenvalues dominate, and when the noise random-walks into alignment with a large-eigenvalue direction, the loss surges. The EXPECTED loss stays smooth — average-case scaling-law analyses remain valid but stop describing individual runs. Side result: spikes occur in convex quadratic models under stochastic optimization — the 3rd-order terms needed for Edge-of-Stability spikes under full-batch GD are NOT necessary once gradient noise exists; and the SGD divergence threshold is not 2/λ_max but solves (1/B)·Σ γλ_i/(2−γλ_i) = 1 — sharpness (λ_max) is only distantly relevant; the whole eigenvalue distribution is what matters. LAYER-WISE SIMULATOR (Algorithm 1): each layer gets a 2nd-order Taylor expansion of validation loss around a checkpoint (per-example gradient second moments factorize through the activation-correlation spectrum — Prediction 5, verified with relative error <0.1, mostly within 5%, across layer types and steps); from ONE checkpoint + one validation pass (activation-correlation eigendecomposition, mean gradient, mean squared per-batch gradient norm, Hessian trace via Hutchinson probing), synthesize Gaussian per-batch gradients and roll the real optimizer map forward — ~5 seconds on CPU for 1,500 steps for one layer, vs 8 min–1.7 hrs of measurement on TPUv4×32 and 40 hrs to train the case-study model. CASE STUDY: vanilla 1.3B decoder-only Transformer (24 blocks, d=2048, C4, ~25.5B tokens, AdamW β2=0.95, peak LR 8.2e-4, NO gradient clipping); changing only β2 0.95 → 0.999 induces spikes (two seeds). Simulating from the step-21k checkpoint, the normal configuration stays comparatively smooth while both spiky configurations show clear bumps — matching the qualitative fact of spikiness, NOT the step (spike timing is random by construction). Activation-correlation eigenvalues are power-law distributed and MORE heavy-tailed for the spiky configuration, especially in lower layers. EQUIVALENT BATCH FACTOR: despite ~524K tokens per batch, the measured equivalent batch factor 𝔅 ≈ 1 — for gradient-noise purposes Transformer LM training sits in the SMALL-BATCH stochastic regime, because per-token gradients vary wildly; token-count batch size does not buy the gradient-noise suppression sequence-count reasoning suggests. β2 RECIPE: make Adam's second-moment decorrelation time ~1/√(η_t·H) instead of ~1/(η_t·H), giving β2 ≈ 1 − √(η_t·𝔗/√𝔑) from measured Hessian trace 𝔗 and per-batch gradient norm 𝔑 — generically an INCREASING β2 schedule as LR decays; fitted schedule β2 0.982 → 0.992 gave final val loss 2.4404 vs 2.4421 for constant 0.95 and 2.4502 (visibly spiky) for constant 0.992 — real but TINY margins (0.0017 over the original; 0.0001 over the best constant), single runs, no seed variance; the sharper finding is the sensitivity — a 0.01 change in constant β2 flips training between smooth and spiky. Caveats (authors' own, unusually candid): the simulator explains spikes only PARTIALLY — measured 2nd-order terms show level "jumps" rather than spike-and-recovery, 1st-order terms are ~20× larger than the quadratic model predicts; cross-layer correlations and >2nd-order terms are needed and absent; the honest claim is "quadratic models at least partially reveal the mechanism," weaker than the abstract's "successfully predicts." "Prediction" is qualitative — a spike-RISK screen from a checkpoint, not a forecast of when. The layer framework rests on imposed assumptions (Gaussian latents with negligible drift; isotropic output-gradient covariance) and EXCLUDES tied embedding/LM-head weights entirely. The β2 mechanism is admittedly unexplained ("a curious mystery"); the recipe is offered as proof of concept. Simulator accuracy degrades badly with batch size in the PLRF check (severe overestimation at B=64) — the DNN case is argued safe only because 𝔅 happens to be ≈1 for this recipe. Single case study: one size (1.3B), one dataset, one recipe, spikiness constructed by pushing β2, no gradient clipping (atypical for production pretraining); Muon is mentioned only as neighboring spectrum work, NOT simulated. All results first-party, no independent replication, paper ~2 weeks old.

Venue
arXiv cs.LG preprint v1, submitted 9 Oct 2026 (no venue stated, not peer-reviewed as far as the record shows)
Source
arxiv
Access
free
Language
en
Added
Oct 22, 2026
Verified
Oct 22, 2026

Research notes

  • Discovery: Hudson shared a bare t.co link 2026-10-22 resolving to the arXiv abs page. Relevance: (1) his pretraining — monitor the power-law exponent of per-layer activation-correlation eigenvalues as a training-health metric (heavier tails = spike risk; watch the spectrum, not λ_max); the β2-from-metrics recipe and its generic implication (β2 should rise as LR decays) apply IF he runs AdamW, with the tiny-margin caveat; the 𝔅 ≈ 1 finding bears on batch-size/LR schedule decisions (pairs with #68/#102 on batch schedules). (2) Launch Helm — the simulator is nearly a feature spec: from one checkpoint + one validation pass, a 5-second CPU rollout per layer flags spike-prone configurations BEFORE burning training steps, plus loggable diagnostics (per-layer α, Hessian trace, per-batch gradient norm, equivalent batch factor); complements #107 OPAL's per-tensor gradient-spike tracing — OPAL detects spikes reactively in-run, this is a checkpoint-level predictive screen with a candidate mechanism. (3) His 3:1 SWA:full-attention + FlashAttention stack — ANALOGY ONLY: the framework is layer-wise in principle, but validation is a vanilla dense full-attention Transformer; nothing tests SWA layers, hybrid stacks, or kernel numerics. RLVR: not studied (analogy only). Near neighbors NOT to merge: Bai et al. 2026 "Adaptive preconditioners trigger loss spikes in Adam"; Molybog et al. 2023; Paquette et al. 2021/2024 random-feature SGD dynamics (foundation papers, different works).
  • License: paper CC BY 4.0 (verified from abs-page license icon); code: Colab notebooks only, NO license stated — flagged; no weights/checkpoints released; the Transformer training code itself is not released (hyperparameters only)

Similar entries