alphaFeedback

WorksComputer Science

ZEMA: confidence-calibrated signed descent with only one state

AI contributions
Not recorded for this paper
View details

Abstract

Recent work characterizes the Adam optimizer as sign descent modulated by gradient uncertainty: the update is the sign of the batch gradient, scaled by how strongly the batch supports that sign. We apply this view directly and introduce ZEMA (Z-score Evidence Momentum Adaptation), which measures that support with a per-coordinate zz-score computed from the per-example gradients in the current batch, converts it into a sign probability, and smooths the resulting update with a single exponential moving average. Because the probability is formed before smoothing rather than after, ZEMA keeps one state per parameter instead of Adam's two, at a 4.64.6 increase in per-step time; the per-example variance it requires can also be estimated from a small fraction of the batch. In fine-tuning and pretraining experiments, ZEMA is competitive with Adam, reduces the variability of the validation loss, and in some settings recovers the sign of the full-dataset gradient more consistently. We close with two directions this opens: extending confidence adaptation beyond the sign geometry, to methods such as Muon, and to differentially private training.

Introduction

Sign descent dynamics explain a considerable part of Adam’s success Bernstein et al. [4]; Kunstner et al. [14]; Kunstner and Bach [13]; Tomihari and Sato [23]; Zhao et al. [31], alongside recent geometric accounts that are outside the scope of this paper Xie et al. [24]; Bernstein and Newhouse [3]. However, sign descent methods degrade at smaller batch sizes relative to Adam Semenov et al. [20]; Kunstner et al. [14], which suggests a greater sensitivity to gradient noise: even extensively tuned Signum underperforms Adam Orvieto and Gower [18].

Adam as uncertainty-aware adaptation One explanation for this gap is that Adam scales its step by the uncertainty in the sign. If the sign of the stochastic batch gradient, mi=B−1∑nginm_i = B^{-1}\sum_{n} g_i^n for per-example gradients ging_i^n with respect to the iith parameter, is positive with probability ρi\rho_i, then the iith component of the Adam update is approximately 2ρi−12\rho_i - 1. When the sign is deterministic, i.e., ρi=0\rho_i = 0 or ρi=1\rho_i = 1, this reduces to sign descent; when both signs are equally likely, i.e., ρi=0.5\rho_i = 0.5, the update is zero. Prior work interprets Adam as a three-stage procedure for estimating ρi\rho_i: (i) assume a normal distribution for the stochastic batch gradient Ballés and Hennig [1]; Orvieto and Gower [18]; (ii) estimate its mean and standard deviation, mim_i and σi\sigma_i, by variational inference, implemented as an exponential moving average (EMA) Orvieto and Gower [18]; and (iii) compute the update 2ρi−12\rho_i - 1 from these estimates using an approximation to the error function, since 2ρi−1=erf⁡(zi/2)=erf⁡(mi/(2σi))2\rho_i - 1 = \operatorname{erf}(z_i/\sqrt{2}) = \operatorname{erf}(m_i/(\sqrt{2}\sigma_i)) for the zz-score zi=mi/σiz_i = m_i/\sigma_i Balles and Hennig [1].

Contributions. We take the magnitude of a signed update to reflect how strongly the batch supports that sign, and we measure that support per coordinate with a zz-score. ZEMA computes ziz_i from the spread of the per-example gradients in the current batch, converts it to the probability ρi\rho_i that the full-dataset gradient is positive, and smooths the resulting update with a single exponential moving average (Algorithm 1). Adam forms this probability after smoothing, whereas ZEMA forms it before, and therefore needs only one state per parameter. The per-example variance this requires costs 4.6% more per step (Table 14, Appendix E), and can be estimated from a small fraction of the batch (Appendix E.7). ZEMA matches AdamW on LoRA fine-tuning to within 0.04 perplexity (Table 1) and improves on it by 0.6 perplexity at 160M-parameter pretraining, at roughly a quarter of AdamW’s seed-to-seed standard deviation and at the learning rate chosen for AdamW (Table 2).

Table 1: LoRA fine-tuning: best validation perplexity over epochs, mean of three seeds. The first three blocks are a Llama scale ladder; Qwen3-1.7B is a single-scale check on a second family and its perplexities are not comparable across families. Δ\Delta is the paired difference from AdamW at the same seed, with a 95% Student-tt interval; positive favours AdamW. Learning rates are selected per cell (Appendix C.§ 1).

ModelOptimizerE2E NLG pplE2E NLG Δ\Delta vs. AdamWSAMSum pplSAMSum Δ\Delta vs. AdamW
Llama-3.2-1BAdamW2.959—8.134—
Llama-3.2-1BZEMA-CLT2.971+0.011 ± 0.0388.173+0.039 ± 0.017
Llama-3.2-1BZEMA-Adam2.975+0.015 ± 0.0268.172+0.038 ± 0.017
Llama-3.2-3BAdamW2.911—7.157—
Llama-3.2-3BZEMA-CLT2.932+0.021 ± 0.0127.197+0.040 ± 0.008
Llama-3.2-3BZEMA-Adam2.931+0.020 ± 0.0117.194+0.037 ± 0.007
Llama-3.1-8BAdamW2.878—6.595—
Llama-3.1-8BZEMA-CLT2.889+0.011 ± 0.0186.622+0.026 ± 0.026
Llama-3.1-8BZEMA-Adam2.887+0.009 ± 0.0176.621+0.025 ± 0.024
Qwen3-1.7BAdamW2.953—8.297—
Qwen3-1.7BZEMA-CLT2.968+0.015 ± 0.0228.344+0.047 ± 0.006
Qwen3-1.7BZEMA-Adam2.967+0.014 ± 0.0288.343+0.045 ± 0.009

Table 1.

Optimizerstates/paramlearning rateval. pplΔ vs. AdamW
AdamW28⋅10−38\cdot10^{-3}22.79±0.4622.79 \pm0.46—
ZEMA-CLT18⋅10−38\cdot10^{-3}22.18±0.1222.18 \pm0.12−0.61±0.55-0.61 \pm0.55
ZEMA-Adam18⋅10−38\cdot10^{-3}22.36±0.2222.36 \pm0.22−0.43±0.36-0.43 \pm0.36
Signum11⋅10−31\cdot10^{-3}25.25±1.0225.25 \pm1.02+2.46±0.60+2.46 \pm0.60
RMSProp11⋅10−31\cdot10^{-3}26.71±0.1126.71 \pm0.11+3.93±0.39+3.93 \pm0.39
Lion11⋅10−41\cdot10^{-4}29.10±1.5129.10 \pm1.51+6.32±1.35+6.32 \pm1.35
Adagrad11⋅10−21\cdot10^{-2}38.31±1.2338.31 \pm1.23+15.53±1.10+15.53 \pm1.10

Table 2. Pretraining, replicating the 160M setting of Orvieto and Gower [18]: final validation perplexity after 3.2B tokens, mean of three seeds. The interval on Δ\Delta is a 95% Student-tt interval on the per-seed paired difference from AdamW; negative favours ZEMA. AdamW and Signum use the rates that paper reports; the ZEMA arms copy AdamW’s without a sweep; Lion, RMSProp and Adagrad are each swept on their own grid (Appendix C.§ 2.1). All arms use weight decay 0.1. Optimizers from other families are in Appendix C.6.

Configurationms/stepvs. AdamWPeak GiB
AdamW21091.000×22.20
Direct implementation of Algorithm 133591.593×21.79
AdamW20911.000×22.20
Rank-local pooling + fused kernel, no overlap22471.075×21.15
All three changes21881.046×21.15

Table 14. Per-step training time and peak memory, four L40S, global batch 256 at context 2048. Each block is a single job on a single node; the two blocks are separate jobs, which is why AdamW appears twice. The middle row of the second block isolates the 59 ms recovered by overlapping the reduction (§E.4).

Related work Previous adaptive methods store only the first moment (Signum Bernstein et al. [4], Lion Chen et al. [5]) or only the second (AdaGrad Duchi et al. [7], RMSProp Hinton et al. [10]), whereas ZEMA keeps a single statistic, the zz-score, that combines the information both provide. Muon Jordan et al. [12], which works in a different geometry, and GaLore Zhao et al. [30], which projects gradients into a low-rank subspace, are also used for training large language models, but their connection to signed descent is currently unclear and outside the scope of this paper; we include both in Appendix C.6 for a broad comparison. Variance-reduction strategies such as MARS (Yuan et al. [26]) could be applied on top of ZEMA, which we leave to future work. Finally, ours is not the first work to use per-example variance, or to motivate Adam in terms of a zz-score-like statistic (Kunze et al. [15]; Balles and Hennig [1]; Patitucci and Mokhtari [19]), but these works do not use it to reduce the number of optimizer states, nor do they evaluate extensively in the LLM regime, where large-batch pretraining involves non-stationary gradients from rare tokens.

ZEMA: Z-score Evidence Momentum Adaptation

Adaptivity as evidence and confidence. Adam estimates ρi\rho_i indirectly, through two moments smoothed across steps. We estimate it directly from the current batch. The batch-level evidence is the zz-score zi=mi/σiz_i = m_i/\sigma_i, which measures how far the batch mean sits from zero relative to its sampling error. Under the Gaussian assumption, the probability that the full-dataset gradient is positive is ρi=Φ(zi)\rho_i = \Phi(z_i), where Φ\Phi is the CDF of N(0,1)\mathcal{N}(0,1); we call this probability the confidence in the sign. The confidence-adapted sign descent direction is ui=2ρi−1=erf⁡(zi/2)u_i = 2\rho_i - 1 = \operatorname{erf}(z_i/\sqrt{2}), which we smooth over time to obtain the direction u^i\hat{u}_i we actually apply. Two changes relative to Adam follow: the evidence comes from statistics of the current batch rather than from moments accumulated across steps (§ 2.1), and the smoothing acts on the confidence rather than on the moments it is computed from (§ 2.2). The second is what leaves ZEMA with one state per parameter instead of two.

Because E[ui]\mathbb{E}[u_i] vanishes when the evidence does, coordinates with weak evidence take proportionally smaller steps than under Signum (Proposition 3); and because ziz_i grows as B\sqrt{B} for any fixed non-zero gradient, the step saturates to the sign of the full-dataset gradient as BB grows (Proposition 2). Adam’s denominator retains the variation of the gradient across steps and so does not saturate the same way (Appendix A); Appendix B.§ 2 develops the evidence view further.

Estimating the zz-score from batch statistics

At iteration tt we estimate the standard error of the batch mean, σt\boldsymbol{\sigma}_t, from the per-example gradients (Algorithm 1, line 5). This adds computation on top of the batch gradient mt\boldsymbol{m}_t alone, but most of it can be shared with the usual backpropagation ([6 BackPack]). The overhead is largest in the pretraining setting of § 3.2, where a direct implementation costs 1.59×\times AdamW per step; the implementation of Appendix E reduces this to 1.046×\times, a 4.6% increase in per-step time (Table 14). Appendix E.7 discusses a subsampling approach that reduces the cost of the dispersion further.

The evidence is then zt=mt/(σt+σ0)z_t = m_t/(\sigma_t+\sigma_0), clipped to ±zmax⁡\pm z_{\max} (line 6), where σ0>0\sigma_0 > 0 prevents division by a vanishing standard error. It is a property of the current batch alone, with no dependence on earlier steps.

Smoothing the confidence over time

Two links turn ztz_t into a confidence. Equation (5) gives ρtCLT=12+12erf⁡(zt/2)\rho_t^{\mathrm{CLT}} = \frac{1}{2} + \frac{1}{2}\operatorname{erf}(z_t/\sqrt{2}) (Algorithm 1, line 8), and the rational approximation of Equation (7) gives ρtAdam=12+12(zt/1+zt2)\rho_t^{\mathrm{Adam}} = \frac{1}{2} + \frac{1}{2}(z_t/\sqrt{1+z_t^2}) (line 10), the form in which Adam’s own update can be written.

Since ρt\rho_t is estimated from a single batch, we smooth it over time. Our variational inference formulation is

ρ^t,i=arg⁡min⁡ρ^i KL⁡(Bern⁡(ρt,iMETHOD)∥Bern⁡(ρ^i))+λKL⁡(Bern⁡(ρ^t−1,i)∥Bern⁡(ρ^i))(1)\hat{\rho}_{t,i} = \underset{\hat{\rho}_i}{\arg\min}\ \operatorname{KL}\left(\operatorname{Bern}\left(\rho_{t,i}^{\mathrm{METHOD}}\right)\middle\|\operatorname{Bern}\left(\hat{\rho}_i\right)\right) + \lambda\operatorname{KL}\left(\operatorname{Bern}\left(\hat{\rho}_{t-1,i}\right)\middle\|\operatorname{Bern}\left(\hat{\rho}_i\right)\right) \tag*{(1)}

whose solution is available in closed form as the exponential moving average

ρ^t=βρ^t−1+(1−β)ρtMETHOD(2)\hat{\rho}_t = \beta\hat{\rho}_{t-1} + (1-\beta)\rho_t^{\mathrm{METHOD}} \tag*{(2)}

with β=λ1+λ\beta= \frac{\lambda}{1+\lambda}; a proof is given in Appendix B.§ 1. The update direction is u^t=2ρ^t−1\hat{u}_t = 2\hat{\rho}_t - 1. Because the smoothing and the map ρ↦2ρ−1\rho\mapsto2\rho- 1 commute, Algorithm 1 equivalently forms ut=2ρt−1u_t = 2\rho_t - 1 first (lines 8 and 10) and smooths that instead, so u^\hat{u} is the only state it carries.

Experiments

We focus exclusively on LLM settings, where Adam has consistently been shown to be of particular importance ([14, 23, 29]). In the main paper, we present both fine-tuning and pretraining settings, to show the advantages and the limitations of ZEMA; experiments on non-stationarity (rare tokens and task mixtures) are in Appendix C.§ 3. Further experiments with different optimizers, with the choice of kk in batch subsampling, and on computational overhead are in Appendix C. These Algorithm 1: ZEMA, in its CLT and Adam-shaped variants.

Input: step size η\eta; smoothing β∈[0,1)\beta\in[0, 1); weight decay λ\lambda; σ0\sigma_0, zmax⁡z_{\max}; link ∈{CLT,Adam}\in\{\mathrm{CLT}, \mathrm{Adam}\}

Output: parameters θT\theta_T

  1. u^0←0\hat{u}_0 \leftarrow0 // the only state, one scalar per parameter

  2. for t←1t \leftarrow1 to TT do

  3. sample a batch of size BB; form per-example gradients gt(1),…,gt(B)g_t^{(1)}, \ldots, g_t^{(B)}

  4. mt←1B∑ngt(n)m_t \leftarrow\frac{1}{B}\sum_n g_t^{(n)} // batch mean

  5. σt←[1B(B−1)∑n(gt(n)−mt)2]1/2\sigma_t \leftarrow\left[\frac{1}{B(B-1)}\sum_n(g_t^{(n)}-m_t)^2\right]^{1/2} // standard error of mtm_t

  6. zt←clip⁡(mt/(σt+σ0),±zmax⁡)z_t \leftarrow\operatorname{clip}(m_t/(\sigma_t+\sigma_0), \pm z_{\max}) // z-score, this batch alone

  7. if link = CLT then

  8. ut←erf⁡(zt/2)u_t \leftarrow\operatorname{erf}(z_t/\sqrt{2}) // 2ρtCLT−12\rho_t^{\mathrm{CLT}}-1

  9. else

  10. ut←zt(1+zt2)−1/2u_t \leftarrow z_t(1+z_t^2)^{-1/2} // 2ρtAdam−12\rho_t^{\mathrm{Adam}}-1

  11. end

  12. u^t←βu^t−1+(1−β)ut\hat{u}_t \leftarrow\beta\hat{u}_{t-1}+(1-\beta)u_t // smooth the belief, not zz

  13. θt←(1−ηλ)θt−1−ηu^t\theta_t \leftarrow(1-\eta\lambda)\theta_{t-1}-\eta\hat{u}_t // decoupled decay, then step

  14. end

include a probe of how often each optimizer recovers the sign of the full-dataset gradient, where ZEMA is ahead of AdamW by 9–12 points on the output head in pretraining, but not separable from it on the other tensors we probed (Appendix C.§ 4).

Fine-tuning

We compare both ZEMA variants against AdamW on LoRA (Hu et al., [11]) fine-tuning across three model scales—Llama-3.2-1B, Llama-3.2-3B and Llama-3.1-8B—and two generation tasks, E2E NLG (Novikova et al., [17]) and SAMSum (Gliwa et al., [8]). We add Qwen3-1.7B (Yang et al., [25]) at a single scale as a check that the result is not specific to one model family. Each optimizer is tuned on its own learning-rate grid, wide enough that the selected rate is interior, and the selected rate is then rerun with two further seeds. The setup, the rate-selection procedure, and the full sweeps are in Appendix C.§ 1.

Table 1 reports the best validation perplexity over epochs, averaged over three seeds. Both optimizers see the same seeds, so each difference is formed per seed; the reported interval is a paired 95% Student-tt interval.

The two optimizers are separated by at most 0.05 validation perplexity. Across all sixteen comparisons the gap lies between +0.009 and +0.047 perplexity, against absolute values of 2.9–3.0 on E2E and 6.6–8.3 on SAMSum, or 0.3% to 0.7%; six of the sixteen are indistinguishable from seed noise at the 95% level. We read the fine-tuning result as practical parity, with ZEMA carrying one state variable per parameter instead of two.

The seed-to-seed spread is also smaller for both ZEMA variants in four of the six Llama cells, most clearly on SAMSum at 8B (0.003 and 0.004 perplexity against AdamW’s 0.011); it is comparable at 3B/E2E and larger at 8B/E2E.

Pretraining

For pretraining, we replicate the 160M-parameter setting of Orvieto and Gower [18]: a 162.2M-parameter decoder-only transformer trained from scratch on 3.2B tokens of SlimPajama at context 2048 and global batch 256, three seeds per arm. AdamW and Signum run at the peak learning rates that paper selects, 8⋅10−38 \cdot10^{-3} and 10−310^{-3}. The two ZEMA arms are not tuned and both run at AdamW’s. Table 2 adds the three one-state coordinate-wise baselines named in § 1—Lion, Adagrad and RMSProp—each swept on its own grid. Appendix C.§ 2 gives the architecture, the schedule and the corpus, and Appendix C.§ 2.1 the rate grids and the configuration choices behind these rows.

Both ZEMA variants finish ahead of AdamW, by 0.61 and 0.43 validation perplexity; both paired differences resolve at the 95% level. ZEMA therefore matches or exceeds AdamW at AdamW’s own learning rate, with a smaller seed spread and one state variable per parameter instead of two. A second pretraining setting supports reading this as parity or better: at 9.31M parameters on TinyStories, run to the same 3.2B tokens, the two optimizers finish level (Appendix D). Both settings show the same shape over training. AdamW leads early in validation loss—by 21.5 perplexity at 0.26B tokens here—after which ZEMA catches up, takes the lead by about 1.1B tokens, and holds it to the end, finishing level on TinyStories and 0.61 ahead here (Table 4). Which optimizer is ahead therefore depends on where training stops, which is a caution for comparisons made at a fixed update budget.

Table 4: SlimPajama, validation perplexity against token budget, three seeds per cell. Δ\Delta is ZEMA-CLT minus AdamW at matched seed, with a two-sided 95% tt-interval over the three paired differences; negative favours ZEMA. The final column counts seeds favouring ZEMA. Bold marks intervals excluding zero. ZEMA-t2 is shown for reference and does not enter the paired test. The final row is the endpoint reported in Table 2.

TokensAdamWZEMA-CLTZEMA-t2Δ\Delta95% CIseeds
0.26B94.76116.22115.84+21.45[+8.18, +34.73]0/3
0.52B47.4949.9450.57+2.45[−0.60, +5.50]0/3
0.79B38.4938.7339.24+0.24[−1.46, +1.94]1/3
1.05B34.5034.2034.64−0.29[−1.64, +1.06]1/3
1.31B31.9031.3731.70−0.52[−1.50, +0.46]3/3
1.57B29.8929.2629.52−0.62[−1.54, +0.30]3/3
1.83B28.0927.4827.71−0.61[−1.44, +0.22]3/3
2.10B26.4925.8526.07−0.64[−1.36, +0.08]3/3
2.36B25.0224.4024.59−0.63[−1.29, +0.03]3/3
2.62B23.8423.2223.41−0.62[−1.21, −0.03]3/3
2.88B23.0722.4522.64−0.62[−1.18, −0.05]3/3
3.15B22.8022.1922.37−0.61[−1.16, −0.06]3/3
3.20B22.7922.1822.36−0.61[−1.16, −0.06]3/3

Table 4.

ZEMA is the only one-state method in Table 2 that gives up no validation loss for the reduction; the others trail AdamW by between 2.5 and 15.5 perplexity (Appendix C.§ 2.1).

Keeping one state instead of two also halves what the optimizer stores: 84.9M values on the bound weights against AdamW’s 169.9M (Appendix C.6).

Conclusion

Discussion & Limitations ZEMA trades computation for memory at little to no cost in quality: it halves the optimizer state for a few percent more time per step (Appendix E), and at every endpoint we measured it is at parity with AdamW or ahead of it. Which to prefer depends on which resource is scarce—ZEMA when memory is, as in training a large model on limited VRAM, AdamW when step time is. Two limitations qualify this: the zz-score is formed within a single batch, so ZEMA does not accumulate the across-step gradient variation that Adam’s second moment carries, though this costs no validation loss in our experiments; and ZEMA converges more slowly early in pretraining, with AdamW leading until about a third of the way through our longest run (Table 4, Appendix D).

Conclusion We introduce ZEMA, an uncertainty-aware sign-based algorithm for training transformer-based language models. It forms the confidence in the sign of the gradient from the statistics of the current batch rather than from moments accumulated across steps, and because that confidence is formed before smoothing, one state per parameter does the work of Adam’s two. In our experiments this costs little or nothing in quality: parity with AdamW on LoRA fine-tuning, to within 0.05 validation perplexity, and 0.61 perplexity ahead at 160M-parameter pretraining at AdamW’s own learning rate, with a smaller seed-to-seed spread. Where the optimizer state is what limits training, dropping one of its two tensors for a few percent of step time is a favourable trade.

Future work We see three directions of future work. First, our work highlights that the choices inside the confidence adaptation of sign descent itself are still open. The link function assumes a Gaussian distribution for the stochastic gradient; the Student-tt link noted in Appendix B.§ 2 is one alternative, and heavier-tailed per-example distributions Battash et al. [2] are another. The target is a choice as well: the step 2pi−12p_i - 1 minimizes the mean squared error to the gradient sign (Theorem 1), and a different loss—a more robust one, for instance—would map the same confidence to a different step.

Second, the construction is not tied to the sign geometry. Operator-norm optimizers such as Muon ([12]) and Shampoo Gupta et al. [9], which can be read as steepest descent under a norm ([3]), have no built-in confidence adaptation and are in that respect closer to Signum than to Adam. Adding it requires deciding how per-coordinate evidence should scale a matrix-valued step rather than one coordinate at a time; attempts exist [21, 16, 28, 27], but we are not aware of a principled derivation.

Third, differential privacy. Tang et al. [22] show that in DP-Adam the privacy noise dominates the second moment, so that the optimizer behaves like DP-SGD unless that noise is corrected out of the denominator; from the confidence view, such a correction discards the uncertainty the noise itself introduces into the sign. A confidence formed directly from batch statistics, i.e., from the ziz_i computed in ZEMA, is a more natural target for privatization.

Adam as an uncertainty-aware sign descent algorithm

In this section we review the approaches from previous literature that treat Adam as an uncertainty-aware sign descent algorithm, together with the proofs and derivations they rest on.

Uncertainty adaptation of the sign descent algorithm

Theorem 1 (Best MSE sign estimator). Suppose gg is a random variable taking values in Rd\mathbb{R}^{d}, and suppose sign⁡(gi)∈{−1,+1}\operatorname{sign}(g_i) \in\{-1,+1\} for each ii. Let

[ρ]i=ρi=P(sign⁡(gi)=+1).[\rho]_i = \rho_i = \mathbb{P}(\operatorname{sign}(g_i)=+1).

Then:

  1. The expectation of the sign vector satisfies

E[sign⁡(g)]=2ρ−1.(3)\mathbb{E}[\operatorname{sign}(\mathbf{g})] = 2\rho- 1. \tag*{(3)}
  1. Among all deterministic vectors x∈Rdx \in\mathbb{R}^{d}, the vector minimizing the mean squared error to sign⁡(g)\operatorname{sign}(g) is (2ρ1−1,…,2ρd−1)(2\rho_1 - 1,\ldots,2\rho_d - 1). That is,

x⋆=arg min⁡x∈RdE[∥x−sign⁡(g)∥22]=2ρ−1.(4)x^\star= \underset{x\in\mathbb{R}^{d}}{\operatorname{arg\,min}}\mathbb{E}\left[\lVert x-\operatorname{sign}(g)\rVert_2^2\right] = 2\rho- 1. \tag*{(4)}

The proof is given in Appendix A.§ 2 below. 2

Proof of Theorem 1

While this theorem generalizes Balles and Hennig [1] as it does not assume that gg is normally distributed, it is itself a special case of the well-known fact that the mean of a random variable is the unique minimizer of the mean squared error to that random variable. For the first statement, since sign⁡(gi)\operatorname{sign}(g_i) takes the value +1+1 with probability ρi\rho_i and the value −1-1 with probability 1−ρi1-\rho_i,

E[sign⁡(gi)]=ρi(+1)+(1−ρi)(−1)=2ρi−1.\mathbb{E}[\operatorname{sign}(g_i)] = \rho_i(+1) + (1-\rho_i)(-1) = 2\rho_i - 1.

Applying this argument coordinate-wise gives

E[sign⁡(g)]=(2ρ1−1,…,2ρd−1).\mathbb{E}[\operatorname{sign}(\mathbf{g})] = (2\rho_1 - 1,\ldots,2\rho_d - 1).

For the second statement, let

S=sign⁡(g)S = \operatorname{sign}(g)

and consider the objective

L(x)=E[∥x−S∥22].L(x) = \mathbb{E}\left[\lVert x-S\rVert_{2}^{2}\right].

Expanding the squared norm,

L(x)=E[∥x∥22−2xTS+∥S∥22].L(x) = \mathbb{E}\left[\lVert x\rVert_{2}^{2}-2x^{\mathsf{T}}S+\lVert S\rVert_{2}^{2}\right].

Since xx is deterministic,

L(x)=∥x∥22−2xTE[S]+E[∥S∥22].L(x) = \lVert x\rVert_{2}^{2}-2x^{\mathsf{T}}\mathbb{E}[S]+\mathbb{E}\left[\lVert S\rVert_{2}^{2}\right].

The last term does not depend on xx. Completing the square gives

L(x)=∥x−E[S]∥22+E[∥S∥22]−∥E[S]∥22.L(x) = \lVert x-\mathbb{E}[S]\rVert_{2}^{2}+\mathbb{E}\left[\lVert S\rVert_{2}^{2}\right]-\lVert\mathbb{E}[S]\rVert_{2}^{2}.

Therefore the unique minimizer is

x⋆=E[S].x^{\star}=\mathbb{E}[S].

Using the first part,

x⋆=(2ρ1−1,…,2ρd−1).x^{\star}=(2\rho_{1}-1,\ldots,2\rho_{d}-1).

Distribution of sign of stochastic batch gradient

Assuming gradients are normally distributed, gi∼N(mi,σi2)g_i\sim\mathcal{N}(m_i,\sigma_i^2), the probability of the sign of gig_i being positive is given by

ρi=P(gi>0)=12+12erf⁡(mi2σi).(5)\rho_i=\mathbb{P}(g_i>0)=\frac{1}{2}+\frac{1}{2}\operatorname{erf}\left(\frac{m_i}{\sqrt{2}\sigma_i}\right). \tag*{(5)}

A derivation of Equation (5) is given in Appendix A.§ 4 below. Interestingly, this only depends on the ratio zi=miσiz_i=\frac{m_i}{\sigma_i}, and with this notation, the uncertainty-aware sign descent direction, 2ρi−12\rho_i-1, can be expressed as

2ρi−1=erf⁡(zi2).(6)2\rho_i-1=\operatorname{erf}\left(\frac{z_i}{\sqrt{2}}\right). \tag*{(6)}

Now, a central assumption to uncertainty-aware interpretation of Adam is the following approximation to the erf function.

erf⁡(zi2)≈zi1+zi2.(7)\operatorname{erf}\left(\frac{z_i}{\sqrt{2}}\right)\approx\frac{z_i}{\sqrt{1+z_i^2}}. \tag*{(7)}

A comparison plot for these two functions is given in Figure 1 in Appendix A.5 below.

Comparison of the error function and its approximation

Figure 1. Comparison of the error function and its approximation.

Also, we can multiply the numerator and denominator of the approximation by σi\sigma_i, which changes the expression to

zi1+zi2=mimi2+σi2.(8)\frac{z_i}{\sqrt{1+z_i^2}}=\frac{m_i}{\sqrt{m_i^2+\sigma_i^2}}. \tag*{(8)}

Which starts to resemble the Adam update. If we expand the denominator to see that using the definition of expectation and variance we have

mi2+σi2=E(gi)2+(E(gi2)−E(gi)2)=E(gi2)(9)m_i^2+\sigma_i^2=\mathbb{E}(g_i)^2+\left(\mathbb{E}(g_i^2)-\mathbb{E}(g_i)^2\right)=\mathbb{E}(g_i^2) \tag*{(9)}

So if we replace the average of the gradient mim_i by the EMA of the stochastic gradient, and σi2\sigma_i^2 by the EMA of the squared stochastic gradient, we get very close to the Adam update.

2ρi−1≈E(gi)E(gi2)≈EMA⁡β1[gi]EMA⁡β2[gi2](10)2\rho_i-1\approx\frac{\mathbb{E}(g_i)}{\sqrt{\mathbb{E}(g_i^2)}}\approx\frac{\operatorname{EMA}_{\beta_1}[g_i]}{\sqrt{\operatorname{EMA}_{\beta_2}[g_i^2]}} \tag*{(10)}

The justification for the latter approximation is the topic of the next section.

Derivation of Equation 5

Let

Z=gi−miσi∼N(0,1),(11)Z=\frac{g_i-m_i}{\sigma_i}\sim\mathcal{N}(0,1), \tag*{(11)}

and denote the cumulative distribution function of a standard normal random variable by Φ\Phi. Since σi>0\sigma_i>0, standardizing gig_i gives

ρi=P(gi>0)(12)\rho_i=\mathbb{P}(g_i>0) \tag*{(12)}
=P(gi−miσi>−miσi)(13)=\mathbb{P}\left(\frac{g_i-m_i}{\sigma_i}>-\frac{m_i}{\sigma_i}\right) \tag*{(13)}
=1−Φ(−miσi)(14)=1-\Phi\left(-\frac{m_i}{\sigma_i}\right) \tag*{(14)}
=Φ(miσi),(15)=\Phi\left(\frac{m_i}{\sigma_i}\right), \tag*{(15)}

where the last equality follows from the symmetry of the standard normal distribution. Finally, using

Φ(x)=12[1+erf⁡(x2)],(16)\Phi(x)=\frac{1}{2}\left[1+\operatorname{erf}\left(\frac{x}{\sqrt{2}}\right)\right], \tag*{(16)}

we obtain

ρi=12+12erf⁡(mi2σi),(17)\rho_i=\frac{1}{2}+\frac{1}{2}\operatorname{erf}\left(\frac{m_i}{\sqrt{2}\sigma_i}\right), \tag*{(17)}

which is Equation (5).

Error-function Approximation

Figure 1 compares the error function with its rational approximation. In Balles and Hennig [1], a similar plot is shown but is expressed in terms of zi−1z_i^{-1}, and is only shown when zi>0z_i>0.

Adam's EMA as variational inference

Orvieto and Gower [18] give a variational inference interpretation of the EMA used in Adam optimizer. First, they show empirically that setting β1=β2\beta_1 = \beta_2 recovers most of the performance gap between Adam and Signum. Then, they formulate a variational inference problem

mt+1,i,σt+1,i2=arg⁡min⁡m,σ2[−log⁡p(gt+1,i∣m,σ2)+1λKL⁡(N(mt,i,σt,i2)∥N(m,σ2))](18)m_{t+1,i},\sigma_{t+1,i}^{2} = \underset{m,\sigma^{2}}{\arg\min}\left[-\log p(g_{t+1,i}\mid m,\sigma^{2})+\frac{1}{\lambda}\operatorname{KL}\left(\mathcal{N}(m_{t,i},\sigma_{t,i}^{2})\|\mathcal{N}(m,\sigma^{2})\right)\right] \tag*{(18)}

and show that the result of plugging in the solution of this optimization problem into the equation (8) gives the same formulation of adam update, namely EMA⁡β[gi]/EMA⁡β[gi2]\operatorname{EMA}_{\beta}[g_i]/\sqrt{\operatorname{EMA}_{\beta}[g_i^2]}.

This last formulation has a simple interpretation, the parameterization of the Adam update tries to fit the mean and variance of the gradient distribution to the current batch gradient, while also keeping the distribution close to the previous one. The KL divergence term acts as a smoothness penalty, and the λ\lambda parameter controls how much weight is given to the previous distribution versus the current batch gradient. This regularized variational inference approach is a design choice that we are going to use.

Note that, in Adam, first the mean and variance of the stochastic batch gradient are estimated using smoothed out variational inference, and then the signal-to-noise ratio ziz_i and the update direction 2ρi−12\rho_i-1 are computed using Gaussian assumption and the approximation to the erf function. This ordering of operations is not necessary, and we can reverse the order of operations, and first compute ziz_i and ρi\rho_i from the batch statistics, and then use variational inference to smooth out the estimated ρi\rho_i over time. This is the main idea behind our new optimizer, ZEMA. By this change of ordering of operations, we can reduce the number of state variables per parameter from two to one, while maintaining the variance adaptation properties of Adam.

Additional proofs and mathematical details

In this section we collect the proofs and mathematical details specific to ZEMA.

Proof of Equation 2

The problem in Equation (1) is separable across coordinates, so fix a coordinate ii and a step tt, and abbreviate the two fixed probabilities and the optimization variable by

p=ρt,iMETHOD,q=ρ^t−1,i,r=ρ^i∈(0,1).p = \rho_{t,i}^{\mathrm{METHOD}}, \qquad q = \hat{\rho}_{t-1,i}, \qquad r = \hat{\rho}_i \in(0,1).

Writing out the two Bernoulli divergences, the objective is

J(r)=KL⁡(Bern⁡(p)∥Bern⁡(r))+λKL⁡(Bern⁡(q)∥Bern⁡(r))(19)J(r) = \operatorname{KL}(\operatorname{Bern}(p)\|\operatorname{Bern}(r)) + \lambda\operatorname{KL}(\operatorname{Bern}(q)\|\operatorname{Bern}(r)) \tag*{(19)}
=plog⁡pr+(1−p)log⁡1−p1−r+λ[qlog⁡qr+(1−q)log⁡1−q1−r].(20)= p \log\frac{p}{r} + (1-p)\log\frac{1-p}{1-r} + \lambda\left[q\log\frac{q}{r} + (1-q)\log\frac{1-q}{1-r}\right]. \tag*{(20)}

The terms plog⁡p+(1−p)log⁡(1−p)p\log p + (1-p)\log(1-p) and λ[qlog⁡q+(1−q)log⁡(1−q)]\lambda\left[q\log q + (1-q)\log(1-q)\right] do not involve rr; collecting them into a constant CC and grouping the rest by log⁡r\log r and log⁡(1−r)\log(1-r) gives

J(r)=−(p+λq)log⁡r−((1−p)+λ(1−q))log⁡(1−r)+C.(21)J(r) = -(p+\lambda q)\log r - ((1-p)+\lambda(1-q))\log(1-r) + C. \tag*{(21)}

Note that this is where the direction of the two divergences matters: because the optimization variable appears as the second argument of both, it enters only through log⁡r\log r and log⁡(1−r)\log(1-r), and the two fixed probabilities enter only through the coefficients.

Differentiating Equation (21),

J′(r)=−p+λqr+(1−p)+λ(1−q)1−r.(22)J'(r) = -\frac{p+\lambda q}{r} + \frac{(1-p)+\lambda(1-q)}{1-r}. \tag*{(22)}

Setting J′(r)=0J'(r)=0 and multiplying by r(1−r)>0r(1-r)>0,

(p+λq)(1−r)=((1−p)+λ(1−q))r,(23)(p+\lambda q)(1-r) = ((1-p)+\lambda(1-q))r, \tag*{(23)}
p+λq=r[(p+λq)+((1−p)+λ(1−q))]=r(1+λ),(24)p+\lambda q = r\left[(p+\lambda q)+((1-p)+\lambda(1-q))\right] = r(1+\lambda), \tag*{(24)}

where the last equality uses that the two bracketed coefficients sum to 1+λ1+\lambda. Hence the unique stationary point is

r∗=p+λq1+λ.(25)r^* = \frac{p+\lambda q}{1+\lambda}. \tag*{(25)}

It is a minimum, and the only one: the second derivative

J′′(r)=p+λqr2+(1−p)+λ(1−q)(1−r)2(26)J''(r) = \frac{p+\lambda q}{r^2} + \frac{(1-p)+\lambda(1-q)}{(1-r)^2} \tag*{(26)}

is strictly positive for every r∈(0,1)r\in(0,1), since both coefficients are nonnegative and sum to 1+λ>01+\lambda>0, so JJ is strictly convex on (0,1)(0,1).

Finally, substituting β=λ1+λ\beta=\frac{\lambda}{1+\lambda}, so that 1−β=11+λ1-\beta=\frac{1}{1+\lambda}, Equation (25) reads

ρ^t,i=βρ^t−1,i+(1−β)ρt,iMETHOD,(27)\hat{\rho}_{t,i} = \beta\hat{\rho}_{t-1,i} + (1-\beta)\rho_{t,i}^{\mathrm{METHOD}}, \tag*{(27)}

which applied coordinate-wise is Equation (2). As λ\lambda ranges over (0,∞)(0,\infty) the smoothing parameter β=λ/(1+λ)\beta=\lambda/(1+\lambda) ranges over (0,1)(0,1), so every smoothing level used in Algorithm 1 corresponds to some penalty weight λ\lambda.

The minimizer is interior. Equation (25) is a convex combination of pp and qq, so r⋆∈(0,1)r^\star\in(0,1) whenever p,q∈(0,1)p,q \in(0,1), and the argument above applies as stated. Both conditions hold in ZEMA: the z-score is clipped to ±zmax⁡\pm z_{\max} before either link function is applied (Algorithm 1, line 6), so ρtCLT\rho_t^{\mathrm{CLT}} and ρtAdam\rho_t^{\mathrm{Adam}} are bounded away from 0 and 1, and the state is initialized at u^0=0\hat{u}_0=0, that is ρ^0=12\hat{\rho}_0=\frac{1}{2}.

Why the update is an average of probabilities. Had both divergences been taken in the opposite direction, with the fitted distribution as the first argument, the same calculation would have given a weighted average of the log-odds rather than of the probabilities,

log⁡r⋆1−r⋆=(1−β)log⁡p1−p+βlog⁡q1−q,(28)\log\frac{r^\star}{1-r^\star}=(1-\beta)\log\frac{p}{1-p}+\beta\log\frac{q}{1-q}, \tag*{(28)}

with the same β\beta. The direction chosen in Equation (1) is therefore what makes the smoothing a plain exponential moving average in probability space.

Smoothing ρ\rho and smoothing uu agree. Because u=2ρ−1u=2\rho-1 is affine in ρ\rho, applying it to Equation (2) gives

u^t=2ρ^t−1=β(2ρ^t−1−1)+(1−β)(2ρt−1)=βu^t−1+(1−β)ut,(29)\hat{u}_t=2\hat{\rho}_t-1=\beta(2\hat{\rho}_{t-1}-1)+(1-\beta)(2\rho_t-1)=\beta\hat{u}_{t-1}+(1-\beta)u_t, \tag*{(29)}

the same recursion with the same β\beta. This justifies computing the batch-level update direction first and smoothing it afterwards, which is what Algorithm 1 does.

Two properties of the confidence-scaled step utu_t in ZEMA

Fix a coordinate and drop the index ii. The per-example gradients g(1),…,g(B)g^{(1)},\ldots,g^{(B)} are i.i.d. with mean μ\mu and finite variance s2>0s^2>0; mm is their mean, σ=s/B\sigma=s/\sqrt{B} its standard error, z=m/σz=m/\sigma, and u=h(z)u=h(z) with h(z)=erf⁡(z/2)h(z)=\operatorname{erf}(z/\sqrt{2}). Write ζ=Bμ/s\zeta=\sqrt{B}\mu/s for the population evidence. All statements hold for any link hh that is continuous, odd, strictly increasing and bounded by 1 with h(z)→±1h(z)\to\pm1 as z→±∞z\to\pm\infty, which includes the Adam-shaped link z(1+z2)−1/2z(1+z^2)^{-1/2}; the closed forms are for erf.

Proposition 2 (Saturation at large batch) If μ≠0\mu\ne0, then u→sign⁡(μ)u\to\operatorname{sign}(\mu) almost surely as B→∞B\to\infty. The same holds when σ\sigma is replaced by any consistent estimate σ^\hat{\sigma}.

Proof By the strong law of large numbers m→μm\to\mu a.s., so z=Bm/s→sign⁡(μ)⋅∞z=\sqrt{B}m/s\to\operatorname{sign}(\mu)\cdot\infty a.s. Since hh is continuous with h(z)→±1h(z)\to\pm1, h(z)→sign⁡(μ)h(z)\to\operatorname{sign}(\mu) a.s. With σ^=s^/B\hat{\sigma}=\hat{s}/\sqrt{B} and s^→s\hat{s}\to s a.s., the ratio m/σ^m/\hat{\sigma} has the same limit.

Hence for every coordinate with a non-zero full-dataset gradient, the ZEMA step converges to the Signum step, and the damping in Proposition 3 disappears. Adam’s step m/vm/\sqrt{v} does not share this limit: vv is a temporal average of squared batch gradients, so v≈μˉ2+Var⁡t(μt)+s2/Bv\approx\bar{\mu}^{2}+\operatorname{Var}_t(\mu_t)+s^2/B where Var⁡t(μt)\operatorname{Var}_t(\mu_t) is the variation of the mean gradient across steps. As B→∞B\to\infty the last term vanishes but the middle one does not, so ∣m/v∣\lvert m/\sqrt{v}\rvert stays strictly below one whenever the gradient moves during training.

Proposition 3 (Damping at weak evidence) Assume the per-example gradients are Gaussian, so that z∼N(ζ,1)z\sim\mathcal{N}(\zeta,1). Then

  1. ∣u∣<1|u| < 1 for every finite zz, whereas the Signum step satisfies ∣u∣=1|u| = 1;

  1. E[u]=erf⁡(ζ/2)\mathbb{E}[u] = \operatorname{erf}(\zeta/2), which is odd, strictly increasing in ζ\zeta, has the sign of μ\mu, and vanishes at ζ=0\zeta= 0;

  1. at ζ=0\zeta= 0, E[u2]=13\mathbb{E}[u^2] = \frac{1}{3}.

Proof. (1) is immediate from ∣erf⁡(⋅)∣<1|\operatorname{erf}(\cdot)| < 1 on R\mathbb{R}. For (2), write u=2Φ(z)−1u = 2\Phi(z) - 1. For z∼N(ζ,1)z \sim\mathcal{N}(\zeta, 1) and an independent W∼N(0,1)W \sim\mathcal{N}(0, 1), E[Φ(z)]=P(W≤z)=P(W−z≤0)=Φ(ζ/2)\mathbb{E}[\Phi(z)] = \mathbb{P}(W \le z) = \mathbb{P}(W - z \le0) = \Phi(\zeta/\sqrt{2}), since W−z∼N(−ζ,2)W - z \sim\mathcal{N}(-\zeta, 2). Hence E[u]=2Φ(ζ/2)−1=erf⁡(ζ/2)\mathbb{E}[u] = 2\Phi(\zeta/\sqrt{2}) - 1 = \operatorname{erf}(\zeta/2); the listed properties are those of erf⁡\operatorname{erf}. For (3), at ζ=0\zeta= 0 the variable Φ(z)\Phi(z) is uniform on (0,1)(0,1), so E[(2Φ(z)−1)2]=E[(2U−1)2]=13\mathbb{E}[(2\Phi(z) - 1)^2] = \mathbb{E}[(2U - 1)^2] = \frac{1}{3}.

Property (2) says the expected per-coordinate step is ηerf⁡(ζ/2)\eta\operatorname{erf}(\zeta/2): the learning rate is scaled down exactly where the batch gives weak evidence, and the scaling is a fixed function of the evidence rather than of the gradient magnitude. Property (3) quantifies the damping at a stationary coordinate: ZEMA’s mean squared step there is one third of Signum’s, which is the mechanism we associate with the reduced seed-to-seed variance in Table 1 and Table 2. Monotonicity in (2) holds without the Gaussian assumption for any symmetric noise, since zz then belongs to a location family and hh is increasing; the closed form does not. When σ\sigma is estimated from kk examples, zz is Student-tt with k−1k - 1 degrees of freedom rather than Gaussian; replacing Φ\Phi by the corresponding tt distribution gives the ZEMA-tt which we have not showed empirically since it performs approximately the same as ZEMA-CLT.

Experimental details and additional experiments

In this section we report the fine-tuning, instruction fine-tuning and pretraining details, and add a number of additional experiments to further validate ZEMA.

E2E and SAMSum fine-tuning details

Setup. LoRA adapters of rank 16 with α=32\alpha= 32 are attached to seven projections per block; the base weights are frozen in bfloat16 and the adapters held in float32. E2E NLG is trained for five epochs at batch 64 with a linear schedule (3,290 steps); SAMSum for two epochs at batch 16 with a cosine schedule and 6% warmup (1,842 steps). The batch is held fixed across all four models, because the ZEMA statistic is a zz-score of a BB-sample mean and changing BB between cells would change the estimator rather than only the model. This is also why the Qwen3-1.7B numbers here supersede any run of ours at a different batch: at a different BB the arm is not the same estimator, so such runs cannot be placed on the same axis. All arms share β=0.95\beta= 0.95 (the ZEMA smoothing and AdamW’s β1=β2\beta_1 = \beta_2), σ0=10−8\sigma_0 = 10^{-8}, and zmax⁡=10z_{\max} = 10. Runs are on a single NVIDIA L40S.

Selection metric. We select on the minimum validation perplexity over epochs, not the final-epoch value. On E2E every cell turns over between epochs two and four, so the final-epoch value measures where a run happened to sit on its own overfitting curve rather than the quality of the rate; ranking on it bends the sweep curves into a shape that is an artifact of the epoch budget. On SAMSum, which trains for two epochs and never turns over, the minimum and the final value coincide in every cell, so the choice changes nothing there.

Rate selection. Each optimizer is swept independently on each (model, task) cell, at a single seed, with generation metrics disabled. On the six Llama cells the initial grid is {2,5}⋅10−4\{2, 5\} \cdot10^{-4} and {1,2}⋅10−3\{1, 2\} \cdot10^{-3}; it was then extended downwards—through 10−410^{-4}, 5⋅10−55 \cdot10^{-5}, 2.5⋅10−52.5 \cdot10^{-5}, 10−510^{-5} and 5⋅10−65 \cdot10^{-6}—for whichever cells needed it, until every cell’s argmin had two finished grid points on each side. We adopted this counting rule rather than a significance test on the neighbouring point, because the question a bracket has to answer is whether anything below the current edge is better, not whether the edge beats its neighbour by more than noise. The two Qwen cells were swept in a single pass on the wider grid those extensions had established, {5⋅10−5,10−4,2⋅10−4,5⋅10−4,10−3,2⋅10−3}\{5 \cdot10^{-5}, 10^{-4}, 2 \cdot10^{-4}, 5 \cdot10^{-4}, 10^{-3}, 2 \cdot10^{-3}\}; every argmin is interior, and all but one have two points on each side. The exception is ZEMA-Adam on E2E, whose argmin of 10−310^{-3} has two points below and only one above; we report it as selected because the point above it is worse by 0.058 perplexity, roughly ten times the seed standard deviation of that cell, but it is a weaker bracket than every other cell in this table. The selected rate is then frozen and rerun with seeds 2 and 3; it is not re-derived at report time, so a later extension of the grid cannot silently repoint a seed that has already run.

Figure 2 shows the resulting sweeps and Table 3 the rate each cell selected. The perplexities in the figure are single-seed, from the sweep stage, and are therefore not directly comparable to the three-seed means in Table 1; they establish that every optimum is interior and give the scale of one grid step. Signum was also swept on every cell but is omitted from the tables: on Llama its optimum sits an order of magnitude below every other arm and it loses at every rung, so it is not part of this comparison. We note in passing that on Qwen3-1.7B it does not lose—its paired differences from AdamW are +0.002 ± 0.032 on E2E and +0.003 ± 0.006 on SAMSum, both indistinguishable—at an optimum of 10−410^{-4}, five times below AdamW’s rather than ten. We have not investigated this and do not draw a conclusion from a single model.

Learning-rate sweep across models and tasks

Figure 2. Learning-rate sweep, single seed. Each panel is one (model, task) cell; the marker is the best validation perplexity over epochs at that rate and the ring marks the selected rate. Each arm is shown as its optimum plus the two grid points on either side; grids were extended downwards per arm until that was possible, so the arms do not all span the same range. Note the vertical scales differ between panels.

ModelTaskAdamWZEMA-CLTZEMA-Adam
Llama-3.2-1BE2E2⋅10−42 \cdot10^{-4}5⋅10−45 \cdot10^{-4}2⋅10−42 \cdot10^{-4}
Llama-3.2-1BSAMSum2⋅10−42 \cdot10^{-4}5⋅10−45 \cdot10^{-4}5⋅10−45 \cdot10^{-4}
Llama-3.2-3BE2E2⋅10−42 \cdot10^{-4}2⋅10−42 \cdot10^{-4}2⋅10−42 \cdot10^{-4}
Llama-3.2-3BSAMSum2⋅10−42 \cdot10^{-4}5⋅10−45 \cdot10^{-4}5⋅10−45 \cdot10^{-4}
Llama-3.1-8BE2E1⋅10−41 \cdot10^{-4}2⋅10−42 \cdot10^{-4}2⋅10−42 \cdot10^{-4}
Llama-3.1-8BSAMSum2⋅10−42 \cdot10^{-4}2⋅10−42 \cdot10^{-4}2⋅10−42 \cdot10^{-4}
Qwen3-1.7BE2E5⋅10−45 \cdot10^{-4}5⋅10−45 \cdot10^{-4}1⋅10−31 \cdot10^{-3}
Qwen3-1.7BSAMSum5⋅10−45 \cdot10^{-4}5⋅10−45 \cdot10^{-4}5⋅10−45 \cdot10^{-4}

Table 3. Selected learning rate per cell, from the sweeps in Figure 2 and Figure 3. These rates are frozen and reused for the three-seed runs in Table 1.

Qwen3-1.7B learning-rate sweep for E2E NLG and SAMSum

Figure 3. Qwen3-1.7B learning-rate sweep, single seed, plotted on the same conventions as Figure 2: the marker is the best validation perplexity over epochs and the ring marks the selected rate. AdamW diverges at 2⋅10−32 \cdot10^{-3} on both tasks; those two points are drawn as arrows with their values rather than clipped, since they set the top of the grid. Note the vertical scales differ between panels and from Figure 2.

Two features of Figure 2 are worth noting. The curves are locally flat near their minima, so on most cells one grid step costs between 0.002 and 0.02 perplexity—of the same order as, and usually larger than, the entire gap between AdamW and ZEMA in Table 1. And the two ZEMA variants track each other almost exactly at every rate, which is expected: their links, erf⁡(z/2)\operatorname{erf}(z/\sqrt{2}) and z(1+z2)−1/2z(1+z^2)^{-1/2}, agree closely over the range of zz these runs occupy (Appendix A.5).

SlimPajama details

Setup. A decoder-only transformer with 12 layers, dmodel=768d_{\mathrm{model}} = 768, 12 heads, SwiGLU feed-forward of width 2048, RoPE, context 2048 and an untied embedding and output head over the GPT-NeoX 50,280-token vocabulary: 162,183,936 parameters, matching the configuration of Orvieto and Gower [18]. Global batch 256 sequences (8 micro-batches of 8 on each of four ranks), 6,103 steps, 3.2B tokens. Linear warmup over 610 steps then cosine decay to 10−510^{-5}; weight decay 0.1 on matrices only, gradient clipping 1.0, and β=0.95\beta= 0.95 for every arm—AdamW in the equal-β1=β2\beta_1 = \beta_2 form that paper identifies as the strong baseline. Four NVIDIA L40S.

As in the fine-tuning campaign the ZEMA arms are hybrid: the estimator covers the body linears (84.9M parameters) while the embedding, the untied head and the norm gains stay on AdamW at the same rate, leaving each arm a single learning-rate knob.

Corpus. The paper’s cerebras/SlimPajama-627B no longer resolves, so we use instead DKYoon/SlimPajama-6B, a published subset of the same source corpus, with its own held-out validation split (9.2M tokens) rather than a resampled tail of the training data.

What was and was not tuned. AdamW at 8⋅10−38 \cdot10^{-3} and Signum at 10−310^{-3} are the rates Orvieto and Gower [18] select at this scale; we ran no search of our own. The ZEMA arms have no published rate to copy, and rather than sweep them—which would have given them an advantage the baselines did not get—both were run at AdamW’s rate. The result in Table 2 is therefore a lower bound on what ZEMA does here.

Distance from the published number. Our AdamW reaches 22.79 ±\pm 0.46 against the 21.86 that paper reports, so this setup runs somewhat harder than theirs—plausibly the corpus substitution above. That offset applies to every arm equally and does not affect the within-table comparison, which is why Table 2 is reported as paired differences against our own AdamW rather than against the published value.

Distributed correctness. All four arms trained on four L40S under DDP. The ZEMA arms do not use DistributedDataParallel: the bound weights carry no .grad, and their evidence statistic is pooled across ranks by a hand-written all-reduce, verified against a single-GPU run to 4⋅10−84 \cdot10^{-8} relative error in fp32 before the campaign was launched.

Curves. Figure 4 shows the full trajectories. Signum separates from the other three within the first 0.5B tokens and never rejoins them; AdamW and the two ZEMA arms stay together until roughly 1.5B, after which the ZEMA curves sit marginally below. The seed bands are widest early and narrow as the runs converge—at the end the ZEMA-CLT band is about a fifth the width of AdamW’s, the same ordering of seed-to-seed spread that Table 2 reports.

Training and validation loss curves for AdamW, Signum, ZEMA-CLT, and ZEMA-Adam

Figure 4. Training and validation loss over the replication run, mean of three seeds, on a logarithmic vertical scale. The shaded band is the 95% Student-tt interval on the seed mean, the same interval as Table 2. Training loss is logged every 10 steps and is shown under a centred 50-step rolling mean, applied identically to the mean and to both band edges; validation is evaluated every 500 steps and is unsmoothed.

Paired differences over the run. Table 4 tabulates what Figure 4 plots, as paired differences at matched seed. The run has the same three phases as the TinyStories campaign of Appendix D: AdamW leads by 21.45 perplexity at the first checkpoint, the arms cross at about 1.1B tokens, and from 1.31B onward all three seeds favour ZEMA-CLT at every checkpoint. The difference then settles at −0.6 perplexity and stays there, resolving at the 95% level over the final four checkpoints. Unlike TinyStories, where the gap closes as the cosine anneals, here it persists to the endpoint of Table 2.

SlimPajama learning-rate selection

Every rate in Table 2 is either taken from Orvieto and Gower [18] or is the argmin of a sweep at seed 1 over the grid below. We report the whole grid, not only the winner: a rate quoted without its neighbours cannot be checked, and a selection procedure that stops at the first interior-looking point is exactly how a sweep reports a boundary as an optimum. Every argmin below is interior to its own grid. Table 5 lists the values and Figure 5 plots them.

Armvalidation perplexity by learning rate (seed 1)
Lion, λ=0.1\lambda= 0.131.8 5⋅10−55\cdot10^{-5}29.6 10−410^{-4}29.8 2⋅10−42\cdot10^{-4}36.7 5⋅10−45\cdot10^{-4}554 10−310^{-3}749 2⋅10−32\cdot10^{-3}871 4⋅10−34\cdot10^{-3}
Lion, λ=0.8\lambda= 0.831.4 5⋅10−55\cdot10^{-5}28.8 10−410^{-4}28.4 2⋅10−42\cdot10^{-4}29.5 5⋅10−45\cdot10^{-4}
RMSProp32.7 3⋅10−43\cdot10^{-4}26.7 10−310^{-3}27.8 3⋅10−33\cdot10^{-3}531 10−210^{-2}
Adagrad133 10−310^{-3}55.9 3⋅10−33\cdot10^{-3}38.7 10−210^{-2}48.8 3⋅10−23\cdot10^{-2}83.3 10−110^{-1}279 3⋅10−13\cdot10^{-1}

Table 5. Pretraining learning-rate sweeps. Validation perplexity at seed 1; * marks the selected rate, which is then rerun with seeds 2 and 3. AdamW and Signum are not swept—they use the rates Orvieto and Gower [18] reports—and the ZEMA arms deliberately copy AdamW’s rate, so that the arm is the only thing that differs from the baseline.

Pretraining sweeps for Lion, RMSProp, and Adagrad showing final validation perplexity versus learning rate

Figure 5. Pretraining sweeps for the tuned baselines of Table 2; the ring marks the selected rate and the values are those of Table 5. Both axes are logarithmic. A linear vertical axis is unusable here: the diverged cells reach perplexity 871 against optima near 30, and the divergence is the finding for Lion rather than something to clip away. A weight decay is a knob on an optimizer and not a different optimizer, so Lion’s two decays share a colour and are separated by the dash pattern. Note that the arms operate at genuinely different rate scales—Lion’s optimum is 80×80 \times below AdamW’s and Adagrad’s is above it—which is why the horizontal span is so wide.

Lion’s grid is an order of magnitude below its published one. Lion’s recommended rate for language-model pretraining is 33–10×10\times smaller than AdamW’s, which at AdamW’s 8⋅10−38\cdot10^{-3} would put it near 10−310^{-3}. Every rate in that band diverged here: 10−310^{-3}, 2⋅10−32\cdot10^{-3} and 4⋅10−34\cdot10^{-3} finish at perplexity 554, 749 and 871. The grid had to be moved a full decade down before Lion trained at all, and its optimum sits at 10−410^{-4}, 80×80\times below AdamW’s. We report this because a reader reproducing Lion from its published guidance at this scale will see divergence, not a weak result.

Weight decay: λ=0.1\lambda= 0.1 is reported, λ=0.8\lambda= 0.8 is a control. Lion is normally run with a decoupled decay several times larger than AdamW’s, because its update is a sign and so has a fixed magnitude that does not shrink as gradients do. Table 2 reports λ=0.1\lambda= 0.1, the value every other arm uses, so that the table varies one thing. We also ran Lion’s own λ=0.8\lambda= 0.8 with its own sweep: it selects 2⋅10−42\cdot10^{-4} and reaches 27.97±1.5327.97 \pm1.53, a paired improvement of 1.13±0.241.13\pm0.24 over the matched-decay row. So the larger decay does help, and materially—but it does not change the ordering in Table 2, where Lion trails AdamW by 6.32; λ=0.8\lambda= 0.8 would still trail by 5.19. Promoting the λ=0.8\lambda= 0.8 row into the main table would silently put an 8×8\times regularization difference inside a comparison whose point is that only the optimizer changes.

Lion with β1=β2\beta_1 = \beta_2 is Signum, exactly. This is an algebraic identity, not an approximation, and it is worth stating because it constrains what a Lion baseline can show. Lion forms its update from an interpolation and then updates its momentum,

ut=sign⁡(β1mt−1+(1−β1)gt),mt=β2mt−1+(1−β2)gt.u_t = \operatorname{sign}(\beta_1m_{t-1} + (1-\beta_1)g_t), \qquad m_t = \beta_2m_{t-1} + (1-\beta_2)g_t.

Setting β1=β2=β\beta_1 = \beta_2 = \beta makes the two expressions the same tensor, so ut=sign⁡(mt)u_t = \operatorname{sign}(m_t) with mtm_t the Signum momentum: the arms coincide for every input, at every step. Running Lion at the β=0.95\beta= 0.95 this paper’s other arms share would therefore not have produced a Lion baseline at all, only a second copy of the Signum row. Lion is run at its own published (β1,β2)=(0.9,0.99)(\beta_1,\beta_2) = (0.9,0.99) for this reason, and it is the one arm in Table 2 not matched to β=0.95\beta= 0.95.

Adagrad has no decay to match. Adagrad accumulates an undecayed sum of squared gradients; adding a decay to it is what makes it RMSProp. It therefore has no β\beta to set to 0.95, and the two arms together span that axis: RMSProp is the same second-moment normalization at ρ=0.95\rho= 0.95, and is also exactly AdamW at β1=β2=0.95\beta_1 = \beta_2 = 0.95 with the first moment removed. That makes the pair a clean ablation of the two AdamW moments taken separately, which is how they should be read—not as competitive optimizers at this scale.

Reading the one-state baselines. The four one-state arms of Table 2 separate widely, and which moment they keep does not predict where they land: keeping a first moment and taking its sign gives 25.25 (Signum) and 29.10 (Lion), while keeping a second and normalizing by it gives 26.71 (RMSProp) and 38.31 (Adagrad). Signum is the informative arm, as the one that takes the sign without scaling it by a confidence: its 2.46 deficit is what dropping that scaling costs in this setting (Appendix A.§ 1). ZEMA’s single state is of a different kind from any of these—the smoothed confidence, formed from the batch mean and its standard error together—which is why it is the only one-state arm in the table that does not pay for the reduction.

Instruction fine-tuning details (MATH and TULU)

In this section we present additional instruction fine-tuning experiments to evaluate non-stationarity. Instruction fine-tuning illustrates this because task mixtures can introduce significant drift (TULU) and rare tokens (MATH). We fine-tune Qwen2.5-0.5B (non-instruction-tuned) on a controlled dialogue/math/code Tulu-3 drift mixture using rank-8 LoRA adapters (4.40M trainable parameters, sequence length 512, 128 validation examples per source), and Llama-3.2-1B on the rare-token MATH split using rank-16 LoRA adapters (11.27M trainable parameters, sequence length 1024, 754 validation examples). Each cell performs exactly 48 optimizer updates at a global batch drawn from {8,32,128,512}\{8, 32, 128, 512\}, drawing examples with replacement where the cell’s example budget exceeds the dataset, and is evaluated at eight checkpoints; we report the best validation loss over those checkpoints, exponentiated to a token-level perplexity. Adapters are held in float32 with weight decay 0.01 and β=0.95\beta= 0.95 for both optimizers. Both campaigns use a single selection seed (11), so the tables below carry no confidence intervals and differences should be compared against the scale of seed variation rather than treated as resolved.

In the parameter-efficient setting the two optimizers are indistinguishable. Every difference in Table 6 falls within ±0.3%, and the sign is not consistent: ZEMA is nominally ahead at the two largest Tulu-3 batches and at the smallest MATH batch, behind elsewhere. With a single selection seed these margins are smaller than the seed variation one should expect from a 48-update run, and we therefore read the fine-tuning results as parity rather than as evidence for either method. Two observations survive this caveat. First, the fixed-update budget removes the large-batch degradation seen in the fixed-token setting: ZEMA does not fall behind as the batch grows, and at B=128B = 128 and B=512B = 512 on Tulu-3 it is marginally ahead, so the degradation reported elsewhere is at least partly attributable to update count rather than to batch size as such. Second, ZEMA’s selected learning rate is consistently two to four times AdamW’s at matched batch, a systematic offset rather than per-cell scatter; a shared grid would have handicapped ZEMA, and we recommend independent selection for any comparison of this kind. We note that the MATH B=512B = 512 ZEMA cell remains unbracketed above, so its already small deficit may narrow further.

BatchAdamW lrZEMA-CLT lrΔ\DeltaΔ\Delta %
Tulu-3 drift, Qwen2.5-0.5B, rank-8 LoRA
82.45684×10−44 \times10^{-4}2.45941×10−31 \times10^{-3}+0.0026+0.11
322.42472×10−42 \times10^{-4}2.42665×10−45 \times10^{-4}+0.0019+0.08
1282.39685×10−45 \times10^{-4}2.39151×10−31 \times10^{-3}−0.0053−0.22
5122.37395×10−45 \times10^{-4}2.37201×10−31 \times10^{-3}−0.0020−0.08
MATH rare-token split, Llama-3.2-1B, rank-16 LoRA
82.70182×10−42 \times10^{-4}2.69971×10−31 \times10^{-3}−0.0021−0.08
322.63645×10−45 \times10^{-4}2.63732×10−32 \times10^{-3}+0.0009+0.03
1282.55031×10−31 \times10^{-3}2.55772×10−32 \times10^{-3}+0.0074+0.29
5122.51161×10−31 \times10^{-3}2.5165†2×10−32 \times10^{-3}+0.0048+0.19

Table 6. Validation perplexity for instruction fine-tuning at fixed update count (48 steps), with the independently selected learning rate for each cell. Δ\Delta is ZEMA-CLT minus AdamW; positive values favour AdamW. † marks a cell whose selected learning rate is the largest searched, so its optimum is not bracketed above.

Sign estimation accuracy in SlimPajama pre-training

To isolate sign estimation from trajectory divergence, a separate probe trains one shared AdamW trajectory. At every checkpoint, shadow AdamW and ZEMA states receive the same training batch at the same parameter vector; neither shadow state changes the trajectory. We instrument the QKV matrix in block zero and the untied output head. The reference direction is a deterministic held-out gradient, disjoint from training and reused at every checkpoint to compute the trget gradient at that checkpoint.

For direction dd and held-out gradient g∗g^{*}, accuracy is the coordinate mean of 1{sign⁡(di)=sign⁡(gi∗)}1\{\operatorname{sign}(d_i) = \operatorname{sign}(g_i^{*})\}. The Δ\Delta columns are ZEMA minus AdamW in absolute percentage points; positive values favour ZEMA.

We run the probe on a SlimPajama model (12 layers, dmodel=768d_{\mathrm{model}} = 768, 12 heads, FFN width 2048, vocabulary 50,280, context 2048) trained at global batch 256 for 100M tokens, probing every 48 updates against a fixed 256-sequence oracle, with three seeds. Table 7 reports every probe rather than only the last, since the two layer groups evolve differently over training.

StepBody QKV AdamWBody QKV ZEMA-CLTBody QKV Δ\DeltaOutput head AdamWOutput head ZEMA-CLTOutput head Δ\Delta
168.3068.30+0.00 ± 0.0069.8469.84+0.00 ± 0.00
4850.3855.30+4.92 ± 7.6052.3461.68+9.35 ± 0.90
9653.5354.62+1.09 ± 3.2554.0963.68+9.59 ± 0.73
14455.4451.62−3.82 ± 5.6552.2063.73+11.53 ± 0.67
19056.1353.65−2.48 ± 6.3752.6962.10+9.41 ± 1.45

Table 7. Sign agreement with a fixed 256-sequence oracle on SlimPajama, global batch 256, three seeds. At the first probe the two optimizers’ state is still identical by construction, so the matching accuracies there serve as a sanity check on the setup.

The two layer groups separate sharply. The output head shows a large and stable gain, between +9.4 and +11.5 points at every probe after the first, with seed standard deviations below 1.5 points; this is the clearest sign-recovery result we obtain anywhere. Body QKV, by contrast, is not separable from zero at any probe: the seed standard deviation exceeds the mean at all four, and the point estimate changes sign over training, drifting from +4.92 at step 48 to −2.48 at step 190. We therefore report a sign-recovery advantage for this model only on the output head, and explicitly not on the body, and we do not claim a general mechanism.

TaskTensorAdamWZEMA-CLTΔ\Delta
E2EL0 q-proj51.5051.29−0.21±0.43-0.21 \pm0.43
E2EL31 down-proj51.6151.54−0.07±0.60-0.07 \pm0.60
SAMSumL0 q-proj48.2848.82+0.54±0.44+0.54 \pm0.44
SAMSumL31 down-proj52.5852.05−0.54±0.36-0.54 \pm0.36
E2Epooled——−0.14±0.37-0.14 \pm0.37
SAMSumpooled——+0.00±0.37+0.00 \pm0.37

Table 8. Sign agreement on LoRA adapter tensors at the final probe, three seeds. Tensor names abbreviate lora_B projections by layer index.

Sign estimation accuracy in fine-tuning

We repeat the probe on the LoRA setting of the main text: Llama-3.1-8B-Instruct SAMSum (B=16B = 16, 1,842 updates), probing every 460 updates against a 64-example oracle with three seeds. Two adapter tensors are tracked, an early attention projection and a late MLP projection.

Neither method recovers held-out gradient signs on adapter tensors: absolute accuracies lie between 48.3% and 52.6%, that is, within a few points of chance, and every difference is smaller than its seed standard deviation. The pooled effect is −0.14±0.37-0.14 \pm0.37 points on E2E and +0.00±0.37+0.00 \pm0.37 on SAMSum. We read this as a null result rather than as weak evidence in either direction, and note that where ZEMA governs only a thin adapter atop a frozen backbone, it achieves nothing measurable. Sign recovery on LoRA adapters should not be offered as evidence for the method.

Optimizers from other families: Muon, GaLore, and ZEMA inside GaLore

The arms in this appendix are not coordinate-wise sign methods, so they do not belong in Table 2; but they are the two best-known ways to train a transformer on less than two optimizer states per parameter, and leaving them out would make the memory claim in this paper look less contested than it is. They run in the identical setting: same architecture, corpus, schedule, batch, decay and three seeds.

All three use the same hybrid split ZEMA uses. Only the 84.9M body linear weights (52.4% of the model) go to the arm; the embedding, the untied head and the norms stay on AdamW, because Muon and GaLore both require matrices and neither the reference implementations nor ours applies them to an embedding table. State totals therefore include an AdamW pair on the remaining 77.2M parameters.

Muon. One momentum buffer per matrix, whose direction is replaced by its nearest semiorthogonal matrix through a five-step Newton–Schulz iteration in bfloat16, at the reference coefficients. It is the same one-state budget as ZEMA and it wins this comparison outright, by 2.65 perplexity against AdamW, four times ZEMA’s margin. We report this plainly because it bounds what the rest of the paper claims: a single state per parameter is clearly sufficient to beat Adam at this scale, and ZEMA is not the only way to get there. What ZEMA and Muon do is different in kind—Muon changes the geometry the step is measured in, and is defined only for matrices; ZEMA changes the per-coordinate scale, and applies to any parameter—and nothing in our results says the two cannot be combined. Its rate was swept on {3⋅10−3,10−2,3⋅10−2,10−1}\{3\cdot10^{-3}, 10^{-2}, 3\cdot10^{-2}, 10^{-1}\}, selecting 3⋅10−23\cdot10^{-2} (perplexities 22.2, 20.2, *20.2,

21.5; Figure 6), inside the published 0.02–0.05 band. A ten-step Newton–Schulz variant was also run and finished within 0.10 of the five-step arm at every rate, so the five-step reference configuration is what we report.

Pretraining sweep curves for Muon, GaLore, and ZEMA-CLT/GaLore

Figure 6. Pretraining sweeps for the arms of Table 9; the ring marks the selected rate. Every argmin is interior to its own grid. As in Figure 5, a variant of an optimizer keeps that optimizer’s colour and is separated by the dash pattern: Muon’s two Newton–Schulz depths lie within 0.10 perplexity of each other at every rate, which is why the five-step reference configuration is the one reported, and GaLore’s two weight decays select different rates. ZEMA-CLT/GaLore carries ZEMA-CLT’s colour from Table 2 because it is that arm, run inside GaLore’s subspace; it tracks GaLore-Adam’s curve shape but sits above it at every rate, including at the 10−210^{-2} both arms select.

Optimizerlrbody statetotal stateval. pplΔ\Delta vs. AdamW
AdamW8⋅10−38\cdot10^{-3}169.9M324.4M22.79±0.4622.79 \pm0.46—
ZEMA-CLT8⋅10−38\cdot10^{-3}84.9M239.4M22.18±0.1222.18 \pm0.12−0.61±0.55-0.61 \pm0.55
Muon3⋅10−23\cdot10^{-2}84.9M239.4M20.14±0.1120.14 \pm0.11−2.65±0.40-2.65 \pm0.40
GaLore1⋅10−21\cdot10^{-2}73.1M227.6M23.58±0.2223.58 \pm0.22+0.79±0.28+0.79 \pm0.28
ZEMA-CLT/GaLore1⋅10−21\cdot10^{-2}44.8M199.3M24.10±0.0724.10 \pm0.07+1.31±0.52+1.31 \pm0.52
ZEMA-Adam/GaLore1⋅10−21\cdot10^{-2}44.8M199.3M24.14±0.0924.14 \pm0.09+1.36±0.54+1.36 \pm0.54

Table 9. Optimizers from other families, same setting as Table 2: final validation perplexity after 3.2B tokens, mean of three seeds, 95% Student-t interval on the per-seed paired difference. “Body state” counts optimizer coordinates over the 84.9M body weights; “total” adds the AdamW pair carried on the remaining 77.2M parameters. AdamW and ZEMA-CLT are repeated from Table 2 for reference.

GaLore. Adam run inside a rank-rr subspace of each gradient, taken from that gradient’s own SVD and refreshed every 200 steps. At r=256r = 256 its state is r(min⁡+2max⁡)r(\min+ 2\max) per matrix, which for a 768×768768 \times768 matrix is exactly d2d^2: the published rank for dmodel=768d_{\mathrm{model}} = 768 and the rank at which GaLore matches ZEMA’s state coincide, so this is GaLore at its own setting, not squeezed to fit our comparison. It trails AdamW by 0.79 and ZEMA by 1.40, at 0.86× ZEMA’s body state. We swept both weight decays: λ=0.1\lambda= 0.1 (matched to every other arm) selects 10−210^{-2} and is the row above; the reference’s own pretraining default λ=0\lambda= 0 selects a different rate, 3⋅10−23 \cdot10^{-2}, and is worse by 0.85 at 24.45±0.1524.45 \pm0.15. Running only the published default would have made GaLore the sole unregularized arm here and cost it most of a perplexity point.

ZEMA inside GaLore. The two memory mechanisms compose in principle: GaLore keeps three states of a smaller shape, ZEMA keeps one state of full shape, and running ZEMA as the inner optimizer keeps one state of the smaller shape. This is the cheapest arm we ran, at 0.53× ZEMA’s body state and 0.26× AdamW’s. It is cheap to compute as well as to store: projecting a per-example gradient requires projecting only one of its two operands, since Gi=δiTxiG_i = \delta_i^{\mathsf{T}} x_i gives GiPT=δiT(xiPT)G_i P^{\mathsf{T}} = \delta_i^{\mathsf{T}}(x_i P^{\mathsf{T}}) for a tall matrix and PTGi=(δiP)TxiP^{\mathsf{T}}G_i = (\delta_i P)^{\mathsf{T}}x_i for a wide one, so ZEMA’s per-example reduction is unchanged and simply runs at the smaller shape.

It does not compose in practice. Against GaLore-Adam at the same rate, decay and subspace—the comparison in which only the inner optimizer changes—the swap costs +0.52±0.29+0.52 \pm0.29 (CLT) and +0.57±0.28+0.57 \pm0.28 (t2t_2), paired over three seeds. The rate is not the explanation: we swept it over {3⋅10−3,10−2,3⋅10−2,10−1}\{3 \cdot10^{-3}, 10^{-2}, 3 \cdot10^{-2}, 10^{-1}\} (Figure 6) and both arms optimize at the same 10−210^{-2}, with the swap costing 0.42–0.49 at every rate near the optimum and 1.90 at a rate 3×3\times too small.

Two observations point the same way. ZEMA’s advantage inverts under projection: at full shape ZEMA-CLT beats AdamW by 0.61, inside a rank-256 subspace it loses to Adam by 0.52. And the choice of link, which separates the two ZEMA variants by 0.18 at full shape, stops mattering inside the subspace—the paired difference between them there is +0.045±0.061+0.045 \pm0.061, an interval containing zero. Both are consistent with the projection having already discarded the per-coordinate structure that ZEMA’s standardization exploits: the top-rr directions of the gradient are not where the two links disagree.

Training horizon in TinyStories pretraining

The comparison in Section 3.2 is made at a single token budget. This appendix asks how much the outcome depends on that budget, in a second and much smaller pretraining setting: a 9.31M-parameter model on TinyStories, trained to 3.2B tokens at two batch sizes with three seeds per arm. The comparison there has three phases. AdamW leads early, ZEMA leads through the middle of training, and the two finish level, so a run stopped early can report either optimizer ahead. The same configuration stopped at a fixed update count also produces an apparent growth of AdamW’s margin with batch size, which the full horizon shows to be an effect of where training stops rather than of batch size.

Setup

The model is a 9.31M-parameter decoder-only transformer (6 layers, dmodel=256d_{\mathrm{model}} = 256, 8 heads, FFN width 768, context 128) trained on TinyStories with a native 8,192-token BPE vocabulary, with exact within-batch dispersion, body-only ZEMA coverage, and a micro-batch of 64 sequences. Each run trains for 3.2B tokens under a cosine schedule with 10% linear warmup over the full horizon, and is evaluated every 0.1B tokens on 4M held-out tokens, giving 32 checkpoints per run. Validation batches are drawn from a generator reseeded identically at every checkpoint, so all checkpoints of all runs are scored on the same held-out sequences and the training stream is unaffected by the evaluation cadence.

We run B=256B = 256 and B=1024B = 1024 with three seeds per optimizer, twelve runs total. Learning rates are the bracketed optima of a six-point grid, searched separately for each optimizer at 2,000 updates at that batch: 0.006 at B=256B = 256 and 0.012 at B=1024B = 1024. At both batches the two optimizers selected the same value, so a single learning rate is simultaneously each one’s own optimum and neither arm is advantaged by the choice. Runs used one NVIDIA H100 each on Trillium.

Results

Table 10 shows the same three-phase structure at both batch sizes. AdamW leads early by a margin that is significant at 0.10B and larger at the larger batch (+0.235 versus +0.090). The curves cross at approximately 0.4B tokens. ZEMA then leads for the remainder of training, by 0.01 to 0.03 perplexity, with all three seeds agreeing at every checkpoint from 0.8B onward and several intervals excluding zero. As the cosine anneals the gap closes, and at 3.2B the two are level: −0.004 [−0.015, +0.008] at B=256B = 256 and −0.011 [−0.030, +0.008] at B=1024B = 1024, neither separable from zero.

TokensAdamWZEMA-CLTΔ\Delta95% CIseeds
B=256B = 256, lrlr 0.006
0.10B7.25667.3466+0.0900[+0.036,+0.144][+0.036, +0.144]0/3
0.20B6.69336.7274+0.0341[−0.002,+0.070][-0.002, +0.070]0/3
0.40B6.44886.4458−0.0030[−0.044,+0.038][-0.044, +0.038]2/3
0.80B6.22086.1947−0.0261[−0.083,+0.031][-0.083, +0.031]3/3
1.20B6.02415.9959−0.0282[−0.055,−0.002][-0.055, -0.002]3/3
1.60B5.77595.7559−0.0200[−0.035,−0.005][-0.035, -0.005]3/3
2.00B5.50025.4793−0.0209[−0.050,+0.008][-0.050, +0.008]3/3
2.40B5.16105.1492−0.0117[−0.038,+0.015][-0.038, +0.015]2/3
2.80B4.78324.7736−0.0095[−0.021,+0.002][-0.021, +0.002]3/3
3.20B4.58854.5850−0.0035[−0.015,+0.008][-0.015, +0.008]2/3
B=1024B = 1024, lrlr 0.012
0.10B7.38377.6183+0.2346[+0.152,+0.317][+0.152, +0.317]0/3
0.20B6.52676.6138+0.0871[+0.029,+0.146][+0.029, +0.146]0/3
0.40B6.08436.0821−0.0022[−0.032,+0.027][-0.032, +0.027]1/3
0.80B5.78945.7766−0.0127[−0.056,+0.030][-0.056, +0.030]3/3
1.20B5.62915.6011−0.0280[−0.064,+0.008][-0.064, +0.008]3/3
1.60B5.42575.3933−0.0324[−0.046,−0.019][-0.046, -0.019]3/3
2.00B5.19545.1694−0.0260[−0.041,−0.011][-0.041, -0.011]3/3
2.40B4.91964.9021−0.0175[−0.031,−0.005][-0.031, -0.005]3/3
2.80B4.65194.6357−0.0162[−0.046,+0.014][-0.046, +0.014]3/3
3.20B4.53194.5208−0.0112[−0.030,+0.008][-0.030, +0.008]3/3

Table 10. Validation perplexity against token budget, three seeds per cell. Δ\Delta is ZEMA-CLT minus AdamW at matched seed, with a two-sided 95% tt-interval over the three paired differences; negative favours ZEMA. The final column counts seeds favouring ZEMA. Bold marks intervals excluding zero.

Two points follow for short-horizon comparisons. First, measured at 3.2B tokens the difference is −0.1% at B=256B = 256 and −0.2% at B=1024B = 1024, whereas the same configuration stopped at 2,000 optimizer updates—0.065B tokens at B=256B = 256 and 0.26B at $B = 1024—puts AdamW ahead by 2.09% and 3.56%. Second, a fixed update budget also generates an apparent batch-size trend: AdamW’s early advantage is itself larger at the larger batch, and every cell is sampled inside that early window, so a horizon effect is read off as a batch effect. At the full horizon the trend does not survive, because there is no advantage to either method.

The crossover is determined by tokens rather than by updates. It occurs near 0.4B tokens at both batch sizes, which is 12,207 optimizer steps at B=256B = 256 but only 3,052 at B=1024B = 1024. Any explanation resting on optimizer-state warm-up would predict a fixed step count; the data instead tracks data seen, consistent with ZEMA’s evidence weighting becoming useful once gradient noise grows relative to the gradient mean.

Finally, note that B=1024B = 1024 reaches a lower perplexity than B=256B = 256 at matched tokens for both optimizers (4.53 and 4.52 versus 4.59 for both), so the larger batch is not harmful in this setting once training is long enough.

Smoothing rule ablation

The belief EMA in Algorithm 1 applies an update of much smaller magnitude than the per-step belief it smooths: at B=256B = 256 the recorded mean absolute belief is 0.50–0.83 while the mean absolute applied update is 0.07–0.085, a factor of 6.5–9.8, and the ratio is largest early in training. This invites the hypothesis that the shrinkage is a defect and that correcting it would remove ZEMA’s early disadvantage. It does not. Table 11 compares the four alternative smoothing rules implemented alongside the paper’s, each with its own learning rate selected from a common six-point grid spanning 2.5×10−42.5 \times10^{-4} to 8×10−38 \times10^{-3} at B=256B = 256 and 2,000 updates.

Every alternative is worse, and the ordering is monotone in how aggressively the variant removes the shrinkage: the selected learning rate falls from 0.006 to 0.0005 across the table as the effective update grows, and perplexity degrades in step, with the most thorough corrector worst by 1.6 perplexity. The damping is therefore doing useful work. Averaging bounded beliefs cancels coordinates whose sign disagrees between steps, and the variants that undo it trade that evidence weighting for larger, noisier updates. We keep the post-link EMA of Algorithm 1 on this evidence.

Table 11: Smoothing rule ablation, B=256B = 256, 2,000 updates, seed 7. Each variant’s learning rate is selected independently; all optima are interior to the grid searched.

VariantRuleVal. PPLlr
AdamW—6.26070.006
ZEMA-CLTEMA of the belief (Algorithm 1)6.39170.006
ZEMA-CLT-zEMA of zz, then link7.17210.002
ZEMA-poolpooled zz, bias corrected by 1−β2t\sqrt{1-\beta^{2t}}7.35590.001
ZEMA-logoddsaccumulate log-odds, squash with tanh7.57950.001
ZEMA-kalmanposterior mean, bias corrected by 1−βt1-\beta^t8.01480.0005

Table 11.

Caveats

Intermediate checkpoints are mid-schedule: the cosine is tied to the full 3.2B horizon, so the value at 0.4B in these runs is not what a run terminating at 0.4B with a fully annealed learning rate would produce. The comparison between arms at each checkpoint is unaffected, since both share the schedule, but these intermediate numbers are not comparable to annealed endpoints. The learning rates were selected at 2,000 updates and reused at 97,656; both arms carry the same value at each batch, so the comparison remains fair, but absolute perplexities may be off-optimum. The 3.2B horizon is roughly 7.7 epochs over the 416M-token training split; validation perplexity is still decreasing at the final checkpoint, so neither optimizer has been trained to saturation. Finally, perplexity is specific to the 8,192-token vocabulary used here and is not comparable to published TinyStories perplexities obtained with different tokenizers.

Efficient implementation of ZEMA

§ 3.2 reports ZEMA at a per-step cost of 1.046× AdamW. A direct implementation of Algorithm 1 costs 1.59×. This appendix specifies the three changes that close that gap and the end-to-end runs that validate them. Two of the three are exact rearrangements of the same computation; the third replaces one estimator of σt\boldsymbol{\sigma}_t with another estimator of the same quantity, at a cost of three degrees of freedom out of 255. Section E.7 then treats subsampling, which is an independent and larger reduction available on top of these.

Where the overhead comes from

Fix one bound linear weight of shape dout×dind_{\mathrm{out}} \times d_{\mathrm{in}}, and let LL be the context length, BB the global batch of sequences, and WW the number of data-parallel ranks. For example nn write x(n)∈RL×din\boldsymbol{x}^{(n)} \in\mathbb{R}^{L \times d_{\mathrm{in}}} for the layer input, δ(n)∈RL×dout\boldsymbol{\delta}^{(n)} \in\mathbb{R}^{L \times d_{\mathrm{out}}} for the gradient of the loss with respect to the layer output, and

g(n)=δ(n)Tx(n)∈Rdout×din(30)\boldsymbol{g}^{(n)} = \boldsymbol{\delta}^{(n)\mathsf{T}}\boldsymbol{x}^{(n)} \in\mathbb{R}^{d_{\mathrm{out}} \times d_{\mathrm{in}}} \tag*{(30)}

for that example’s own weight gradient. Algorithm 1 needs the mean mt\boldsymbol{m}_t and, through line 5, the dispersion

M2=∑n=1B(g(n)−mt)2,σt2=M2B(B−1).(31)M_2 = \sum_{n=1}^{B}\left(\boldsymbol{g}^{(n)}-\boldsymbol{m}_t\right)^2,\qquad\boldsymbol{\sigma}_t^2 = \frac{M_2}{B(B-1)}. \tag*{(31)}

The asymmetry. mt\boldsymbol{m}_t is the ordinary weight gradient that any backward pass already produces, and costs nothing extra. M2M_2 is a function of the spread across examples, which the usual batched backward destroys the instant it sums over the batch. Every cost below follows from that one fact, and it appears twice. In arithmetic, AdamW’s weight-gradient GEMM contracts over all B⋅LB \cdot L tokens at once, whereas any per-example statistic must stop at every example boundary. In communication, AdamW’s second moment vt=β2vt−1+(1−β2)gt2v_t = \beta_2v_{t-1} + (1-\beta_2)g_t^2 is a pure function of the already reduced gradient, which every rank holds after the gradient all-reduce, so it costs no extra bytes; M2M_2 is a function of the pre-reduction spread, which that same reduction has destroyed.

The direct implementation. Written literally, Equation (31) materializes the [B,dout,din][B,d_{\mathrm{out}},d_{\mathrm{in}}] per-example gradient tensor, writes it once and reads it at least twice; and because M2M_2 is defined against the global mean, it forces three serialized collectives per step—reduce the mean, agree a common scale, then reduce the rescaled dispersion—of which the second cannot begin until the first has finished. Table 12 gives the resulting ladder.

ConfigurationTrain timeTokens/svs. AdamW
AdamW3.572 h248,8151.000×
Direct implementation of Algorithm 15.643 h157,4961.580×
+ bfloat16 statistic accumulation4.828 h184,1031.352×
+ rank-local pooling (§E.2)4.322 h205,6441.210×
+ overlapped reduction (§E.4) and fused per-example kernel (§E.3)†3.862 h230,1291.081×

Table 12. Cumulative effect of the changes in this appendix, on the setting of § 3.2. Each row is a complete 6,103-step run at seed 1. Times are training only; the separate validation pass, 156–158 s in every row, is excluded. The perplexities carry no interval of their own and should be read against the three-seed spread of ±0.049 reported for this arm in Table 2; the numerical changes are gated separately in Table 13. †These runs were launched to gate the numerical changes, so the final row is the configuration current at that time: it additionally carried the variant discarded in §E.4 and predates the host-side cleanup described in §E.6. It is therefore not the configuration of Table 14.

ConfigurationVal. lossΔ\DeltaPerplexityVerdict
Exact baseline3.096886—22.129—
+ bfloat16 statistic3.099870+0.00298422.195pass
+ rank-local pooling3.100192+0.00330622.202pass
+ fused kernel3.096976+0.00009022.131pass

Table 13. End-to-end validation of the numerical changes, on the setting of § 3.2, seed 1. Tolerance ±2ς\varsigma = ±0.004378 nats.

Rank-local pooling of the dispersion

The change. Pool the dispersion within each rank only. Partition the batch into the WW rank-sized blocks it is already sliced into, write gˉw\bar{\boldsymbol{g}}_w for the mean over the B/WB/W examples resident on rank ww, and decompose the exact sum of squares:

∑n(g(n)−mt)2=∑w∑n∈w(g(n)−gˉw)2+BW∑w(gˉw−mt)2.(32)\sum_n\left(\boldsymbol{g}^{(n)}-\boldsymbol{m}_t\right)^2 = \sum_w\sum_{n\in w}\left(\boldsymbol{g}^{(n)}-\bar{\boldsymbol{g}}_w\right)^2 + \frac{B}{W}\sum_w\left(\bar{\boldsymbol{g}}_w-\boldsymbol{m}_t\right)^2. \tag*{(32)}

If examples are i.i.d. across ranks, the three terms have expectations (B−1)ς2(B-1)\varsigma^2, (B−W)ς2(B-W)\varsigma^2 and (W−1)ς2(W-1)\varsigma^2 for a per-example variance ς2\varsigma^2. Discarding the between-rank term and dividing by B−WB-W rather than B−1B-1 therefore leaves an unbiased estimator of the same quantity:

σt,i2=1B(B−W)∑w∑n∈w(gi(n)−gˉw,i)2.(33)\sigma_{t,i}^{2} = \frac{1}{B(B-W)} \sum_w \sum_{n \in w} \left(g_i^{(n)}-\bar{g}_{w,i}\right)^2 . \tag*{(33)}

As with subsampling (Equation (35)), the estimand is unchanged—it is still the standard error of the BB-example mean—and mtm_t itself is untouched, still the exact global mean formed by an all-reduce over every example. Only the sample used for the dispersion changes, and with it the relative error of σt\sigma_t, which for a χ2\chi^2 estimator on ν\nu degrees of freedom is 1/2ν1/\sqrt{2\nu}:

Estimator of σt\sigma_tν\nurel. error
Exact pooling (Algorithm 1)2554.43%
Rank-local pooling, W=4W=42524.45%
Subsampling at k=32k=32 (§E.7)3112.70%

Table 15.

Why it is cheaper. With no between-rank term, nothing in the dispersion depends on the pooled mean, so the three-deep chain collapses to two independent sums:

exact:sum⁡(means)→max⁡(scale)→sum⁡(rescaled M2),\text{exact:}\quad\operatorname{sum}(\text{means}) \mathbin{\to} \operatorname{max}(\text{scale}) \mathbin{\to} \operatorname{sum}(\text{rescaled }M_2),
rank-local:sum⁡(m)∥sum⁡(M2),\text{rank-local:}\quad\operatorname{sum}(m) \mathbin{\|} \operatorname{sum}(M_2),

where ∥\| denotes two collectives issued back to back with no dependency between them. Because each rank’s window holds only B/WB/W examples, the partials can further be carried as raw sums S1=∑n∈Wg(n)S_1 = \sum_{n \in\mathcal{W}} g^{(n)} and S2=∑n∈W(g(n))2S_2 = \sum_{n \in\mathcal{W}} (g^{(n)})^2, converted locally by M2=S2−S12W/BM_2 = S_2 - S_1^2 W/B with no collective at all, which removes the MAX round that the factored form needs for underflow protection. The cancellation this invites is bounded by the identity S2=M2(1+z2/(B/W−1))S_2 = M_2 (1 + z^2/(B/W - 1)): at zmax⁡=10z_{\max} = 10 and B/W=64B/W = 64 the worst attainable ratio is 2.6, under one bit of float32, and at the ∣z∣≈0.51\lvert z\rvert\approx0.51 these runs actually exhibit it is 1.004.

Assumptions, and when they fail. Two conditions are load-bearing. First, unbiasedness in Equation (33) requires the between-rank term to be pure noise. Here the global permutation is drawn once per step and then sliced across ranks, so rank membership carries no information and the condition holds by construction; an implementation that instead gave each rank its own shard, or sorted examples by length, would discard real between-rank spread, report σt\sigma_t low, ∣zt∣\lvert z_t\rvert high, and be overconfident. Second, the raw-sum form assumes no underflow. It is safe at pretraining scale—the fraction of coordinates reporting zero variance is exactly 0 on every run reported here—but not universally: LoRA initializes one factor at zero, producing gradients of order 10−2210^{-22} whose squares underflow float32 to exactly zero and read as unanimous agreement among examples. The fine-tuning experiments of § 3.1 therefore retain the factored form and its MAX round.

A fused per-example kernel

Why the ordinary GEMM structure does not apply. A matrix-product kernel tiles the output [dout,din][d_{\mathrm{out}}, d_{\mathrm{in}}] and streams the whole B⋅LB \cdot L contraction into a register accumulator that is written once. The per-example square in Equation (31) requires the sum over the LL token positions to complete at every example boundary, so the accumulator must be finalized BB times rather than once—which is why the direct path falls back to a batched product and materializes [B,dout,din][B, d_{\mathrm{out}}, d_{\mathrm{in}}].

The change. Reorder the contraction so that the example index is the outer loop and finalize in registers, never writing the per-example tensor (Algorithm 2). Each program owns a disjoint tile of the output, so the final accumulation is a plain read–modify–write rather than an atomic. Operands are loaded in their own precision with a float32 accumulator—the same arithmetic the ordinary weight gradient performs—so tensor cores are retained; upcasting both operands before the product instead forces the float32 CUDA-core path and is 4.7–6.5× slower than the plain weight gradient.

It replaces work rather than only adding it. S1S_1 is the weight gradient, so the kernel subsumes the backward pass’s own weight-gradient product for that layer, which must then be suppressed. On the setting of § 3.2 the kernel costs 181 ms of device time per step while removing a 148 ms product, a marginal cost of about 33 ms; an accounting that prices it as pure addition overstates it roughly fivefold. The extra arithmetic proper is B doutdinB\,d_{\mathrm{out}}d_{\mathrm{in}} squares against BL doutdinB L\,d_{\mathrm{out}}d_{\mathrm{in}} multiply–accumulates, smaller by a factor of LL. The binding constraint is registers: three float32 tiles are live at once, which caps tile size well below what a plain GEMM would choose.

When it pays. The saving is the traffic of the [B,dout,din][B, d_{\mathrm{out}}, d_{\mathrm{in}}] tensor, weighed against operands that are read either way, so the governing ratio is

r=B doutdinBL(dout+din)=doutdinL(dout+din).(34)r = \frac{B\,d_{\mathrm{out}}d_{\mathrm{in}}}{B L\left(d_{\mathrm{out}} + d_{\mathrm{in}}\right)} = \frac{d_{\mathrm{out}}d_{\mathrm{in}}}{L\left(d_{\mathrm{out}} + d_{\mathrm{in}}\right)} . \tag*{(34)}

Algorithm 2: Fused per-example first and second sums, for one bound weight and one rank. Replaces line 3 of Algorithm 1; S1S_1 is the rank’s weight gradient and S2S_2 feeds Equation (33). The [B,dout,din][B,d_{\mathrm{out}},d_{\mathrm{in}}] tensor is never formed.

Input: activations xx, output sensitivities δ\delta; tile sizes (bout,bin,bL)(b_{\mathrm{out}}, b_{\mathrm{in}}, b_L)

Output: S1,S2S_1,S_2

  1. foreach tile TT of size bout×binb_{\mathrm{out}} \times b_{\mathrm{in}} of the output, in parallel do

    1. s1←0s_1 \leftarrow0; s2←0s_2 \leftarrow0 // float32, in registers

    2. for n←1n \leftarrow1 to BB do

      1. p←0p \leftarrow0 // this example’s own gradient tile

      2. for each block of bLb_L token positions do

        1. p←p+δblock(n)Txblock(n)p \leftarrow p+\delta_{\mathrm{block}}^{(n)\mathsf{T}}x_{\mathrm{block}}^{(n)} // tensor-core product

      3. end

      4. s1←s1+ps_1 \leftarrow s_1+p; s2←s2+p2s_2 \leftarrow s_2+p^2 // finalize at the example boundary

    3. end

    4. write s1,s2s_1,s_2 into TT of S1,S2S_1,S_2

  2. end

Here r=0.19r=0.19–0.270.27, but r>1r>1 whenever the context is short and the layer wide—1.94 for a [8192, 256] head at L=128L=128. Short context and wide layers favour the kernel; long context and narrow layers do not.

Overlapping the reduction with the backward pass

With gradient accumulation, a weight’s S1S_1 and S2S_2 are complete only once the last micro-batch’s backward has passed it. Reducing everything after the accumulation window closes leaves the collective fully exposed at the end of the step. But weights become final in reverse layer order, so the reduction for the last layer can be launched while the earlier layers are still computing. Grouping weights into byte-sized buckets and launching each bucket asynchronously as it fills—the scheme DistributedDataParallel uses for gradients—recovers 59 ms per step here. It changes only when bytes move, not what is computed.

Two conditions are required. Bucket boundaries must be identical on every rank, or ranks issue mismatched collectives and deadlock; this holds because weights complete in the same deterministic order everywhere and buckets fill by the same byte rule. And the scheme requires rank-local pooling: under the exact three-round chain of §E.2, round two depends on round one and round three on round two, so only the first could be launched early. Removing the between-rank term is what makes both payloads independent, and therefore launchable as soon as they exist.

A variant we discarded. One can go further and use the previous step’s dispersion with the current step’s mean, leaving the current dispersion in flight across the step boundary. We do not recommend it. Once the kernel and the bucketing above had shrunk the surrounding work, bucketed overlap alone hid the dispersion collective essentially completely, and the stale variant measured −1 ms—within noise—while costing a persistent [dout,din][d_{\mathrm{out}},d_{\mathrm{in}}] float32 buffer, +0.32 GiB, which is precisely the footprint of AdamW’s vv. ZEMA’s claim is one state against Adam’s two; that variant buys a second full-size state for no speed.

What remains, and why it cannot reach zero

After all three changes, ZEMA moves two weight-shaped payloads per step on the bound parameters where AdamW moves one:

Per step, bound parametersBytesvs. AdamW
AdamW (gradient only)648,735,7441.00×
ZEMA, rank-local (mean + dispersion + auxiliary)988,474,3681.52×

Table 11 (PDF p. 37).

One of the two is not a premium: the mean is the gradient, the same bytes data-parallel training moves anyway. The second has no AdamW counterpart and cannot acquire one, for the reason given in §E.1: vtv_t is recoverable from the reduced gradient and M2M_2 is not. 1.52× of AdamW’s collective traffic is therefore the floor for this statistic as specified, not a target to optimize past. Reducing it further means computing a different statistic—which is what subsampling (§E.7) does, and it is priced in degrees of freedom accordingly.

Validation

Of the four changes in Table 12, two alter the numbers the optimizer sees—bfloat16 accumulation of the statistic, through rounding, and rank-local pooling, through three degrees of freedom—and two do not. The fused kernel computes Equation (30) exactly in exact arithmetic and is pinned against a batched-product reference in unit tests; bucketed overlap changes only scheduling.

Both numerical changes were carried to a complete run—6,103 steps and 3.2B tokens, ending in a full validation pass over the 9.2M held-out tokens—rather than to a short smoke, and compared against the exact baseline with a tolerance of ±2ς\varsigma, where ς\varsigma = 0.002189 nats is that baseline’s own three-seed standard deviation.

Short runs are not a substitute. A rounding change and a three-degree-of-freedom change both produce drift that is invisible early and only interpretable against a same-schedule multi-seed band, which exists only at the end of training. A 20-step smoke of this configuration reported a negative-variance fraction of 0.142 where the completed runs give 3.9⋅10−93.9 \cdot10^{-9}, because the smoke’s compressed warmup pooled 8 examples where the real schedule pools 256.

Measured throughput. Table 14 gives per-step training times for the two endpoints. AdamW’s own step time varies by about 7% across nodes of this cluster, so each block is one job on one node and ratios are taken within a block, never across. Peak memory is below AdamW’s in every ZEMA row, because ZEMA carries one persistent state tensor on the bound parameters where AdamW carries two.

Reconciling the two ratios. Table 12 ends at 1.081× and Table 14 at 1.046×. Both are training-time measurements and the difference is configuration, not metric. The complete runs of Table 12 exist to gate the two numerical changes, and were launched before the implementation settled: that final row still carries the stale-dispersion variant of §E.4 and predates a set of host-side cleanups—chiefly the removal of 672 per-step device-to-host synchronizations—together worth 90 ms per step, taking 2,278 ms down to the 2,188 ms of Table 14. The configuration we recommend has been measured per step but not carried to a complete run. We therefore report 1.046× as its per-step cost and 1.081× as the only ratio backed by a full 3.2B-token run, rather than quoting one number for both.

Diagnostics for a reimplementation. Three quantities are worth monitoring. The fraction of coordinates reporting zero variance must be 0; a nonzero value means the raw-sum cancellation bound of §E.2 has failed for that regime and the factored form is required. The mean ∣z∣|z|, about 0.51 here, sets the realized cancellation ratio and should be checked before trusting the raw-sum path. And the assignment of examples to ranks must be verified to be exchangeable, or Equation (33) is biased rather than merely wider. Kernel tile sizes are register-bound and shape-dependent, so they should be retuned per architecture—after computing Equation (34), which decides whether the kernel is worth using at all.

Subsampling the per-batch variance

The standard error σt\sigma_t is the only statistic in ZEMA that needs per-example gradients, and it does not need all of them: the mean can be taken over the whole batch while the variance is estimated from a fraction of it. Figure 7 sweeps that fraction on the setting of § 3.2.

Final validation perplexity versus examples used for the dispersion

Figure 7. Estimating the variance from kk of the B=256B = 256 examples, on the setting of § 3.2. Left to right is dearer to cheaper. The leftmost point uses every example and is the three-seed mean of Table 2 with its 95% interval; every other point is a single seed and so carries no bar. The AdamW line and band are its own whole-batch three-seed mean and 95% interval. Signum, at 25.25, is off the top of the scale.

Down to k=8k = 8 of B=256B = 256 examples both arms stay within seed noise of their whole-batch result, and at every kk we tried they remain below AdamW. Details of the estimator and the Algorithm 3 can be found below.

The estimator. The mean mtm_t and the standard error σt\sigma_t need not be estimated from the same examples. We keep the mean over all BB examples and estimate the dispersion from a subset SS of size kk:

σt,i2=1B(k−1)∑j∈S(gj,i−g‾S,i)2,g‾S,i=1k∑j∈Sgj,i.(35)\sigma_{t,i}^{2} = \frac{1}{B(k-1)} \sum_{j \in S}(g_{j,i} - \overline{g}_{S,i})^{2}, \qquad\overline{g}_{S,i} = \frac{1}{k}\sum_{j \in S} g_{j,i}. \tag*{(35)}

The divisor is B(k−1)B(k - 1), not k(k−1)k(k - 1). The sum over SS divided by k−1k - 1 estimates the per-example variance from kk draws; dividing by BB instead rescales that to the standard error of the BB-example mean, which is the quantity ztz_t is defined against. The estimand is therefore unchanged—only the sample used to estimate it shrinks, and with it the relative error of σt\sigma_t, which grows as roughly 1/2(k−1)1/\sqrt{2(k - 1)}.

This is not a smaller batch. Every example still enters mtm_t, so the direction the optimizer follows is formed from the full batch, and the nn behind the standard error remains BB. A batch of kk would change both.

Why it is cheaper. Algorithm 3 gives the replacement. The saving is in traffic, not arithmetic. The full path materializes a [B,out,in][B,\mathrm{out},\mathrm{in}] per-example gradient tensor and makes several elementwise passes over it; here the mean comes from a single matrix product over all B⋅TB \cdot T tokens—the same contraction, and the same floating-point operations, as the ordinary weight gradient—and only kk examples ever enter the batched product that forms per-example gradients. Arithmetic rises by a factor (B+k)/B(B+k)/B; the intermediate tensor shrinks by B/kB/k.

Algorithm 3: Subsampled variance. Replaces lines 3–5 of Algorithm 1; everything from ztz_t onwards is unchanged.

Input: batch size BB; variance sample size k≤Bk \le B; activations x\mathbf{x} and output sensitivities δ\boldsymbol{\delta} for the batch

  1. sample a batch of size BB

  2. mt←1BδTxm_t \leftarrow\frac{1}{B}\boldsymbol{\delta}^{\mathsf{T}}\mathbf{x} // one product over all B⋅TB \cdot T tokens; no per-example tensor

  3. S←S \leftarrow the first kk examples of the batch // the batch is shuffled, so SS is a random draw from the data

  4. form per-example gradients gt(j)\mathbf{g}_t^{(j)} for j∈Sj \in S only // a [k,out,in][k,\mathrm{out},\mathrm{in}] tensor, not [B,out,in][B,\mathrm{out},\mathrm{in}]

  5. gˉS←1k∑j∈Sgt(j)\bar{\mathbf{g}}_S \leftarrow\frac{1}{k}\sum_{j\in S}\mathbf{g}_t^{(j)} // centre on the subsample’s own mean

  6. σt←[1B(k−1)∑j∈S(gt(j)−gˉS)2]1/2\boldsymbol{\sigma}_t \leftarrow\left[\frac{1}{B(k-1)}\sum_{j\in S}\left(\mathbf{g}_t^{(j)}-\bar{\mathbf{g}}_S\right)^2\right]^{1/2} // still the standard error of the BB-example mean

Results. Figure 7 sweeps kk from 256 down to 4, one seed per kk. From k=128k = 128 down to k=8k = 8—a 32×32\times reduction in the per-example tensor—ZEMA-CLT moves between 22.22 and 22.28 against its whole-batch 22.18, and ZEMA-Adam between 22.30 and 22.45 against 22.36; in both cases the excursion is at or below the seed-to-seed spread at that point, which is 0.05 and 0.09 in standard deviation over the three whole-batch seeds. Only at k=4k = 4 does a penalty appear that is clearly bigger than noise, and it remains small: ZEMA-CLT rises to 22.49 and ZEMA-Adam to 22.53. At every kk, including k=4k = 4, both arms sit below AdamW’s whole-batch mean of 22.79, though at k=4k = 4 they are inside AdamW’s 95% interval and we do not claim a separation there.

References

  1. [1]Lukas Balles and Philipp Hennig. Dissecting Adam: The Sign, Magnitude and Variance of Stochastic Gradients, December 2020. URL http://arxiv.org/abs/1705.07774. arXiv:1705.07774 [cs].
  2. [2]Barak Battash, Lior Wolf, and Ofir Lindenbaum. Revisiting the noise model of stochastic gradient descent. In Sanjoy Dasgupta, Stephan Mandt, and Yingzhen Li, editors, Proceedings of The 27th International Conference on Artificial Intelligence and Statistics, volume 238 of Proceedings of Machine Learning Research, pages 4780–4788. PMLR, 02–04 May 2024. URL https://proceedings.mlr.press/v238/battash24a.html.arxiv.org/abs/2303.02749
  3. [3]Jeremy Bernstein and Laker Newhouse. Old Optimizer, New Norm: An Anthology, December 2024. URL http://arxiv.org/abs/2409.20325. arXiv:2409.20325 [cs.LG].
  4. [4]Jeremy Bernstein, Yu-Xiang Wang, Kamyar Azizzadehnesheli, and Anima Anandkumar. signSGD: Compressed Optimisation for Non-Convex Problems, August 2018. URL http://arxiv.org/abs/1802.04434. arXiv:1802.04434 [cs.LG].
  5. [5]Xiangning Chen, Chen Liang, Da Huang, Esteban Real, Kaiyuan Wang, Hieu Pham, Xuanyi Dong, Thang Luong, Cho-Jui Hsieh, Yifeng Lu, et al. Symbolic discovery of optimization algorithms. Advances in neural information processing systems, 36:49205–49233, 2023.arxiv.org/abs/2302.06675
  6. [6]Felix Dangel, Frederik Kunstner, and Philipp Hennig. Backpack: Packing more into back-prop. arXiv preprint arXiv:1912.10985, 2019.
  7. [7]John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of machine learning research, 12(7), 2011.
  8. [8]Bogdan Gliwa, Iwona Mochol, Maciej Biesek, and Aleksander Wawer. SAMSum corpus: A human-annotated dialogue dataset for abstractive summarization. In Proceedings of the 2nd Workshop on New Frontiers in Summarization, pages 70–79, 2019.DOI
  9. [9]Vineet Gupta, Tomer Koren, and Yoram Singer. Shampoo: Preconditioned stochastic tensor optimization. In International Conference on Machine Learning, pages 1842–1850. PMLR, 2018.arxiv.org/abs/1802.09568
  10. [10]Geoffrey Hinton, Nitish Srivastava, and Kevin Swersky. Neural networks for machine learning—lecture 6e—rmsprop: Divide the gradient by a running average of its recent magnitude, 2012.
  11. [11]Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. LoRA: Low-rank adaptation of large language models. In International Conference on Learning Representations, 2022.arxiv.org/abs/2106.09685
  12. [12]Keller Jordan, Yuchen Jin, Vlado Boza, Jiacheng You, Franz Cesista, Laker Newhouse, and Jeremy Bernstein. Muon: An optimizer for hidden layers in neural networks, 2024. URL https://kellerjordan.github.io/posts/muon/.
  13. [13]Frederik Kunstner and Francis Bach. Scaling Laws for Gradient Descent and Sign Descent for Linear Bigram Models under Zipf’s Law, May 2025. URL https://arxiv.org/abs/2505.19227v1.
  14. [14]Frederik Kunstner, Jacques Chen, Jonathan Wilder Lavington, and Mark Schmidt. Noise Is Not the Main Factor Behind the Gap Between SGD and Adam on Transformers, but Sign Descent Might Be, April 2023. URL https://arxiv.org/abs/2304.13960v1.
  15. [15]Julius Kunze, James Townsend, and David Barber. Adaptive optimization with examplewise gradients. arXiv preprint arXiv:2112.00174, 2021.arxiv.org/abs/2112.00174
  16. [16]Ziyue Liu, Ruijie Zhang, Zhengyang Wang, Yeq uan Zhao, Yupeng Su, Zi Yang, and Zheng Zhang. Muon²: Boosting muon via adaptive second-moment preconditioning. arXiv preprint arXiv:2604.09967, 2026.arxiv.org/abs/2604.09967
  17. [17]Jekaterina Novikova, Ondřej Dušek, and Verena Rieser. The E2E dataset: New challenges for end-to-end generation. In Proceedings of the 18th Annual SIGdial Meeting on Discourse and Dialogue, pages 201–206, 2017.arxiv.org/abs/1706.09254
  18. [18]Antonio Orvieto and Robert M. Gower. In Search of Adam’s Secret Sauce, December 2025. URL http://arxiv.org/abs/2505.21829. arXiv:2505.21829 [cs].
  19. [19]Francisco Patitucci and Aryan Mokhtari. Adaptive optimization via momentum on variance-normalized gradients. arXiv preprint arXiv:2602.10204, 2026.arxiv.org/abs/2602.10204
  20. [20]Andrei Semenov, Matteo Pagliardini, and Martin Jaggi. Benchmarking Optimizers for Large Language Model Pretraining, September 2025. URL http://arxiv.org/abs/2509.01440. arXiv:2509.01440 [cs.LG].
  21. [21]Chongjie Si, Debing Zhang, and Wei Shen. Adamuon: Adaptive muon optimizer. arXiv preprint arXiv:2507.11005, 2025.arxiv.org/abs/2507.11005
  22. [22]Qiaoyue Tang, Frederick Shpilevskyy, and Mathias Lécuyer. Dp-adambc: Your dp-adam is actually dp-sgd (unless you apply bias correction). In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, pages 15276–15283, 2024.
  23. [23]Akiyoshi Tomihari and Issei Sato. Understanding Why Adam Outperforms SGD: Gradient Heterogeneity in Transformers, January 2025. URL http://arxiv.org/abs/2502.00213. arXiv:2502.00213 [cs.LG] version: 1.
  24. [24]Shuo Xie, Mohamad Amin Mohamadi, and Zhiyuan Li. Adam exploits ℓ∞-geometry of loss landscape via coordinate-wise adaptivity. In The Thirteenth International Conference on Learning Representations, 2025.arxiv.org/abs/2410.08198
  25. [25]An Yang, Anfeng Li, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chang Gao, Cheng'en Huang, Chenxu Lv, et al. Qwen3 technical report. arXiv preprint arXiv:2505.09388, 2025.arxiv.org/abs/2505.09388
  26. [26]Huizhuo Yuan, Yifeng Liu, Shuang Wu, Xun Zhou, and Quanquan Gu. Mars: Unleashing the power of variance reduction for training large models. arXiv preprint arXiv:2411.10438, 2024.arxiv.org/abs/2411.10438
  27. [27]Minxin Zhang, Yuxuan Liu, and Hayden Schaeffer. Adagrad meets muon: Adaptive step-sizes for orthogonal updates. arXiv preprint arXiv:2509.02981, 2025.arxiv.org/abs/2509.02981
  28. [28]Minxin Zhang, Yuxuan Liu, and Hayden Schaeffer. Adam improves muon: Adaptive moment estimation with orthogonalized momentum. arXiv preprint arXiv:2602.17080, 2026.arxiv.org/abs/2602.17080
  29. [29]Yushun Zhang, Congliang Chen, Tian Ding, Ziniu Li, Ruoyu Sun, and Zhi-Quan Luo. Why Transformers Need Adam: A Hessian Perspective, October 2024. URL http://arxiv.org/abs/2402.16788. arXiv:2402.16788 [cs].
  30. [30]Jiawei Zhao, Zhenyu Zhang, Beidi Chen, Zhangyang Wang, Anima Anandkumar, and Yuan-dong Tian. Galore: Memory-efficient llm training by gradient low-rank projection. arXiv preprint arXiv:2403.03507, 2024.arxiv.org/abs/2403.03507
  31. [31]Rosie Zhao, Depen Morwani, David Brandfonbrener, Nikhil Vyas, and Sham Kakade. Deconstructing What Makes a Good Optimizer for Language Models, February 2025. URL http://arxiv.org/abs/2407.07972. arXiv:2407.07972 [cs.LG].

Paper details

vlnc:W_chv26fje
v1 · latestHistory (1)

published · Fresh — added to the Hub within the last 30 days

added ·

Usage

views · 5

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

CC BY 4.0

Original source

  • Computer Science

Not recorded for this paper · View statement →

Looking for related papers…
Contents