StoSignSGD

Unbiased Structural Stochasticity Fixes SignSGD for Training Large Language Models

1 University of Illinois Urbana-Champaign 2 The University of Hong Kong * Equal contribution

Key Achievements

Two things matter most: StoSignSGD stays numerically stable in our radical low-precision setting, and its stochastic sign fixes a basic non-convergence issue of deterministic SignSGD.

Low-precision LLM training
FP8 / FP4

Stable where AdamW and Muon hit NaN

We store gradients and persistent optimizer states directly in low precision. StoSignSGD remains stable in these experiments without optimizer-specific stabilization.

See low-precision results →
Non-smooth optimization
Unbiased sign

Fixing SignSGD's non-convergence

Structural stochasticity removes the bias of deterministic sign updates. StoSignSGD converges on the simple failure case below and achieves sharp convex and non-convex guarantees.

See theory →
FP8 GPT-2 pretraining
OptimizerTrain lossVal loss
AdamWNaNNaN
MuonNaNNaN
SignSGD3.5393.546
Lion3.4523.460
StoSignSGD3.3943.405

AdamW and Muon diverge; StoSignSGD stays stable and reaches the best final loss among the stable baselines.

A simple non-smooth failure case
Convex non-smooth example comparing SignSGD and StoSignSGD.
Deterministic SignSGD stalls away from the optimum, while StoSignSGD converges.

StoSignSGD in one equation

The basic idea is to replace the deterministic sign with a stochastic sign operator. For a coordinate-wise scale \(\mathbf G\succeq |\mathbf x|\), sample \(\mathbf n\sim\Unif([-1,1]^d)\) and define

\[ \mathcal S_{\mathbf G}(\mathbf x)=\sign(\mathbf x+\mathbf G\odot\mathbf n), \qquad \E\!\left[\mathcal S_{\mathbf G}(\mathbf x)\right]=\mathbf x/\mathbf G. \]

The practical optimizer keeps momentum and tracks a damped coordinate-wise maximum. The update used throughout this page is:

Algorithm 1 · StoSignSGD
\[ \begin{aligned} &\textbf{Input: }\mathbf x_1\in\R^d,\ \beta_1\in[0,1),\ \beta_2\in(0,1],\ \{\eta_t\}_{t=1}^T,\ \lambda\ge0.\\[2pt] &\textbf{for }t=1,\ldots,T:\\ &\quad \text{get stochastic gradient }\mathbf g_t,\\ &\quad \mathbf m_t=\beta_1\mathbf m_{t-1}+(1-\beta_1)\mathbf g_t,\\ &\quad \mathbf G_t=\max\{\beta_2\mathbf G_{t-1},\,|\mathbf m_t|\},\\ &\quad \mathbf n_t\sim\Unif([-1,1]^d),\\ &\quad \mathbf x_{t+1}=\mathbf x_t-\eta_t\sign(\mathbf m_t+\mathbf G_t\odot\mathbf n_t)-\eta_t\lambda\mathbf x_t. \end{aligned} \]

FP8: low precision without NaNs

We pretrain GPT-2 on OpenWebText in an intentionally aggressive FP8 setting: not only low-precision linear operations, but also gradients and persistent optimizer states are stored in FP8. AdamW and Muon diverge early. StoSignSGD stays stable and reaches the same validation-loss target with 53% fewer tokens than SignSGD and 30% fewer than Lion, corresponding to 2.14× and 1.44× token-efficiency speedups.

FP8 GPT-2 training curves comparing StoSignSGD with Lion, SignSGD, AdamW and Muon.
FP8 pretraining on GPT-2 / OpenWebText. StoSignSGD remains stable and reaches lower loss than the stable baselines.
AdamW variance-buffer values underflowing in FP8.
AdamW failure diagnosis: the variance and momentum buffers underflow to exactly zero in the observed failure step.

Why does AdamW fail here?

In the diagnosed run, the squared gradients fall below the minimum representable FP8 value, so the second-moment buffer \(\mathbf v_t\) is flushed to zero and the normalized update becomes unstable. StoSignSGD avoids a squared-gradient variance buffer: it only uses momentum, a max-buffer, and a sign update.

FP4: stability at an even more aggressive frontier

We then push the same idea to NVFP4 pretraining with the OLMo2 series. Gradients and optimizer states are again stored in FP4. AdamW and Muon diverge to NaN at every scale, while StoSignSGD remains stable and consistently outperforms Lion. The gain in average downstream accuracy is +0.45, +0.44, and +1.13 points from OLMo2-70M to OLMo2-370M.

OLMo2 model names count non-embedding parameters. Including embeddings, the three models contain 136M / 267M / 474M parameters and are trained on 4.19B / 9.23B / 20.97B tokens, respectively.

Radical FP4 pretraining results for the OLMo2 model series. All downstream scores are accuracies (%).
ModelMethodARC-EARC-COBQAHellaSwagPIQASIQABoolQAAvg.
OLMo2-70MAdamW----------------
Muon----------------
Lion33.8621.4025.4026.0955.2838.7952.2636.15
StoSignSGD33.3320.7426.4026.0855.6039.2554.8336.60
OLMo2-150MAdamW----------------
Muon----------------
Lion39.4719.7327.6026.8559.4139.6661.3539.15
StoSignSGD41.9321.4026.6027.0658.8140.6960.6739.59
OLMo2-370MAdamW----------------
Muon----------------
Lion51.5826.7629.0033.5463.6642.8455.7843.31
StoSignSGD52.1125.4232.2033.8064.7441.8161.0144.44

7B+ LLM post-training

The effect is not limited to pretraining. On mathematical reasoning SFT, StoSignSGD is particularly strong on foundational math tasks. For Qwen2.5-7B trained on NuminaMath-CoT, it improves GSM8K by about 3 points over AdamW while matching AdamW on MATH.

Evaluation accuracy (%) for Qwen2.5-7B
OptimizerGSM8KMATH
AdamW74.37 ± 1.2048.86 ± 0.66
SignSGD71.95 ± 1.2447.66 ± 0.66
StoSignSGD77.33 ± 1.1548.88 ± 0.65

What makes StoSignSGD work?

We use an unbiased sign conversion framework to turn a general optimizer update into a stochastic sign update. This lets us isolate three ingredients: structural noise, coupling the scale to momentum, and using an infinity-norm / max-based scale.

Unbiased Sign Conversion Framework
\[ \begin{aligned} &\mathbf m_t\leftarrow m(\mathbf m_{t-1},\mathbf g_t),\qquad \boldsymbol\sigma_t\leftarrow\sigma(\mathbf v_{t-1},\mathbf g_t),\\[3pt] &\textcolor{#6b7280}{\text{General optimizer:}}\quad \mathbf x_{t+1}=\mathbf x_t-\eta_t\,\mathbf m_t/\boldsymbol\sigma_t-\eta_t\lambda\mathbf x_t,\\[3pt] &\textcolor{#2563eb}{\text{Sign conversion:}}\quad \mathbf n_t\sim\Unif([-1,1]^d),\\[-1pt] &\hspace{39mm} \mathbf x_{t+1}=\mathbf x_t-\eta_t\sign(\mathbf m_t+\boldsymbol\sigma_t\odot\mathbf n_t)-\eta_t\lambda\mathbf x_t. \end{aligned} \]
Ablating the three design choices
OptimizerStructural noise\(\boldsymbol\sigma_t\) depends on \(\mathbf m_t\)Inf-norm scaleRMS norm of \(\mathbf m_t/\boldsymbol\sigma_t\)
SignSGD1
AdamW≈ 0.2
AdaMax≈ 0.1
IE-StoSignSGD≈ 0.4
SignAdamW1
SignAdaMax1
StoSignSGD1

Controlled ablations show that the full combination is what consistently gives the strongest results.

Theory: fixing SignSGD on non-smooth objectives

This project started from a theoretical issue: deterministic SignSGD can fail even on simple convex non-smooth objectives. StoSignSGD removes that bias and gives sharp guarantees in both convex and non-convex settings.

Theorem 1 · Online convex optimization

Under convexity and coordinate-wise Lipschitzness, set \(\eta_t=D_\infty/\sqrt{2t}\). Online StoSignSGD ensures

\[ \E\!\left[\max_{\mathbf x\in\X}\Regret_T(\mathbf x)\right] \le (2+\sqrt2)D_\infty\lVert\mathbf L\rVert_1\sqrt T. \]

The paper also proves the matching lower bound \(\E[\max_{\mathbf x\in\X}\Regret_T(\mathbf x)]\ge D_\infty\lVert\mathbf L\rVert_1\sqrt{T/8}\), so the dependence on \(T\), \(D_\infty\), and \(\lVert\mathbf L\rVert_1\) is tight up to constants.

Theorem 3 · Non-smooth non-convex optimization

Under coordinate-wise Lipschitzness, non-convexity, and well-behavedness, and assuming \(f(\mathbf x_0)-f^*\le\Delta_f\), set

\[ \begin{aligned} K&=\left\lceil\frac{7\sqrt{14}\,\Delta_f\delta^{1/2}}{2\epsilon^{3/2}}\right\rceil,\qquad N=\left\lceil751\lVert\mathbf L\rVert_1^2\epsilon^{-2}\right\rceil,\\ D_\infty&=\frac{\sqrt\epsilon}{\sqrt{14\delta}\,N},\qquad \eta_t=\frac{\sqrt2D_\infty}{\sqrt{((t-1)\bmod N)+1}}. \end{aligned} \]

Then StoSignSGD finds a \((\delta,\epsilon)\)-\(\ell_{1,\infty}\)-stationary point within

\[ T=KN\le39326\,\Delta_f\lVert\mathbf L\rVert_1^2\delta^{1/2}\epsilon^{-7/2} \]

stochastic gradient evaluations. This removes the extra explicit \(\sqrt d\) factor in the cited prior \(\ell_{1,2}\) Adam upper bound, while matching the known \(\ell_{2,2}\) lower-bound scaling in \(\Delta_f,\delta,\epsilon\).

BibTeX

@article{yu2026stosignsgd,
  title={StoSignSGD: Unbiased Structural Stochasticity Fixes SignSGD for Training Large Language Models},
  author={Dingzhi Yu and Rui Pan and Yuxing Liu and Difan Zou and Tong Zhang},
  journal={arXiv preprint arXiv:2604.15416},
  year={2026}
}