In the world of deep learning, not all solutions are created equal. While many different sets of model weights can achieve zero training loss, those that lie in "flat" regions of the loss landscape—where the curvature is low—tend to generalize much better to new data.
A new paper from researchers at Princeton University, "A new algorithmic approach for finding flat minima: critically damped Polyak stepsizes," introduces a surprisingly simple way to find these elusive flat minima. By slightly modifying a classic optimization rule, they’ve created an optimizer that naturally "drifts" toward flatter regions of the parameter space.
TL;DR
The authors propose Critically Damped Polyak (CDP) stepsizes, a simple adaptive learning rate rule that biases gradient descent toward flatter minima. By operating at the "edge of stability," the algorithm causes iterates to oscillate around the solution manifold, creating a natural drift toward regions of lower curvature, with proven theoretical guarantees and strong results in fine-tuning Large Language Models (LLMs).
What Problem Does This Paper Address?
Overparameterized models, like modern neural networks, have a "manifold" of global minima—a continuous set of points where the training loss is zero. However, some points on this manifold are "sharp" (high curvature), while others are "flat" (low curvature). Flat minima are highly desirable because they are more robust to small perturbations and generally perform better on test data.
Existing methods to find flat minima, such as Sharpness-Aware Minimization (SAM), often require multiple gradient evaluations per step or complex modifications to the objective function. The challenge is to find a first-order optimizer that can navigate the manifold of solutions toward flatter regions using only standard gradient information.
Methods
The core of the paper is the Critically Damped Polyak (CDP) stepsize rule:
$$\eta_\kappa = 4 e^{-\kappa \mathcal{L}(\theta)} \frac{\mathcal{L}(\theta)}{\|\nabla \mathcal{L}(\theta)\|^2}$$
This formula builds on the classical Polyak stepsize but introduces two critical changes:
- The Factor of 4: While standard Polyak rules use a factor of 1 or 2 to converge directly to a minimum, the factor of 4 is "critical." it intentionally overshoots, causing the iterates to oscillate (or "equioscillate") across the manifold of solutions.
- The Damping Factor ($e^{-\kappa \mathcal{L}}$): This term gradually slows down the oscillations as the loss $\mathcal{L}$ decreases, eventually allowing the model to converge onto the manifold.
As shown in Figure 1, these oscillations aren't just noise; they align the model's movement with the direction of greatest curvature. This tension between oscillating and converging creates a "slow drift" along the manifold toward flatter regions.
Datasets
The researchers validated CDP across a range of tasks:
- Toy Models: Visualizable 2D loss landscapes to confirm the "flatness drift."
- Student-Teacher Networks: Synthetic regression tasks using both ReLU and smooth (tanh) activations to test the theory in controlled neural network settings.
- LLM Fine-tuning: Fine-tuning pre-trained Large Language Models, specifically GPT-2 and Qwen2.5-1.5B/0.5B, on the WikiText-2 dataset.
Key Insights and Ideas
- Embracing the Edge of Stability: Most optimizers try to avoid oscillations. CDP uses them as a compass. By oscillating in the "sharpest" direction, the optimizer naturally feels a pressure to move toward areas where those oscillations are less violent—i.e., flatter regions.
- Implicit Bias via Stepsize: Unlike SAM, which changes the direction of the gradient, CDP only changes the length of the step. The "flatness bias" emerges purely from how the stepsize reacts to local curvature.
- Uniform-in-Time Guarantees: A major theoretical contribution is proving that CDP reduces both loss and sharpness simultaneously over the entire training run. Many previous analyses of similar "drift" effects only held for short periods.
- Convergence to Interpolation: Unlike "Normalized Gradient Descent," which requires adding noise to move along the manifold, CDP's steps naturally shrink as the loss goes to zero, allowing it to settle into a specific, high-quality solution.
Key Results
The empirical results demonstrate that CDP is highly effective at reducing "sharpness" (the top eigenvalue of the Hessian, $\lambda_1$):
- LLM Sharpness Reduction: In GPT-2 fine-tuning, CDP reduced the sharpness from an initial 1475 down to 27. For comparison, the popular AdamW optimizer only reached a sharpness of 486.
- Hybrid Schedules: The authors found that using CDP as a "warmup" phase followed by Adam works best. On Qwen2.5, this hybrid approach achieved nearly the same perplexity as Adam alone but with 7x lower sharpness.
- Quantization Robustness: Models trained with CDP were more robust to 4-bit quantization. Because the minima were flatter, "rounding" the weights during quantization caused less damage to the model's performance.
Limitations and Future Work
- Zero-Loss Assumption: The current theory and stepsize rule assume the global minimum loss is zero (common in overparameterized regression). Adapting this to cross-entropy loss (where loss doesn't hit zero) requires careful tuning of the damping parameter.
- Hyperparameter Sensitivity: The "step cap" (limiting how much a parameter can change in one step) was found to be important for LLM stability, suggesting CDP might be sensitive to initialization in very complex landscapes.
- Stochasticity: While the paper explores minibatch gradients, the core theory is deterministic. Extending the "uniform-in-time" proofs to the fully stochastic setting is a promising next step.
Summary updated