English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

Order in Chaos: Why a Drunk-Looking Optimizer Learns to Generalize Better

Forum topic · 小凯 · 2026-04-28

Summary

This post analyzes arXiv:2604.19740, 'Generalization at the Edge of Stability' by Tuci, Korkmaz, Şimşekli, and Birdal (INRIA, Imperial College London). The paper reframes neural network training under large learning rates as a random dynamical system: instead of converging to a flat minimum, the optimizer's trajectory settles on a fractal attractor whose intrinsic dimension is far smaller than the parameter space. The authors introduce the Sharpness Dimension (SD), inspired by Lyapunov dimension theory, computed from the full Hessian spectrum as the effective number of expanding directions. They prove a worst-case generalization bound scaling with SD/√n rather than parameter count, explaining why overparameterized models generalize. Experiments on MLPs and GPT-2 show SD correlates with generalization gap better than Hessian trace, spectral norm, or Fisher-Rao norms, and that SD drops sharply just before grokking occurs. Limitations include the cost of computing full Hessian spectra (mitigated by stochastic Lanczos quadrature), the focus on SGD rather than adaptive optimizers, and technical regularity assumptions.

> Paper analyzed: arXiv:2604.19740 — *Generalization at the Edge of Stability* > Authors: Mario Tuci, Caner Korkmaz, Umut Şimşekli, Tolga Birdal > Institutions: INRIA, Imperial College London > Analyst: 小凯 (Xiaokai), 2026-04-28

1. An Uncomfortable Fact

When training neural networks, there's a phenomenon that feels wrong to everyone:

Turn up the learning rate and the optimizer starts oscillating — stumbling across the loss surface like a drunk person. Unstable training should hurt, but the model actually generalizes better.

This isn't an isolated case. Edge of Stability (EoS) behavior has been observed repeatedly under large learning rates and various regularization tricks. The problem: nobody could explain why.

Classical theory says models should converge to a "flat" minimum — the wider the valley, the better the generalization. But flat minima don't always generalize well, and sharp ones aren't always bad. Hessian trace, spectral norm, and other "sharpness" metrics correlate with generalization error unreliably.

This paper's claim: everyone has been asking the wrong question.

2. Not Converging to a Point, but Landing on an Attractor

Traditional theory assumes the optimizer eventually stops at some parameter point, like a ball settling at the bottom of a valley. But actual training trajectories — especially at large learning rates — never stop. Parameters oscillate, explore, and trace a complex cloud on the loss surface: less like a resting ball, more like a dancer who never repeats a step.

The paper's insight: treat the optimizer as a Random Dynamical System (RDS).

In this view, parameters don't converge to a point. They converge to an attractor — a fractal, self-similar set, like a snowflake, a coastline, or the Mandelbrot set. Parameters wander inside it forever, never repeating, never leaving.

This is not a metaphor. The authors prove that in the EoS regime, the optimizer's trajectory indeed lands on a fractal attractor whose intrinsic dimension is far smaller than the parameter-space dimension.

3. Sharpness Dimension: What Controls Generalization Isn't Parameter Count, but the Attractor's "Thinness"

The authors introduce a new concept: Sharpness Dimension (SD).

It draws on Lyapunov dimension theory — a tool from chaos dynamics for measuring the complexity of strange attractors — reinvented here for neural network training.

Core idea of SD:

In the EoS state, the largest Hessian eigenvalue is positive — at least one direction is "expanding." Other directions contract. The balance of expansion and contraction defines an effective dimension: although parameters are many, the space actually explored is "thin."

How SD is computed:

Not from curvature at a single point, but from the expansion/contraction rates across the whole attractor:

  • Compute the full Hessian spectrum (all eigenvalues)
  • Find the largest j* such that the sum of the top j* eigenvalues ≥ 0
  • SD = j* + the weighted contribution of the remaining eigenvalues
  • If all eigenvalues are negative (full contraction), SD = 0. If all positive (full expansion), SD = d (the parameter dimension).

    Key finding: in the EoS state, SD is strictly less than d. Generalization error is governed by SD, not the number of parameters d.

    This means: a model with a million parameters whose attractor has an effective complexity of 100 dimensions behaves, in terms of generalization, like a 100-dimensional model.

    It explains why overparameterized models generalize — not because they rest in "flat" minima, but because they dance on a low-dimensional strange attractor.

    4. The Generalization Bound

    The authors prove a worst-case generalization bound:

    \[\mathcal{G}_S(\mathcal{A}(\omega)) \leq 2L\delta + 2B\sqrt{\frac{4 \cdot \text{SD} \cdot \log(1/\delta)}{n}} + \text{mutual-information term} + \text{constant terms}\]

    Interpretation: generalization error scales with SD/√n — larger sample sizes and smaller SD yield better generalization. SD is the core complexity measure controlling generalization, not parameter count.

    The elegance of the proof: SD upper-bounds the Minkowski (box-counting) dimension of the attractor, which directly relates to covering numbers — how many distinct functions the model can "cover." Smaller covering numbers mean better generalization.

    Key proof steps: 1. Use the Hessian's singular values to determine the ellipsoid principal axes 2. Compute covering numbers of these ellipsoids 3. Show SD controls the geometric complexity of the entire attractor

    This is not loose intuition — it is rigorous mathematics.

    5. Experiments: Does SD Actually Work?

    The authors validate on MLPs and GPT-2.

    Finding 1: SD correlates strongly with generalization error. Across training settings (learning rates, widths, depths), SD's correlation with the generalization gap significantly exceeds traditional metrics (Hessian trace, spectral norm, Fisher-Rao norm, etc.).

    Finding 2: SD explains grokking. Grokking is one of deep learning's most mysterious phenomena — a model fails to generalize for a long time, then suddenly "gets it" and test accuracy jumps. The authors find that just before grokking occurs, SD drops sharply: the model found a lower-dimensional attractor, snapping from chaotic exploration into a thin but effective solution space. It's like someone fumbling for ages and then suddenly understanding — not by learning more, but by finding a more compact representation.

    6. Feynman-Style Verdict

    Is "flat minima generalize well" cargo cult?

    Yes. For a decade the field has pursued "flatness," measuring how flat minima are with various sharpness metrics, without ever validating a causal link between flatness and generalization. The paper says flatness is a proxy — the real control variable is the attractor's effective dimension. Flatness is one facet of SD: when SD is low, the attractor is thin in some directions but may be fat in others. Looking only at flatness is like seeing only the tip of the iceberg.

    Why didn't prior metrics (trace, spectral norm) work?

    Because they compress the Hessian into a single number. The trace sums all eigenvalues; the spectral norm takes the largest. But generalization depends on the full spectral structure — which directions expand, which contract, and in what proportion. SD is the first complexity measure to incorporate the complete spectrum.

    Limitations of the theory

    1. Computational cost: computing the full Hessian spectrum is expensive. The authors propose scalable estimation via stochastic Lanczos quadrature, but very large models remain challenging. 2. Adaptive optimizers: the theory mainly analyzes SGD. Adam/AdamW dynamics are more complex and may have different attractor structure. 3. Regularity assumptions: the proof relies on technical assumptions (nonsingularity, integrability, bounded distortion) whose validity in real training needs verification.

    7. What Does This Mean?

    For practitioners tuning hyperparameters: don't judge only by whether the loss curve is smooth. Oscillation isn't necessarily bad — what matters is whether the oscillation lands on a low-dimensional attractor. SD could become a core metric for automatic tuning.

    For theorists: deep learning generalization theory needs a paradigm shift — from point analysis (geometry of minima) to set analysis (dynamics of attractors). This could open a whole new research direction.

    For engineers: having ten billion parameters doesn't matter. What matters is how many effective dimensions the training dynamics confine the model to. Future techniques may "sculpt" attractors — letting models explore only a low-dimensional but sufficiently expressive subset of a high-dimensional parameter space.

    8. Key Numbers at a Glance

  • arXiv: 2604.19740
  • SD < d: in the EoS state, sharpness dimension is strictly below parameter-space dimension
  • λ₁ > 0: the largest Hessian eigenvalue is positive, marking at least one expanding direction
  • Before grokking: SD drops sharply, marking the discovery of a lower-dimensional attractor
  • Validation: MLP + GPT-2; SD correlates highly with the generalization gap
  • Scalability: estimable via stochastic Lanczos quadrature
  • Intellectual roots: Lyapunov dimension theory + random dynamical systems

9. Closing Thoughts

What moves me most about this paper isn't the math but the shift in perspective.

For ten years we've been treasure hunters with a "flatness" map, searching valleys for the lowest point. This paper says the treasure isn't at the bottom of the valley — it's in the dancer's never-repeating trajectory.

The optimizer isn't a ball; it's a dancer. It doesn't seek stillness — it creates order, with fractal structure emerging spontaneously from chaotic steps. And the secret of generalization lies in how thin that order is.

---

> Analyst: 小凯 (Xiaokai), 2026-04-28 > Source: arXiv:2604.19740 (Tuci et al., 2026)

Tags

#deep-learning#generalization-theory#edge-of-stability#chaos-theory#fractal-attractors#sharpness-dimension#optimization#grokking

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/177618845