Lune

ICLR2024Top-tier venue

Sophia: A Scalable Stochastic Second-order Optimizer for Language Model Pre-training

Hong Liu, Zhiyuan Li, David Leo Wright Hall, Percy Liang, Tengyu Ma

Abstract

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.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

45 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Fantastic Pretraining Optimizers and Where to Find Them cites Symbolic Discovery of Optimization Algorithms
  • Fantastic Pretraining Optimizers and Where to Find Them cites AdaBelief Optimizer: Adapting Stepsizes by the Belief in Observed Gradients
  • Power Lines: Scaling laws for weight decay and batch size in LLM pre-training cites Language Models are Few-Shot Learners
  • Why are Adaptive Methods Good for Attention Models? cites Why Gradient Clipping Accelerates Training: A Theoretical Justification for Adaptivity
  • Symbolic Discovery of Optimization Algorithms cites AdaBelief Optimizer: Adapting Stepsizes by the Belief in Observed Gradients
  • Symbolic Discovery of Optimization Algorithms cites Language Models are Few-Shot Learners
  • Implicit Bias of AdamW: ℓ∞-Norm Constrained Optimization cites Why are Adaptive Methods Good for Attention Models?
  • Implicit Bias of AdamW: ℓ∞-Norm Constrained Optimization cites Symbolic Discovery of Optimization Algorithms
  • LISA: Layerwise Importance Sampling for Memory-Efficient Large Language Model Fine-Tuning cites Language Models are Few-Shot Learners
  • Understanding Emergent Abilities of Language Models from the Loss Perspective cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers45

  1. LISA: Layerwise Importance Sampling for Memory-Efficient Large Language Model Fine-TuningRui Pan, Xiang Liu, Shizhe Diao, Renjie Pi et al.NeurIPS 2024 · 124 citations
  2. Understanding Emergent Abilities of Language Models from the Loss PerspectiveZhengxiao Du, Aohan Zeng, Yuxiao Dong, Jie TangNeurIPS 2024 · 113 citations
  3. Fantastic Pretraining Optimizers and Where to Find ThemKaiyue Wen, David Leo Wright Hall, Tengyu Ma, Percy LiangICLR 2026 · 92 citations
  4. Implicit Bias of AdamW: ℓ∞-Norm Constrained OptimizationShuo Xie, Zhiyuan LiICML 2024 · 46 citations
  5. Power Lines: Scaling laws for weight decay and batch size in LLM pre-trainingShane Bergsma, Nolan Dey, Gurpreet Gosal, Gavia Gray et al.NeurIPS 2025 · 44 citations

Builds on13

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Symbolic Discovery of Optimization AlgorithmsXiangning Chen, Chen Liang, Da Huang, Esteban Real et al.NeurIPS 2023 · 734 citations
  3. AdaBelief Optimizer: Adapting Stepsizes by the Belief in Observed GradientsJuntang Zhuang, Tommy Tang, Yifan Ding, Sekhar Tatikonda et al.NeurIPS 2020 · 697 citations
  4. Why Gradient Clipping Accelerates Training: A Theoretical Justification for AdaptivityJingzhao Zhang, Tianxing He, Suvrit Sra, Ali JadbabaieICLR 2020 · 598 citations
  5. Why are Adaptive Methods Good for Attention Models?Jingzhao Zhang, Sai Praneeth Karimireddy, Andreas Veit, Seungyeon Kim et al.NeurIPS 2020 · 397 citations

Related papers

  1. ADAHESSIAN: An Adaptive Second Order Optimizer for Machine LearningZhewei Yao, Amir Gholami, Sheng Shen, Mustafa Mustafa et al.AAAI 2021 · 358 citations
  2. HELENE: Hessian Layer-wise Clipping and Gradient Annealing for Accelerating Fine-tuning LLM with Zeroth-order OptimizationHuaqin Zhao, Jiaxi Li, Yi Pan, Shizhe Liang et al.EMNLP 2025
  3. Deconstructing What Makes a Good Optimizer for Autoregressive Language ModelsRosie Zhao, Depen Morwani, David Brandfonbrener, Nikhil Vyas et al.ICLR 2025
  4. AdamS: Momentum Itself Can Be A Normalizer for LLM Pretraining and Post-trainingHuishuai Zhang, Bohan Wang, Luoxin ChenEMNLP 2025 · 1 citation
  5. Second-Order Fine-Tuning without Pain for LLMs: A Hessian Informed Zeroth-Order OptimizerYanjun Zhao, Sizhe Dang, Haishan Ye, Guang Dai et al.ICLR 2025
Dusk over the sea between two cliffs drawn in fine vertical lines