Accelerating LLM Pretraining with Zeroth-Order Curvature on Idle Serving Compute
Organizations: School of Software & Microelectronics, Peking University · Nanjing University · MingTi Technology · Beijing University of Posts and Telecommunications ·
Abstract
LLM pretraining is increasingly compute-intensive, while substantial inference serving compute remains idle during off-peak periods. However, such serving hardware is difficult to use for conventional first-order training due to its memory, networking and other system requirements. Zeroth-order (ZO) optimization offers a natural interface to this forward-only compute resource, but its gradient estimates break down in pretraining. Unlike fine-tuning, which can confine updates to a small parameter subspace, pretraining must update every parameter, and the alignment of a ZO gradient estimate with the true gradient shrinks as the number of updated parameters grows. We make a different observation: noisy ZO estimates can still provide useful curvature information, even when they are too inaccurate to serve as gradients. Based on this insight, we propose ZO-Curv, which leverages idle forward-only devices to estimate curvature and uses it to adapt and refine the update used during first-order training, thereby accelerating the process. We provide convergence guarantees that characterize the effect of finite-query curvature estimation. Experiments on LLMs from 125M to 1.5B parameters show that ZO-Curv consistently accelerates pretraining. At 770M parameters, ZO-Curv reaches AdamW's 20K-step validation loss in 3.9 hours instead of 7.5 hours, while achieving a lower final loss of 2.70 versus 2.84 under the same step budget. These results show that idle model serving compute can accelerate LLM pretraining when zeroth-order queries are used to estimate curvature rather than gradients directly.
Figures & tables
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
| Model | Heads | Depth | AdamW lr | SophiaG / ZO-Curv lr | ||
|---|---|---|---|---|---|---|
| GPT-2 Small (125M) | 768 | 12 | 12 | 0.05 | ||
| GPT-2 Medium (355M) | 1024 | 16 | 24 | 0.08 | ||
| GPT-2 Large (770M) | 1280 | 20 | 36 | 0.05 | ||
| GPT-NeoX (1.5B) | 1536 | 24 | 48 | 0.05 |
| HellaSwag | ARC-E | ARC-C | LAMBADA | Average | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Method | Base | FT | Base | FT | Base | FT | Base | FT | Base | FT |
| AdamW | 31.4 | 33.0 | 40.2 | 50.9 | 22.1 | 26.1 | 30.8 | – | 31.1 | 35.2 |
| SophiaG | 35.6 | 37.1 | 47.5 | 54.7 | 25.8 | 28.1 | 39.1 | – | 37.0 | 39.8 |
| ZO-Curv (ours) | 35.2 | 36.3 | 47.4 | 54.2 | 26.8 | 28.8 | 39.0 | – | 37.1 | 39.6 |
Language Model Pretraining
Language model pretraining teaches models language patterns and knowledge from large text corpora before they are adapted to specific tasks.
See all 461 papers