Command Palette
Search for a command to run...
Polar Express: 최적의 행렬 부호 함수 방법론과 Muon 알고리즘에의 적용
Polar Express: 최적의 행렬 부호 함수 방법론과 Muon 알고리즘에의 적용
Noah Amsel David Persson Christopher Musco Robert M. Gower
초록
극 분해 및 관련 행렬 부호 함수의 계산은 수치해석 분야에서 수십 년간 활발히 연구되어 온 문제이다. 최근 이 문제는 심층 신경망 학습을 위한 Muon 옵티마이저의 핵심 서브루틴으로 부상하였다. 그러나 이 응용 분야의 요구 사항은 고전적인 설정과 크게 다르다. 심층 학습에서는 높은 정밀도보다 높은 처리량(high throughput)을 우선시하는 GPU 친화적 알고리즘이 필요하다. 본 논문은 극 분해를 계산하기 위한 새로운 방법인 Polar Express를 소개한다. Newton-Schulz를 비롯한 고전적 다항식 방법과 마찬가지로, 본 접근법은 행렬 간 곱셈만 사용하므로 GPU에서 매우 효율적으로 실행된다. Chen & Chow 그리고 Nakatsukasa & Freund의 선행 연구를 기반으로, Polar Express는 매 반복에서 최소최대(minimax) 최적화 문제를 풀어 갱신 규칙을 적응적으로 조정한다. 본 논문은 이 전략이 최악의 경우(worst-case) 의미에서 오차를 최소화함을 증명하며, 이를 통해 Polar Express가 초기 반복 구간과 점근적 구간 모두에서 가능한 한 빠르게 수렴함을 보인다. 또한 유한 정밀도(finite-precision) 문제를 다루어 bfloat16 환경에서도 실용적으로 사용할 수 있도록 하였다. Muon에 통합하여 FineWeb 데이터셋에서 10억에서 100억 토큰으로 훈련한 GPT-2 모델에 적용한 결과, 다양한 학습률에 걸쳐 일관된 검증 손실 개선이 관찰되었으며, 최근 대안 방법들을 능가하는 성능을 보였다.
One-sentence Summary
Researchers at New York University and the Flatiron Institute propose Polar Express, a GPU-friendly polar decomposition method that solves a minimax optimization problem at each iteration to achieve provably optimal worst-case convergence in both early and asymptotic regimes, and demonstrate consistent validation loss improvements over recent alternatives when integrated into the Muon optimizer for GPT-2 training.
Key Contributions
- Polar Express introduces a polar decomposition method that adapts polynomial updates at each iteration by solving a minimax problem and uses only matrix-matrix multiplications, making it efficient for GPU-based Muon optimizers.
- The polynomial sequence is proved to give a worst-case optimal approximation to the sign function, with super-exponential convergence and rapid progress within just five to ten iterations.
- An implementation compatible with bfloat16 is evaluated on synthetic matrices, GPT-2 gradient matrices, and Muon-trained GPT-2 models on one to ten billion FineWeb tokens, improving validation loss across learning rates and being adopted in the NanoGPT speedrun.
Introduction
Advanced linear algebra is increasingly central to deep learning, especially in optimizers like Muon, which replaces the usual momentum direction with the polar factor of a gradient-based matrix. This polar factor is equivalent to a matrix sign function for square matrices and gives a steepest-descent direction under the spectral norm. For large language model training, the computation must be fast, GPU-friendly, memory efficient, and mainly useful at low or moderate accuracy.
Prior methods face practical limitations. A direct SVD is too expensive on GPUs, and many classical polar-decomposition methods require matrix inverses, QR factorizations, or other operations that do not parallelize well. Newton-Schulz is attractive because it uses only matrix-matrix products, but it converges slowly at first. Recent heuristic polynomial iterations reach low-accuracy estimates quickly, but they do not converge to the true polar factor.
The authors introduce Polar Express, a new GPU-friendly iterative method for approximating the matrix polar factor. It adapts the polynomial update rule at each iteration, balancing fast early progress and later accuracy. The method uses polynomials designed to optimize the worst-case approximation of the sign function, converges super-exponentially, and can produce useful approximations within a small number of iterations. Applied inside Muon, Polar Express improves GPT-2 training validation loss across learning rates and has been adopted in optimized NanoGPT training workflows.
Method
The authors design the method to compute polar(M) through operations that are efficient on GPUs: linear combinations of matrices and matrix-matrix products. Since matrix products are more expensive than linear combinations, the algorithm is structured to use as few matrix products as possible. For a matrix with singular value decomposition M=UΣV⊤, odd powers can be written as
M2q+1=UΣ2q+1V⊤=M(M⊤M)q.Therefore, for an odd polynomial
p(x)=a0x+a1x3+⋯+aqx2q+1,the matrix polynomial can be evaluated as
p(M)=a0M+a1M(M⊤M)+⋯+aqM(M⊤M)q.The central design choice is to approximate polar(M) using a composition of lower-degree odd polynomials. The full approximation has the form
p=pT∘pT−1∘⋯∘p1,and the matrix iterate is generated recursively by
X0=M,Xt=pt(Xt−1)for t=1,…,T.The final matrix XT is the approximation to polar(M). If each component polynomial has odd degree d, this composition requires only O(Td) matrix products. A standard Newton-Schulz iteration is a special case of this framework, but the authors choose the polynomials to minimize the worst-case approximation error.
Given known or estimated lower and upper bounds ℓ and u on the singular values of M, the goal is to find the composition that minimizes the spectral norm error in the worst case. Because
polar(M)−p(M)=U(I−p(Σ))V⊤,and the spectral norm is unitarily invariant, this reduces to a scalar uniform approximation problem: find a composed odd polynomial p such that p(x) stays as close as possible to 1 for all x∈[ℓ,u]. Formally,
p⋆=argp=pT∘pT−1∘⋯∘p1pt∈Pdoddminx∈[ℓ,u]max∣1−p(x)∣.The method solves this problem greedily across iterations. For the current interval [ℓt,ut], one odd-degree-d polynomial is chosen to minimize
x∈[ℓt,ut]max∣1−p(x)∣.This polynomial maps the current interval to a new interval
[ℓt+1,ut+1],which then becomes the target interval for the next polynomial. The bounds can be updated using
ℓt+1=pt(ℓt),ut+1=2−ℓt+1.The resulting composition is optimal among all compositions of T odd polynomials of degree d. The final approximation satisfies
∥polar(M)−XT∥2≤x∈[ℓ,u]max∣1−p⋆(x)∣=1−ℓT+1.When the singular values are normalized so that σ(M)⊂[ℓ,1] and d=2q+1, the error bound takes the stronger form
∥polar(M)−XT∥2≤∣1−ℓ2∣(q+1)T,which shows rapidly improving convergence as T grows.
As shown in the figure below:
The evolution of the intervals shows how each polynomial narrows the range of singular values that still deviate from 1. The first polynomial maps the original singular value interval into a new interval closer to 1, the second polynomial acts on that updated interval, and subsequent polynomials continue refining the approximation. This interval-based view is what makes the greedy construction optimal for the spectral norm error.
To find each polynomial pt, the method solves a minimax approximation problem: among all odd polynomials of the chosen degree, it selects the one that uniformly approximates the constant function 1 on the current interval [ℓt,ut]. For the low degrees used in practice, this can be done explicitly or with a simplified solver derived from the equioscillation property of minimax approximations. A full Remez-style procedure would also solve the problem, but because the target function is constant and the degree is small, the method uses a specialized low-degree construction that is simpler to implement and mathematically equivalent in the relevant setting.
The method also requires practical bounds on the singular values. A simple upper bound is ∥M∥F, the Frobenius norm of the matrix. In practice, the input matrix is rescaled by a quantity proportional to this norm, and the upper bound is set to u=1. The lower bound ℓ is harder to estimate efficiently, so the authors choose a small value such as ℓ=10−3 for floating-point workloads, particularly when operating in bfloat16. A poor lower-bound estimate does not destroy convergence; it mainly delays it by a small number of iterations.
There are also numerical safeguards for finite-precision arithmetic. If roundoff causes singular values to appear slightly above the current upper bound, each polynomial can be replaced by x↦pt(x/1.01), which effectively enlarges the interval and avoids instability. Because some optimal polynomials can be non-monotone near the beginning of the process, the early iterations can also use slightly suboptimal but less oscillatory polynomials. These changes stabilize the offline coefficient computation with negligible loss of approximation quality.
The overall pipeline has an offline stage and an online stage. During the offline stage, the polynomials p1,…,pT are precomputed once for fixed bounds ℓ and u. During the online stage, these stored coefficients are reused for every matrix update. For a degree-5 polynomial
pt(x)=ax+bx3+cx5,the matrix iteration can be evaluated efficiently with a Horner-like form. Setting
Yt−1=Xt−1⊤Xt−1,the update is
Xt=Xt−1(aI+Yt−1(bI+cYt−1)).In the recommended implementation, the composition is applied to a normalized matrix of the form
∥M∥F+10−2M,and a small number of iterations, typically five or six, are sufficient for the deep learning use case.
Experiment
The experiments evaluate Polar Express both as an iterative polar-factor approximation and as the matrix sign subroutine in Muon, comparing it with Newton-Schulz, Jordan’s method, and You’s method. On synthetic and real matrix approximations, Polar Express converges more reliably and faster than the baselines when its lower singular value bound is reasonable, while remaining competitive when that bound is misestimated. In GPT-2 training, replacing these polar approximation subroutines with Polar Express consistently improves validation and training loss without extra cost, and ablations show that using only a few Polar Express iterations is sufficient, with further accuracy or exact SVD-based computation not helping optimization. The gains persist under weight decay and longer training, though the margin narrows.