[Paper Review] Sophia: A Scalable Stochastic Second-order Optimizer for Language Model Pre-training
Sophia introduces a lightweight second-order optimizer using a diagonal Hessian pre-conditioner with per-coordinate clipping, achieving about 2x speedups over AdamW in GPT-like language model pre-training without large overhead.
Given the massive cost of language model pre-training, a non-trivial improvement of the optimization algorithm would lead to a material reduction on the time and cost of training. Adam and its variants have been state-of-the-art for years, and more sophisticated second-order (Hessian-based) optimizers often incur too much per-step overhead. In this paper, we propose Sophia, Second-order Clipped Stochastic Optimization, a simple scalable second-order optimizer that uses a light-weight estimate of the diagonal Hessian as the pre-conditioner. The update is the moving average of the gradients divided by the moving average of the estimated Hessian, followed by element-wise clipping. The clipping controls the worst-case update size and tames the negative impact of non-convexity and rapid change of Hessian along the trajectory. Sophia only estimates the diagonal Hessian every handful of iterations, which has negligible average per-step time and memory overhead. On language modeling with GPT models of sizes ranging from 125M to 1.5B, Sophia achieves a 2x speed-up compared to Adam in the number of steps, total compute, and wall-clock time, achieving the same perplexity with 50% fewer steps, less total compute, and reduced wall-clock time. Theoretically, we show that Sophia, in a much simplified setting, adapts to the heterogeneous curvatures in different parameter dimensions, and thus has a run-time bound that does not depend on the condition number of the loss.
Motivation & Objective
- Motivate and address the high cost of language model pre-training and the need for faster optimizers beyond Adam and simple first-order methods.
- Develop a light-weight second-order optimizer that reduces per-step overhead while leveraging curvature information.
- Achieve substantial reductions in training steps, total compute, and wall-clock time without sacrificing model performance.
- Provide theoretical and empirical evidence that a diagonal Hessian pre-conditioner adapts to heterogeneous curvatures across parameters.
Proposed method
- Propose Sophia, which uses a moving average of gradients divided by a moving average of a diagonal Hessian estimate as the update direction.
- Estimate the diagonal Hessian every k steps (k=10) using two options: Hutchinson’s unbiased estimator (Hessian-vector product) and Gauss-Newton-Bartlett (GNB) estimator (diagonal of Gauss-Newton/Hessian).
- Apply per-coordinate clipping to control the worst-case update size and ensure robust behavior in non-convex landscapes.
- Update rule combines gradient EMA, diagonal Hessian pre-conditioner, and clipping: theta_{t+1} = theta_t - eta_t * clip(m_t / max{gamma * h_t, epsilon}, 1).
- Maintain positive diagonal Hessian entries for a PSD pre-conditioner to ensure descent directions.
- Demonstrate practical integration into existing pipelines with minimal overhead and compatible with PyTorch/JAX.

Experimental results
Research questions
- RQ1Can a lightweight diagonal Hessian-based pre-conditioner with clipping accelerate language model pre-training compared to AdamW?
- RQ2Do two estimators (Hutchinson and Gauss-Newton-Bartlett) provide reliable diagonal Hessian estimates with acceptable overhead in large language models?
- RQ3How does Sophia perform across model scales from 125M to 6.6B parameters in terms of steps to reach the same validation loss and total compute?
- RQ4Does the per-coordinate clipping mechanism improve stability and convergence in non-convex LLM landscapes?
- RQ5What theoretical insights can explain Sophia’s adaptation to heterogeneous curvatures and its runtime independence from condition number in simplified settings?
Key findings
- Sophia achieves about a 2x speed-up over AdamW in number of steps, total compute, and wall-clock time for GPT-2 and GPT NeoX pre-training across model sizes.
- Sophia reaches the same validation pre-training loss with ~50% fewer steps, and ~50% less total compute and wall-clock time.
- Across model sizes from 125M to 1.5B+ parameters, the performance gap between Sophia and AdamW grows, with larger models benefiting more.
- Two diagonal Hessian estimators (Hutchinson and Gauss-Newton-Bartlett) introduce ~5% per-step overhead and enable scalable pre-conditioning.
- The clipping mechanism safeguards against negative curvature and rapid Hessian changes, enabling robust training and preventing Newton-like failures.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.