skip to content
← Scientific Spaces English

Steepest Descent on Manifolds, Part 6: Muon + Double Rotation

We know that when matrix parameters are updated using optimizers such as Adam or Muon, both the singular values and the left and right singular vectors change accordingly, and they are usually coupled together. Precisely because of this coupling, we cannot easily regulate the singular values of matrix parameters; therefore, when an anomalous growth in singular values occurs, we cannot easily and effectively prevent it, which may lead to training failure.

In this post, inspired by 《Pion: A Spectrum-Preserving Optimizer via Orthogonal Equivalence Transformation》 (hereinafter referred to as Pion), I propose a Muon variant that separately updates the left and right singular vectors of a matrix—"Rotational Muon (MuonR)"—which keeps the matrix's singular value distribution unchanged, thereby ensuring training stability.

Recap of Previous Posts #

Since the matrices formed by the left and right singular vectors are necessarily orthogonal matrices, let us first briefly review Muon under orthogonal constraints. Let the parameter be , satisfying , and let the update step be . We want the parameter to still satisfy orthogonality after the update, so the corresponding spectral-norm steepest descent problem is

This can be solved to yield , where , where is the antisymmetrization operator. Taking the retraction operation into account, the complete update rule is:

In particular, if has full rank, it simplifies to

The derivation can be found in Steepest Descent on Manifolds, Part 2: Muon + Orthogonality, so we will not elaborate on it here. Whether it is Eq. or , they are both fully analytical and only add a few matrix multiplications on top of Muon without significantly increasing the complexity, so this result is entirely practical.

Now consider a matrix ; if it also satisfies , then we say that lies on the Stiefel manifold, which is a generalization of the concept of orthogonal matrices. The above results can theoretically be extended to the Stiefel manifold, but for non-square matrices one needs to solve a system of nonlinear equations, making it difficult to put into practice. For details, one can refer to Steepest Descent on Manifolds, Part 3: Muon + Stiefel.

Instantaneous Reparameterization #

Next, we turn our attention to an arbitrary parameter matrix , with the goal of keeping the singular values unchanged during parameter updates, thereby eliminating the possibility of anomalous singular value growth.

To achieve this goal, we adopt the idea of "instantaneous reparameterization": before the update begins, we first reparameterize the matrix as , where , and both are initialized as identity matrices. In this way, at initialization, holds, and by denoting , we can write

Subsequently, we agree to freeze , updating only and , while maintaining the orthogonality of throughout the update process, so that the updated still has the exact same singular values as . Now, from the perspective of , the problem once again becomes steepest descent on the orthogonal manifold, and at this point are both square matrices, and the corresponding steepest descent has a fully analytical solution! According to Eq. , we can directly write down the update rule:

where . Multiplying the new with , we obtain the complete update rule:

This is "Muon under Rotation (MuonR)", derived based on the idea of "instantaneous reparameterization". In practical scenarios, momentum is usually also present, which we understand as a smoothed gradient, so we only need to replace the gradient with momentum .

A Few Details #

Since the updates to each require computing once, even in the most ideal case (), the computational cost of MuonR is twice that of Muon. However, for sufficiently large models, this doubling of computation has a rather mild impact on end-to-end training time and is usually acceptable. If we want to reduce this overhead, we can consider an alternating update scheme for to amortize the computational cost.

In fact, the biggest issue with MuonR is that it keeps all singular values of the matrix unchanged from start to finish, which means we must fix all singular values of the parameters right at initialization. This is not easy, because matrices at different positions may require different scales, and forcing them to the same set of values is very likely suboptimal.

One viable idea is, on top of an appropriate random initialization, to prepend or append an element-wise multiplying vector to each matrix to compensate for scale degrees of freedom. For matrices immediately following an RMSNorm, the gamma parameter built into RMSNorm already plays this role, so this operation can be omitted for these matrices.

As for how to choose the initial singular values of the matrix, we can consider conventional random initialization, or constructing them in the form of Zipf's law. Furthermore, we can try adjusting the singular value entropy to the optimal entropy calculated in Is Higher Singular Value Entropy Always Better for Matrix Parameters?, in hopes of achieving better results.

Of course, if we can indeed determine the matrix's singular values in advance—for instance, if we already expect parameters at a certain position to remain orthogonal throughout—then we do not need to worry about any of this and can simply apply MuonR directly.

Switching Midway #

Another alternative approach is "switching midway", using MuonR merely as a means of "maintaining stability".

Specifically, we start by using standard Muon and monitor the spectral norm/Frobenius norm of the matrix. Once the norm of the matrix exceeds our desired range, we switch to MuonR. Since both variants of Muon depend only on the same gradient/momentum and differ only in their computations, such switching is permissible. Because MuonR does not change the singular values of the matrix, neither the spectral norm nor the Frobenius norm will grow any further, making it ideally suited as a tool for "maintaining stability".

However, it should be noted that we need to align the update magnitudes before and after switching as much as possible to avoid introducing 'abrupt changes'. To this end, we consider the first-order approximation of MuonR:

Since both have singular values no greater than 1 (note that we cannot guarantee that and are both full-rank, so we cannot directly use the orthogonality of ), we have and , and hence

Standard Muon is , where typically has an F-norm of , so to align the F-norm of the updates, switching from Muon to MuonR roughly requires multiplying the learning rate by .

In practice, the first inequality above may not be tight enough; and are mostly nearly orthogonal. According to the Pythagorean theorem, the result should be approximately equal to , in which case this factor should be multiplied by an additional . However, considering that and do not differ substantially, and to ensure usability in extreme cases, I suggest still keeping the form above.

Analysis of Similarities and Differences #

Right at the beginning of this article, I explicitly noted that MuonR was inspired by Pion; let us first look at the connections and differences between them.

First, the idea of restricting the update rule to the double-rotation form of multiplying on the left and right by orthogonal matrices mainly originated from Pion. After fixing this update form, obtaining the corresponding gradients via 'instantaneous reparameterization' is quite natural. Then, Pion and MuonR begin to 'part ways':

1. Pion uses the matrix exponential to achieve orthogonality, which in actual computation is approximated by expanding up to the second order;

2. Pion takes the Adam route, and computes separate moving averages of the gradients of , which brings its number of cached variable sets to 4;

3. MuonR takes the Muon route, caching only momentum just like Muon, which allows us to switch with Muon at any time;

4. MuonR is based on the analytical solution of steepest descent on the orthogonal manifold, requiring only a finite number of extra steps to achieve orthogonality exactly.

Overall, Pion's orthogonality design is somewhat empirical, and having four sets of cached variables can be a bit 'daunting'; MuonR, by contrast, is a relatively natural product of the line of work including Muon and steepest descent on the orthogonal manifold, and I believe it is overall more in line with first principles.

Summary #

This article proposes MuonR, a Muon variant that constrains the update form to left and right rotation matrices. It preserves the singular value distribution of the matrix and serves as a clean scheme for maintaining training stability.