The Polar Express Algorithm
In this note we look at how the sign function can be approximated by compositions of polynomials, as in the Polar Express algorithm [1]. This simple idea has a number of applications in modern machine learning and optimization, as it can be used to approximate matrix functions using only matrix-matrix products, which are very efficient to compute on modern hardware such as GPUs. Applied to the singular values of a matrix, the approximation of the sign function gives the polar factor . This is, e.g., the basis of the update of the Muon optimizer [2], which would otherwise require an SVD, an expensive computation that is not very GPU friendly. Muon is explained as steepest descent in the spectral norm in Which Way Is Down? It is furthermore possible to approximate the ReLU function in a similar way, which can be used to project matrices onto the cone of positive semidefinite matrices.
1. The Singular Value Transformation
The singular value transformation is defined for any odd function , as
(1)
When is square and symmetric, the singular value transformation of an odd coincides with the matrix function , which applies to the eigenvalues. Writing shows that , and , and since is odd,
(2)
where the sign function is defined as the odd function
(3)
2. Approximating the Polar Normalization
Polar normalization corresponds to the singular value transformation when itself is the sign function, i.e.
(4)
where the last equality takes and from the compact SVD, which keeps only the singular vectors of the nonzero singular values. Zero singular values stay zero, as .
Computed directly, the polar factor requires an SVD, which is computationally expensive and not very GPU friendly (it is primarily memory bound rather than compute bound). The Polar Express algorithm instead approximates the matrix sign function using just matrix-matrix products [1]. The key idea is rather simple: Approximate the function using a composition of polynomials, e.g.,
(5)
Since the above is a composition of polynomials, it can be evaluated using just additions and multiplications.
ExampleΒ 1: NewtonβSchulz
Example 1 (NewtonβSchulz)Β Β The idea of approximating functions using repeated polynomial application is not new. An example is the NewtonβSchulz algorithm which is based on repeatedly applying the same polynomial, i.e. , in order to approximate the sign function. For order 3 and 5 the polynomials look as follows
(6)
While the NewtonβSchulz method converges for all , the convergence is only fast for values close to . Conversely, for values that are close to zero the convergence is slow. The slow convergence is exactly what the Polar Express method explained shortly aims to fix. The graph shows the cubic and quintic polynomials composed times, together with the sign function (dotted). The shaded interval is where they approximate it.
A note here is that for non-square matrices we cannot simply do . Instead, what is done is that .
3. The Polar Express Algorithm
The basic question that the Polar Express algorithm aims to solve is as follows: Given a set of polynomials , can we find an optimal set of coefficients that minimizes the maximum error over a given interval ? Define their composition as . We then solve
(7)
Here denotes the space of real odd polynomials of degree at most . Since is odd, , so the error is , and the problem is the scalar one of approximating on , or by oddness the sign function on .
In [1] they show that the above can be solved by a greedy approach, with a caveat that the error bound only holds if the smallest singular value is at least , which we do not know in advance. Smaller singular values still converge, but more slowly. A comment here is that the main focus in the paper is on bfloat16. Here the spacing between representable numbers at 1 is , so singular values much smaller than this are at the level of rounding errors. They therefore suggest setting , and after scaling by its Frobenius norm so that . In addition, they provide a few modifications in order to make the method numerically robust. These additions are skipped here, but can be found in the original paper.
Interactive figureΒ 1: Polar Express against NewtonβSchulz
Interactive figure 1 (Polar Express against NewtonβSchulz)Β Β The graph compares the first Polar Express polynomials for , composed, with the NewtonβSchulz quintic composed times, drawn as in Example 1. NewtonβSchulz approaches slowly from below, while Polar Express first lifts the small values and then oscillates around , with every step shrinking the oscillation. The oscillation is the price for the smallest worst-case error. By the equioscillation theorem, the polynomial with the smallest maximum error on an interval reaches that error several times with alternating sign [3], so each optimal step has to oscillate around . NewtonβSchulz instead matches the sign function closely at , where , which makes it accurate close to but slow close to zero. After a few steps the oscillations become too dense to be told apart, and soon after that too small to be seen. The readout gives both compositions at , which is too close to zero to be seen in the graph.
Values at , NewtonβSchulz and Polar Express:
Interactive figureΒ 2: Polar Express on a matrix
Interactive figure 2 (Polar Express on a matrix)Β Β The same polynomials applied to a matrix . A matrix maps the unit circle (dotted) to an ellipse whose semi-axes are its singular values. The dashed ellipse belongs to , scaled so that ,11 The scaling is a requirement: the polynomials are designed for singular values in , the positive half of in the previous figure, and larger singular values need not converge. Dividing by its Frobenius norm guarantees , as the Frobenius norm is at least the largest singular value. and its columns (the two points) can be dragged. The solid ellipse and arrows show the matrix after steps. Each step applies the next polynomial to the singular values, so the ellipse turns into the unit circle, which is the ellipse of .
After steps:
4. Projection onto the semidefinite cone
The positive semidefinite cone is the set of all real symmetric positive semidefinite matrices. That is
(8)
Semidefinite programming (SDP) problems are optimization problems for which matrix variables are constrained to be positive semidefinite, a special case of the conic programs in Conic Optimization. As such, algorithms that aim to solve SDPs need to ensure that the solution satisfies the positive semidefinite constraint. In interior point methods this is done by only taking steps for which the next iterate remains inside the cone, while first-order methods most often rely on projecting back onto the set after taking a step, i.e., for a symmetric ,
(9)
While the idea of projecting back onto the semidefinite cone using just matrix-matrix products is not new (a similar fixed-point approach was suggested in [4]), the main takeaway is that the ideas of Polar Express can be used to find a faster converging method [5]. An initial idea would be to directly find polynomials that approximate the ReLU function, i.e., solving
(10)
where is the total number of polynomials in the composition, is the degree of the βth polynomial, and the degrees are fixed in advance as part of a βmatrix-matrixβ multiplication budget. Unfortunately, directly solving the above is challenging, and instead a two-stage approach is proposed. The idea is to realize that we can write the ReLU function as
(11)
The first step is to compute optimal coefficients for approximating the sign function using the Polar Express approach. The second step is then to refine the coefficients of the polynomials found in the first step by minimizing the error to the ReLU function on the entire interval , i.e., minimizing the following loss function
(12)
Interactive figureΒ 3: From the sign function to the ReLU
Interactive figure 3 (From the sign function to the ReLU)Β Β The graph shows , with the Polar Express composition from the previous figure, together with the ReLU (dotted). The shaded interval is where it approximates the ReLU. The oscillation is inherited from , and the factor damps the error of where it is largest, close to zero.
Interactive figureΒ 4: Projecting a matrix onto the semidefinite cone
Interactive figure 4 (Projecting a matrix onto the semidefinite cone)Β Β The same idea for a symmetric matrix with eigenvalues and an eigenvector at angle . For each unit vector the graph draws a point at distance in the direction of , solid where and dashed where it is negative, so the lobes point along the eigenvectors and have lengths and . is positive semidefinite exactly when nothing is dashed.22 If is already positive semidefinite, the curve first moves away from and then returns. The first polynomials are tuned for singular values near and temporarily push values close to far off. The faint lobes are , the dotted curve its exact projection, and the bold curve the approximation after steps. As grows, the dashed lobes vanish and the solid ones grow slightly, since the negative eigenvalue no longer subtracts from them.
After steps:True projection:
Cite this post
@misc{paltorp2026polarexpress, author = {Paltorp, Mikkel}, title = {{The Polar Express Algorithm}}, year = {2026}, month = oct, url = {https://mipals.github.io/pdf/2026/01-03-polar-express/polar-express.pdf}, note = {Blog post}}Bibliography
- [1] N. Amsel, D. Persson, C. Musco, and R. M. Gower, βThe Polar Express: Optimal Matrix Sign Methods and Their Application to the Muon Algorithm.β [Online]. Available: https://arxiv.org/abs/2505.16932
- [2] K. Jordan et al., βMuon: An optimizer for hidden layers in neural networks.β [Online]. Available: https://kellerjordan.github.io/posts/muon/
- [3] L. N. Trefethen, Approximation Theory and Approximation Practice, Extended Edition. Society for Industrial, Applied Mathematics, 2019. doi: 10.1137/1.9781611975949.
- [4] J. B. Francisco and D. S. GonΓ§alves, βA fixed-point method for approximate projection onto the positive semidefinite cone,β Linear Algebra and its Applications, vol. 523, pp. 59β78, 2017, doi: 10.1016/j.laa.2017.02.014.
- [5] S. Kang, H. Han, A. Groudiev, and H. Yang, βFactorization-free Orthogonal Projection onto the Positive Semidefinite Cone with Composite Polynomial Filtering.β [Online]. Available: https://arxiv.org/abs/2507.09165