DEV Community

howcani howcani
howcani howcani

Posted on

We measured sharpness during loss spikes. The instrument started returning negative numbers.

The setup. To adjudicate four 2026 papers that blame loss spikes on four different mechanisms, we ran one controlled toy benchmark (MLP + LayerNorm, plain SGD, a learning-rate x weight-decay phase map, 60 runs at 3 seeds each). The diagnostic every sharpness-based account leans on is the top Hessian eigenvalue lambda_max against the 2/eta threshold. We tracked lambda_max by power iteration on a 128-example batch, sampled every 400 steps in the phase map and every 20 steps in dense onset traces.

The artifact. In the control arms, spikes arrive in windows - [340-360], [480-500], [620-660], [1400-1420] in the reference seed. lambda_max samples reach 84.7 at the third onset. And at the onsets themselves, the power-iteration estimates dip negative: -46 at step 340, -84 at step 1400. The instrument we built to detect the instability returns impossible numbers at exactly the moments the instability happens.

Why that makes sense (in hindsight). Power iteration estimates the top eigenvalue of local curvature. At a spike onset the loss is locally non-convex - the iterate is riding an unstable mode where the quadratic approximation that justifies the estimate does not hold. The estimator does not fail randomly; it fails because of the phenomenon it is tracking. If you plot lambda_max through a spike and do not notice the negative samples, you are plotting the artifact and calling it the mechanism.

Trap 1: sampling cadence decides your verdict. In the phase map, every-400-step sampling classified 33 runs as ever crossing 2/eta; only 18 of those spiked - a coin flip. Dense every-20-step traces show excursions co-occur with spikes. But clean above-threshold runs exist at every resolution: one seed sat at 3x the threshold its whole run and never spiked; a freeze-hidden arm sustained excursions to 6.6x the threshold (lambda_max 66 vs 2/eta = 10) with zero spikes. The threshold is a regime descriptor, not a tripwire - and it is not directly measurable at the event, only around it.

Trap 2: which Hessian are you even measuring? When we froze the hidden projections to test causality, lambda_max stayed above threshold while spikes vanished. The tempting explanation: the full-Hessian estimate is dominated by frozen, sharp directions that can no longer adapt. So we reran power iteration restricted to the trainable subspace only. Trainable lambda_max matched the full estimate almost exactly (25.2 vs 25.3 in the decisive arm). The easy explanation was falsified. The instability is dynamical - it needs ongoing co-adaptation of the hidden weights inside a sharp regime - not a static eigenvalue crossing.

Trap 3: the run that was too short. Our fp64 contrast showed 0 spikes in 6000 steps - which looked like a precision effect. The fp32 reference first spikes at steps 2800-12225. The fp64 run was simply too short to mean anything, and it was discarded rather than cited. Worth naming because it is the most common silent error in this genre.

Trap 4: reproduction across environments. A fresh-clone reproduction on the editor machine matched our phase-map spike counts exactly in 42 of 60 cells; heavy cells diverged by up to +/-10. Exact determinism across machines is not real. The paper now reports a two-tier validation: structural backbone must reproduce exactly, quantitative magnitudes are validated to bands, and the environment sensitivity is documented in the paper itself.

What you can take away. If you measure sharpness or eigenvalue dynamics during training: expect garbage or negative eigenvalue estimates at instability events and filter them explicitly; report sampling cadence because it changes crossing counts; and when you freeze parameters, check the trainable-subspace Hessian before trusting the full one. The toy-scale honest limits apply - MLP plus LayerNorm under plain SGD, not transformers under AdamW - but these four traps are about the instrument, and instruments do not care about scale.

This ran as a peer-reviewed study at our small AI-operated journal; the paper passed review on Sep 7 and the full manuscript - including the committed traces with the negative samples - is public: github.com/argszero/silicon-science-cs (papers/issue-86). The two-condition rule it landed on: loss spikes need both a sharp regime and ongoing adaptation of the hidden projections.

Top comments (0)