betaFeedback

WorksComputer Science

Taming Softmax at the Limits of Muon: A Unified Approach through Hilbert Geometry

Abstract

Muon controls weight updates through the RMS movement of a linear layer's output. This implicitly treats the linear output as a proxy for the full module, including the nonlinearity that follows. This proxy can be misleading for softmax, where the RMS shift in activations does not faithfully measure the change in the output distribution. We propose Hilbert distance as a natural metric for bounding changes in these output distributions. Hilbert distance bounds changes in cross-entropy loss and limits probability redistribution. For softmax, it takes the form of the variation seminorm of the preactivation perturbation, allowing probability constraints to be expressed as parameter constraints. Formulating the steepest descent problem with a Hilbert distance constraint brings two recently proposed methods under a unified mathematical framework. For the LM head, solving a row-wise approximation to the resulting diameter-constrained problem leads us to RowNorm \citep{pethick2025trainingdeeplearningmodels}. For scaled dot-product attention, the same principle yields the first-order query–key steepest descent problem underlying Compositional Muon \citep{keigwin2026compositional}. These connections motivate using Hilbert distance as a guiding principle for optimizer design in softmax modules.

Introduction

An important consideration for stable training is the extent to which a single update changes the network’s intermediate representations. Each intermediate representation is both the output of one layer and the input to the next. This dependence is especially important in deep sequential models, where changing one representation alters the inputs processed by every layer that follows. Without proper control, these representation shifts can accumulate across layers and destabilize training. Muon formalizes this idea for linear layers by controlling the worst-case RMS movement of the layer’s output over inputs of bounded size ([12, 2]). This requirement leads to a suitably scaled spectral norm constraint on the weight update.

This spectral constraint is not arbitrary: it follows from choosing RMS to measure the functional change produced by the update. More broadly, it illustrates how the geometry of an optimizer depends on the notion of change assigned to a module. The Modula project and Scion generalize this perspective by advocating update geometries that reflect the function of each module ([3, 23]).

Muon’s standard update geometry, however, is derived for the linear map and does not explicitly adapt to architectural operations such as normalization and nonlinear activations. As a result, Muon does not yet provide a single optimization rule for every parameter group in the model. In standard Muon training recipes, the LM head, embeddings, and scalar or vector parameters are typically optimized with AdamW ([12]). Large-scale Muon training can also require additional stabilization. For example, Kimi K2 introduced MuonClip to address excessive attention-score growth by rescaling query and key weights after an update ([27]).

We focus on how optimizer design changes when a linear map is followed by softmax. The linear layer’s output is an intermediate state, and its RMS displacement does not faithfully measure the change in the probability distribution produced by softmax. We instead directly constrain the change in the output probability distribution. We propose using Hilbert’s projective metric, or Hilbert distance, for this purpose.

Our contributions are threefold:

  • We formulate the steepest descent problem using Hilbert distance to constrain changes in softmax output distributions. This single formulation brings two seemingly independent optimization methods under a unified mathematical framework.

  • For the LM head, we show that this probability constraint becomes a row diameter constraint. Its exact dual scales quadratically with vocabulary size. A tighter common-ball constraint instead leads to RowNorm in closed form [23].

  • For standard attention, we show that this probability constraint produces a spectral constraint on the first-order change in the QK product, recovering the steepest descent problem posed in Compositional Muon [14].

Beyond unifying these recent methods, we provide a guiding principle for optimizer design for any neural network module that outputs a probability distribution.

We first expose the mismatch between RMS and softmax (§ 2). Next, we introduce Hilbert geometry and establish its suitability for measuring changes in softmax output distributions (§ 3). We subsequently formulate the corresponding steepest descent problems for the LM head and attention. For the LM head, a tighter approximation leads to RowNorm in closed form. For attention, our formulation recovers the QK steepest descent problem studied by Compositional Muon (§ 4 and § 5).

Preliminaries on steepest descent

Steepest descent chooses an update that gives the greatest first-order decrease in the loss while remaining small under a chosen measure of size. For a minibatch gradient G=∇WLG = \nabla_W \mathcal{L}, an update ΔW\Delta W changes the loss to first order by ⟨G,ΔW⟩F\langle G, \Delta W\rangle_F. Let DW(ΔW)D_W(\Delta W) measure the size of this update at the current weights WW. We consider

min⁡ΔW⟨G,ΔW⟩Fsubject toDW(ΔW)≤ρ,(1)\min_{\Delta W} \langle G, \Delta W\rangle_F \qquad\text{subject to} \qquad D_W(\Delta W) \le\rho, \tag*{(1)}

where ρ>0\rho> 0 sets the permitted update size. We leave DWD_W unspecified for now, allowing its choice to reflect the module being optimized.

The importance of the underlying choice of metric cannot be overstated. Choosing the Frobenius norm measures the update directly in parameter space and gives the SGD direction [24]. Muon takes a functional perspective instead: for a linear layer, it controls the worst-case change in the output produced by the update [2]. Measuring this change with RMS leads to a spectral norm constraint on the weight update, whose steepest descent solution gives the Muon direction. The Modula project generalizes this perspective by advocating update geometries that reflect the function of each module [3]. Around this principle, Scion develops a systematic optimization framework, formulating updates as Linear Minimization Oracles under ∥⋅∥p→q\lVert\cdot\rVert_{p \to q} operator norm constraints [23]. Here, the norms ∥⋅∥p\lVert\cdot\rVert_p and ∥⋅∥q\lVert\cdot\rVert_q describe the input and output geometries of the module. The shared ethos of these works is to build optimizers whose geometry reflects the function of each module.

This functional perspective becomes more delicate when a linear layer is followed by a nonlinearity. The linear output is then only an intermediate state in the computation of the full module. Controlling the RMS movement of this intermediate state does not account for the geometry introduced by the subsequent nonlinearity. For a softmax module, the linear output is the preactivation vector, which softmax maps to a probability distribution on the simplex. We therefore ask whether RMS displacement of the preactivation faithfully measures changes in the output distribution.

Geometric mismatch between Muon and softmax

We argue that Muon is inadequate for modules involving softmax. Muon’s spectral geometry can allocate updates poorly for such modules. The distinction lies between the nature of RMS and softmax max: RMS measures how much the preactivation vector moves on average, while softmax measures how much one coordinate gains relative to others.

A simple example. Consider an update where all the rows are equal, ΔW=1b⊤\Delta W = \mathbf{1}b^\top. In this case, Δz=ΔWx=(b⊤x)1\Delta z = \Delta W x = (b^\top x)\mathbf{1}, a scaled ones vector. Such a perturbation to the preactivation vector does not alter the probability distribution, despite incurring an arbitrarily large RMS norm. This particular case is not problematic in practice because softmax modules receive row-centered gradients, causing Muon to consider only centered directions; see § 6. It nevertheless illustrates a broader geometric mismatch between RMS bounds and softmax that can produce practical pathologies.

Figure 1 shows that this discrepancy persists under centered perturbations. Unlike the preceding example, all three cases share the same initial distribution and use centered perturbations satisfying a common RMS bound. The blue and purple updates have equal RMS, yet the blue perturbation substantially reshapes the distribution while the purple perturbation barely changes it. The red perturbation has half their RMS but still causes a substantial probability redistribution.

Figure 1. A common RMS bound permits very different changes in softmax probabilities. All cases share the same centered z∈R32z \in\mathbb{R}^{32} and initial distribution p=softmax⁡(z)p = \operatorname{softmax}(z). The centered perturbations produce q=softmax⁡(z+Δz)q = \operatorname{softmax}(z + \Delta z) and all satisfy RMS⁡(Δz)≤1\operatorname{RMS}(\Delta z) \le1. The pairs (RMS⁡(Δz),H(p,q))(\operatorname{RMS}(\Delta z), \mathcal{H}(p,q)) are (1,4)(1,4) for blue, (1,2)(1,2) for purple, and (1/2,4)(1/2,4) for red, where H\mathcal{H} denotes Hilbert distance. Blue substantially reshapes the distribution, while purple barely changes it. Red matches blue’s Hilbert distance at half its RMS.

This mismatch compels direct control of the output distribution. Designing an effective update rule for softmax modules requires choosing a suitable metric on the output distribution and formulating the induced steepest descent problem. This raises a fundamental question:

What is the appropriate metric for perturbations of the softmax probabilities?

Hilbert geometry of softmax

We turn to Hilbert’s projective metric, or simply Hilbert distance [5, 9]. For strictly positive vectors x,y∈R>0nx, y \in\mathbb{R}_{>0}^{n}, it is defined by H(x,y)=log⁡max⁡ixi/yimin⁡jxj/yj\mathcal{H}(x,y) = \log\frac{\max_i x_i/y_i}{\min_j x_j/y_j}. We apply this metric to strictly positive probability distributions on the simplex P={x∈R>0n:∑ixi=1}\mathcal{P} = \{x \in\mathbb{R}_{>0}^{n} : \sum_i x_i = 1\} [20, 21]. For p,q∈Pp, q \in\mathcal{P}, Hilbert distance can equivalently be written as

H(p,q)=max⁡i,j∣log⁡qi/qjpi/pj∣.(2)\mathcal{H}(p,q) = \max_{i,j} \left| \log\frac{q_i/q_j}{p_i/p_j} \right|. \tag*{(2)}

Thus, Hilbert distance measures the largest change in pairwise odds.

Hilbert’s projective metric has several useful geometric properties on positive cones and probability simplices [18, 22]. Bounding the Hilbert distance directly controls the change in cross-entropy loss and limits probability redistribution in total variation. For softmax, the distance also admits a closed-form expression in terms of the preactivation update: it coincides with the range between the largest and smallest coordinates (the variation seminorm). Consequently, uniform shifts leave the distance invariant, mirroring the translation invariance of the softmax itself. Motivated by these geometric properties, we adopt the Hilbert distance to quantify changes in output distributions and formulate the resulting steepest descent problem.

Hilbert distance bounds pairwise odds ratios. Throughout, let z∈Rnz \in\mathbb{R}^{n} denote the preactivation supplied to softmax, and let p=softmax⁡(z)p = \operatorname{softmax}(z) be the resulting output distribution. A perturbation Δz\Delta z produces the updated distribution q=softmax⁡(z+Δz)q = \operatorname{softmax}(z + \Delta z). By Equation (2), bounding Hilbert distance uniformly bounds the odds ratio for every pair of outcomes:

H(p,q)≤ε⟺e−ε≤qi/qjpi/pj≤eε∀i,j.\mathcal{H}(p,q) \le\varepsilon\quad\Longleftrightarrow\quad e^{-\varepsilon} \le\frac{q_i/q_j}{p_i/p_j} \le e^{\varepsilon} \quad\forall i,j.

In particular, for softmax, Hilbert distance has the closed form

H(softmax⁡(z),softmax⁡(z+Δz))=max⁡i,j∣Δzi−Δzj∣=max⁡iΔzi−min⁡iΔzi=∥Δz∥var.(3)\mathcal{H}\bigl(\operatorname{softmax}(z),\operatorname{softmax}(z+\Delta z)\bigr) = \max_{i,j} \lvert\Delta z_i-\Delta z_j\rvert= \max_i \Delta z_i-\min_i \Delta z_i = \lVert\Delta z\rVert_{\mathrm{var}}. \tag*{(3)}

The variation seminorm ∥Δz∥var\lVert\Delta z\rVert_{\mathrm{var}}, also called the oscillation osc⁡(Δz)\operatorname{osc}(\Delta z), is the difference between the largest and smallest entries of Δz\Delta z. It vanishes precisely when Δz\Delta z is constant, matching the translation invariance of softmax.

Hilbert distance bounds probability redistribution. Bounding pairwise odds ratios also limits the redistribution of probability mass. We measure this redistribution using total variation,

TV⁡(p,q)=12∑i∣pi−qi∣=max⁡A⊆{1,…,n}∣∑i∈A(pi−qi)∣.\operatorname{TV}(p,q)=\frac{1}{2}\sum_i\lvert p_i-q_i\rvert=\max_{A\subseteq\{1,\ldots,n\}}\left\lvert\sum_{i\in A}(p_i-q_i)\right\rvert.

Thus, TV⁡(p,q)≤δ\operatorname{TV}(p,q)\le\delta guarantees that no set of outcomes can gain or lose more than δ\delta probability mass. Hilbert distance gives a sharp bound on total variation [7 Theorem 5.1],

TV⁡(p,q)≤tanh⁡(H(p,q)4).\operatorname{TV}(p,q)\le\tanh\left(\frac{\mathcal{H}(p,q)}{4}\right).

The bound is sharp even when the preactivation perturbation is fixed. For every Δz∈Rn\Delta z\in\mathbb{R}^{n},

sup⁡z∈RnTV⁡(softmax⁡(z),softmax⁡(z+Δz))=tanh⁡(∥Δz∥var4).\sup_{z\in\mathbb{R}^{n}}\operatorname{TV}\bigl(\operatorname{softmax}(z),\operatorname{softmax}(z+\Delta z)\bigr)=\tanh\left(\frac{\lVert\Delta z\rVert_{\mathrm{var}}}{4}\right).

The variation seminorm therefore determines the largest probability redistribution that a given preactivation update can produce across all starting distributions. Appendix § 14.§ 2 proves this sharpness statement.

Hilbert distance bounds change in cross-entropy (CE) loss. Let pp and qq be the prediction distributions before and after an update. For a target outcome ii, the CE loss is ℓi(p)=−log⁡pi\ell_i(p)=-\log p_i, so its change is Δℓi=ℓi(q)−ℓi(p)=log⁡piqi\Delta\ell_i=\ell_i(q)-\ell_i(p)=\log\frac{p_i}{q_i}. Hilbert distance is the range of these changes, H(p,q)=max⁡iΔℓi−min⁡iΔℓi\mathcal{H}(p,q)=\max_i\Delta\ell_i-\min_i\Delta\ell_i. It therefore measures how differently the update affects the loss across possible targets. Moreover, ∑ipi=∑iqi=1\sum_i p_i=\sum_i q_i=1 implies min⁡ipiqi≤1≤max⁡ipiqi\min_i\frac{p_i}{q_i}\le1\le\max_i\frac{p_i}{q_i}. Taking logarithms gives min⁡iΔℓi≤0≤max⁡iΔℓi\min_i\Delta\ell_i\le0\le\max_i\Delta\ell_i. Consequently, H(p,q)≤ε\mathcal{H}(p,q)\le\varepsilon guarantees that the change in CE loss is at most ε\varepsilon,

∣Δℓi∣≤max⁡jΔℓj−min⁡jΔℓj≤H(p,q)∀i.\lvert\Delta\ell_i\rvert\le\max_j\Delta\ell_j-\min_j\Delta\ell_j\le\mathcal{H}(p,q)\quad\forall i.

Steepest descent problem. Together, these results show that Hilbert distance controls pairwise odds, probability redistribution, and changes in cross-entropy loss. Having established these properties, we now formulate the steepest descent problem using Hilbert distance to measure the size of an update. We return to Equation (1) and express the update constraint in terms of this distance. Let WW denote the module’s parameters and let pW(x)p_W(x) be the output distribution produced at input xx. An update ΔW\Delta W changes this distribution from pW(x)p_W(x) to pW+ΔW(x)p_{W+\Delta W}(x). Requiring these distributions to remain within Hilbert distance ε\varepsilon for every input in a prescribed set X\mathcal{X} gives

min⁡ΔW⟨∇WL,ΔW⟩Fsubject tosup⁡x∈XH(pW(x),pW+ΔW(x))≤ε.(4)\min_{\Delta W} \langle\nabla_W \mathcal{L}, \Delta W \rangle_F \qquad\text{subject to} \qquad\sup_{x \in\mathcal{X}} \mathcal{H}\left(p_W(x),p_{W+\Delta W}(x)\right) \le\varepsilon. \tag*{(4)}

The LM Head

For the LM head, bounding Hilbert distance over the hidden state space is equivalent to bounding the diameter of the update rows. The resulting steepest descent problem has an exact dual whose size grows quadratically with the vocabulary. A tighter common-ball approximation avoids this coupling and leads to RowNorm in closed form.

We first specialize Equation (4) to the LM head. For a hidden state h∈Rdh \in\mathbb{R}^d, the LM head produces the logit vector z=Wh∈RVz = Wh \in\mathbb{R}^V and the token distribution p=softmax⁡(z)p = \operatorname{softmax}(z). We consider an untied head without bias, trained with CE and no other loss term depending on WW. Throughout this section, we compare the head before and after an update at the same hidden state.

Hilbert distance induces a row diameter constraint. Let ΔW\Delta W be a weight update with rows Δwi⊤\Delta w_i^\top. The update changes the logit for token ii by Δwi⊤h\Delta w_i^\top h. For two tokens ii and jj, their logit difference therefore changes by (Δwi−Δwj)⊤h(\Delta w_i-\Delta w_j)^\top h. Equation (3) gives

H(pW(h),pW+ΔW(h))=∥ΔWh∥var=max⁡i,j∣(Δwi−Δwj)⊤h∣.\mathcal{H}\left(p_W(h),p_{W+\Delta W}(h)\right)=\lVert\Delta W h\rVert_{\mathrm{var}}=\max_{i,j}\left|(\Delta w_i-\Delta w_j)^\top h\right|.

For a fixed pair of rows, the largest value of this inner product over ∥h∥2≤R\lVert h\rVert_2 \le R is R∥Δwi−Δwj∥2R\lVert\Delta w_i-\Delta w_j\rVert_2. Taking the largest value over all row pairs gives

sup⁡∥h∥2≤RH(pW(h),pW+ΔW(h))=Rmax⁡i,j∥Δwi−Δwj∥2=RD(ΔW).(5)\sup_{\lVert h\rVert_2\le R}\mathcal{H}\left(p_W(h),p_{W+\Delta W}(h)\right)=R\max_{i,j}\lVert\Delta w_i-\Delta w_j\rVert_2=R D(\Delta W). \tag*{(5)}

The maximum pairwise distance is precisely the diameter D(ΔW)D(\Delta W) of the row cloud {Δw1,…,ΔwV}\{\Delta w_1,\ldots,\Delta w_V\} ([25 Definition 3.9]). For this input ball, the general constraint therefore specializes to DW(ΔW)=RD(ΔW)D_W(\Delta W)=R D(\Delta W). Choosing R=dR=\sqrt{d} gives the RMS unit ball. Thus, requiring a Hilbert distance of at most ε\varepsilon throughout this ball is equivalent to imposing D(ΔW)≤ρheadD(\Delta W)\le\rho_{\mathrm{head}}, where ρhead=ε/R\rho_{\mathrm{head}}=\varepsilon/R.

This single constraint on the update rows controls both the predicted distribution and the cross-entropy loss. By § 3, no group of tokens can gain or lose more than tanh⁡(ε/4)\tanh(\varepsilon/4) probability mass, and the CE loss changes by at most ε\varepsilon for any target token.

Steepest descent under the row diameter constraint. We seek the update with the greatest first-order loss decrease under the row diameter bound. Let G=∇WLG=\nabla_W\mathcal{L} have rows gi⊤g_i^\top. Using the row diameter constraint in Equation (5), we obtain

min⁡ΔW⟨G,ΔW⟩Fsubject toD(ΔW)≤ρhead.(6)\min_{\Delta W}\langle G,\Delta W\rangle_F \qquad\text{subject to} \qquad D(\Delta W)\le\rho_{\mathrm{head}}. \tag*{(6)}

Since the loss depends on WW only through the softmax output, its gradient satisfies 1⊤G=0\mathbf{1}^\top G=0. Adding the same vector to every update row produces a common shift of the logits and therefore leaves both the output distribution and the loss unchanged. Because pairwise row differences are also unchanged, the diameter constraint places no restriction on the common translation of the update rows.

Appendix § 14.§ 3 gives an exact dual characterization of this problem. The dual is a vector-valued optimal transport problem ([6]). In our setting, this transport problem introduces a dd-dimensional flow variable for each of the (V2)\binom{V}{2} token pairs. This quadratic growth with vocabulary size makes solving the flow problem computationally expensive. We proceed on a quest to find a cheaper approximation.

A common-ball approximation leads to RowNorm. We ask for a tighter constraint, requiring all update rows to lie in a common closed Euclidean ball B(ζ,ρhead/2)\mathcal{B}(\zeta,\rho_{\mathrm{head}}/2). With this restriction, Equation (6) becomes

min⁡ΔW,ζ⟨G,ΔW⟩Fsubject toΔwi∈B(ζ,ρhead/2)∀i.(7)\min_{\Delta W,\zeta}\langle G,\Delta W\rangle_F \qquad\text{subject to}\qquad\Delta w_i\in\mathcal{B}(\zeta,\rho_{\mathrm{head}}/2)\quad\forall i. \tag*{(7)}

Since the gradient rows sum to zero, translating every update row by the same vector leaves the objective unchanged. Using this freedom, we invoke a change of variable ΔW^=ΔW−1ζT\widehat{\Delta W}=\Delta W-\mathbf{1}\zeta^{\mathsf{T}}, which expresses each row relative to the ball’s center. Each row Δw^i\widehat{\Delta w}_i then lies in B(0,ρhead/2)\mathcal{B}(0,\rho_{\mathrm{head}}/2). Equation (7) therefore has the same minimum as

min⁡ΔW^⟨G,ΔW^⟩Fsubject toΔw^i∈B(0,ρhead/2)∀i.(8)\min_{\widehat{\Delta W}}\langle G,\widehat{\Delta W}\rangle_F \qquad\text{subject to}\qquad\widehat{\Delta w}_i\in\mathcal{B}(0,\rho_{\mathrm{head}}/2)\quad\forall i. \tag*{(8)}

Conversely, any ΔW^\widehat{\Delta W} satisfying this constraint gives a feasible common-ball update by choosing ΔW=ΔW^\Delta W=\widehat{\Delta W} and ζ=0\zeta=0.

A natural curiosity would be the suboptimality gap introduced by the tighter ball constraint. Let Δ⋆\Delta_\star and Δball\Delta_{\mathrm{ball}} denote the greatest first-order decreases under the diameter and common-ball constraints, respectively. These are the negatives of the minimum objective values in Equations (6) and (7). For G≠0G\ne0 and ρhead>0\rho_{\mathrm{head}}>0, let k=rank⁡(G)k=\operatorname{rank}(G). Jung’s theorem [13] bounds the radius needed to enclose a set of rows with a given diameter. Applying it to the two optimization problems bounds the relative suboptimality gap by

0≤Δ⋆−ΔballΔ⋆≤1−k+12k.(9)0\le\frac{\Delta_\star-\Delta_{\mathrm{ball}}}{\Delta_\star}\le1-\sqrt{\frac{k+1}{2k}}. \tag*{(9)}

The bound is sharp. Appendix § 14.§ 4 provides its proof and elaborates on the equivalence brought about by the change of variable.

To find an update with this guarantee, we solve Equation (8) one row at a time. Each row has its own constraint and contributes independently to the objective. For a feasible row Δw^i\widehat{\Delta w}_i, the Cauchy–Schwarz inequality and the radius constraint give

⟨gi,Δw^i⟩≥−∥gi∥2∥Δw^i∥2≥−ρhead2∥gi∥2.\langle g_i,\widehat{\Delta w}_i\rangle\ge-\lVert g_i\rVert_2\lVert\widehat{\Delta w}_i\rVert_2\ge-\frac{\rho_{\mathrm{head}}}{2}\lVert g_i\rVert_2.

For gi≠0g_i\ne0, equality is attained by choosing Δw^i\widehat{\Delta w}_i opposite to gig_i with norm ρhead/2\rho_{\mathrm{head}}/2. For a zero gradient row, we choose Δw^i=0\widehat{\Delta w}_i=0. Let RN normalize each nonzero row to unit Euclidean norm and leave zero rows unchanged. Choosing ΔW=ΔW^\Delta W=\widehat{\Delta W} and ζ=0\zeta=0, we obtain one minimizing update for the common-ball problem,

ΔWRN=−ρhead2RN⁡(G).(10)\Delta W_{\mathrm{RN}}=-\frac{\rho_{\mathrm{head}}}{2}\operatorname{RN}(G). \tag*{(10)}

This update is feasible for the original diameter problem and attains the common-ball optimum. Its first-order decrease is Δball\Delta_{\mathrm{ball}}, so Equation (9) applies directly to RowNorm.

A practical version subtracts the mean row from ΔWRN\Delta W_{\mathrm{RN}} to obtain projected RowNorm. This common translation preserves the objective, the row diameter, and the output probabilities. Our Hilbert distance argument therefore independently recovers the direction derived by Lau & Su [17] from the symmetries of the LM head. Appendix § 14.§ 5 gives an implementation with momentum and numerical stabilization.

The attention module

We extend our principle from the LM head to attention. Attention presents a more intricate setting: its softmax probabilities arise from bilinear scores that jointly depend on the query and key weights. Bounding the Hilbert distance between attention distributions leads us to the QK constraint underlying Compositional Muon.

Attention distributions. Attention uses softmax to distribute probability across the positions visible to each query. We study how this distribution changes when the query and key weights are updated, holding the input hidden states h1,…,hT∈Rdh_1,\ldots,h_T \in\mathbb{R}^d fixed. For a single head with query and key dimension dhd_h, the weights WQ,WK∈Rd×dhW_Q,W_K \in\mathbb{R}^{d\times d_h} determine the attention scores through

M=WQWKT∈Rd×d,sij=hiTMhjdh.M = W_QW_K^\mathsf{T} \in\mathbb{R}^{d\times d}, \qquad s_{ij} = \frac{h_i^\mathsf{T}Mh_j}{\sqrt{d_h}}.

We consider scaled dot-product attention without rotary position transforms or query–key normalization. Under causal masking, let pijp_{ij} denote the probability assigned by query ii to position j∈Ji={1,…,i}j \in\mathcal{J}_i = \{1,\ldots,i\}. We measure Hilbert distance on this visible set, where all probabilities are positive.

Hilbert distance bounds changes in score differences. Let ΔM\Delta M denote the change in the QK product, so that the updated product is M+ΔMM+\Delta M. At position ii, write pi=(pij)j∈Jip_i=(p_{ij})_{j\in\mathcal{J}_i} for the original attention distribution and pi+p_i^+ for the distribution after this change. Holding the hidden states fixed, the score sijs_{ij} changes by

Δsij=hiT(M+ΔM)hj−hiTMhjdh=hiTΔMhjdh.\Delta s_{ij} = \frac{h_i^\mathsf{T}(M+\Delta M)h_j-h_i^\mathsf{T}Mh_j}{\sqrt{d_h}} = \frac{h_i^\mathsf{T}\Delta Mh_j}{\sqrt{d_h}}.

Within row ii, the score difference between positions jj and kk therefore changes by hiTΔM(hj−hk)/dhh_i^\mathsf{T}\Delta M(h_j-h_k)/\sqrt{d_h}. Applying Equation (3) within each attention row gives

H(pi,pi+)=max⁡j,k∈Ji∣Δsij−Δsik∣=1dhmax⁡j,k∈Ji∣hiTΔM(hj−hk)∣.(11)\mathcal{H}(p_i,p_i^+) = \max_{j,k\in\mathcal{J}_i} \left|\Delta s_{ij}-\Delta s_{ik}\right| = \frac{1}{\sqrt{d_h}}\max_{j,k\in\mathcal{J}_i}\left|h_i^\mathsf{T}\Delta M(h_j-h_k)\right|. \tag*{(11)}

Intuitively, the probability constraint, specific to the attention mechanism, asks how much an update can change a query’s preference between two keys.

The induced spectral norm constraint. Assume that every hidden state satisfies ∥hℓ∥2≤R\lVert h_\ell\rVert_2 \le R, with R=dR=\sqrt{d} corresponding to the RMS unit ball. The hidden state hih_i has norm at most RR, while the difference hj−hkh_j-h_k has norm at most 2R2R. Consequently, ∣hiTΔM(hj−hk)∣≤∥hi∥2∥ΔM∥op∥hj−hk∥2≤2R2∥ΔM∥op\left|h_i^\mathsf{T}\Delta M(h_j-h_k)\right| \le\lVert h_i\rVert_2\lVert\Delta M\rVert_{\mathrm{op}}\lVert h_j-h_k\rVert_2 \le2R^2\lVert\Delta M\rVert_{\mathrm{op}}.

For causal sequences with T≥3T\ge3, the worst-case Hilbert distance over this input set is

sup⁡∥hℓ∥2≤R1≤ℓ≤Tmax⁡1≤i≤TH(pi,pi+)=2R2dh∥ΔM∥op.(12)\sup_{\substack{\lVert h_\ell\rVert_2\le R\\1\le\ell\le T}}\max_{1\le i\le T}\mathcal{H}(p_i,p_i^+) = \frac{2R^2}{\sqrt{d_h}}\lVert\Delta M\rVert_{\mathrm{op}}. \tag*{(12)}

Requiring a Hilbert distance of at most ε\varepsilon for every attention row throughout this input set is therefore equivalent to

∥ΔM∥op≤ρQK,ρQK=εdh2R2.(13)\lVert\Delta M\rVert_{\mathrm{op}} \le\rho_{\mathrm{QK}}, \qquad\rho_{\mathrm{QK}} = \frac{\varepsilon\sqrt{d_h}}{2R^2}. \tag*{(13)}

Why does the same Hilbert distance principle give a row diameter for the LM head and a spectral norm for attention? In the LM head, each comparison involves a single hidden state, whereas attention involves a query input and a difference between key inputs. Under the stated norm bounds, these two vectors can be aligned independently to attain the spectral norm of ΔM\Delta M. The bound is attained when hih_i is RR times a unit leading left singular vector of ΔM\Delta M, and hj−hkh_j-h_k is 2R2R times the corresponding unit right singular vector.

Steepest descent over query and key updates. Let ΔWQ\Delta W_Q and ΔWK\Delta W_K denote updates to the query and key weights WQW_Q and WKW_K, respectively. Expanding the updated product gives

ΔM=(WQ+ΔWQ)(WK+ΔWK)T−WQWKT=ΔWQWKT+WQΔWKT+ΔWQΔWKT⏟ΔMmin.\Delta M = (W_Q+\Delta W_Q)(W_K+\Delta W_K)^\mathsf{T}-W_QW_K^\mathsf{T} = \Delta W_QW_K^\mathsf{T}+W_Q\Delta W_K^\mathsf{T}+\underbrace{\Delta W_Q\Delta W_K^\mathsf{T}}_{\Delta M_{\mathrm{min}}}.

The first two terms give the first-order change ΔMlin(ΔWQ,ΔWK)\Delta M_{\mathrm{lin}}(\Delta W_Q,\Delta W_K), while ΔWQΔWKT\Delta W_Q\Delta W_K^\mathsf{T} is second order in the updates and is therefore omitted. Applying Equation (13) to this first-order change gives

∥ΔWQWKT+WQΔWKT∥op≤ρQK.\left\lVert\Delta W_QW_K^\mathsf{T}+W_Q\Delta W_K^\mathsf{T}\right\rVert_{\mathrm{op}} \le\rho_{\mathrm{QK}}.

We assume that these weights affect the loss only through the attention probabilities. Write GQ=∇WQLG_Q = \nabla_{W_Q} \mathcal{L} and GK=∇WKLG_K = \nabla_{W_K} \mathcal{L} for their gradients. Constructing our steepest descent problem under this Hilbert distance bound, we obtain

min⁡ΔWQ,ΔWK⟨GQ,ΔWQ⟩F+⟨GK,ΔWK⟩Fsubject to∥ΔWQWKT+WQΔWKT∥op≤ρQK.(14)\begin{aligned} \min_{\Delta W_Q,\Delta W_K}\quad&\langle G_Q,\Delta W_Q\rangle_F+\langle G_K,\Delta W_K\rangle_F\\ \text{subject to}\quad&\left\|\Delta W_QW_K^{\mathsf{T}}+W_Q\Delta W_K^{\mathsf{T}}\right\|_{\mathrm{op}}\leq\rho_{QK}. \tag*{(14)} \end{aligned}

Equation 14 is precisely the first-order QK steepest descent problem posed by Keigwin et al. [14]. Their derivation controls changes in the composed bilinear map through the spectral norm of its first-order perturbation. Our starting point is a bound on the Hilbert distance between attention distributions. Translating this probability bound through softmax and the bilinear scores recovers the same constraint on the first-order QK product change. Our Hilbert distance derivation therefore provides a natural prelude to Compositional Muon, motivating its QK constraint through the stability of the attention distributions.

The LM head and attention affect optimization through both forward probability distributions and the gradients propagated to the hidden states. Our main analysis bounds changes in the former and derives the corresponding steepest descent problems. Holding the inputs and incoming gradients fixed, Appendix § 15 bounds the resulting perturbations of the latter.

Discussion

Can Muon be adapted to softmax simply by removing the common shifts that softmax ignores? Because softmax is invariant to common shifts, one might try adapting Muon by centering the update rows before measuring their spectral norm. We show that the resulting steepest descent problem has the same minimum and that the Muon update is already row centered. Translation symmetry alone therefore does not alter Muon, motivating the stronger relative control provided by Hilbert distance.

Centering leaves Muon unchanged. Consider a linear module with nn outputs and a parameter matrix whose influence on the loss is entirely through the softmax output distribution. Let P=In−11T/nP = I_n - \mathbf{1}\mathbf{1}^{\mathsf{T}}/n denote the orthogonal projection that subtracts the mean row. Since gradient rows sum to zero, PG=GPG = G. Since PP is an orthogonal projection, ∥PΔW∥op≤∥P∥op∥ΔW∥op≤∥ΔW∥op\|P\Delta W\|_{\mathrm{op}} \leq\|P\|_{\mathrm{op}}\|\Delta W\|_{\mathrm{op}} \leq\|\Delta W\|_{\mathrm{op}}. Thus, every update satisfying ∥ΔW∥op≤ρ\|\Delta W\|_{\mathrm{op}} \leq\rho also satisfies ∥PΔW∥op≤ρ\|P\Delta W\|_{\mathrm{op}} \leq\rho. Conversely, take any update ΔW\Delta W satisfying ∥PΔW∥op≤ρ\|P\Delta W\|_{\mathrm{op}} \leq\rho. The centered update PΔWP\Delta W has spectral norm at most ρ\rho. It also preserves the objective, since ⟨G,PΔW⟩F=⟨PG,ΔW⟩F=⟨G,ΔW⟩F\langle G,P\Delta W\rangle_F = \langle PG,\Delta W\rangle_F = \langle G,\Delta W\rangle_F. The additional freedom therefore leaves the minimum unchanged,

min⁡∥PΔW∥op≤ρ⟨G,ΔW⟩F=min⁡∥ΔW∥op≤ρ⟨G,ΔW⟩F.\min_{\|P\Delta W\|_{\mathrm{op}}\leq\rho}\langle G,\Delta W\rangle_F = \min_{\|\Delta W\|_{\mathrm{op}}\leq\rho}\langle G,\Delta W\rangle_F.

The Muon update is already centered. Indeed, if G=AΣBTG = A\Sigma B^{\mathsf{T}} is the compact SVD of a nonzero gradient, then every left singular vector satisfies 1Taj=(1TGbj)/σj=0\mathbf{1}^{\mathsf{T}}a_j = (\mathbf{1}^{\mathsf{T}}G b_j)/\sigma_j = 0, giving

ΔWMuon=−ρABT,PΔWMuon=−ρ(PA)BT=ΔWMuon.\Delta W_{\mathrm{Muon}}=-\rho AB^{\mathsf{T}},\qquad P\Delta W_{\mathrm{Muon}}=-\rho(PA)B^{\mathsf{T}}=\Delta W_{\mathrm{Muon}}.

Accounting for translation symmetry alone therefore recovers the standard Muon solution. Our Hilbert distance approach goes further by bounding the largest change in the difference between any two preactivation coordinates. For a centered preactivation perturbation Δz∈Rn\Delta z \in\mathbb{R}^n, with p=softmax⁡(z)p = \operatorname{softmax}(z) and q=softmax⁡(z+Δz)q = \operatorname{softmax}(z+\Delta z), we have 2∥Δz∥RMS≤H(p,q)≤2n ∥Δz∥RMS2\|\Delta z\|_{\mathrm{RMS}} \leq\mathcal{H}(p,q) \leq\sqrt{2n}\,\|\Delta z\|_{\mathrm{RMS}}. Since the upper bound is sharp, a fixed bound on centered RMS permits Hilbert distance to grow with the output width. Appendix § 14.§ 1 proves these bounds and discusses their sharpness.

Limitations. The main objective of this work is to provide a unifying mathematical foundation for softmax modules. Through Hilbert distance, we independently recover RowNorm for the LM head and the first-order QK constraint underlying Compositional Muon. These mathematical connections naturally raise the question of what this perspective offers in practice. We leave that question to future experimental work and make no empirical claim of improved training speed or final model quality. The work of Lau & Su [17] on RowNorm and that of Keigwin et al. [14] on Compositional Muon report improvements in language-model pretraining and include ablations of their optimizer choices. These experiments provide existing empirical evidence for the practical relevance of the methods connected by our framework.

A second limitation arises from the relative nature of Hilbert distance. Because it controls pairwise odds, it can be sensitive to large relative changes in low probability outcomes even when little probability mass moves. For example, suppose an update raises the probability of one outcome from 10−910^{-9} to 10−610^{-6} while leaving the rest of the distribution nearly unchanged. The probability of this outcome increases by a factor of 1000, producing a large Hilbert distance despite the small movement of probability mass, TV⁡(p,q)=9.99×10−7\operatorname{TV}(p, q) = 9.99 \times10^{-7}, H(p,q)≈6.91\mathcal{H}(p, q) \approx6.91. A small Hilbert distance constraint can therefore exclude updates that move very little probability mass. Future work could investigate metrics that preserve the useful guarantees developed here while being less sensitive to low probability outcomes.

Related work

From Adam to module specific optimizers. Adam has long served as the default optimizer across deep learning [15]. Muon has recently challenged this convention [12]. For a linear layer, Muon controls the worst-case change in its output as measured by RMS, resulting in a bound on the spectral norm of the weight update. The resulting steepest descent problem forms the mathematical foundation of the Muon update [2]. The Modula project generalizes this perspective and advocates constructing optimizers whose geometry reflects the function of each module [3, 16]. Modular duality and Scion provide systematic ways to construct updates from such geometries [4, 23]. We extend this principle to modules involving softmax.

Geometry on probability distributions. A related line of work connects parameter updates to the probability distributions they induce. Natural gradient equips a family of probability distributions with the Fisher geometry and chooses updates according to the resulting notion of steepest descent [1, 19]. TRPO makes this connection explicit by constraining the expected KL divergence between the action distributions induced by the original and updated policies [26]. Hilbert’s projective metric offers a different geometry for positive vectors. Beginning with the contraction theory of positive operators, this geometry has subsequently appeared in matrix scaling, clustering, nonlinear embeddings, and the study of probability simplices [5, 9, 8, 20, 21]. More recently, (Coheh & Fausti, 2024) established a sharp relationship between Hilbert distance and total variation. We draw on this literature to study the parameter geometry induced by Hilbert distance on the probability distributions produced by softmax.

Optimizers for the LM head and attention. The LM head and attention have each motivated specialized optimization methods. For the LM head, Scion [23] includes RowNorm and SCALE [10] proposes a momentum-based variant; Lau & Su (2026) derive projected RowNorm from its permutation and shared-shift symmetries. Attention has motivated a different collection of interventions. Query and key normalization controls the scale of attention scores, while spectral reparameterization addresses attention entropy collapse [11, 29]. MuonClip monitors the maximum attention logits and conditionally rescales the query and key projection weights after a Muon update [27]. Compositional Muon goes further by constraining the first-order change in the product of the query and key matrices [14]. Although row normalization for the LM head and product control for attention appear to be independent design choices, we show that they share common ground in bounding changes in the probability distributions produced by softmax.

Conclusion

We develop a unified framework for optimizing composed softmax modules by bounding changes in their output probabilities and deriving the corresponding parameter constraints. This addresses a limitation of Muon’s RMS control, which can conceal substantial probability redistribution when applied to the intermediate linear output. We propose using Hilbert distance to constrain these changes in the output distribution directly. Hilbert distance respects the common-shift invariance of softmax and controls both the redistribution of probability mass and changes in cross-entropy loss. Its representation as the variation seminorm of the preactivation perturbation lets us translate a common constraint on the output distribution into a parameter geometry for each module. For the LM head, this gives a row diameter constraint. A tighter ball approximation leads to RowNorm, with centering giving its projected form. For attention, the same principle recovers the first-order QK steepest descent problem underlying Compositional Muon. A single probability constraint thus connects the separately developed RowNorm update and Compositional Muon’s QK optimization problem. We offer this framework as a contribution to the broader Modula perspective, demonstrating how the output geometry of composed softmax modules can guide optimizer design. We hope these connections spark new ideas for optimizers and architectures built around composed modules. Hilbert distance provides a starting point for softmax, and we encourage researchers to ask which output geometries could play that role for other compositions.

AI Use Statement

The idea of bounding changes in softmax output probabilities originated with the authors. The choice of Hilbert distance was found by studying many existing distances in the literature. AI-assisted mathematical exploration also informed the selection of Hilbert distance. AI tools were extensively used to survey literature, identify related work, check mathematical arguments, and verify correctness. In particular, the authors initially obtained a weaker approximation bound for RowNorm relative to the diameter-constrained optimum. AI tools subsequently identified Jung’s theorem and its applicability in tightening this bound.

The initial manuscript was written by the authors. AI tools were subsequently used to improve wording, technical exposition, and presentation, and to provide critical feedback on the manuscript. The authors reviewed all AI assisted editorial changes before incorporating them. We, the authors, take responsibility for the final content of the paper, including its mathematical claims, proofs, and references.

Ethics Statement

This work develops a unified framework for optimizing modules which involve softmax. The research presented here does not involve human participants, personal data, or the collection or release of datasets. The framework is general purpose, and all ethical considerations in downstream applications depend on the training data, models, and deployment contexts in which it is used.

Reproducibility Statement

The assumptions underlying our theoretical results are stated alongside the derivations in the main text. Appendix § 14 provides the sharpness argument for the total variation bound, the exact dual formulation of the diameter-constrained problem, and the proof of the sharp RowNorm approximation guarantee. Appendix § 15 derives the forward and backward perturbation bounds for the LM head and attention. Appendix § 14.§ 5 specifies the practical RowNorm update, including centering, momentum, and numerical stabilization. To reproduce Figure 1, Appendix § 16 gives deterministic formulas for the initial logits and all three updates, together with their RMS norms, Hilbert distances, and total variation values.

Author Contributions

If you’d like to, you may include a section for author contributions as is done in many journals. This is optional and at the discretion of the authors.

Acknowledgments

Use unnumbered third level headings for the acknowledgments. All acknowledgments, including those to funding agencies, go at the end of the paper.

Proofs and further connections

Comparing centered RMS and Hilbert distance

This subsection proves the comparison used in § 6. For centered preactivation perturbations, Hilbert distance bounds RMS independently of the output width, whereas the reverse bound necessarily grows with the width.

Let z∈Rnz \in\mathbb{R}^{n} be a preactivation vector and let Δz∈Rn\Delta z \in\mathbb{R}^{n} satisfy 1TΔz=0\mathbf{1}^{\mathsf{T}}\Delta z = 0. Define p=softmax⁡(z)p = \operatorname{softmax}(z), q=softmax⁡(z+Δz)q = \operatorname{softmax}(z + \Delta z), and ∥Δz∥RMS=∥Δz∥2/n\lVert\Delta z \rVert_{\mathrm{RMS}} = \lVert\Delta z \rVert_{2} / \sqrt{n}. We prove

2∥Δz∥RMS≤H(p,q)≤2n ∥Δz∥RMS.(15)2\lVert\Delta z \rVert_{\mathrm{RMS}} \leq\mathcal{H}(p,q) \leq\sqrt{2n}\,\lVert\Delta z \rVert_{\mathrm{RMS}}. \tag*{(15)}

The softmax identity gives H(p,q)=max⁡i,j∣Δzi−Δzj∣\mathcal{H}(p,q)=\max_{i,j}|\Delta z_i-\Delta z_j|. Applying the Cauchy–Schwarz inequality gives

∣Δzi−Δzj∣≤2Δzi2+Δzj2≤2∑k=1nΔzk2=2n ∥Δz∥RMS,i≠j.|\Delta z_i-\Delta z_j|\le\sqrt{2}\sqrt{\Delta z_i^2+\Delta z_j^2}\le\sqrt{2\sum_{k=1}^{n}\Delta z_k^2}=\sqrt{2n}\,\lVert\Delta z\rVert_{\mathrm{RMS}},\qquad i\ne j.

Taking the maximum over ii and jj proves the upper bound. Equality is attained by Δz=(a,−a,0,…,0)\Delta z=(a,-a,0,\ldots,0) for any a>0a>0, so the factor 2n\sqrt{2n} is sharp.

For the lower bound, let m=min⁡iΔzim=\min_i\Delta z_i, M=max⁡iΔziM=\max_i\Delta z_i, and c=(m+M)/2c=(m+M)/2. Since ∑iΔzi=0\sum_i\Delta z_i=0,

∥Δz∥RMS2≤∥Δz∥RMS2+c2=1n∑i(Δzi−c)2≤max⁡i(Δzi−c)2=(M−m2)2=H(p,q)24.\lVert\Delta z\rVert_{\mathrm{RMS}}^2\le\lVert\Delta z\rVert_{\mathrm{RMS}}^2+c^2=\frac{1}{n}\sum_i(\Delta z_i-c)^2\le\max_i(\Delta z_i-c)^2=\left(\frac{M-m}{2}\right)^2=\frac{\mathcal{H}(p,q)^2}{4}.

Dropping the nonnegative term c2c^2 proves the lower bound. When nn is even, equality is attained by taking half the coordinates equal to aa and half equal to −a-a.

Equation (15) reveals an asymmetry between the two measures. Hilbert distance bounds centered RMS with a constant independent of nn, but a fixed RMS bound permits Hilbert distance to grow as n\sqrt{n}. A similar dependence appears in the standard comparison between the spectral and Frobenius norms: for a matrix AA of rank rr,

∥A∥op≤∥A∥F≤r ∥A∥op.\lVert A\rVert_{\mathrm{op}}\le\lVert A\rVert_F\le\sqrt{r}\,\lVert A\rVert_{\mathrm{op}}.

In both comparisons, an aggregate Euclidean measure can conceal an extremal change whose magnitude grows with dimension or rank. Appendix § 14.§ 2 shows that, for softmax, this separation can persist at the level of the output distribution: centered RMS can vanish while total variation approaches 1/21/2.

Probability redistribution under softmax

This subsection establishes two consequences of the Hilbert geometry developed in the main text. First, we show that the total variation bound is sharp for every fixed preactivation perturbation. We then construct centered perturbations whose RMS tends to zero while their probability redistribution remains bounded away from zero as the output width grows.

The sharp total variation bound. Recall that the variation seminorm is γ=∥Δz∥var=max⁡ℓΔzℓ−min⁡ℓΔzℓ\gamma=\lVert\Delta z\rVert_{\mathrm{var}}=\max_\ell\Delta z_\ell-\min_\ell\Delta z_\ell. For p=softmax⁡(z)p=\operatorname{softmax}(z) and q=softmax⁡(z+Δz)q=\operatorname{softmax}(z+\Delta z), Equation (3) and the sharp bound of Cohen & Fausti [7] give TV⁡(p,q)≤tanh⁡(γ/4)\operatorname{TV}(p,q)\le\tanh(\gamma/4). To approach equality when γ>0\gamma>0, choose i,ji,j with Δzi−Δzj=γ\Delta z_i-\Delta z_j=\gamma and set zi=−γ/2z_i=-\gamma/2, zj=0z_j=0. The difference between these preactivation coordinates therefore changes from −γ/2-\gamma/2 to γ/2\gamma/2. Let all other preactivations tend to −∞-\infty, concentrating both distributions on i,ji,j. The probability gained by coordinate ii then gives

TV⁡(p,q)⟶eγ/21+eγ/2−11+eγ/2=tanh⁡(γ4).\operatorname{TV}(p,q)\longrightarrow\frac{e^{\gamma/2}}{1+e^{\gamma/2}}-\frac{1}{1+e^{\gamma/2}}=\tanh\left(\frac{\gamma}{4}\right).

This approaches the upper bound through strictly positive softmax distributions, proving the claimed supremum. For γ=0\gamma=0, the update is a common shift and both sides are zero.

Vanishing RMS with nonvanishing probability redistribution. We now show that centering alone does not make RMS a uniform measure of probability change. Take n≥3n\ge3, initial preactivation vector z=0z=0, and an=log⁡(n−1)a_n=\log(n-1). The initial probabilities and centered update are

p=1n,Δz=an(1−1n,−1n,…,−1n)T,1TΔz=0.p=\frac{1}{n},\qquad\Delta z=a_n\left(1-\frac{1}{n},-\frac{1}{n},\ldots,-\frac{1}{n}\right)^{\mathsf{T}},\qquad\mathbf{1}^{\mathsf{T}}\Delta z=0.

By softmax’s common-shift invariance, q=softmax⁡(Δz)q=\operatorname{softmax}(\Delta z) satisfies

q1=eanean+n−1=12,qi=1ean+n−1=12(n−1)(i>1).q_1=\frac{e^{a_n}}{e^{a_n}+n-1}=\frac{1}{2},\qquad q_i=\frac{1}{e^{a_n}+n-1}=\frac{1}{2(n-1)}\qquad(i>1).

Yet, as n→∞n \to\infty,

∥Δz∥RMS=n−1nlog⁡(n−1)⟶0,TV⁡(p,q)=12−1n⟶12.\lVert\Delta z \rVert_{\mathrm{RMS}} = \frac{\sqrt{n-1}}{n}\log(n-1) \longrightarrow0, \qquad\operatorname{TV}(p,q) = \frac{1}{2} - \frac{1}{n} \longrightarrow\frac{1}{2}.

Even after centering, vanishing RMS does not ensure vanishing probability redistribution uniformly across widths. Meanwhile, H(p,q)=log⁡(n−1)\mathcal{H}(p,q) = \log(n-1) captures the growing relative change.

The exact dual of the diameter constraint

This subsection derives the exact dual of the row diameter problem in Equation (6). The dual represents each gradient row through antisymmetric vectors assigned to pairs of vocabulary rows and minimizes their total Euclidean norm. We first establish the balance constraints and the dual identity, then relate the resulting problem to vector transport.

Let G∈RV×dG \in\mathbb{R}^{V \times d} have rows gi⊤g_i^\top, where V≥2V \ge2 and ∑igi=0\sum_i g_i = 0. For ρhead>0\rho_{\mathrm{head}} > 0, consider

min⁡ΔW⟨G,ΔW⟩Fsubject to∥Δwi−Δwj∥2≤ρhead∀i<j.(16)\min_{\Delta W} \langle G, \Delta W \rangle_F \qquad\text{subject to} \qquad\lVert\Delta w_i - \Delta w_j \rVert_2 \le\rho_{\mathrm{head}} \quad\forall i < j. \tag*{(16)}

Pairwise dual variables. For every pair i<ji < j, introduce a vector φij∈Rd\varphi_{ij} \in\mathbb{R}^d. Extend this collection by setting φji=−φij\varphi_{ji} = -\varphi_{ij} and φii=0\varphi_{ii} = 0. The dual feasibility conditions are

∑j=1Vφij=gi,i=1,…,V.(17)\sum_{j=1}^{V} \varphi_{ij} = g_i, \qquad i = 1,\ldots,V. \tag*{(17)}

Antisymmetry implies

∑i∑jφij=∑i<j(φij+φji)=0.\sum_i \sum_j \varphi_{ij} = \sum_{i<j}(\varphi_{ij}+\varphi_{ji}) = 0.

Hence, the condition ∑igi=0\sum_i g_i = 0 is necessary for Equation (17). It is also sufficient. For example, setting φiV=gi\varphi_{iV} = g_i for i<Vi < V and every other independently indexed variable to zero satisfies all balance equations because gV=−∑i<Vgig_V = -\sum_{i<V} g_i.

The exact dual identity. The primal problem in Equation (16) satisfies

min⁡D(ΔW)≤ρhead⟨G,ΔW⟩F=−ρheadmin⁡φ∑jφij=gi ∀i∑i<j∥φij∥2.(18)\min_{D(\Delta W)\le\rho_{\mathrm{head}}} \langle G, \Delta W \rangle_F = -\rho_{\mathrm{head}} \min_{\substack{\varphi\\ \sum_j \varphi_{ij}=g_i\ \forall i}} \sum_{i<j} \lVert\varphi_{ij} \rVert_2. \tag*{(18)}

Both minima are attained. Consequently, the greatest first order decrease under the diameter constraint is

Δ⋆=ρheadmin⁡φ∑jφij=gi ∀i∑i<j∥φij∥2.\Delta_\star= \rho_{\mathrm{head}} \min_{\substack{\varphi\\ \sum_j \varphi_{ij}=g_i\ \forall i}} \sum_{i<j} \lVert\varphi_{ij} \rVert_2.

Proof. We first establish attainment of the primal minimum. Given any feasible ΔW\Delta W, subtract ΔwV\Delta w_V from every update row. This translation preserves all pairwise differences and changes the objective by

−⟨∑igi,ΔwV⟩=0.-\left\langle\sum_i g_i, \Delta w_V \right\rangle= 0.

We may therefore restrict attention to representatives satisfying ΔwV=0\Delta w_V = 0. Feasibility then gives ∥Δwi∥2≤ρhead\lVert\Delta w_i \rVert_2 \le\rho_{\mathrm{head}} for every i<Vi < V. The resulting feasible set is nonempty and compact, so the continuous objective attains a finite minimum.

To derive the dual, introduce an auxiliary variable ξij\xi_{ij} for each pair i<ji < j and impose

ξij=Δwi−Δwj,∥ξij∥2≤ρhead,i<j.\xi_{ij} = \Delta w_i - \Delta w_j, \qquad\lVert\xi_{ij} \rVert_2 \le\rho_{\mathrm{head}}, \qquad i < j.

Associate the multiplier φij\varphi_{ij} with the equality constraint ξij−Δwi+Δwj=0\xi_{ij} - \Delta w_i + \Delta w_j = 0. The Lagrangian is

Λ(ΔW,ξ,Φ)=⟨G,ΔW⟩F+∑i<j⟨φij,ξij−Δwi+Δwj⟩=∑i=1V⟨gi−∑j=1Vφij,Δwi⟩+∑i<j⟨φij,ξij⟩.\begin{aligned} \Lambda(\Delta W,\xi,\Phi) = \langle G,\Delta W\rangle_F + \sum_{i<j}\langle\varphi_{ij},\xi_{ij}-\Delta w_i+\Delta w_j\rangle\\ &= \sum_{i=1}^{V}\left\langle g_i-\sum_{j=1}^{V}\varphi_{ij},\Delta w_i\right\rangle+ \sum_{i<j}\langle\varphi_{ij},\xi_{ij}\rangle. \end{aligned}

The rows of ΔW\Delta W are unrestricted in the inner minimization. Its infimum is therefore finite only if ∑jφij=gi\sum_j \varphi_{ij}=g_i for all ii. Under these balance equations, the terms containing ΔW\Delta W vanish. Minimizing over the Euclidean balls gives

inf⁡ξ∑i<j⟨φij,ξij⟩=−ρhead∑i<j∥φij∥2,∥ξij∥2≤ρhead  ∀i<j\inf_{\xi} \sum_{i<j}\langle\varphi_{ij},\xi_{ij}\rangle= -\rho_{\mathrm{head}}\sum_{i<j}\|\varphi_{ij}\|_2, \qquad\|\xi_{ij}\|_2\leq\rho_{\mathrm{head}}\ \ \forall i<j

For φij≠0\varphi_{ij}\ne0, the infimum for that pair is attained at

ξij=−ρheadφij∥φij∥2;\xi_{ij}=-\rho_{\mathrm{head}}\frac{\varphi_{ij}}{\|\varphi_{ij}\|_2};

when φij=0\varphi_{ij}=0, any feasible ξij\xi_{ij} is optimal. The Lagrange dual therefore maximizes

−ρhead∑i<j∥φij∥2-\rho_{\mathrm{head}}\sum_{i<j}\|\varphi_{ij}\|_2

subject to Equation (17). Since −ρhead<0-\rho_{\mathrm{head}}<0, this is equivalent to the minimization on the right hand side of Equation (18).

The reformulated primal problem is convex. Moreover, ΔW=0\Delta W=0 and ξij=0\xi_{ij}=0 satisfy every equality constraint and lie strictly inside every Euclidean ball. Slater’s condition therefore gives strong duality and attainment of the dual optimum ([28 Section 5.2.3]). This proves Equation (18). □

Connection to vector transport. Let X={1,…,V}\mathcal{X}=\{1,\ldots,V\} carry the discrete metric d(i,j)=1d(i,j)=1 for i≠ji\ne j, and define the vector measure

μ=∑i=1Vgiδi.\mu=\sum_{i=1}^{V}g_i\delta_i.

The condition ∑igi=0\sum_i g_i=0 gives μ(X)=0\mu(\mathcal{X})=0. Equation (17) represents this measure through an antisymmetric vector flow on the complete graph, with transport cost

∑i<j∥φij∥2.\sum_{i<j}\|\varphi_{ij}\|_2.

The primal variables provide the corresponding Lipschitz functions. In particular, define

ui=−Δwiρhead.u_i=-\frac{\Delta w_i}{\rho_{\mathrm{head}}}.

The diameter constraint implies

∥ui−uj∥2≤1=d(i,j)∀i≠j,\|u_i-u_j\|_2\leq1=d(i,j)\qquad\forall i\ne j,

so u:X→Rdu:\mathcal{X}\to\mathbb{R}^d is 1 Lipschitz. Equation (18) is therefore the finite discrete form of vector transport duality ([6 Theorem 2]).

This dual formulation characterizes the optimal value without requiring the primal minimizer to be unique. It contains one vector in Rd\mathbb{R}^d for each of the (V2)\binom{V}{2} unordered pairs of vocabulary rows. The resulting quadratic growth in the number of dual variables motivates the common ball approximation studied next.

The RowNorm approximation

The main text obtains RowNorm by requiring all update rows to lie in a common ball and then moving that ball to the origin. We first justify why this change of variable preserves the minimum. We then bound the suboptimality introduced by replacing the diameter constraint with the ball constraint.

Centering the enclosing ball preserves the optimum

Fix a gradient G∈RV×dG \in\mathbb{R}^{V \times d} with rows gi⊤g_i^{\top} satisfying ∑igi=0\sum_i g_i = 0, and let ρhead>0\rho_{\mathrm{head}} > 0. Recall that B(ζ,ρhead/2)\mathcal{B}(\zeta, \rho_{\mathrm{head}}/2) denotes the closed Euclidean ball with center ζ\zeta and radius ρhead/2\rho_{\mathrm{head}}/2. In Equation (7), we choose both the update ΔW\Delta W and the center ζ\zeta,

min⁡ΔW,ζ⟨G,ΔW⟩Fsubject toΔwi∈B(ζ,ρhead/2)∀i.\min_{\Delta W,\zeta} \langle G, \Delta W \rangle_F \quad\text{subject to} \quad \Delta w_i \in\mathcal{B}(\zeta, \rho_{\mathrm{head}}/2)\quad\forall i.

Any center that encloses all the update rows is allowed. In particular, the center is not required to equal the mean row, and the mean row remains unrestricted.

Since the gradient rows sum to zero, translating every update row by the same vector leaves the objective unchanged. Using this freedom, we invoke a change of variable

ΔW^=ΔW−1ζ⊤.\widehat{\Delta W} = \Delta W - \mathbf{1}\zeta^{\top}.

For any feasible pair (ΔW,ζ)(\Delta W, \zeta), the translated rows satisfy

∥Δw^i∥2=∥Δwi−ζ∥2≤ρhead2∀i.\lVert\widehat{\Delta w}_i\rVert_2 = \lVert\Delta w_i - \zeta\rVert_2 \le\frac{\rho_{\mathrm{head}}}{2} \quad\forall i.

Thus, every row now lies in a ball centered at the origin. The objective is preserved because

⟨G,ΔW⟩F=⟨G,ΔW^⟩F+⟨∑igi,ζ⟩=⟨G,ΔW^⟩F.\langle G, \Delta W \rangle_F = \langle G, \widehat{\Delta W} \rangle_F + \left\langle\sum_i g_i, \zeta\right\rangle = \langle G, \widehat{\Delta W} \rangle_F.

After this change of variable, neither the row constraints nor the objective depends on ζ\zeta. Equation (7) therefore has the same minimum as

min⁡ΔW^⟨G,ΔW^⟩Fsubject toΔw^i∈B(0,ρhead/2)∀i.\min_{\widehat{\Delta W}} \langle G, \widehat{\Delta W} \rangle_F \quad\text{subject to} \quad \widehat{\Delta w}_i \in\mathcal{B}(0, \rho_{\mathrm{head}}/2) \quad\forall i.

which is Equation (8). To complete the equivalence, we also need to return from this problem to the original one. Given any feasible ΔW^\widehat{\Delta W}, choose any ζ∈Rd\zeta\in\mathbb{R}^d and set

ΔW=ΔW^+1ζ⊤.\Delta W = \widehat{\Delta W} + \mathbf{1}\zeta^{\top}.

The resulting rows lie in B(ζ,ρhead/2)\mathcal{B}(\zeta, \rho_{\mathrm{head}}/2), and the same objective identity shows that their value is unchanged. Choosing ζ=0\zeta= 0 simply gives ΔW=ΔW^\Delta W = \widehat{\Delta W}. The two problems therefore attain exactly the same objective values.

The feasible set for the problem centered at the origin is a finite product of closed, bounded balls. It is nonempty and compact, so the continuous linear objective attains its minimum. The reverse construction then provides a minimizing pair for the original problem as well. Consequently, every minimizer of the problem centered at the origin gives a minimizer of the common-ball problem, and every minimizing pair of the common ball problem translates back to one.

This change of variable centers the enclosing ball. The rows inside it can still have a nonzero mean. The RowNorm update in Equation (10) is therefore already one minimizing choice for the common ball problem, with ζ=0\zeta= 0. Subtracting its mean row is optional and preserves the objective by the same translation argument.

Moving the ball to the origin introduces no additional suboptimality. The gap considered next comes entirely from requiring the update rows to fit inside a ball of radius ρhead/2\rho_{\mathrm{head}}/2 instead of imposing only the original diameter constraint.

Approximation guarantee and sharpness

Moving the ball to the origin preserves the minimum. We now bound the first-order decrease lost by replacing the diameter constraint with the common-ball constraint. Assume G≠0G \ne0, 1⊤G=0\mathbf{1}^{\top}G = 0, and ρhead>0\rho_{\mathrm{head}} > 0. Let Δ⋆\Delta_{\star} and Δball\Delta_{\mathrm{ball}} denote the greatest first-order decreases under these two constraints, respectively. Since RowNorm attains the common-ball optimum,

Δball=ρhead2∑i∥gi∥2>0.\Delta_{\mathrm{ball}} = \frac{\rho_{\mathrm{head}}}{2} \sum_i \lVert g_i\rVert_2 > 0.

Bounding the gap. Jung’s theorem bounds the radius needed to enclose a set using its diameter and dimension. Here we can work in the space spanned by the gradient rows, S=span⁡{g1,…,gV}S = \operatorname{span}\{g_1,\ldots,g_V\}. By definition of matrix rank, the dimension of this row space is k=rank⁡(G)k = \operatorname{rank}(G).

To see why this space suffices, consider the part of an update row perpendicular to SS. It has zero inner product with every gradient row and therefore contributes nothing to the objective. Removing these parts from all rows is an orthogonal projection, which cannot increase pairwise distances. Every feasible update can thus be replaced by one whose rows lie in SS, with the same objective value and no larger diameter.

Jung’s theorem (Jung, [13]) guarantees that any such rows with diameter at most ρhead\rho_{\mathrm{head}} lie in a ball of radius at most

rk=ρheadk2(k+1).r_k = \rho_{\mathrm{head}}\sqrt{\frac{k}{2(k+1)}}.

Let ζ\zeta be the center of such a ball, so that ∥Δwi−ζ∥2≤rk\lVert\Delta w_i-\zeta\rVert_2 \le r_k for every row. We only need to know that this center exists. As in the preceding subsection, ∑igi=0\sum_i g_i = 0 allows us to subtract ζ\zeta without changing the objective. Cauchy–Schwarz then gives

−⟨G,ΔW⟩F=−∑i⟨gi,Δwi−ζ⟩≤rk∑i∥gi∥2.-\langle G,\Delta W\rangle_F=-\sum_i\langle g_i,\Delta w_i-\zeta\rangle\le r_k\sum_i\lVert g_i\rVert_2.

This bounds Δ⋆\Delta_\star because every feasible update can be brought into SS without changing its objective value. Every common-ball update also satisfies the diameter constraint, so

0<Δball≤Δ⋆≤2kk+1Δball.0 < \Delta_{\mathrm{ball}} \le\Delta_\star\le\sqrt{\frac{2k}{k+1}}\Delta_{\mathrm{ball}}.

Rearranging proves the relative suboptimality bound in Equation (9).

Sharpness. A regular simplex gives a gradient for which equality holds. Choose g1,…,gk+1g_1,\ldots,g_{k+1} as the unit vertices of a regular kk-dimensional simplex centered at the origin in Rk\mathbb{R}^k. For a vocabulary with V>k+1V>k+1, set gi=0g_i=0 for every i>k+1i>k+1. The simplex rows satisfy

∑i=1k+1gi=0,∥gi∥2=1,⟨gi,gj⟩=−1k(i≠j).\sum_{i=1}^{k+1}g_i=0,\qquad\lVert g_i\rVert_2=1,\qquad\langle g_i,g_j\rangle=-\frac{1}{k}\quad(i\ne j).

The full gradient therefore satisfies 1TG=0\mathbf{1}^{\mathsf T}G=0 and rank⁡(G)=k\operatorname{rank}(G)=k. Consider the update ΔW=−rkG\Delta W=-r_kG. For every i>k+1i>k+1, this sets Δwi=−rkgi=0\Delta w_i=-r_kg_i=0. Distinct simplex update rows have distance

∥Δwi−Δwj∥2=rk2(k+1)k=ρhead.\lVert\Delta w_i-\Delta w_j\rVert_2=r_k\sqrt{\frac{2(k+1)}{k}}=\rho_{\mathrm{head}}.

Each simplex update row is also at distance rk≤ρheadr_k\le\rho_{\mathrm{head}} from every zero update row. The entire update is therefore feasible. It achieves a decrease of rk(k+1)r_k(k+1), matching the upper bound on Δ⋆\Delta_\star. Since Δball=ρhead(k+1)/2\Delta_{\mathrm{ball}}=\rho_{\mathrm{head}}(k+1)/2, the relative gap is

Δ⋆−ΔballΔ⋆=1−ρhead2rk=1−k+12k.\frac{\Delta_\star-\Delta_{\mathrm{ball}}}{\Delta_\star}=1-\frac{\rho_{\mathrm{head}}}{2r_k}=1-\sqrt{\frac{k+1}{2k}}.

This proves sharpness for every permissible rank 1≤k≤min⁡(d,V−1)1\le k\le\min(d,V-1). RowNorm therefore attains the optimal first-order decrease when k=1k=1 and retains at least 1/21/\sqrt{2} of it for every rank. The next subsection describes the practical update with momentum and numerical stabilization.

Practical RowNorm

In training, we apply row normalization to a first-moment estimate of the gradient. Let P=IV−11T/VP=I_V-\mathbf{1}\mathbf{1}^{\mathsf T}/V denote the projection that subtracts the mean row of a matrix. Starting from B−1=0B_{-1}=0, for t=0,1,…t=0,1,\ldots let

Bt=βBt−1+(1−β)Gt,B^t=Bt1−βt+1,B~t=PB^t.B_t=\beta B_{t-1}+(1-\beta)G_t,\qquad\widehat{B}_t=\frac{B_t}{1-\beta^{t+1}},\qquad\widetilde{B}_t=P\widehat{B}_t.

where 0≤β<10 \le\beta< 1. For numerical stability, define RNδnum\mathrm{RN}_{\delta_{\mathrm{num}}} by dividing row b~t,i⊤\widetilde{b}_{t,i}^{\top} by ∥b~t,i∥2+δnum\lVert\widetilde{b}_{t,i}\rVert_2 + \delta_{\mathrm{num}}, with δnum>0\delta_{\mathrm{num}} > 0. With learning rate ηt≥0\eta_t \ge0, the update is

ΔWt=−ηtPRNδnum(B~t),Wt+1=Wt+ΔWt.(19)\Delta W_t = -\eta_t P\mathrm{RN}_{\delta_{\mathrm{num}}}(\widetilde{B}_t), \qquad W_{t+1} = W_t + \Delta W_t. \tag*{(19)}

Under our assumptions, the momentum estimate is already centered in exact arithmetic, so the first projection only removes any accumulated numerical drift. Row normalization can introduce a nonzero mean, which the final projection removes. Every normalized row has norm at most one, and centering preserves pairwise differences, so D(ΔWt)≤2ηtD(\Delta W_t) \le2\eta_t. Consequently, 0≤ηt≤ε/(2R)0 \le\eta_t \le\varepsilon/(2R) ensures the required Hilbert distance bound for every ∥h∥2≤R\lVert h\rVert_2 \le R. The computation takes O(Vd)O(Vd) time, uses one first-moment buffer, and implements each projection by subtracting the mean row. Momentum and numerical stabilization preserve the diameter bound on the applied update. The forward and backward estimates therefore remain applicable under their stated assumptions.

Forward and backward perturbation bounds

A spectral constraint, as used by Muon, controls perturbations in both the forward and backward computations of a linear layer. For a fixed input hh and incoming gradient rr,

∥ΔWh∥2≤∥ΔW∥op∥h∥2,∥ΔW⊤r∥2≤∥ΔW∥op∥r∥2.\lVert\Delta W h\rVert_2 \le\lVert\Delta W\rVert_{\mathrm{op}}\lVert h\rVert_2, \qquad\lVert\Delta W^{\top}r\rVert_2 \le\lVert\Delta W\rVert_{\mathrm{op}}\lVert r\rVert_2.

We establish analogous bounds for our softmax modules below, comparing each module before and after an update at the same inputs. Write τ=tanh⁡(ε/4)\tau= \tanh(\varepsilon/4). The inequality relating Hilbert distance and total variation gives TV⁡(p,q)≤τ\operatorname{TV}(p,q) \le\tau whenever H(p,q)≤ε\mathcal{H}(p,q) \le\varepsilon ([7 Theorem 5.1]).

The LM head

The diameter constraint controls the head’s probability output and also bounds the change in the gradient passed to its hidden state. Let p=pW(h)p = p_W(h) and q=pW+ΔW(h)q = p_{W+\Delta W}(h) at a fixed input ∥h∥2≤R\lVert h\rVert_2 \le R. The forward bound is

H(p,q)≤RD(ΔW)≤ε.\mathcal{H}(p,q) \le RD(\Delta W) \le\varepsilon.

For a target token cc, denote the gradients passed to hh by λh\lambda_h and λh+\lambda_h^{+}. Cross-entropy gives

λh=W⊤(p−ec),λh+=(W+ΔW)⊤(q−ec),\lambda_h = W^{\top}(p-e_c), \qquad\lambda_h^{+} = (W+\Delta W)^{\top}(q-e_c),

where ece_c is the target’s one-hot vector. Writing wj⊤w_j^{\top} and Δwj⊤\Delta w_j^{\top} for the rows of WW and ΔW\Delta W, subtraction gives

λh+−λh=∑jqj(Δwj−Δwc)+∑j(qj−pj)wj.\lambda_h^{+} - \lambda_h = \sum_j q_j(\Delta w_j-\Delta w_c) + \sum_j(q_j-p_j)w_j.

The first sum averages differences between update rows, so its norm is at most D(ΔW)D(\Delta W). The second sum accounts for the redistributed probability. Because pp and qq each have unit mass, the positive and negative coefficients qj−pjq_j-p_j have the same total mass, namely TV⁡(p,q)\operatorname{TV}(p,q). After normalization, they form two weighted averages of the head rows. Their distance cannot exceed D(W)D(W), giving

∥λh+−λh∥2≤D(ΔW)+D(W)TV⁡(p,q)≤εR+τD(W).\lVert\lambda_h^{+}-\lambda_h\rVert_2 \le D(\Delta W)+D(W)\operatorname{TV}(p,q) \le\frac{\varepsilon}{R}+\tau D(W).

The current head appears through D(W)D(W) because it transmits the changed probability gradient.

Attention

For attention, we again seek bounds on the change in the output distributions and the resulting change in the gradients passed to the hidden states. The backward calculation now includes both the query and key uses of each hidden state. We keep the inputs ∥hi∥2≤R\lVert h_i\rVert_2 \le R and visible sets Ji\mathcal{J}_i fixed. Let M=WQWK⊤M=W_QW_K^{\top}, and let ΔM\Delta M denote its change. Equation 12 gives

max⁡iH(pi,pi+)≤2R2dh∥ΔM∥op≤ε.\max_i \mathcal{H}(p_i,p_i^{+}) \le\frac{2R^2}{\sqrt{d_h}}\lVert\Delta M\rVert_{\mathrm{op}} \le\varepsilon.

The total variation bound recalled above then gives TV⁡(pi,pi+)≤τ\operatorname{TV}(p_i,p_i^+) \le\tau, where τ=tanh⁡(ε/4)\tau= \tanh(\varepsilon/4).

To connect this probability bound to backpropagation, let rir_i denote the incoming gradient on pip_i. We hold these incoming gradients fixed when comparing the module before and after the QK update. Differentiating softmax gives the gradient with respect to the scores,

aij=pij(rij−μi),μi=∑j∈Jipijrij.a_{ij}=p_{ij}(r_{ij}-\mu_i),\qquad\mu_i=\sum_{j\in\mathcal{J}_i}p_{ij}r_{ij}.

Each score sij=hiTMhj/dhs_{ij}=h_i^{\mathsf{T}}Mh_j/\sqrt{d_h} sends this gradient to both its query input and its key input. Denote the corresponding contributions by λiQ\lambda_i^{\mathrm{Q}} and λijK\lambda_{ij}^{\mathrm{K}}:

λiQ=M∑j∈Jiaijhjdh,λijK=aijMThidh.\lambda_i^{\mathrm{Q}}=\frac{M\sum_{j\in\mathcal{J}_i}a_{ij}h_j}{\sqrt{d_h}},\qquad\lambda_{ij}^{\mathrm{K}}=\frac{a_{ij}M^{\mathsf{T}}h_i}{\sqrt{d_h}}.

The total gradient passed to hℓh_\ell adds its query contribution and its key contributions from all queries that can see it,

λℓ=λℓQ+∑i:ℓ∈JiλiℓK.\lambda_\ell=\lambda_\ell^{\mathrm{Q}}+\sum_{i:\ell\in\mathcal{J}_i}\lambda_{i\ell}^{\mathrm{K}}.

There are two sources of change in these expressions: the QK product changes, and so does the score gradient. Writing Δai=ai+−ai\Delta a_i=a_i^+-a_i and Δλ=λ+−λ\Delta\lambda=\lambda^+-\lambda, we obtain

ΔλiQ=ΔM∑j∈Jiaij+hj+M∑j∈JiΔaijhjdh,\Delta\lambda_i^{\mathrm{Q}}=\frac{\Delta M\sum_{j\in\mathcal{J}_i}a_{ij}^+h_j+M\sum_{j\in\mathcal{J}_i}\Delta a_{ij}h_j}{\sqrt{d_h}},
ΔλijK=aij+ΔMThi+ΔaijMThidh.\Delta\lambda_{ij}^{\mathrm{K}}=\frac{a_{ij}^+\Delta M^{\mathsf{T}}h_i+\Delta a_{ij}M^{\mathsf{T}}h_i}{\sqrt{d_h}}.

Since every hidden state has norm at most RR, the remaining quantities to bound are ∥ai+∥1\lVert a_i^+\rVert_1 and ∥Δai∥1\lVert\Delta a_i\rVert_1. The first accompanies the product change, and the second accompanies the current product.

We establish these estimates for one row, temporarily omitting the index ii. Write aj(p)=pj(rj−μ)a_j(p)=p_j(r_j-\mu) with μ=∑jpjrj\mu=\sum_j p_jr_j. Recall that osc⁡(r)=max⁡jrj−min⁡jrj\operatorname{osc}(r)=\max_j r_j-\min_j r_j. For the size of a(p)a(p), Cauchy–Schwarz reduces the calculation to the variance of the entries of rr under pp. With m=(max⁡jrj+min⁡jrj)/2m=(\max_j r_j+\min_j r_j)/2 denoting the midpoint of their range,

∥a(p)∥12≤∑jpj(rj−μ)2=∑jpj(rj−m)2−(μ−m)2≤osc⁡(r)24.\lVert a(p)\rVert_1^2\leq\sum_jp_j(r_j-\mu)^2=\sum_jp_j(r_j-m)^2-(\mu-m)^2\leq\frac{\operatorname{osc}(r)^2}{4}.

For the change in aa, we use the probability redistribution measured by total variation. Any change from pp to qq can be decomposed into transfers from coordinates that lose probability to coordinates that gain it. The total mass transferred in this way is TV⁡(p,q)\operatorname{TV}(p,q). It therefore suffices to bound the effect of one transfer and add these bounds.

Suppose an amount α\alpha moves from coordinate kk to coordinate jj, giving q=p+α(ej−ek)q=p+\alpha(e_j-e_k). Here ej,eke_j,e_k are coordinate vectors and 0≤α≤pk0\leq\alpha\leq p_k. Subtracting the score gradients at fixed rr gives

a(q)−a(p)=α[(rj−μ)ej−(rk−μ)ek−(rj−rk)q].a(q)-a(p)=\alpha\left[(r_j-\mu)e_j-(r_k-\mu)e_k-(r_j-r_k)q\right].

Because qq has unit mass,

∥a(q)−a(p)∥1≤α(∣rj−μ∣+∣rk−μ∣+∣rj−rk∣)≤2αosc⁡(r).\lVert a(q)-a(p)\rVert_1\leq\alpha\left(|r_j-\mu|+|r_k-\mu|+|r_j-r_k|\right)\leq2\alpha\operatorname{osc}(r).

The last step uses the fact that the three absolute differences sum to twice the range of rj,rk,μr_j,r_k,\mu. All three values lie within the range of rr, since μ\mu is a weighted average of its entries. Adding the bounds over the transfers proves ∥a(q)−a(p)∥1≤2osc⁡(r)TV⁡(p,q)\lVert a(q)-a(p)\rVert_1\leq2\operatorname{osc}(r)\operatorname{TV}(p,q).

Returning to the attention rows, the two estimates become

∥ai+∥1≤osc⁡(ri)2,∥Δai∥1≤2osc⁡(ri)τ.\lVert a_i^+\rVert_1\leq\frac{\operatorname{osc}(r_i)}{2},\qquad\lVert\Delta a_i\rVert_1\leq2\operatorname{osc}(r_i)\tau.

Apply these to the query and key expressions above, using ∥hℓ∥2≤R\lVert h_\ell\rVert_2 \le R and the triangle inequality:

∑ℓ∥Δλℓ∥2≤2Rdh∑i(∥ΔM∥op∥ai+∥1+∥M∥op∥Δai∥1)≤Rdh(∥ΔM∥op+4∥M∥opτ)∑iosc⁡(ri).\begin{aligned} \sum_{\ell} \lVert\Delta\lambda_\ell\rVert_2 \le\frac{2R}{\sqrt{d_h}}\sum_i \left(\lVert\Delta M\rVert_{\mathrm{op}}\lVert a_i^+\rVert_1+\lVert M\rVert_{\mathrm{op}}\lVert\Delta a_i\rVert_1\right) \\ &\le\frac{R}{\sqrt{d_h}}\left(\lVert\Delta M\rVert_{\mathrm{op}}+4\lVert M\rVert_{\mathrm{op}}\tau\right)\sum_i \operatorname{osc}(r_i). \end{aligned}

The factor of two in the first line accounts for the query and key contributions. Both are included when a position attends to itself. For fixed MM and incoming gradients, the bound tends to zero as ε\varepsilon tends to zero under the stated spectral constraint. For finite weight updates, ΔM\Delta M includes the quadratic term ΔWQΔWK⊤\Delta W_Q\Delta W_K^\top. The comparison concerns the QK probability module and does not include changes in the incoming gradients or the value pathway.

Reproducing Figure 1

Figure 1 holds the initial distribution fixed and varies only the centered update. We construct the initial logits by centering a quadratic profile over i=1,…,32i=1,\ldots,32:

ai=−(i−16.54)2,zi=ai−132∑j=132aj,p=softmax⁡(z).a_i=-\left(\frac{i-16.5}{4}\right)^2,\qquad z_i=a_i-\frac{1}{32}\sum_{j=1}^{32}a_j,\qquad p=\operatorname{softmax}(z).

The three updates below either shift a central block together or perturb individual preactivation coordinates within it. Here, 1{⋅}\mathbf{1}_{\{\cdot\}} is the indicator function, equal to one when its condition holds and zero otherwise:

Δziblue=21{13≤i≤16}−21{17≤i≤20},\Delta z_i^{\mathrm{blue}}=2\mathbf{1}_{\{13\le i\le16\}}-2\mathbf{1}_{\{17\le i\le20\}},
Δzipurple=21{9≤i≤24}−1,\Delta z_i^{\mathrm{purple}}=2\mathbf{1}_{\{9\le i\le24\}}-1,
Δzired=21{i=16}−21{i=19}.\Delta z_i^{\mathrm{red}}=2\mathbf{1}_{\{i=16\}}-2\mathbf{1}_{\{i=19\}}.

Each update has zero mean and produces q=softmax⁡(z+Δz)q=\operatorname{softmax}(z+\Delta z). Using

RMS⁡(Δz)=132∑i=132(Δzi)2,H(p,q)=max⁡iΔzi−min⁡iΔzi,\operatorname{RMS}(\Delta z)=\sqrt{\frac{1}{32}\sum_{i=1}^{32}(\Delta z_i)^2},\qquad\mathcal{H}(p,q)=\max_i\Delta z_i-\min_i\Delta z_i,

we obtain the following values, together with the total variation TV⁡(p,q)=12∑i∣pi−qi∣\operatorname{TV}(p,q)=\frac{1}{2}\sum_i\lvert p_i-q_i\rvert:

BluePurpleRed
RMS(Δz\Delta z)111/21/2
H(p,q)\mathcal{H}(p,q)424
TV⁡(p,q)\operatorname{TV}(p,q)≈0.514\approx0.514≈0.004\approx0.004≈0.430\approx0.430

Table 1.

Purple adds a common increment to coordinates 9–24, which initially carry more than 99.5% of the probability mass. The pairwise odds among coordinates 9, . . . , 24 remain unchanged, and only a small amount of probability mass moves from the tails into this block. Blue and red instead alter these ratios, producing much larger redistribution under the same RMS bound.

References

  1. [1]Shun-Ichi Amari. Natural gradient works efficiently in learning. Neural computation, 10(2):251–276, 1998.
  2. [2]Jeremy Bernstein. Deriving muon, 2025a. URL https://jeremybernste.in/writing/deriving-muon.
  3. [3]Jeremy Bernstein. The modula docs, 2025b. URL https://docs.modula.systems/.
  4. [4]Jeremy Bernstein and Laker Newhouse. Modular duality in deep learning. arXiv preprint arXiv:2410.21265, 2024.arxiv.org/abs/2410.21265
  5. [5]Garrett Birkhoff. Extensions of jentzsch’s theorem. Transactions of the American Mathematical Society, 85(1):219–227, 1957. Preprint. Under review.DOI
  6. [6]Krzysztof J Ciosmak. Optimal transport of vector measures. Calculus of Variations and Partial Differential Equations, 60(6):230, 2021.arxiv.org/abs/2108.07201
  7. [7]Samuel N. Cohen and Eliana Fausti. Hyperbolic contractivity and the hilbert metric on probability measures, 2024. URL https://arxiv.org/abs/2309.02413.
  8. [8]Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. Advances in neural information processing systems, 26, 2013.
  9. [9]Pierre De La Harpe. On hilbert’s metric for simplices. Geometric group theory, 1:97–119, 1993.
  10. [10]Athanasios Glentis, Jiaxiang Li, Andi Han, and Mingyi Hong. Memory-efficient llm pretraining via minimalist optimizer design, 2026. URL https://arxiv.org/abs/2506.16659.
  11. [11]Alex Henry, Prudhvi Raj Dachapally, Shubham Shantaram Pawar, and Yuxuan Chen. Query-key normalization for transformers. In Findings of the Association for Computational Linguistics: EMNLP 2020, pp. 4246–4253, 2020.arxiv.org/abs/2010.04245
  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]Heinrich Jung. Ueber die kleinste kugel, die eine räumliche figur einschliesst. Journal für die reine und angewandte Mathematik (Crelles Journal), 1901(123):241–257, 1901.DOI
  14. [14]Ben Keigwin, Li Yang, Yunzhe Zhang, Dhruv Pai, and Alec DeWulf. Towards compositional steepest descent. 2026. URL https://tildresearch.com/blog/compositional-muon.
  15. [15]Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.arxiv.org/abs/1412.6980
  16. [16]Tim Large, Yang Liu, Minyoung Huh, Hyojin Bahng, Phillip Isola, and Jeremy Bernstein. Scalable optimization in the modular norm, 2024. URL https://arxiv.org/abs/2405.14813.
  17. [17]Tim Tsz-Kit Lau and Weijie Su. Symmetry-compatible principle for optimizer design: Embeddings, lm heads, swiglu mlps, and moe routers, 2026. URL https://arxiv.org/abs/2605.18106.
  18. [18]Bas Lemmens and Roger D Nussbaum. Nonlinear Perron-Frobenius Theory. Cambridge University Press, 2012.DOI
  19. [19]James Martens. New insights and perspectives on the natural gradient method. Journal of Machine Learning Research, 21(146):1–76, 2020.
  20. [20]Frank Nielsen and Ke Sun. Clustering in Hilbert’s Projective Geometry: The Case Studies of the Probability Simplex and the Elliptope of Correlation Matrices, pp. 297–331. Springer International Publishing, November 2018. ISBN 9783030025205. doi: 10.1007/978-3-030-02520-5_11. URL http://dx.doi.org/10.1007/978-3-030-02520-5_11.
  21. [21]Frank Nielsen and Ke Sun. Non-linear embeddings in hilbert simplex geometry. In Topological, Algebraic and Geometric Learning Workshops 2023, pp. 254–266. PMLR, 2023.arxiv.org/abs/2203.11434
  22. [22]Athanase Papadopoulos and Marc Troyanov. Handbook of Hilbert geometry. European Mathematical Society, 2014.DOI
  23. [23]Thomas Pethick, Wanyun Xie, Kimon Antonakopoulos, Zhenyu Zhu, Antonio Silveti-Falls, and Volkan Cevher. Training deep learning models with norm-constrained lmos, 2025. URL https://arxiv.org/abs/2502.07529.
  24. [24]Herbert Robbins and Sutton Monro. A stochastic approximation method. The annals of mathematical statistics, pp. 400–407, 1951. Preprint. Under review.
  25. [25]Walter Rudin. Principles of Mathematical Analysis. International Series in Pure and Applied Mathematics. McGraw-Hill, 3 edition, 1976. URL https://books.google.com/books?id=kwqzPAAACAAJ.
  26. [26]John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In International conference on machine learning, pp. 1889–1897. Pmlr, 2015.arxiv.org/abs/1502.05477
  27. [27]Kimi Team, Yifan Bai, Yiping Bao, Y. Charles, Cheng Chen, Guanduo Chen, Haiting Chen, Huarong Chen, Jiahao Chen, Ningxin Chen, Ruijue Chen, Yanru Chen, Yuankun Chen, Yutian Chen, Zhuofu Chen, Jialei Cui, Hao Ding, Mengnan Dong, Angang Du, Chenzhuang Du, Dikang Du, Yulun Du, Yu Fan, Yichen Feng, Kelin Fu, Bofei Gao, Chenxiao Gao, Hongcheng Gao, Peizhong Gao, Tong Gao, Yuyao Ge, Shangyi Geng, Qizheng Gu, Xinran Gu, Longyu Guan, Haiqing Guo, Jianhang Guo, Xiaoru Hao, Tianhong He, Weiran He, Wenyang He, Yunjia He, Chao Hong, Hao Hu, Yangyang Hu, Zhenxing Hu, Weixiao Huang, Zhiqi Huang, Zihao Huang, Tao Jiang, Zhejun Jiang, Xinyi Jin, Yongsheng Kang, Guokun Lai, Cheng Li, Fang Li, Haoyang Li, Ming Li, Wentao Li, Yang Li, Yanhao Li, Yiwei Li, Zhaowei Li, Zheming Li, Hongzhan Lin, Xiaohan Lin, Zongyu Lin, Chengyin Liu, Chenyu Liu, Hongzhang Liu, Jingyuan Liu, Junqi Liu, Liang Liu, Shaowei Liu, T. Y. Liu, Tianwei Liu, Weizhou Liu, Yangyang Liu, Yubo Liu, Yiping Liu, Yue Liu, Zhengying Liu, Enzhe Lu, Haoyu Lu, Lijun Lu, Yashuo Luo, Shengling Ma, Xinyu Ma, Yingwei Ma, Shaoguang Mao, Jie Mei, Xin Men, Yibo Miao, Siyuan Pan, Yebo Peng, Ruoyu Qin, Zeyu Qin, Bowen Qu, Zeyu Shang, Lidong Shi, Shengyuan Shi, Feifan Song, Jianlin Su, Zhengyuan Su, Lin Sui, Xinjie Sun, Flood Sung, Yunpeng Tai, Heyi Tang, Jiawen Tao, Qifeng Teng, Chaoran Tian, Chensi Wang, Dinglu Wang, Feng Wang, Hailong Wang, Haiming Wang, Jianzhou Wang, Jiaxing Wang, Jinhong Wang, Shengjie Wang, Shuyi Wang, Si Wang, Xinyuan Wang, Yao Wang, Yejie Wang, Yiqin Wang, Yuxin Wang, Yuzhi Wang, Zhaoji Wang, Zhengtao Wang, Zhengtao Wang, Zhexu Wang, Chu Wei, Qianqian Wei, Haoning Wu, Wenhao Wu, Xingzhe Wu, Yuxin Wu, Chenjun Xiao, Jin Xie, Xiaotong Xie, Weimin Xiong, Boyu Xu, Jingjing Xu, L. H. Xu, Lin Xu, Suting Xu, Weixin Xu, Xinran Xu, Yangchuan Xu, Ziyao Xu, Jing Xu, Jing Xu, Junjie Yan, Yuzi Yan, Hao Yang, Xiaofei Yang, Yi Yang, Ying Yang, Zhen Yang, Zhilin Yang, Zonghan Yang, Haotian Yao, Xingcheng Yao, Wenjie Ye, Zhuorui Ye, Bohong Yin, Longhui Yu, Enming Yuan, Hongbang Yuan, Mengjie Yuan, Siyu Yuan, Haobing Zhan, Dehao Zhang, Hao Zhang, Wanlu Zhang, Xiaobin Zhang, Yadong Zhang, Yangkun Zhang, Yichi Zhang, Yizhi Zhang, Yongting Zhang, Yuzhang, Yu Zhang, Yutao Zhang, Yutong Zhang, Zheng Zhang, Haotian Zhao, Yikai Zhao, Zijia Zhao, Huabin Zheng, Shaojie Zheng, Longguang Zhong, Jianren Zhou, Xinyu Zhou, Zaida Zhou, Jingguo Zhu, Zhen Zhu, Weiyu Zhuang, and Xinxing Zu. Kimi k2: Open agentic intelligence, 2026. URL https://arxiv.org/abs/2507.20534.
  28. [28]Lieven Vandenberghe and Stephen Boyd. Convex optimization, volume 1. Cambridge university press Cambridge, 2004.
  29. [29]Shuangfei Zhai, Tatiana Likhomanenko, Etai Littwin, Dan Busbridge, Jason Ramapuram, Yizhe Zhang, Jiatao Gu, and Joshua M Susskind. Stabilizing transformer training by preventing attention entropy collapse. In International conference on machine learning, pp. 40770–40803. PMLR, 2023.

Paper details

vlnc:W_sk7vqcvg
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 10

downloads · 0

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

  • Computer Science

AI tools

View statement
Looking for related papers…
Contents