← All Posts
Deep Learning · OptimizersChapter 08 / 11

Muon, Part 2: Newton–Schulz Without the Mystery

How do you set every singular value of a matrix to $1$ without computing an SVD? Run $5$ steps of a simple matrix-multiply loop that pushes every $\sigma_i\in(0,1]$ up to $\approx 1$ in parallel.

Part 1 showed that Muon wants to turn a momentum matrix $M=U\Sigma V^\top$ into its orthogonal polar factor $Q=UV^\top$ by replacing every nonzero singular value $\sigma_i$ with $1$. Calling an exact SVD (`torch.linalg.svd`) on every weight matrix at every training step is slow on GPUs. Newton–Schulz iteration replaces SVD with $5$ fast `bfloat16` matrix multiplications that run directly on GPU Tensor Cores.

01 · SCALE TO [0, 1]Divide by $\|M\|_F$Ensure every singular value starts safely inside $[0,1]$ so high powers don’t explode.
02 · MULTIPLY 5×Apply odd powersRepeat $X\leftarrow aX+(bA+cA^2)X$ with $A=XX^\top$ for $5$ iterations in bfloat16.
03 · ORTHOGONAL QAll $\sigma_i \approx 1$Directions $U$ and $V^\top$ stay fixed while every active singular value is pushed to $\approx 1$.

1. Step 0: Divide by $\|M\|_F$ so all singular values start in $[0,1]$

Before running the polynomial loop, Muon divides the momentum matrix $M$ by its Frobenius norm $\|M\|_F$:

$$X_0=\frac{M}{\|M\|_F+\epsilon},\qquad\|M\|_F=\sqrt{\sum_{i,j}M_{ij}^2}=\sqrt{\sum_{i=1}^r\sigma_i^2}.$$

Why is this single division enough? Because no individual singular value $\sigma_i$ can exceed the square root of the sum of all squared singular values ($\sigma_i\le\sqrt{\sum_{j=1}^r\sigma_j^2}=\|M\|_F$). Dividing by $\|M\|_F$ guarantees that every singular value of $X_0$ starts between $0$ and $1$:

$$0\le\sigma_i(X_0)=\frac{\sigma_i(M)}{\sqrt{\sum_{j=1}^r\sigma_j^2}+\epsilon}\le 1.$$
Why $[0,1]$ matters

Polynomials with powers like $s^3$ and $s^5$ only behave well inside $[0,1]$. If a singular value started above $1$, raising it to the 3rd and 5th power repeatedly would make it explode to $\pm\infty$.

2. The key insight: why odd matrix products only change $\Sigma$

How can we change the singular values $\Sigma$ of a matrix $X=U\Sigma V^\top$ without ever computing $U$ or $V$? Look at what happens when we multiply $X$, $X^\top$, and $X$ together. Because $U$ and $V$ have perpendicular unit columns ($V^\top V=I$ and $U^\top U=I$), the inner matrices cancel out like dominoes:

$$\begin{aligned}(X X^\top)X&=(U\Sigma\underbrace{V^\top)(V}_{=\,I}\Sigma\underbrace{U^\top)(U}_{=\,I}\Sigma V^\top)=U\Sigma^3 V^\top,\\(X X^\top)^2 X&=(U\Sigma^2\underbrace{U^\top)(U}_{=\,I}\Sigma^2\underbrace{U^\top)(U}_{=\,I}\Sigma V^\top)=U\Sigma^5 V^\top.\end{aligned}$$

Notice what happened: $U$ and $V^\top$ stay completely untouched on the outside, while the diagonal matrix $\Sigma$ in the middle gets raised to odd powers ($\Sigma^3$, $\Sigma^5$). Therefore, combining $X$, $(XX^\top)X$, and $(XX^\top)^2 X$ applies an ordinary 1D polynomial $\phi(s)=as+bs^3+cs^5$ to every singular value $s=\sigma_i$ at the exact same time:

$$X_{k+1}=a X_k+b(X_k X_k^\top)X_k+c(X_k X_k^\top)^2 X_k=U\,\phi(\Sigma_k)\,V^\top,\qquad\sigma_{k+1,i}=\phi(\sigma_{k,i}).$$

This turns the entire matrix problem into a simple 1D question: choose a curve $\phi(s)$ that pushes any number $s\in(0,1]$ up to $1$ in as few steps as possible!

3. Where the classical cubic $\phi(s)=\tfrac32 s-\tfrac12 s^3$ comes from

Since Section 2 showed that any odd matrix polynomial acts on each singular value $s$ one number at a time, let’s derive the formula on a single number $s\in(0,1]$ first, and then write it in matrix form:

1. The exact goal (why $(XX^\top)^{-1/2}X = UV^\top$ and $QQ^\top = I$): Watch the transpose carefully on $X=U\Sigma V^\top$ (with rows $\le$ cols so $V^\top V=I$ and $UU^\top=I$). In $XX^\top$, the inner $V^\top V=I$ cancels, leaving $U$ and $U^\top$ on the outside—so $XX^\top = U\Sigma^2 U^\top$ (not $U\Sigma^2 V^\top$!). Taking its inverse square root $(XX^\top)^{-1/2}=U\Sigma^{-1}U^\top$ and multiplying by $X$ cancels $\Sigma$ to give $Q=UV^\top$ (note that $Q=UV^\top$ itself is not $I$, but $QQ^\top = UV^\top V U^\top = UU^\top = I$):

$$\begin{aligned}\textbf{1D scalar:}\quad &1=(s^2)^{-1/2}s,\\[6pt]\textbf{Matrix:}\quad &XX^\top=(U\Sigma\underbrace{V^\top)(V}_{=\,I}\Sigma U^\top)=U\Sigma^2 U^\top\implies (XX^\top)^{-1/2}=U\Sigma^{-1}U^\top,\\[4pt]&Q=(XX^\top)^{-1/2}X=(U\Sigma^{-1}\underbrace{U^\top)(U}_{=\,I}\Sigma V^\top)=U\underbrace{\Sigma^{-1}\Sigma}_{=\,I}V^\top=UV^\top\quad(\text{where }QQ^\top=UU^\top=I).\end{aligned}$$

2. Avoid the square root via the Taylor expansion of $f(e)=(1-e)^{-1/2}$: Since our target has $QQ^\top=I$, measure how far $XX^\top=U\Sigma^2 U^\top$ is from $I=UU^\top$ via the error $E=I-XX^\top=U(I-\Sigma^2)U^\top$, or on each singular value $e=1-s^2$ (so $s^2=1-e$). Around $e=0$, the Taylor series $f(e)=f(0)+f'(0)e+\tfrac12 f''(0)e^2+\cdots$ has $f(0)=1$ and $f'(e)=-\tfrac12(1-e)^{-3/2}(-1)\implies f'(0)=+\tfrac12$:

$$(s^2)^{-1/2}=(1-e)^{-1/2}=\underbrace{1}_{f(0)}+\underbrace{\frac12 e}_{f'(0)e}+\underbrace{\frac38 e^2}_{\frac12 f''(0)e^2}+\cdots\;\approx\;1+\frac12 e=1+\frac12(1-s^2)=\frac32-\frac12 s^2.$$

3. Substitute Step 2 into Step 1—and why we need a loop when $X_0 X_0^\top$ is nowhere near $I$: At step $0$, small singular values ($s_0\ll 1$) make $X_0 X_0^\top=U\Sigma_0^2 U^\top$ nowhere near $I$ ($e_0=1-s_0^2\approx 1$, not $0$). That is why one Taylor step does not jump straight to $UV^\top$! Instead, for any $s_k\in(0,1)$, the multiplier $1+\tfrac12(1-s_k^2)\in(1,1.5)$ is strictly greater than $1$, so each step pushes $s_{k+1}$ closer to $1$—shrinking $E_k=U(I-\Sigma_k^2)U^\top\to 0$ and driving $X_k X_k^\top\to I$ over multiple iterations:

$$\begin{aligned}\textbf{Substitutions:}\quad &1\;\longleftrightarrow\;I,\qquad s_k\;\longleftrightarrow\;X_k,\qquad s_k^2\;\longleftrightarrow\;X_k X_k^\top,\qquad e_k=1-s_k^2\;\longleftrightarrow\;E_k=I-X_k X_k^\top\\[8pt]\textbf{1D scalar:}\quad &\underbrace{(s_k^2)^{-1/2}s_k}_{\text{Step 1 exact }(=1)}\;\approx\;s_{k+1}=\underbrace{\left(1+\frac12 e_k\right)}_{\text{Step 2 Taylor}}\!s_k=\left(1+\frac12(1-s_k^2)\right)s_k=\frac32 s_k-\frac12 s_k^3,\\[8pt]\textbf{Matrix:}\quad &\underbrace{(X_k X_k^\top)^{-1/2}X_k}_{\text{Step 1 exact }(=UV^\top)}\;\approx\;X_{k+1}=\underbrace{\left(I+\frac12 E_k\right)}_{\text{Step 2 Taylor}}\!X_k=\left(I+\frac12(I-X_k X_k^\top)\right)X_k=\frac32 X_k-\frac12(X_k X_k^\top)X_k.\end{aligned}$$

4. Why Muon upgrades to a tuned 5-step quintic

Why doesn’t Muon just use the classical cubic? When a large weight matrix has hundreds of singular values, dividing by $\|M\|_F=\sqrt{\sum_j\sigma_j^2}$ makes the smaller singular values very close to zero ($s_0\ll 1$). Near $s=0$, $s^3$ is negligible, so the cubic curve $\phi_{\text{cubic}}(s)\approx 1.5s$ only multiplies a small singular value by $1.5\times$ per step—at most $1.5^5\approx 7.6\times$ across $5$ steps.

To lift quiet singular directions much faster, Muon adds a degree-$5$ term $A_k^2 X_k$ with tuned coefficients $(a,b,c)=(3.4445,-4.7750,2.0315)$:

$$\begin{aligned}A_k&=X_k X_k^\top,\\X_{k+1}&=a X_k+\bigl(b A_k+c A_k^2\bigr)X_k,\qquad\phi_{\text{quintic}}(s)=3.4445s-4.7750s^3+2.0315s^5.\end{aligned}$$
Plot of the 1D scalar polynomials for the classical cubic and Muon quintic on [0, 1], with a shaded target band [0.7, 1.2].
Scroll the figure horizontally on small screens.
Muon’s quintic has a $3.44\times$ initial slope at $s=0$ (over $2\times$ steeper than the cubic’s $1.5\times$ slope), launching small singular values rapidly into the shaded $[0.7, 1.2]$ band around $1.0$.
Method1D Scalar Map $\phi(s)$Boost Slope Near $s=0$Max 5-Step BoostBehavior Near $s=1$
Exact SVD$s \mapsto 1$ (in 1 step)$\infty$ (exact step)Exact $1.000$Exact $1.000$, but slow on GPU Tensor Cores.
Classical Cubic NS$1.5s - 0.5s^3$$1.5\times$ per step$1.5^5 \approx 7.6\times$Converges smoothly to $1.000$, but too slow for tiny $s_0$.
Muon Quintic NS$3.4445s - 4.7750s^3 + 2.0315s^5$$3.4445\times$ per step$3.4445^5 \approx 484\times$Trades exact convergence for speed; stays inside $[0.7, 1.2]$.

The engineering trade-off: Notice in the plot that the orange quintic curve wiggles inside $[0.7,1.2]$ rather than sitting flat at $1.000$. In noisy mini-batch training using `bfloat16`, lifting weak singular values by up to $484\times$ into $[0.7,1.2]$ in just $5$ steps is far more valuable than spending $20+$ steps chasing extra decimal places.

5. Lab: follow both singular values

Start from a $2\times 2$ matrix with adjustable singular values $(s_1,s_2)$ below. Each step runs the actual matrix multiplication and plots how both singular values move toward $1$.

Inside one Muon matrix transform

Choose an iteration budget, then click Play or Step to watch the ellipse become a circle as both singular values approach $1$.

6. Code to equation: how each line builds the 3rd-order and 5th-order polynomials

First, notice why both implementations transpose tall matrices ($m>n$) at the start: because $(X_k X_k^\top)X_k=X_k(X_k^\top X_k)$, ensuring $\text{rows}\le\text{cols}$ guarantees that $\texttt{A = X @ X.T}$ always has the smaller shape $\min(m,n)\times\min(m,n)$ (e.g., $1024\times 1024$ instead of $4096\times 4096$).

1. 3rd-order (cubic) Newton–Schulz: $\phi_3(s)=1.5s-0.5s^3$

def newton_schulz_3(G, steps=15, eps=1e-7):
    X = G.bfloat16()
    if G.size(0) > G.size(1):
        X = X.T                        # Ensure rows <= cols so A is small
    X = X / (X.norm() + eps)           # Step 0: scale all singular values into [0, 1]
    for _ in range(steps):
        A = X @ X.T                    # Line 1: forms s^2
        X = 1.5 * X - 0.5 * (A @ X)    # Line 2: combines s^1 and s^3
    if G.size(0) > G.size(1):
        X = X.T
    return X

Starting from $X_k=U\Sigma_k V^\top$ (with singular values $s$), here is how each step inside the `newton_schulz_3` loop builds the cubic equation:

$$\begin{aligned}\textbf{Input }&\bigl(\texttt{X}\bigr):& X_k&=U\Sigma_k V^\top&&\longleftrightarrow\;s^1\\\textbf{Line 1 }&\bigl(\texttt{A = X @ X.T}\bigr):& A_k&=X_k X_k^\top=(U\Sigma_k V^\top)(V\Sigma_k U^\top)=U\Sigma_k^2 U^\top&&\longleftrightarrow\;s^2\\\textbf{Product }&\bigl(\texttt{A @ X}\bigr):& A_k X_k&=(U\Sigma_k^2 U^\top)(U\Sigma_k V^\top)=U\Sigma_k^3 V^\top&&\longleftrightarrow\;s^3\\\textbf{Line 2 }&\bigl(\texttt{X = 1.5*X - 0.5*(A @ X)}\bigr):& X_{k+1}&=1.5X_k-0.5(X_k X_k^\top)X_k=U\bigl(1.5\Sigma_k-0.5\Sigma_k^3\bigr)V^\top&&\longleftrightarrow\;\phi_3(s)=1.5s-0.5s^3\end{aligned}$$

2. Muon’s 5th-order (quintic) Newton–Schulz: $\phi_5(s)=as+bs^3+cs^5$

def newton_schulz_5(G, steps=5, eps=1e-7):
    a, b, c = (3.4445, -4.7750, 2.0315)
    X = G.bfloat16()
    if G.size(0) > G.size(1):
        X = X.T                        # Ensure rows <= cols so A is small
    X = X / (X.norm() + eps)           # Step 0: scale all singular values into [0, 1]
    for _ in range(steps):             # 5 fast bfloat16 Tensor Core iterations
        A = X @ X.T                    # Line 1: forms s^2
        B = b * A + c * (A @ A)        # Line 2: combines b*s^2 + c*s^4
        X = a * X + B @ X              # Line 3: a*s + (b*s^2 + c*s^4)*s = a*s + b*s^3 + c*s^5
    if G.size(0) > G.size(1):
        X = X.T                        # Restore original (m, n) shape
    return X

Here is how each step inside the `newton_schulz_5` loop builds the 5th-order equation using only $3$ matrix multiplications ($\texttt{X @ X.T}$, $\texttt{A @ A}$, and $\texttt{B @ X}$):

$$\begin{aligned}\textbf{Input }&\bigl(\texttt{X}\bigr):& X_k&=U\Sigma_k V^\top&&\longleftrightarrow\;s^1\\\textbf{Line 1 }&\bigl(\texttt{A = X @ X.T}\bigr):& A_k&=X_k X_k^\top=U\Sigma_k^2 U^\top&&\longleftrightarrow\;s^2\\\textbf{Square }&\bigl(\texttt{A @ A}\bigr):& A_k^2&=(X_k X_k^\top)^2=U\Sigma_k^4 U^\top&&\longleftrightarrow\;s^4\\\textbf{Line 2 }&\bigl(\texttt{B = b*A + c*(A @ A)}\bigr):& B_k&=bA_k+cA_k^2=U\bigl(b\Sigma_k^2+c\Sigma_k^4\bigr)U^\top&&\longleftrightarrow\;bs^2+cs^4\\\textbf{Product }&\bigl(\texttt{B @ X}\bigr):& B_k X_k&=\bigl(bA_k+cA_k^2\bigr)X_k=U\bigl(b\Sigma_k^3+c\Sigma_k^5\bigr)V^\top&&\longleftrightarrow\;bs^3+cs^5\\\textbf{Line 3 }&\bigl(\texttt{X = a*X + B @ X}\bigr):& X_{k+1}&=aX_k+B_k X_k=aX_k+b(X_k X_k^\top)X_k+c(X_k X_k^\top)^2 X_k\\&&&=U\bigl(a\Sigma_k+b\Sigma_k^3+c\Sigma_k^5\bigr)V^\top&&\longleftrightarrow\;\phi_5(s)=as+bs^3+cs^5\end{aligned}$$

7. Questions worth answering

Does “Newton–Schulz” mean Muon computes second derivatives (the Hessian) of the training loss?

No. “Newton” here refers only to finding the root $s=1$ of $s^2-1=0$ for the singular values of the momentum matrix $M_t$. Muon only ever uses standard first-order backpropagated gradients.

Why can the polynomial only use odd powers ($s, s^3, s^5$) and not even powers ($s^2, s^4$)?

Two reasons: (1) for a rectangular matrix $X\in\mathbb R^{m\times n}$, $X^2$ does not even exist because the inner dimensions $m$ and $n$ don’t match—only alternating odd products like $X(X^\top X)^k\in\mathbb R^{m\times n}$ preserve the shape of $X$; and (2) odd powers preserve the sign/orientation of every singular direction.

What happens to a zero singular value ($\sigma_i=0$)?

Because $\phi(0)=a(0)+b(0)^3+c(0)^5=0$, any zero singular value stays strictly $0$ at every step rather than amplifying noise.

Sources

Higham, Computing the Polar Decomposition—with Applications; Keller Jordan, Muon: An optimizer for hidden layers in neural networks; Muon reference implementation.