The Signal and the Noise.

Generalizing AdamW.

Authors

Max Misterka, Nahom Seyoum, Adit Srivastava, Mason Eyler, AJ, Deven Pietrzak.

TL;DR

  • AdamW has a privileged basis: it applies its adaptive update separately along each parameter coordinate.
  • We explore generalizing these SNR-based updates to arbitrary directions, finding a new route to momentum: under certain conditions, averaging over directions recovers a scaled momentum update.
  • For linearly independent gradient histories, we construct a direction whose projection onto every stored gradient is identical, achieving SNR 1 when the stabilizer is zero.
  • A variant of this that adds preference toward more recent gradients gives a basis-independent optimizer that matches AdamW.

Introduction

The Adam optimizer's update for a single parameter is a ratio of two running estimates. For a matrix-valued parameter with gradient , Adam's update is

(1)

where and are EMAs of the first and second raw gradient moments.

For a scalar sequence , define the signed signal-to-noise ratio (SNR) operator using Adam's decay rates and stabilizer (with nonzero denominator):

(2)

We write when replacing the stabilizer by . Here SNR means signed mean divided by RMS, not mean divided by standard deviation. With shared moment weights its magnitude is at most ; this bound need not hold when .

AdamW's adaptive update is , with the operator applied entrywise. The interpretation of Adam as an SNR is due to Kingma and Ba in their paper introducing Adam [1].

Adam Has a Privileged Basis

Drag to rotate both plots. Arrow keys rotate by 1 degree; Shift by 10.
Original run reached a matrix minimum. Click to show its contour ground.Drag the start. Arrow keys move it; Shift makes smaller moves. Home resets it.
Original run reached a matrix minimum. Click to show its contour ground.Drag the start. Arrow keys move it; Shift makes smaller moves. Home resets it.

Adam's update acts parameter-wise in the standard basis and does not consider interactions between the parameters. However, there is no reason for the standard basis to be optimal here. For this reason, modern pretraining optimizers such as Shampoo, Muon, and SOAP have no privileged basis. Shampoo preconditions the gradient matrices on both sides using accumulated statistics and :

(3)

Instead of preconditioning the gradients, Muon orthogonalizes the EMA of the gradients: if a compact SVD of retaining only its nonzero singular values is

(4)

then the idealized, unscaled polar update is , which sets the nonzero singular values to without changing the singular vectors. SOAP uses Shampoo's left and right preconditioners to construct an orthonormal eigenbasis and applies the Adam update formula in this basis. All of these optimizers are equivariant to shared orthogonal transformations of the gradients on both sides: if is the update function,

(5)

Shampoo and Muon are basis-independent at the cost of completely dropping the concept of SNR that was key to Adam's success. While SOAP takes advantage of the SNR and is a basis-independent optimizer because the Adam basis is chosen in an orthogonal-equivariant way from the gradients, it only computes the SNR in a single basis, leaving the vast majority of directions unprobed. This suggests that we could construct a new optimizer by computing the SNR in every direction, making it a more direct basis-independent adaptation of Adam. The SNR in a non-coordinate direction is defined as follows. For unit vectors and , the component of the gradient along the rank-one matrix direction is

(6)

This converts the sequence of gradients into a sequence of scalars that depends on the direction. Applying the SNR operator to this scalar sequence gives1. If we set and , then we recover Adam's update formula for entry !

(7)

Now that we have a scalar SNR value for each direction in , we must also decide how to aggregate these values into an update. Adam assembles the coordinates weighted by their SNR into a full matrix:

(8)

To aggregate the SNR over all unit rank-one directions, we can replace the sum over the basis with an integral over the entire space of directions , which is the Cartesian product of the unit sphere in and the unit sphere in : . The optimizer update then becomes

(9)

Here, denotes the uniform probability measure on the sphere . Throughout the averaging analysis, the sampled matrix direction is with independent uniform unit vectors .

Averaging over All Directions Is Not Ideal

Claim. If the RMS norm in the denominator of the SNR integral is constant, then the integral collapses to a scalar multiple of , where is the EMA of the gradients.

Here and average over the history index with the numerator's weights and denominator's weights, respectively, from the opening definition. This implies that .

Derive the constant-denominator average

Let be the constant denominator, including the stabilizer: , independent of the unit directions and .

(10)

By rotational symmetry, both and average to scalar multiples of the identity, so

(11)

When we write as a function over a product of spheres, we see that this is simply a projection of and collapses to a linear functional of . This means the only mechanism that can possibly differentiate between directions is the denominator.

Almost all directions are almost orthogonal to all of the gradients

Let be the span of the gradient history, and let be the Frobenius-orthogonal projector onto . Write .

Claim. For sampled as above, . Moreover, for every integer ,

(12)

Thus most rank-one directions are nearly orthogonal to the gradient history when , with an exponentially small tail.

Derive the rank-one projection bound

For any fixed matrix ,

(13)

Choose a Frobenius-orthonormal basis of . Then

(14)

To obtain an exponential tail, write . For independent standard Gaussian vectors and , conditioning on and applying Minkowski's inequality in a singular-vector basis of gives

(15)

Gaussian radii are independent of their uniform directions, and , by Jensen's inequality. Hence . Applying Minkowski again to the squared projection yields

(16)

Markov's inequality applied to at the claimed threshold gives (the case is immediate). Since every ,

(17)

The nullspace can be ignored

Projecting onto measures overlap, but can destroy rank one. To preserve rank-one directions, project the two factors separately onto the left and right gradient spans:

(18)

These factor spans may be full even when has low dimension. Let be their orthogonal projectors, and write

(19)

Claim. Projecting the two factors and normalizing changes only the effective stabilizer:

(20)

When , the score depends only on the rank-one direction .

Derive the projected sequence score

Every tracked gradient satisfies , so

(21)

For , this scales the weighted mean and RMS by the same amount. Thus

(22)

Averaging reduces the integral to the gradient spans

Write for the unit spheres in the two factor spans.

Claim. Averaging over rank-one directions cancels the components outside the left and right gradient spans:

(23)

For , the remaining integral is over , multiplied by the positive scalar .

Derive the rank-one integral reduction

Write

(24)

where and . Conditional on , reflecting either orthogonal component preserves its distribution and leaves every projected gradient unchanged. Thus

(25)
(26)

The same cancellation holds after multiplying by the conditional SNR, giving the reduced integral.

Under independent uniform , the normalized projections are independent and uniform on their active spheres, and independent of . When , the score is independent of the projection lengths, so their expectations factor out. A full factor span has projection length and no orthogonal component to cancel.

For a nonzero gradient history and positive second-moment weights, zero-RMS directions have measure zero, so they do not affect the zero-stabilizer integral.

We can now work within the left and right gradient spans and ask how much the denominator varies across rank-one directions there. We first account for the stabilizer .

The nullspace amplifies the stabilizer

Now suppose . The nullspace clearly contributes no signal of its own but the stabilizer still acts on a scale set by it. Within the active spans, (20) has the effective stabilizer .

To see why this happens, we can work through a concrete example. Let be the mean and be the RMS measured inside the active spans. If , then the ambient direction retains only of every scalar gradient, and its score is

(27)

The mean and RMS clearly recover their original scale after cancellation, but has become sixteen times larger relative to them. If and are uniformly random, the lengths of their projections onto the active spans are typically

(28)

Substituting these values into gives

(29)

The concentration argument behind these typical projection lengths is included in the panel below.

Show the projection-length concentration bound

For independent uniform directions and , with and ,

(30)

A full factor span has projection length exactly. For a proper factor span, Beta concentration gives, for ,

(31)

with the analogous bound for . We interpret the following estimates asymptotically, with fixed and . Applying the two concentration bounds and taking a union bound shows that, with probability at least ,

(32)
(33)

Hence, in the common regime and , the relative errors vanish as the active ranks grow, so taking reciprocals gives

(34)

When is the RMS nearly constant?

For independent uniform and , define

(35)

Its mean is

(36)

by (13).

We measure the spread of gradient energy using the effective dimension (participation ratio) of a nonzero positive semidefinite second moment :

(37)

where are the singular values of . This counts the effective number of directions carrying energy: equal nonzero singular values give , while one dominant singular value gives .

For each gradient in this history, write , where and are orthogonal matrices whose columns are its left and right singular vectors, and is the diagonal matrix containing its singular values. Applying effective dimension to the left/output directions and right/input directions yields

(38)
(39)

If is constant across the history, orthogonal invariance gives

(40)

with the same formula for when is constant. This counts the fixed singular directions carrying energy; rotation across the history can spread that energy over more directions and increase the effective dimension.

Finally, flatten each gradient to . The effective dimension of the flattened history's second moment is

(41)

This counts effective directions explored by the gradient history. If every is a multiple of the same vector, , even when the corresponding matrix has large rank.

Claim. The relative variance obeys

(42)

Thus large make concentrate near . Conditional on any , the denominator then concentrates relative to .

Derive the variance and conditional denominator bounds

For this derivation, abbreviate , , and . For the two-gradient expectation below, sample and independently from the second-moment EMA distribution. Write in orthonormal bases of the active spaces, and set

(43)

The spherical fourth-moment identity gives

(44)

The index permutation preserves the sum of squares, so Cauchy–Schwarz gives . Using and subtracting from yields (42).

For a failure probability , set

(45)

Chebyshev's inequality gives with probability at least over . When , conditioning on gives

(46)

In particular, the relative error of this denominator is at most . This bound holds for every choice of the projection lengths.

From RMS concentration to momentum

We now use the variance bound to control how far the integral update is from a scalar multiple of momentum. Replacing the active-direction RMS by in (23) leaves the projection lengths to average into a scalar:

(47)

To control its error, assume the second-moment EMA assigns positive probability to every stored gradient. Suppose that . This condition is true for standard settings of the parameters: and . Assuming this condition, we can use the following constant to sharply bound for every finite sequence of gradients:

(48)

Claim. For , the relative error of the momentum approximation satisfies

(49)

The ratio before the square root compares the RMS gradient magnitude with the magnitude of its EMA: it grows when gradients cancel in the mean. When the full right-hand side is much smaller than , the integral update is close to scaled momentum in both magnitude and direction.

Derive the momentum approximation and error bound

Define EMA weights

(50)

By Cauchy–Schwarz

(51)

Substituting the EMA weights and evaluating the geometric series (since by assumption),

(52)

To bound the remaining fraction, use the identity

(53)

Rearranging and dividing by gives

(54)

Applying (54),

(55)

Combining with (51) yields for every finite history. yields equality in (51), and as . Hence, is the least upper bound across and , given and .

We prove the absolute-error bound

(56)

Dividing by cancels the averaging prefactor and gives the relative-error claim.

First, the constant-RMS part satisfies

(57)

which gives after averaging the projection lengths.

For fixed , write , , and

(58)

Since ,

(59)

These inequalities hold almost everywhere, including when .

To bound the averaged matrix, test it against any matrix with . The spherical second-moment identity gives

(60)

By Cauchy–Schwarz,

(61)

Taking the supremum over bounds the Frobenius norm of the averaged error. Multiplying by and averaging the independent projection lengths yields

(62)

Since , this proves the bound. At , the scale factor simplifies to

(63)

Summary of the results so far

Projection onto the active spans amplifies the stabilizer to , typically in the concentration regime above. Thus when the gradient span is much lower rank than the ambient space, can be amplified and push the integral towards a scalar multiple of momentum.

Separately, large effective dimensions of the gradient history make the RMS nearly constant. This also causes the update to be momentum-like, as bounded by (49).

The SNR-Maximizing Direction

In the previous section, we identified why the SNR integral fails: most directions in high-dimensional space are almost orthogonal to every gradient, and for these directions the RMS of the projection of the gradients is nearly constant, causing the integral to collapse to momentum. A natural fix is to avoid summing over these almost-orthogonal directions. Instead, we can use the SNR to filter the directions. The strongest possible filter is to take only the direction which maximizes the SNR.

We seek a matrix that maximizes , without requiring to have rank one. Let be the flattened gradient subspace. Writing and gives , so we may use ordinary linear algebra.

Recall that the SNR is , where , , and . Since scaling and equally can only increase the SNR due to the term, the maximum SNR direction will live in the span of the gradients to maximize its projection onto each gradient. This causes both the numerator and denominator to be as large as possible given the direction's unit norm constraint. For the following analysis, we set . In the pretraining regime considered here, we find empirically that has little effect for most directions within the gradient span. This approximates the stabilized score when is small relative to the projected RMS; directions with very small projected RMS may still be affected.

We will also assume that and will restrict to the span of the gradients (since the SNR is independent of the direction's nullspace component) unless otherwise stated.

Let be the mean gradient and be its uncentered second moment. Since we are restricting to , we know that is positive definite.

Claim. is maximized by , uniquely up to positive rescaling. The maximum is

(64)

with equality when all stored gradients are linearly independent. In this case, is constant across the history. Linear independence of the gradients is almost always true in pretraining, which implies the surprising conclusion that there is always a direction with SNR equal to 1 in practice.

Derive the maximizing direction and maximum SNR

Since is positive definite, we may define the inner product . By the Cauchy–Schwarz inequality,

(65)
(66)

By the equality condition in Cauchy–Schwarz, SNR is maximized exactly at positive multiples of .

The definition of SNR gives . Suppose is linearly independent. Then

(67)

By linear independence of the and positivity of the EMA weights, for every , so . Thus

(68)

Maximizing SNR therefore gives a preconditioned mean gradient, . If we have per-example negative-log-likelihood gradients evaluated at fixed parameters, is a weighted empirical Fisher. In our case, also reflects changes in the parameters because we use batch gradients from different training steps. Kunstner, Balles, and Hennig [2] argue that the empirical Fisher may help account for gradient noise even when it gives a poor estimate of curvature. We ultimately arrive at the same view by choosing the direction whose gradient projections vary least relative to their mean.

Critical points of the SNR function

Claim. The only nonzero critical points of are

(69)

Positive gives the global maximum ; negative gives the global minimum . On the unit sphere, the only critical points are .

Derive the critical-point classification

Differentiating directly gives

(70)

Hence

(71)

At a critical point, cannot vanish: otherwise , contradicting positive definiteness and . Multiplying by and rearranging gives

(72)

Thus is a nonzero scalar multiple of . Positive rescaling preserves SNR and negation reverses its sign, so all such are extrema.

Scale invariance also gives , so the gradient is tangent to the sphere. The constrained critical points therefore satisfy the same equation and are exactly the two normalized directions.

Directional SNR on a product of circles

Rank-one matrix directions: u, v ∈ R²

Loading directional surface…

—SNR 0—

Raw projection

EMA-decayed

Figure 1. Matrix directions are restricted to , with and moving in two-dimensional subspaces. The visualization uses shared EMA weights and the displayed positive stabilizer, so its SNR remains below one.

Computing the direction with the Gram matrix

We can compute the same SNR-maximizing direction without forming the full second-moment matrix. In default coordinates, is a matrix, where . The Gram formulation instead solves an system, where is the number of stored gradients.

Claim. With linearly independent gradient columns and Gram matrix , the maximum-SNR solution is , where is the all-ones vector. It satisfies and is independent of the positive moment weights.

Derive the Gram-system solution

Since , there exists a vector such that . Then

(73)

The columns are linearly independent and each has positive probability, so this expectation vanishes exactly when for every . Thus

(74)

The naive solution forgets

Even though both the numerator and denominator of the SNR depend on the EMA decay , the SNR-maximizing direction which solves is independent of :

(75)

This happens because the columns of form a basis of the gradient subspace in which the th coordinate of is . Therefore we can simply select a point where all coordinates are the same. If the columns of were linearly dependent, we could no longer choose these coordinates independently. When equal nonzero coordinates are unattainable, we must trade off the values of . In that case, governs which values we prioritize keeping close to the same.

This cancellation is undesirable for actual pretraining, where older gradients are stale and thus less useful. The usual EMA remedies this by weighting older gradients exponentially less. Our construction discards the optimizer's intended recency bias and thus produces a poor update.

To remediate this, we can reintroduce recency bias by replacing the target vector with EMA target values with a separate decay rate :

(76)

This gives us a weighted variant of the Gram update formula:

(77)

As we will see below, this fix enables the optimizer to match AdamW's performance in a basis-free manner, which was the original goal! The SNR of the update is now a constant.

Derive the SNR after restoring recency weighting

The target values are the prescribed gradient projections. The EMA weights , with , use decay to compute the SNR's mean and second moment.

Since , the projected history is exactly . Hence

(78)

For fixed decay rates , and history length , the score is independent of the gradients. For positive target values, it is below unless all are equal.

Optimizer comparisons

The following figure shows the learning curves measuring the Gram optimizer's performance for pretraining a 286M-parameter model. The parameter sets for the recency weighting: , where is the number of previous gradients which we save. At , we use the uniform-target limit , giving . The and curves are the learning curves for the standard Gram optimizer and the recency-weighted variant, respectively. All curves are shown at their optimal learning rate and weight decay settings. As the curves show, standard Gram loses to momentum, while recency-weighted Gram matches AdamW by the end of the training run. This shows that we have found a basis-independent variant of AdamW which preserves its performance.

The figure below the learning curve plot displays the SNR measured on held-out batches. As the figure indicates, the held-out SNR for both Gram and AdamW is similar to the in-sample SNR, which implies that the Gram optimizer does not overfit to the sampled batches.

OPTIMIZER COMPARISON

  • Muon
  • SOAP
  • gram c=3
  • gram c=0
  • momentum
  • AdamW
Validation loss (nats/token)2.53.03.54.04.505001k15002k2500Training stepgram c=0momentumgram c=3AdamWSOAPMuon

SNR on independent gradients

Nanochat, 60-gradient windows. In-sample SNR scores an update against the training gradients used to construct it. Held-out SNR uses independent-batch gradients collected along the same training trajectory.

In-sampleHeld-out

Gram

Gram: SNR against Memory decay βUse the left and right arrow keys to inspect runs. Solid lines show held-out SNR; dashed lines show in-sample SNR. Layered squares mark measured values. Selected β = 0.95: in-sample 0.884950, held-out 0.927289.

AdamW

AdamW: SNR against Update exponent p · 1 = AdamWUse the left and right arrow keys to inspect runs. Solid lines show held-out SNR; dashed lines show in-sample SNR. Layered squares mark measured values. AdamW keeps β₁ = 0.80 and β₂ = 0.95. Selected p = 1: in-sample 0.439190, held-out 0.456346.

Alternatives to SNR maximization

So far, we have shown why the SNR integral over all directions recovers momentum and have provided a fix: taking only the maximum SNR direction. However, there is another way to fix the integral: instead of maximizing the SNR, we can replace the integral with a sum over a select set of directions. This recovers Adam if we choose the standard basis. But there is no reason to choose the standard basis. Instead, we can choose the orthonormal eigenbasis of on . Denote the orthonormal eigenvectors as such that . Since is positive definite on , . Since the SNR denominator in the direction is , the sum becomes

(79)

This is identical to the SNR-maximizing direction except we replace the exponent on with . The optimizer is also known as full-matrix AdaGrad [3].

Tokenwise Gradient Structure

For much of the preceding discussion, we have been considering the gradients as vectors in parameter space with no additional structure. However, there is much more structure to a transformer's parameters than just a vector. We considered matrix structure in the original discussion of the integral, but we ignored it later. There is one additional piece of structure which we haven't discussed yet: the raw gradients split into a weighted sum of tokenwise gradients over all tokens in each batch.

Claim. At a single application of a linear map , the local weight-gradient contribution is , where and is the total training loss. It has rank at most one; the full shared-weight gradient sums these contributions over applications.

Derive the local outer-product gradient

Consider a single matrix in the model. Fix a single token . For that token's forward pass, let be the activation entering and let be the output. Let be the total training loss and be 's gradient, combining contributions from all token losses that depend on this activation. Then, by the chain rule, the local contribution is

(80)

Token activation and gradient clouds

Loading clouds…

Tokenwise structure gives an overdetermined maximum SNR direction

We can reuse the SNR-maximizing direction from Sec. 3, now applying it to the per-token gradients rather than the batch gradients. With averaging over tokens in the batch (and across previous batches if we use momentum), define and . The same formula gives

(81)

While the formula is unchanged, this can be a different regime. When the number of token contributions exceeds the matrix's parameter dimension , the matrix of flattened token gradients is wide rather than tall. The equal-projection equations are then overdetermined and generally cannot all be satisfied. The maximum SNR is strictly below unless a direction has the same positive projection on every token gradient. Assuming the token gradients span parameter space, is full rank and still has a unique solution.

The critical-point analysis from the same section also applies: when , this SNR objective has exactly two critical points on the unit sphere, and they are antipodes. Following its spherical gradient gives a flow with an antipodal source-sink pair.

The following figure shows the structure of this gradient flow on a 3D example. For certain parameter settings, the gradient flow is highly non-geodesic, implying that unlike the directional derivative, SNR does not simply measure the alignment of a direction with a fixed axis like .

Gradient flow toward max SNR direction

Loading directional surface…

—SNR 0—
AscentDescent

Raw projection

EMA-decayed

SNR({uᵀgᵢ}) uses shared normalized EMA weights and RMS + ε. Here gᵢ are centered gradients projected onto three principal components.

Conclusion

Our goal was to generalize AdamW's SNR-based update rule beyond its privileged basis. We saw that integrating over all directions can recover momentum, while the naive maximum-SNR direction loses the preference for recent gradients. The Gram solution makes the update computable without constructing the full gradient second moment. Restoring recency weighting gives a basis-invariant optimizer with final validation loss comparable to AdamW's in our pretraining run and lower loss at the first measured checkpoint.

In the previous section, we introduced tokenwise structure, which gives us a way to decompose the gradient such that we get an overdetermined SNR-maximizing direction. Since the Gram optimizer depends on the EMA decay rate in the overdetermined case, this is a more natural optimizer than the artificially-reweighted Gram case. Tokenwise structure suggests many more open directions which we leave for future research.

References

  1. Diederik P. Kingma and Jimmy Ba (2015). Adam: A Method for Stochastic Optimization.
  2. Frederik Kunstner, Lukas Balles, and Philipp Hennig (2019). Limitations of the Empirical Fisher Approximation for Natural Gradient Descent.
  3. John Duchi, Elad Hazan, and Yoram Singer (2011). Adaptive Subgradient Methods for Online Learning and Stochastic Optimization.

Cite this article

Max Misterka, Nahom Seyoum, Adit Srivastava, Mason Eyler, AJ, and Deven Pietrzak. (September 6, 2026). The Signal and the Noise: Generalizing AdamW. Hyperstition. https://hyperstition.cc/the-signal-and-the-noise