Which Way Is Down? First-Order Optimizers as a Choice of Norm

We consider the general optimization problem

min𝜃∈Θ𝒥︀(𝜃),

(1)

where Θ is a vector space and 𝒥︀ is differentiable. First-order methods solve it iteratively: starting from 𝜃0, they take steps 𝜃𝑡+1=𝜃𝑡+ℎ𝑡, where each step ℎ𝑡 is computed from the derivative 𝐷𝒥︀(𝜃𝑡), and possibly from earlier ones. This post is about how to choose ℎ𝑡, and in particular how the choice of a norm on Θ affects it.

1. Derivatives and gradients

The derivative 𝐷𝒥︀(𝜃) maps a direction ℎ∈Θ to a number, so it is an element of the dual space Θ∗ of linear maps Θ→ℝ, and we write its value at ℎ as the pairing ⟨𝐷𝒥︀(𝜃),ℎ⟩. Both Θ∗ and the pairing come with Θ itself, so nothing is chosen here. An inner product ⟨⋅,⋅⟩Θ on Θ, on the other hand, is a choice, for example the Frobenius inner product. With an inner product chosen, the linearization reads

𝒥︀(𝜃+ℎ)≈𝒥︀(𝜃)+⟨𝐷𝒥︀(𝜃),ℎ⟩=𝒥︀(𝜃)+⟨∇𝜃𝒥︀(𝜃),ℎ⟩Θ.

(2)

The second form holds because every linear map Θ→ℝ is ℎ↦⟨𝑘,ℎ⟩Θ for exactly one 𝑘∈Θ, its Riesz representative,11 This is the Riesz representation theorem, as in Batched Backpropagation as a Linear Solve: 𝑘↦⟨𝑘,⋅⟩Θ is linear and one-to-one, and Θ and Θ∗ have the same dimension. and the gradient ∇𝜃𝒥︀(𝜃) is the representative of 𝐷𝒥︀(𝜃). Unlike the derivative, the gradient lies in Θ, but it depends on the inner product: another inner product gives another gradient of the same function. Only the gradient needs an inner product. The derivative and the steps below need none.

Example 1: Two inner products, two gradients

Example 1 (Two inner products, two gradients)   Let Θ=ℝ2 and 𝒥︀(𝜃)=𝜃12+𝜃2, so that ⟨𝐷𝒥︀(𝜃),ℎ⟩=2𝜃1ℎ1+ℎ2.22 This follows from 𝒥︀ alone, as the directional derivative d/(d𝑡)𝒥︀(𝜃+𝑡ℎ)|𝑡=0=2𝜃1ℎ1+ℎ2, with no inner product involved. Writing the derivative as the array (2𝜃1,1) uses the coordinates of Θ=ℝ2, but the value of the pairing does not depend on them. Then

⟨ℎ,𝑘⟩Θ=ℎ1𝑘1+ℎ2𝑘2⇒∇𝜃𝒥︀(𝜃)=(2𝜃1,1),⟨ℎ,𝑘⟩Θ=ℎ1𝑘1+4ℎ2𝑘2⇒∇𝜃𝒥︀(𝜃)=(2𝜃1,1/4),

(3)

since both give ⟨∇𝜃𝒥︀(𝜃),ℎ⟩Θ=2𝜃1ℎ1+ℎ2.

2. Two surrogates

The linearization 𝒥︀(𝜃)+⟨𝑔,ℎ⟩, with 𝑔=𝐷𝒥︀(𝜃), is a good model of 𝒥︀(𝜃+ℎ) only for small ℎ, and on its own it has no minimizer: unless 𝑔=0, it decreases without bound along any direction with ⟨𝑔,ℎ⟩<0. A step therefore needs a second ingredient that says how large ℎ we allow. The length of ℎ∈Θ is measured by a norm ‖⋅‖, which is something that we again have to choose. There are two natural ways to combine the norm with the linearization: as a constraint, or as a penalty,33 The norm here can be any norm on Θ, not just the one induced by the inner product on Θ.

ℎ𝐶=arg min‖ℎ‖≤𝜂⟨𝑔,ℎ⟩,ℎ𝑃=arg minℎ∈Θ⟨𝑔,ℎ⟩+𝜆2‖ℎ‖2.

(4)

The first is a trust-region model: it trusts the linearization only within a radius 𝜂, which caps the length of the step. The second instead penalizes long steps, and as the penalty grows faster than the linearization can decrease, it always has a minimum.44 If 𝒥︀ is 𝐿-smooth with respect to ‖⋅‖, meaning that 𝒥︀(𝜃+ℎ)≤𝒥︀(𝜃)+⟨𝑔,ℎ⟩+𝐿2‖ℎ‖2 for all ℎ, then for 𝜆≥𝐿 the second surrogate is an upper bound on 𝒥︀, and ℎ𝑃 decreases 𝒥︀ by at least the decrease of the surrogate. Convergence analyses use this; in practice 𝜆 is often chosen smaller.

Interactive figure 1: The two surrogates over many steps

Interactive figure 1 (The two surrogates over many steps)   The graph shows both steps for

𝒥︀(𝜃)=3𝜃2/4−5/4logcosh𝜃,

(5)

with the norm |ℎ|. In one dimension every norm is a multiple of |ℎ|, so the choice of norm only matters from two dimensions on. The constrained step always has length 𝜂, since the linearization has no minimum inside the trust region, so close to the minimum it jumps back and forth over it. The penalized step shrinks with the derivative, but with 𝜆=𝐿 set by the largest curvature it crawls where 𝒥︀ is flat. Constrained methods such as sign descent and Muon therefore let 𝜂 decrease over the iterations, while adaptive norms, later in the post, take longer steps where 𝒥︀ is flat.

At iteration 𝑘, the dashed line is the linearization at the constrained iterate 𝜃𝑘, with the trust region |ℎ|≤𝜂 shaded, and the dashed parabola is the quadratic model at the penalized iterate 𝜃𝑘. Drag 𝜃0, change 𝜂 and 𝜆, and step through the iterations with 𝑘.

3. The dual norm and the sharp operator

To write the solutions of the constrained and penalized problems in (4) explicitly, we need two things: the dual norm, which measures the size of a derivative in Θ∗, and the sharp operator, which maps a derivative back to an element of Θ. In both cases it is important to note that they depend on the choice of a norm on Θ, rather than the inner product on Θ.

Definition 1: Dual norm and sharp operator

Definition 1 (Dual norm and sharp operator)   For a norm ‖⋅‖ on Θ, the dual norm of 𝑔∈Θ∗ and the sharp of 𝑔, 𝑔♯∈Θ, are

‖𝑔‖∗=max‖ℎ‖≤1⟨𝑔,ℎ⟩,𝑔♯=−arg minℎ∈Θ⟨𝑔,ℎ⟩+12‖ℎ‖2.

(6)

The dual norm is the slope of the linearization in its steepest direction; that is, a step of unit length with respect to the chosen norm changes the linearization by at most ‖𝑔‖∗, so that |⟨𝑔,ℎ⟩|≤‖𝑔‖∗‖ℎ‖ for all ℎ∈Θ. The sharp operator, the map 𝑔↦𝑔♯, takes 𝑔 back to Θ: −𝑔♯ is the penalized step for 𝜆=1, and its direction and length are set by the dual norm,55 Write ℎ=𝑡𝑢 with 𝑡≥0 and ‖𝑢‖=1. For a fixed 𝑡, the best 𝑢 has ⟨𝑔,𝑢⟩=−‖𝑔‖∗, which leaves −𝑡‖𝑔‖∗+𝑡2/2, smallest at 𝑡=‖𝑔‖∗.

⟨𝑔,𝑔♯⟩=‖𝑔‖∗2and‖𝑔♯‖=‖𝑔‖∗.

(7)

The minus sign is a convention. Like a gradient, 𝑔♯ points where 𝒥︀ increases, and a step subtracts it. When the minimizer is not unique, 𝑔♯ is any one of them.

The sharp operator is the map from Θ∗ back to Θ that a norm provides, while the Riesz map is the one that an inner product provides.66 The two coincide exactly when the norm comes from the inner product, ‖ℎ‖2=⟨ℎ,ℎ⟩Θ. The naming convention and notation 𝑔♯ follow Kelner et al. [1].77 Bernstein and Newhouse [2] call 𝑔♯/‖𝑔‖∗ the duality map. Both the constrained and the penalized steps can be written explicitly using the sharp operator. The constrained problem is bounded below by ⟨𝑔,ℎ⟩≥−‖𝑔‖∗‖ℎ‖≥−𝜂‖𝑔‖∗,88 The first inequality is the bound |⟨𝑔,ℎ⟩|≤‖𝑔‖∗‖ℎ‖ from the definition of the dual norm. The second holds because the constraint gives ‖ℎ‖≤𝜂 and ‖𝑔‖∗≥0. which the step below attains, and writing ℎ=𝑘/𝜆 turns the penalized problem into the definition. For 𝑔≠0,

ℎ𝐶=arg min‖ℎ‖≤𝜂⟨𝑔,ℎ⟩=−𝜂𝑔♯‖𝑔‖∗,ℎ𝑃=1𝜆arg min𝑘∈Θ⟨𝑔,𝑘⟩+12‖𝑘‖2=−1𝜆𝑔♯.

(8)

Here 𝑔♯/‖𝑔‖∗ is the unit vector, in the chosen norm, along 𝑔♯, so ℎ𝐶 goes straight to the border of the trust region. Both steps point along −𝑔♯, which depends on the chosen norm, and differ only in length: 𝜂 for ℎ𝐶 and ‖𝑔‖∗/𝜆 for ℎ𝑃, so they coincide for 𝜆=‖𝑔‖∗/𝜂.

Example 2: The dual norm and the sharp operator in the plane

Example 2 (The dual norm and the sharp operator in the plane)   Let Θ=ℝ2 and ⟨𝑔,ℎ⟩=3ℎ1+4ℎ2. For the Euclidean norm ‖ℎ‖2=ℎ12+ℎ22,

‖𝑔‖∗=max‖ℎ‖2≤13ℎ1+4ℎ2=5,𝑔♯=−arg minℎ∈ℝ23ℎ1+4ℎ2+12(ℎ12+ℎ22)=(3,4).

(9)

By the Cauchy–Schwarz inequality, 3ℎ1+4ℎ2≤5‖ℎ‖2, with equality at ℎ=(3,4)/5, and in the problem for 𝑔♯, setting the derivative (3+ℎ1,4+ℎ2) of the objective to zero gives the minimizer ℎ=(−3,−4), so 𝑔♯=(3,4), the gradient for the Euclidean inner product. For the max-norm ‖ℎ‖∞=max(|ℎ1|,|ℎ2|),

‖𝑔‖∗=max‖ℎ‖∞≤13ℎ1+4ℎ2=7,𝑔♯=−arg minℎ∈ℝ23ℎ1+4ℎ2+12max(|ℎ1|,|ℎ2|)2=(7,7).

(10)

Both coordinates can be moved as far as allowed, so the maximum is 3+4 at ℎ=(1,1). For the minimum, fix 𝑡=max(|ℎ1|,|ℎ2|): the linear part is then smallest at ℎ=(−𝑡,−𝑡), which leaves −7𝑡+𝑡2/2, smallest at 𝑡=7. In both cases ⟨𝑔,𝑔♯⟩=‖𝑔‖∗2 and ‖𝑔♯‖=‖𝑔‖∗. The same derivative gives different directions for different norms.99 The same argument gives 𝑔♯=‖𝑔‖1sign(𝑔) for the max-norm, and this map is not linear: (3,4)♯+(−1,2)♯=(7,7)+(−3,3)=(4,10), while (2,6)♯=(8,8). So the max-norm is not the norm of any inner product, whose sharp operator, the Riesz map, is linear.

Interactive figure 2: The sharp operator

Interactive figure 2 (The sharp operator)   The graph shows the definition for 𝑔=(3,4) of the example above and the ℓ𝑝-norms ‖ℎ‖𝑝=(|ℎ1|𝑝+|ℎ2|𝑝)1/𝑝, which give the Euclidean norm for 𝑝=2 and the max-norm for 𝑝=∞. Its contours are those of 𝜑(ℎ)=⟨𝑔,ℎ⟩+1/2‖ℎ‖2, which is smallest at −𝑔♯. The dual norm shows in two places: −𝑔♯ lies on the border ‖ℎ‖=‖𝑔‖∗ of the ball ‖ℎ‖≤‖𝑔‖∗, and the level set ⟨𝑔,ℎ⟩+‖𝑔‖∗2=0, a line in the plane, touches the ball there. Only 𝑝=2 comes from an inner product. For every other 𝑝 the sharp operator is nonlinear, and for 𝑝 near 1 or ∞ it jumps between corners of the ball as 𝑔 is dragged, which no linear map can do.

The ball is shaded and the line dashed, with −𝑔♯ drawn from the origin. Drag 𝑔, change 𝑝 from 1 to ∞, and drag the point ℎ to check that no point has a smaller value 𝜑(ℎ) than −𝑔♯.

4. The effect of the chosen norm

Once the norm is chosen, the step is fixed. To write the steps down, we need coordinates. Let Θ=ℝ𝑚×𝑛, so that 𝜃 is a matrix, for example the weights of a layer in a neural network. The derivative is then represented by the matrix 𝐺 of partial derivatives 𝜕𝒥︀/𝜕𝜃𝑎𝑏, with

⟨𝑔,ℎ⟩=⟨𝐺,ℎ⟩𝐹=tr(𝐺⊤ℎ),𝑔=𝐷𝒥︀(𝜃).

(11)

This uses the Frobenius inner product, which makes 𝐺 the Riesz representative of 𝑔: the gradient for the Frobenius inner product.1010 This might seem like a limitation, but as shown in Section 4.1 every inner product on Θ can be written using the Frobenius inner product. Some norms on Θ, such as the max-norm, only look at the entries of ℎ, as if the matrix were one long vector of 𝑚𝑛 numbers. Others, such as the spectral norm, use that 𝜃 is a matrix, a linear map from inputs to outputs, which is what the weights of a layer are. For matrices, ‖⋅‖1 and ‖⋅‖∞ act on the entries as for vectors, while ‖⋅‖2 is the spectral norm, the largest singular value. Each norm then gives a dual norm and a sharp operator in terms of 𝐺, and with them a known method. Since both the constrained and the penalized steps follow from ‖𝑔‖∗ and 𝑔♯, each example shows only the one that gives the known method. The other step is a rescaled version of it, for example normalized gradient descent in place of gradient descent. The table below collects the norms of this section.1111 The downloadable code computes 𝑔♯ for the Frobenius norm, a diagonal inner product, the max-norm, and the spectral norm by solving the defining problem as a small conic program [3], and prints it next to the closed form.

Table 1: Three norms and the methods they give. For the first row the method is the penalized step −𝑔♯/𝜆, and for the last two it is the constrained step −𝜂𝑔♯/‖𝑔‖∗.

Norm on Θ‖𝑔‖∗𝑔♯Method
Inner product‖𝒜︀−1(𝐺)‖𝒜︀𝒜︀−1(𝐺)Gradient descent
Max-norm‖𝐺‖1‖𝐺‖1sign(𝐺)Sign descent
Spectral‖𝐺‖nuc‖𝐺‖nuc𝑈𝑉⊤Muon

The norms fall into two families. A norm from an inner product has a linear sharp operator, the Riesz map, and its step is a preconditioned gradient step. Every other norm has a nonlinear sharp operator, and its step is not the gradient for any fixed inner product, one that does not depend on 𝑔.

4.1. Norms from an inner product

Every inner product on Θ can be written as

⟨ℎ,𝑘⟩𝒜︀=⟨𝒜︀(ℎ),𝑘⟩𝐹

(12)

where the linear map 𝒜︀:Θ→Θ is symmetric and positive definite, i.e.,

⟨𝒜︀(ℎ),𝑘⟩𝐹=⟨ℎ,𝒜︀(𝑘)⟩𝐹and⟨𝒜︀(ℎ),ℎ⟩𝐹>0for allℎ≠0.

(13)

Since ⟨𝑔,ℎ⟩=⟨𝐺,ℎ⟩𝐹=⟨𝒜︀−1(𝐺),ℎ⟩𝒜︀,1212 We look for the 𝑘∈Θ with ⟨𝑘,ℎ⟩𝒜︀=⟨𝐺,ℎ⟩𝐹 for all ℎ. By the definition of ⟨⋅,⋅⟩𝒜︀, the left side is ⟨𝒜︀(𝑘),ℎ⟩𝐹, so ⟨𝒜︀(𝑘)−𝐺,ℎ⟩𝐹=0 for all ℎ, which gives 𝒜︀(𝑘)=𝐺 and 𝑘=𝒜︀−1(𝐺). The inverse exists because 𝒜︀ is positive definite. the gradient for ⟨⋅,⋅⟩𝒜︀ is ∇𝒜︀𝒥︀=𝒜︀−1(𝐺).1313 In Example 1, the second inner product is 𝒜︀=diag(1,4), and its gradient (2𝜃1,1/4) is 𝒜︀−1 applied to the first. The inverse 𝒜︀−1 may look unusual, but it is the familiar preconditioner of scientific computing, where a problem is rescaled before it is solved: a gradient step with ∇𝒜︀𝒥︀ is plain gradient descent in the rescaled variables 𝜉=𝒜︀1/2(𝜃).1414 With 𝜉=𝒜︀1/2(𝜃), the derivative of 𝒥︀(𝒜︀−1/2(𝜉)) is represented by 𝒜︀−1/2(𝐺), so a gradient step in 𝜉 changes 𝜉 by −1𝜆𝒜︀−1/2(𝐺), and 𝜃=𝒜︀−1/2(𝜉) by −1𝜆𝒜︀−1(𝐺). With 𝒜︀ close to the curvature of 𝒥︀, the rescaled problem is well conditioned, and the step comes close to Newton’s method.

Example 3: Preconditioned gradient descent

Example 3 (Preconditioned gradient descent)   Let ‖ℎ‖2=⟨ℎ,ℎ⟩𝒜︀, so that ⟨𝑔,ℎ⟩=⟨∇𝒜︀𝒥︀,ℎ⟩𝒜︀ with the gradient ∇𝒜︀𝒥︀=𝒜︀−1(𝐺). Then

‖𝑔‖∗=max‖ℎ‖𝒜︀≤1⟨∇𝒜︀𝒥︀,ℎ⟩𝒜︀=‖∇𝒜︀𝒥︀‖𝒜︀=⟨𝐺,𝒜︀−1(𝐺)⟩𝐹1/2,𝑔♯=−arg minℎ∈Θ⟨∇𝒜︀𝒥︀,ℎ⟩𝒜︀+12‖ℎ‖𝒜︀2=∇𝒜︀𝒥︀.

(14)

By the Cauchy–Schwarz inequality, ⟨∇𝒜︀𝒥︀,ℎ⟩𝒜︀≤‖∇𝒜︀𝒥︀‖𝒜︀‖ℎ‖𝒜︀, with equality at ℎ=∇𝒜︀𝒥︀/‖∇𝒜︀𝒥︀‖𝒜︀. In the problem for 𝑔♯, completing the square gives

⟨∇𝒜︀𝒥︀,ℎ⟩𝒜︀+12‖ℎ‖𝒜︀2=12‖ℎ+∇𝒜︀𝒥︀‖𝒜︀2−12‖∇𝒜︀𝒥︀‖𝒜︀2,

(15)

which is smallest at ℎ=−∇𝒜︀𝒥︀, so 𝑔♯=∇𝒜︀𝒥︀. The sharp operator is the Riesz map, and the penalized step

ℎ𝑃=−1𝜆𝒜︀−1(𝐺)

(16)

is preconditioned gradient descent with the preconditioner 𝒜︀−1, and for the Frobenius norm, 𝒜︀=ℐ︀, plain gradient descent.

Interactive figure 3: A norm from an inner product

Interactive figure 3 (A norm from an inner product)   The graph shows the constrained step for an inner product on ℝ2, ⟨ℎ,𝑘⟩𝒜︀=ℎ⊤𝐴𝑘, where

𝐴=𝑅𝜑[100𝜅]𝑅𝜑⊤,𝑅𝜑=[cos𝜑−sin𝜑sin𝜑cos𝜑],

(17)

has the eigenvalues 1 and 𝜅, with eigenvectors turned by the angle 𝜑. The unit ball is an ellipse, and the step ℎ𝐶=−𝐴−1𝑔/‖𝑔‖∗, for 𝜂=1, is where the line ⟨𝑔,ℎ⟩+‖𝑔‖∗=0 touches it. Unlike the steps for 𝑝=1 and 𝑝=∞, it never jumps between corners, and unlike the steps of the other ℓ𝑝-norms, its direction depends linearly on 𝑔, since the sharp operator 𝐴−1 is linear.

Currently, 𝐴=

The Euclidean unit circle and the Euclidean step −𝑔/‖𝑔‖ are dotted.

4.2. Norms not from inner products

Recall that the norm need not come from an inner product. Every method still minimizes the same linearization ⟨𝑔,ℎ⟩, with the derivative 𝑔=𝐷𝒥︀(𝜃)∈Θ∗. What changes is the norm that limits the step, and with it the sharp operator, the map from Θ∗ back to Θ. For a norm that does not come from an inner product, the sharp operator is nonlinear,1515 If 𝑔↦𝑔♯ were linear, then ‖𝑔‖∗2=⟨𝑔,𝑔♯⟩ would be a quadratic form in 𝑔, so the dual norm would come from an inner product on Θ∗, and then so would the norm on Θ, its dual. so it is not the Riesz map of any fixed inner product, and the step is not a gradient for any inner product that does not depend on 𝑔. The max-norm is one such norm: as in the plane, 𝑔♯=‖𝐺‖1sign(𝐺), and its constrained step ℎ𝐶=−𝜂sign(𝐺) is sign descent. The example below shows the spectral norm, whose constrained step is Muon.

Example 4: The spectral norm: Muon

Example 4 (The spectral norm: Muon)   The spectral norm of a matrix ℎ is its largest singular value, ‖ℎ‖2=𝜎max(ℎ). Let 𝜃∈ℝ𝑚×𝑛 be the weights of a linear layer 𝑍=𝜃𝑋. A step ℎ changes the outputs by ℎ𝑋, and the spectral norm is the largest such change relative to the inputs,

‖ℎ𝑋‖𝐹≤‖ℎ‖2‖𝑋‖𝐹for all𝑋.

(18)

As such, bounding the spectral norm effectively bounds the change of the outputs for every input. The dual norm and the sharp follow from the compact singular value decomposition 𝐺=𝑈Σ𝑉⊤=∑𝑘𝜎𝑘𝑢𝑘𝑣𝑘⊤, which keeps only the nonzero singular values,

‖𝑔‖∗=max‖ℎ‖2≤1tr(𝐺⊤ℎ)=‖𝐺‖nuc,𝑔♯=−arg minℎ∈Θtr(𝐺⊤ℎ)+12‖ℎ‖22=‖𝐺‖nuc𝑈𝑉⊤.

(19)

By the cyclic property of the trace,

tr(𝐺⊤ℎ)=tr(𝑉Σ𝑈⊤ℎ)=tr(Σ𝑈⊤ℎ𝑉)=∑𝑘𝜎𝑘(𝑈⊤ℎ𝑉)𝑘𝑘≤∑𝑘𝜎𝑘=‖𝐺‖nuc,

(20)

since each diagonal entry of 𝑈⊤ℎ𝑉 is at most its spectral norm, ‖𝑈⊤ℎ𝑉‖2≤‖ℎ‖2≤1. Equality holds at ℎ=𝑈𝑉⊤, where 𝑈⊤ℎ𝑉=𝐼. For the minimum, fix 𝑡=‖ℎ‖2: the linear part is then smallest at ℎ=−𝑡𝑈𝑉⊤, which leaves −𝑡‖𝐺‖nuc+𝑡2/2, smallest at 𝑡=‖𝐺‖nuc. The nuclear norm, the sum of the singular values, is therefore not chosen but appears as the dual of the spectral norm. The constrained step

ℎ𝐶=−𝜂𝑈𝑉⊤

(21)

is minus the matrix with the singular vectors of 𝐺 and all its nonzero singular values set to 𝜂, while the zero ones stay zero. It is the update of Muon [4], applied to an averaged derivative as in the next section. In a network, the constraint is applied to each block.1616 That is, the norm is max𝑖‖ℎ𝑖‖2, as in Bernstein and Newhouse [2]. Its dual norm is ∑𝑖‖𝐺𝑖‖nuc, and each block takes the step −𝜂𝑈𝑖𝑉𝑖⊤. In practice, Muon computes 𝑈𝑉⊤ with a few matrix products by a Newton–Schulz iteration, whose polynomials are improved by The Polar Express Algorithm, and uses 𝑈𝑉⊤ only for the weight matrices of the hidden layers. Avoiding the SVD is what makes Muon practical for large networks: an SVD runs poorly on GPUs and needs high precision, while matrix products are fast even in low precision.

Interactive figure 4: The Muon step

Interactive figure 4 (The Muon step)   Unlike the graphs above, this plane is not Θ, which here is four-dimensional: it holds the vectors a 2×2 block acts on, and each matrix is shown through its image of the unit circle. The block 𝐺 maps the unit circle to an ellipse with the semi-axes 𝜎1𝑢1 and 𝜎2𝑢2. The matrix 𝑈𝑉⊤ keeps the singular vectors and sets both singular values to 1: it maps the circle to itself, and its columns 𝑈𝑉⊤𝑒1 and 𝑈𝑉⊤𝑒2, which take the place of 𝐺𝑒1 and 𝐺𝑒2, are orthonormal.

5. Incorporating the past

The surrogates above have no memory of the past. The linearization is created using only the current iterate 𝜃𝑡 and its derivative 𝑔𝑡=𝐷𝒥︀(𝜃𝑡), and the norm is fixed. Methods with memory use past iterations in two ways: momentum methods change the linearization, and adaptive methods change the norm.

5.1. Momentum

The idea behind momentum is to build the linearization from past derivatives as well. The surrogates keep their form, with a chosen derivative 𝑔̂𝑡∈Θ∗ in place of 𝑔𝑡,

ℎ𝐶=arg min‖ℎ‖≤𝜂⟨𝑔̂𝑡,ℎ⟩,ℎ𝑃=arg minℎ∈Θ⟨𝑔̂𝑡,ℎ⟩+𝜆2‖ℎ‖2.

(22)

The derivative 𝑔̂𝑡 enters before the sharp operator, in Θ∗. When the sharp operator is linear, as for a norm from an inner product, averaging the derivatives is the same as averaging the steps they give.1717 A linear sharp operator commutes with averaging, (∑𝑘𝑤𝑘𝑔𝑘)♯=∑𝑘𝑤𝑘𝑔𝑘♯. A nonlinear one does not: for Muon, the orthogonalized average of the derivatives is not the average of the orthogonalized derivatives.

Example 5: Averaged linearizations: Adam and Muon

Example 5 (Averaged linearizations: Adam and Muon)   Average the past derivatives with weights (1−𝛽)𝛽𝑘 for 𝛽∈(0,1), giving

𝑔̂𝑡=(1−𝛽)∑𝑘≥0𝛽𝑘𝑔𝑡−𝑘.

(23)

The pairing is linear in 𝑔 for any norm, so ⟨𝑔̂𝑡,ℎ⟩ is the same weighted average of the past linearizations ⟨𝑔𝑡−𝑘,ℎ⟩. Both steps keep their form with 𝑔̂𝑡 in place of 𝑔𝑡,

ℎ𝐶=−𝜂𝑔̂𝑡♯‖𝑔̂𝑡‖∗,ℎ𝑃=−1𝜆𝑔̂𝑡♯.

(24)

The past derivatives were taken at earlier points, so as a model of 𝒥︀ near 𝜃𝑡 this is worse than the linearization with 𝑔𝑡. But when each 𝑔𝑡 is computed from a minibatch, 𝑔̂𝑡 is a less noisy estimate of the expected derivative. In coordinates, 𝐺̂←𝛽𝐺̂+(1−𝛽)𝐺. Muon takes the step of Example 4 with 𝐺̂ in place of 𝐺, and Adam does the same with the adaptive norm of Example 6.

5.2. Adaptive norms

Past information can also enter the norm. An adaptive method builds an inner product ⟨⋅,⋅⟩𝒜︀𝑡 from past derivatives, so that the norm changes at every step. Each step is still the one of Example 3, with 𝒜︀𝑡 in place of 𝒜︀,

ℎ𝑃=−1𝜆𝒜︀𝑡−1(𝐺).

(25)

Storing a general 𝒜︀𝑡 is out of the question for a network, so two cheap structures are used: a diagonal one, which stores as many numbers as 𝜃, and a Kronecker-factored one.

Example 6: A diagonal norm: AdaGrad and Adam

Example 6 (A diagonal norm: AdaGrad and Adam)   AdaGrad [5] sums the squared partial derivatives of all past iterations, and Adam [6] takes a moving average of them instead,

𝑣←𝑣+𝐺2(AdaGrad),𝑣←𝛽2𝑣+(1−𝛽2)𝐺2(Adam),

(26)

where the square, like the square root below, acts entry by entry. So 𝑣 has the same shape as 𝜃, one number per entry. Both measure the step with the weighted norm

‖ℎ‖𝑡2=∑𝑎(𝑣𝑎+𝜀)ℎ𝑎2=⟨𝒜︀𝑡(ℎ),ℎ⟩𝐹=⟨ℎ,ℎ⟩𝒜︀𝑡,𝒜︀𝑡(ℎ)=(𝑣+𝜀)⊙ℎ,

(27)

where 𝑎 runs over all entries of 𝜃, and ⊙ multiplies two elements of Θ entry by entry, so that 𝒜︀𝑡 multiplies each ℎ𝑎 by 𝑣𝑎+𝜀. As ‖⋅‖𝑡 comes from an inner product, Example 3 gives

𝑔♯=𝒜︀𝑡−1(𝐺),

(28)

which divides each 𝐺𝑎 by 𝑣𝑎+𝜀, and the penalized step with 𝜆=1/𝜂 is −𝜂𝒜︀𝑡−1(𝐺). Adam also uses the averaged derivative 𝐺̂ of Section 5.1 in place of 𝐺, so it carries memory in both the linearization and the norm, and its step, without bias correction,1818 Adam starts both averages at zero, so after 𝑡 steps their weights sum to 1−𝛽𝑡, and early averages are too small. It divides 𝐺̂ by 1−𝛽1𝑡 and 𝑣 by 1−𝛽2𝑡, which scales the step by 1−𝛽2𝑡/(1−𝛽1𝑡) when 𝜀 is ignored. The factor approaches 1 on the time scale of 1/(1−𝛽2) steps. is −𝜂𝒜︀𝑡−1(𝐺̂).

Interactive figure 5: The adaptive norm of AdaGrad

Interactive figure 5 (The adaptive norm of AdaGrad)   The graph shows AdaGrad on the quadratic 𝒥︀(𝜃)=1/2(𝜃12+𝜅𝜃22), next to gradient descent with 𝜆=𝐿=𝜅. At each iterate, the ellipse is the ball of ‖⋅‖𝑡 through the next iterate, which the step reaches where a line of constant linearization touches the ball. Already the first derivative makes the ball narrow in the steep direction 𝜃2, where the derivatives are large, and wide along the flat coordinate 𝜃1. As 𝑣 accumulates, the ball, and with it the step, shrinks. AdaGrad thereby takes long steps where gradient descent crawls.

Gradient descent is dotted and AdaGrad solid, with thirty steps each. Drag 𝜃0, change 𝜂 and 𝜅, and step through the iterations with 𝑘.

Example 7: A Kronecker-factored norm: K-FAC and Shampoo

Example 7 (A Kronecker-factored norm: K-FAC and Shampoo)   Let 𝜃∈ℝ𝑚×𝑛 be the weights of a linear layer 𝑍=𝜃𝑋 with inputs 𝑋∈ℝ𝑛×𝑏. A step ℎ changes the outputs by ℎ𝑋. Measuring this change, weighted on the output side by a symmetric positive definite 𝐿∈ℝ𝑚×𝑚, gives1919 In a network, each layer has its own 𝐿 and 𝑅.

‖𝐿1/2ℎ𝑋‖𝐹2=⟨𝒜︀(ℎ),ℎ⟩𝐹,𝑅=𝑋𝑋⊤,𝒜︀(ℎ)=𝐿ℎ𝑅,

(29)

which is positive definite only if 𝑋𝑋⊤ is. Unlike the spectral norm of Example 4, which is the worst case over all inputs, this norm measures the change on the given inputs. Its inverse, 𝒜︀−1(𝐺)=𝐿−1𝐺𝑅−1, needs only an 𝑚×𝑚 and an 𝑛×𝑛 matrix, not a general one of size 𝑚𝑛×𝑚𝑛.2020 Stacking the columns of ℎ into one long vector vec(ℎ) gives vec(𝐿ℎ𝑅)=(𝑅⊗𝐿)vec(ℎ), so 𝒜︀ is the Kronecker product 𝑅⊗𝐿. This is why such norms and preconditioners are called Kronecker-factored, the KF in K-FAC. Since the inputs change from batch to batch, K-FAC [7] takes moving averages over the iterations of 𝑋𝑋⊤ and of ΔΔ⊤, where Δ holds the derivatives of the loss with respect to the outputs 𝑍,2121 In K-FAC, 𝑋 has an extra row of ones for the bias, and Δ is computed with targets sampled from the network’s own predictive distribution rather than taken from the data, so that 𝑅⊗𝐿 approximates a block of the Fisher information matrix.

𝑅←𝜌𝑅+(1−𝜌)𝑋𝑋⊤,𝐿←𝜌𝐿+(1−𝜌)ΔΔ⊤,

(30)

and its basic step is −𝜂𝐿−1𝐺𝑅−1. K-FAC also adds damping to 𝐿 and 𝑅, and takes the step 𝛼𝑑𝑡+𝜇ℎ𝑡−1 with 𝑑𝑡=−𝐿−1𝐺𝑅−1, where 𝛼 and 𝜇 are chosen at every step by minimizing a quadratic model. This is a momentum term whose coefficients change from step to step. Shampoo [8] instead sums the products of the derivative with itself, starting from 𝐿=𝜀𝐼 and 𝑅=𝜀𝐼,

𝐿←𝐿+𝐺𝐺⊤,𝑅←𝑅+𝐺⊤𝐺,

(31)

and takes the step −𝜂𝐿−1/4𝐺𝑅−1/4, so its norm uses the fourth roots of 𝐿 and 𝑅.

6. Summary

Table 2 summarizes the methods of the post by their norm and by where past information enters.

Table 2: The methods of the post as choices of the norm and of where past information enters: the linearization through 𝑔̂𝑡, and the norm. K-FAC also uses the previous step, and implementations of Shampoo often add momentum as well.

MethodNorm𝑔̂𝑡Norm memory
Gradient descentInner product𝑔𝑡–
AdaGradDiagonal𝑔𝑡Sum
AdamDiagonalAverageAverage
K-FACKronecker-factored𝑔𝑡Average
ShampooKronecker-factored𝑔𝑡Sum
Sign descentMax-norm𝑔𝑡–
MuonSpectralAverage–

Cite this post

bibtex
@misc{paltorp2026steepestdescent,
author = {Paltorp, Mikkel},
title = {{Which Way Is Down? First-Order Optimizers as a Choice of Norm}},
year = {2026},
month = oct,
url = {https://mipals.github.io/pdf/2026/10-13-steepest-descent/steepest-descent.pdf},
note = {Blog post}
}

Bibliography

  • [1] J. A. Kelner, Y. T. Lee, L. Orecchia, and A. Sidford, “An Almost-Linear-Time Algorithm for Approximate Max Flow in Undirected Graphs, and its Multicommodity Generalizations,” in Proceedings of the Twenty-Fifth Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), 2014, pp. 217–226. doi: 10.1137/1.9781611973402.16.
  • [2] J. Bernstein and L. Newhouse, “Modular Duality in Deep Learning.” [Online]. Available: https://arxiv.org/abs/2410.21265
  • [3] P. J. Goulart and Y. Chen, “Clarabel: An interior-point solver for conic programs with quadratic objectives.” [Online]. Available: https://arxiv.org/abs/2405.12762
  • [4] K. Jordan et al., “Muon: An optimizer for hidden layers in neural networks.” [Online]. Available: https://kellerjordan.github.io/posts/muon/
  • [5] J. Duchi, E. Hazan, and Y. Singer, “Adaptive Subgradient Methods for Online Learning and Stochastic Optimization,” Journal of Machine Learning Research, vol. 12, no. 61, pp. 2121–2159, 2011, [Online]. Available: https://jmlr.org/papers/v12/duchi11a.html
  • [6] D. P. Kingma and J. Ba, “Adam: A Method for Stochastic Optimization,” in International Conference on Learning Representations (ICLR), 2015. [Online]. Available: https://arxiv.org/abs/1412.6980
  • [7] J. Martens and R. Grosse, “Optimizing Neural Networks with Kronecker-factored Approximate Curvature,” in Proceedings of the 32nd International Conference on Machine Learning, in Proceedings of Machine Learning Research, vol. 37. 2015, pp. 2408–2417. [Online]. Available: https://proceedings.mlr.press/v37/martens15.html
  • [8] V. Gupta, T. Koren, and Y. Singer, “Shampoo: Preconditioned Stochastic Tensor Optimization,” in Proceedings of the 35th International Conference on Machine Learning, in Proceedings of Machine Learning Research, vol. 80. 2018, pp. 1842–1850. [Online]. Available: https://proceedings.mlr.press/v80/gupta18a.html