Adam through a Second-Order Lens

Ross M Clarke, Baiyu Su, José Miguel Hernández-Lobato · Submission to ICLR 2024 · Rejected

TL;DR

AdamQLR bridges first- and second-order optimization by taking the update directions proposed by Adam and dynamically scaling them using K-FAC’s quadratic model and Levenberg-Marquardt damping. By calculating step sizes directly from Fisher-vector products, AdamQLR eliminates manual learning-rate tuning while avoiding the catastrophic overfitting often seen in full second-order methods.

What Problem Does This Paper Address?

Deep learning optimization is stuck in a trade-off:

  • First-order optimizers (like SGD and Adam) are computationally lightweight per step, but rely heavily on manually tuned learning rates and schedules.
  • Second-order optimizers (like K-FAC) leverage curvature information for faster theoretical progress per step, but are computationally intensive, prone to severe overfitting, and rely on fragile stabilization heuristics.

The authors ask: Can we take the engineering heuristics that stabilize second-order methods—specifically adaptive damping and quadratic step-size selection—and graft them onto Adam?

Methods

AdamQLR wraps standard Adam with two core mechanisms borrowed from K-FAC:

  1. Adam Direction Proposal: At each step, Adam’s momentum ($\hat{m}_t$) and second-moment ($\hat{v}_t$) buffers propose an update direction $d_t = \frac{\hat{m}_t}{\sqrt{\hat{v}_t} + \epsilon}$.
  2. Quadratic Learning Rate Selection (QLR): Rather than using a fixed learning rate $\alpha$, AdamQLR minimizes a local second-order Taylor expansion $M(\theta) = f(\theta_{t-1}) + (\theta - \theta_{t-1})^T g_t + \frac{1}{2}(\theta - \theta_{t-1})^T (C + \lambda I)(\theta - \theta_{t-1})$ along direction $d_t$, yielding: $$\alpha = \frac{g_t^T d_t}{d_t^T (C + \lambda I) d_t}$$ Here, $C$ is the true Fisher Information Matrix, computed efficiently via Jacobian-vector products without ever storing the full matrix.

  3. Levenberg-Marquardt Damping: Damping parameter $\lambda$ dynamically adapts by evaluating the reduction ratio $\rho = \frac{f(\theta_t) - f(\theta_{t-1})}{M(\theta_t) - M(\theta_{t-1})}$. If the quadratic model predicts progress well ($\rho > 3/4$), $\lambda$ decreases; if the model is poor ($\rho < 1/4$), $\lambda$ increases to shrink step sizes.

  4. Learning Rate Clipping: Step sizes are clipped to an upper bound $\alpha_{\max}$ to prevent updates in degenerate, near-zero curvature directions.

The authors propose an Untuned AdamQLR setting with fixed defaults (batch size 3,200, $\lambda_0 = 10^{-3}$, $\omega_{\text{dec}} = 0.5$, $\omega_{\text{inc}} = 2.0$, $\alpha_{\max} = 0.1$).

Datasets

The authors evaluate on standard optimization benchmarks across multiple modalities (no new benchmarks are introduced):

  • Synthetic: 2D Rosenbrock function.
  • Tabular Regression: UCI Energy and UCI Protein (using MLPs).
  • Vision Classification: Fashion-MNIST (MLP), SVHN (ResNet-18), CIFAR-10 (ResNet-18), and preliminary tests on ImageNet (ResNet-50).
  • Language Modeling: Penn Treebank on GPT-2.

Key Insights and Ideas

  • Adam through a Curvature Lens: Adam’s $\hat{v}_t$ buffer already tracks a diagonal approximation of the empirical Fisher. Treating Adam as a curvature-preconditioned direction generator makes it a natural fit for second-order step-sizing.
  • Separating Direction from Step Size: Adam often picks high-quality descent directions, but choosing the optimal step size along that ray is what typically demands extensive hyperparameter searches. Second-order line models solve this analytically.
  • Second-Order Power Without the Overfitting: While K-FAC aggressively minimizes training loss but frequently overfits or diverges (e.g., on Fashion-MNIST, SVHN, and GPT-2), AdamQLR retains Adam's generalisation benefits.
  • Robustness Without Tuning: Sensitivity studies show AdamQLR is largely insensitive to initial damping $\lambda_0$ and step-scaling factors $k$, meaning an "untuned" configuration can compete head-to-head with tuned optimizers.

Key Results

  • SVHN (ResNet-18): AdamQLR (Tuned) achieved the highest test accuracy (91.18%) and lowest test loss (0.3397), comfortably beating vanilla Adam (88.42% accuracy, 0.4833 loss) and K-FAC (86.27% accuracy, 0.4641 loss).
  • CIFAR-10 (ResNet-18): Tuned AdamQLR reached 82.69% test accuracy versus 82.37% for tuned Adam, while Untuned AdamQLR achieved 79.50% without any learning-rate sweep.
  • Fashion-MNIST: Untuned AdamQLR achieved 87.07% test accuracy, matching tuned Adam (87.30%) and tuned SGD Full (87.09%), whereas K-FAC severely overfit (training loss dropped to 0.0904, but test loss blew up to 0.4570).
  • Search Cost Savings: Untuned AdamQLR delivered competitive performance in a single training run, avoiding the 200-trial hyperparameter optimization runs required by the baselines.

Limitations and Future Work

  • Scaling to Large Models (ImageNet): On ResNet-50 / ImageNet, AdamQLR plateaus at ~70% training and ~50% test accuracy. The standard Levenberg-Marquardt rule fails to anneal learning rates during late-stage training, leaving step sizes too large.
  • Architecture Sensitivity (Transformers): On GPT-2 (Penn Treebank), the untuned defaults struggled compared to tuned variants, indicating transformer architectures may require domain-specific default settings.
  • Computational Overhead: Each step requires evaluating Fisher-vector products via additional backward passes, creating computational overhead and raising total memory consumption to roughly $4\times$ SGD (compared to $3\times$ for vanilla Adam).
  • Future Directions: Developing smarter damping schedules that naturally anneal step sizes late in training, amortizing Fisher-vector calculations, and identifying robust transformer-specific defaults.

Summary updated

BibTeX
@inproceedings{clarke2023adam,
  author = {Ross M Clarke and Baiyu Su and José Miguel Hernández-Lobato},
  title = {{Adam through a Second-Order Lens}},
  booktitle = {OPT @ NeurIPS},
  year = {2023},
  url = {https://openreview.net/forum?id=NMUCBSfNxy},
}

Loading related content...

Figure