Manuscript Offprint

arXiv:2610.38277

The Role of Quantization in Loss Spikes

Zaiqian Chen, Aditya Somasundaram, Sophie Li, Sean McLeish, John Kirchenbauer, Tom Goldstein, Micah Goldblum

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Loss spikes in language model pretraining can waste substantial compute and derail otherwise healthy training runs. A primary driver of these instabilities is the growth and divergence of output logits in the final language modeling (LM) head. In this work, we study a particularly costly form of this instability associated with output logit growth: delayed, terminal divergences that emerge only after prolonged training, which we call time-bomb spikes. We find that these instabilities are preceded by rapidly growing quantization error in the LM head, which eventually culminates in a loss spike. Crucially, reducing numerical precision accelerates time-bomb spikes, while increasing precision improves stability. We then propose a simple yet effective mitigation that replaces AdamW on the LM head with SGD with momentum, suppressing logit growth and improving stability over long training horizons. Finally, we find that existing mitigation techniques from the literature (along with our own) all reduce quantization error, suggesting a shared numerical mechanism behind their effectiveness. Together, our results identify finite precision error as a hidden driver of time-bomb spikes and show that suppressing this error is key to stable long-horizon pretraining.

1 INTRODUCTION

Pretraining Transformer-based language models at scale is notoriously difficult due to the instability of the objective and its propensity to diverge or spike during training (Chowdhery et al., 2023; Zhang et al., 2022; Zeng et al., 2023; OLMo et al., 2025). Large-scale training efforts have relied on heuristic procedures in order to recover from these spikes, including reverting to earlier checkpoints, skipping data near observed spikes, and adjusting learning rates (Chowdhery et al., 2023; Almazrouei et al., 2023; Zhang et al., 2022). While such interventions allow training to continue, they treat the symptoms of instability rather than its underlying cause.

A common class of loss spikes is associated with the growth and divergence of output logits in the language modeling (LM) head. Chowdhery et al. (2023) originally identified this behavior and introduced z-loss as a mitigation, an auxiliary loss penalty that discourages output logits from growing too large in magnitude. This mitigation has since become a standard safeguard in many training pipelines (Allal et al., 2025) and remains important in recent open-source, frontier-style training recipes. The latest Marin recipe includes z-loss alongside norm-preserving hyperball optimization, with leave-one-out ablations showing substantial degradation when z-loss is removed (Marin Community, 2026a;b).

Despite the widespread adoption of methods for controlling output logit growth, our understanding of why such unmitigated growth leads to loss spikes remains incomplete. Recent work has traced the growth of logits to the optimizer, showing that Adam's adaptive preconditioning induces persistent drift in the mean output embedding of the LM head, which in turn causes the mean output logit to drift towards extreme values (Stollenwerk & Stollenwerk, 2025; Stollenwerk et al., 2026). Yet, as we show in Section 3, this drift alone cannot substantively affect the forward or backward pass if we assume exact arithmetic. If this is the case, how can an apparently harmless drift ultimately destabilize training?

*Corresponding author: zc2666@columbia.edu. ¹ Columbia University ² Mohamed bin Zayed University of Artificial Intelligence ³ University of Maryland ⁴ Vector Institute. Code available at: https://github.com/tingtang2/quantization-loss-spikes

Figure

BF16 mixed baseline BF16 true baseline FP32 baseline BF16 mixed SGD-M

Figure 1: Reduced precision accelerates time-bomb spikes, while LM head SGD-M prevents them. Lowering LM head precision brings the failure earlier, with BF16 true diverging first, BF16 mixed later, and FP32 remaining stable throughout training (left). Output logit norm grows under every AdamW baseline, including FP32 (middle), but it destabilizes training only in reduced precision, where LM head quantization error grows by orders of magnitude before each failure (right). Quantization error is measured as the RMS difference between native BF16 logits and FP32 logits computed from the same hidden states. Replacing AdamW with SGD-M on the LM head keeps both logit norm and quantization error nearly flat, preventing the time bomb even in BF16 mixed precision. Results are for 28M parameter models trained at peak learning rate 0.1 for ∼28×\sim28\times the Chinchilla optimal token horizon, using AdamW throughout (baselines) or SGD with momentum on the LM head (SGD-M).

To unravel this mystery we focus our study on a particularly costly form of instability driven by output logit growth: slow, unrecoverable loss divergences that emerge only after prolonged training, which we call time-bomb spikes. A run affected by a time-bomb spike can appear healthy for most of training before deteriorating irreversibly, after much of the compute budget has already been spent. While other kinds of fast, transient loss spikes exist, we find these are largely suppressed by learnable RMSNorm gains (Section 2.4). Time-bomb spikes, in contrast, persist in these architectures and become more severe with longer training horizons, making them increasingly relevant as models are trained far beyond the compute-optimal token budget (Yang et al., 2025; Everett & Qiu, 2026).

In this work, we argue that the link between output logit growth and catastrophic loss spikes stems from how finite precision computation in the LM head leads to quantization error. Using the time-bomb spike as a testbed, we explore simple interventions that act separately on each element of the puzzle, the drift itself and the precision of the LM head. First, we show that optimizing the LM head using SGD with momentum, rather than AdamW, eliminates these spikes by removing drift directly, indicating that the drift induced by preconditioning impacts stability in practice more than theory would predict. Second, we confirm that reducing quantization error by simply computing and optimizing just the LM head in higher precision is similarly sufficient for preventing time-bomb spikes. Finally, we tie together our LM head SGD-M mitigation, the effectiveness of increased precision, and other proposed methods in the literature by demonstrating that they all seem to work by suppressing quantization error through different mechanisms. In summary, our findings are:

  1. LM head SGD-M effectively squashes spikes. We propose replacing AdamW with carefully tuned SGD with momentum exclusively on the LM head. This targeted intervention suppresses logit growth and improves stability over long training horizons.

  2. Finite precision is a hidden driver of time-bomb spikes. Quantization error in the LM head grows rapidly before each failure, and loss diverges soon after. Precision directly controls when this happens. Lowering LM head precision triggers time-bomb spikes earlier, while computing the LM head in FP32 keeps runs stable over the horizons we study.

  3. Existing mitigations all share a common numerical mechanism. Even though our proposed LM head SGD-M and other mitigations from the literature intervene in different ways, they all keep quantization error bounded, whereas it grows by orders of magnitude in unmitigated runs. Suppressing quantization error thus emerges as a shared reason these seemingly unrelated methods prevent time-bomb spikes.

References (63)