English

Cautious Optimizers: Improving Training with One Line of Code

Machine Learning 2026-02-17 v4 Artificial Intelligence Computation and Language Computer Vision and Pattern Recognition Discrete Mathematics

Abstract

AdamW has been the default optimizer for transformer pretraining. For many years, our community searched for faster and more stable optimizers with only constrained positive outcomes. In this work, we propose a \textbf{one-line modification in Pytorch} to any momentum-based optimizer, which we rename cautious optimizer, e.g. C-AdamW and C-Lion. Our theoretical result shows that this modification preserves Adam's Hamiltonian function and it does not break the convergence guarantee under the Lyapunov analysis. In addition, a whole new family of optimizers is revealed by our theoretical insight. Among them, we pick the simplest one for empirical experiments, showing not only consistent speed-up on LLM pretraining, but also image classification, with minimum extra tuning on hyperparameters. Code is available at https://github.com/kyleliang919/C-Optim.

Cite

@article{arxiv.2411.16085,
  title  = {Cautious Optimizers: Improving Training with One Line of Code},
  author = {Kaizhao Liang and Lizhang Chen and Bo Liu and Qiang Liu},
  journal= {arXiv preprint arXiv:2411.16085},
  year   = {2026}
}
R2 v1 2026-06-28T20:10:52.120Z