Skip to content

Fantastic Pretraining Optimizers And Where to Find them #1290

Description

@WhenWen

Description

We evaluate a suite of optimizers on Transformer-style language models (130 M–1.2 B parameters) trained on up to 16× Chinchilla-optimal data. The goal is to quantify real speedups under rigorous per-optimizer tuning.

Methodology

The experiment code is now at #1293

  1. General Setup
    • Models: 130 M, 300 M, 520 M, 1.2 B parameter Transformers (seq-len 4 096). Detailed hyperparameters:
Model Params Seq Len Hidden Dim Inter Dim # Layers # Heads
LLaMA-130M 130M 4096 512 2048 32 8
LLaMA-300M 300M 4096 768 3072 32 12
LLaMA-520M 520M 4096 1024 4096 32 16
LLaMA-1.2B 1.2B 4096 1536 6144 32 24
  1. Phase I: Full Hyperparameter Sweep

    • Coordinate-descent over discrete grids for all optimizer hyperparameters (lr, weight decay, warmup, β₁, β₂, ε, max-grad-norm, batch size).
    • Benchmarked six regimes: 130 M/300 M/500 M at 1×; 130 M at 2×/4×/8× Chinchilla.
    • The code for phase I is at: Phase I
    • The found best hyperparameter is at: Best Hyperparameter Found in Phase I
  2. Phase II: Sensitive-Hyperparameters Identification

    • From Phase I results, flagged which hyperparameters’ optima shift with scale (e.g. lr, warmup).
    • The actual code for identification is at: here
    • Re-swept only those hyperparameters across 300 M/500 M at 2×/4×/8×.
    • The code for phase I is at: Phase II
    • The found best hyperparameter is at: Best Hyperparameter Found in Phase II
    • Estimate speedup over AdamW by estimating the equivalent amount of data required to reach same level of loss, the code is at Speedup Estimation
  3. Phase III: Scaling-Law Fitting

    • Fitted smooth parameterizations
      $h(N, D) = \alpha,N^{-A}D^{-B} + \beta$
      over 12 (model size, data size, hyperparameter) triples.
    • Extrapolated to predict optimum settings at two o.o.d settings for a selected subset of optimizers that reach the highest speedup over AdamW

Hypothesis or Goal

  • Baseline tuning will show that claimed “2× speedups” are overstated without fair per-optimizer tuning.
  • Matrix-based preconditioners should outperform scalar methods.
  • Scaling rules can be learned for a small subset of truly sensitive hyperparameters, enabling near-optimal settings without exhaustive search.

Links

Results

For the in-depth analysis, please refer to the Wandb report. Here is a TL;DR.

Image
Image
Image
Image

  • Max Speedup ≤ 1.4× and Matrix Preconditioners Lead
    No optimizer achieved the 2× step-wise speedup from prior claims; the best was ≈ 1.4× over AdamW. Muon, Soap, and Kron outperformed AdamW/NAdamW/Mars across regimes.

  • Regime-Dependent Winner
    Muon wins in 1×–4× Chinchilla; Soap/Kron takes over at ≥ 8× and in over-trained (16×) settings.

We also note many subtleties about hyperparameters emerge from our evaluation.

  • Optimal Hyperparameters May Change Drastically Across Optimizers
    For example in comparison of Lion and AdamW in 130M 1x Chinchilla setting.

Image

  • Speedup may diminish even if one hyperparameter is slightly misset
    For example in comparison of Soap and Mars in 520M 8x Chinchilla setting.

Image

  • Full-Schedule Evaluation Required
    Optimizers can flip rankings during learning rate decay—always use end-of-schedule metrics.

Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions