Sophia (Second-order Clipped Stochastic Optimization) is an optimizer that uses second-order information: it divides a moving average of the gradient by a moving average of the "diagonal Hessian" and clips the magnitude elementwise before updating. It was published in 2023 by Liu, Li, Hall, Liang, and Ma with the goal of speeding up language model pretraining.
Pretraining large language models requires enormous compute, so even a slightly faster optimizer can greatly reduce time and cost. Nevertheless, Adam and its variants (such as AdamW) have remained in use for a long time.
- Adam's weakness: It cannot fully adapt to differences in the curvature of the loss (the Hessian) across parameters.
- The weakness of second-order methods that use the Hessian: Methods such as K-FAC have heavy per-step computation, so even with fewer steps they rarely win in total time.
By using a cheaply estimated diagonal Hessian as the preconditioner and re-estimating it only once every few steps, Sophia keeps the extra per-step computation to about 5%. In addition, elementwise clipping prevents runaway updates when the Hessian estimate is off or the loss is non-convex.
The paper reports that on GPT-style models from 125M to 1.5B parameters, Sophia reached the same validation loss (perplexity) as Adam with about half the steps, total compute, and wall-clock time.

