Overview
This article (from zhichai.net, based on Jianlin Su's Muon optimizer series at kexue.fm/archives/11719) introduces streaming matrix computations as a way to replace expensive one-shot decompositions (SVD, polar decomposition) with cheap per-step updates embedded in the training loop.
Key idea
- Parameter matrices change very little between training steps (learning rates ~1e-3 to 1e-5), so quantities like the orthogonal projection or the largest singular value vary slowly and can be tracked incrementally rather than recomputed from scratch.
- Maintain a state S_t and update it cheaply each step: S_t ← Update(S_{t-1}, W_t), keeping S_t ≈ f(W_t).
- The Stiefel manifold St(m,n) = {W : W^T W = I_n} preserves signal norms (||Wx||₂ = ||x||₂), mitigating gradient vanishing/explosion and smoothing the optimization landscape.
- Standard approach: polar decomposition via full SVD, O(mn²) per step — too expensive.
- Streaming version: 1. Soft update: X_t ← (1 − α) X_{t-1} + α · W_t (α ≈ 0.1) 2. One Newton-Schulz step: X_t ← ½ X_t (3I − X_t^T X_t) 3. Set W_t ← X_t
- Only two extra matrix multiplications per step. Orthogonality error ||W^T W − I||_F stays around 1e-3–1e-2 in experiments; small errors self-correct over subsequent steps. Reported 2–5x training speedup with negligible performance loss.
- The spectral norm ||W||₂ (largest singular value) is the Lipschitz constant of a linear layer; clipping it to ≤ 1 aids adversarial robustness, generalization, and GAN stability.
- Traditional clipping W ← W / max(1, ||W||₂) requires SVD or many power iterations.
- mclip reuses Muon's maintained left/right singular vector estimates u_t, v_t:
- σ₁ ≈ u_t^T W v_t
- W ← W − max(0, σ₁ − 1) · u_t v_t^T
- Cost: one matrix-vector product, one outer product, one subtraction — O(mn). It clips only the largest singular value each step; because updates are small, clipping one direction per step converges globally to all σᵢ ≤ 1 (at most n steps for a fixed W), analogous to projected gradient descent.
- Matrix square root: Y_{k+1} = ½ Y_k (3I − Y_k²), streamed as one step per iteration.
- Approximate inverse: Z_{k+1} = 2Z_k − Z_k A Z_k.
- Streaming PCA via Oja's rule: v_{t+1} = v_t + η_t (x_t x_t^T v_t − (v_t^T x_t x_t^T v_t) v_t) — spiritually related to Muon's streaming power iteration.
1. Streaming Newton-Schulz for orthogonal projection (Stiefel manifold)
2. mclip: streaming spectral norm clipping
Cost comparison
| Method | Complexity | Constant factor | |---|---|---| | Full SVD projection | O(mn²) | large (~10–20n) | | Multi-step Newton-Schulz | O(kmn²) | moderate (~k) | | Spectral Normalization | O(mn + n²) | small | | Streaming Newton-Schulz | O(mn) | tiny | | mclip | O(mn) | tiny |
Streaming methods scale linearly with parameter size, offering order-of-magnitude speedups for large models.
Other streaming tricks
Conclusion
Streaming Newton-Schulz (orthogonality) and mclip (Lipschitz constraints) complete the Muon ecosystem: complex decompositions become gentle per-step refinements, yielding major efficiency gains with minimal accuracy cost. Open directions include rigorous streaming theory, integration with other efficient techniques, and validation at trillion-parameter scale.
References
1. Jianlin Su. Muon optimizer via streaming power iteration, Part 5: Extensions. Scientific Spaces, kexue.fm/archives/11719. 2. Jianlin Su. Earlier Muon optimizer series posts (streaming power iteration). 3. Polar decomposition and Newton-Schulz iteration literature (Stiefel manifold applications). 4. Spectral norm and Lipschitz constraints in GANs and adversarial training. 5. Unified streaming computation frameworks and Oja's rule extensions.