<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>AI — mizorewww</title>
    <link>https://mizore.blog/en/tags/ai/</link>
    <link xmlns="http://www.w3.org/2005/Atom" href="https://mizore.blog/en/tags/ai/feed.xml" rel="self" type="application/rss+xml"></link>
    <description>2 posts</description>
    <language>en</language>
    <lastBuildDate>Tue, 24 Nov 2026 00:00:00 +0000</lastBuildDate>
    <item>
      <title>From Transformer Matrix Flows to Modern Optimizer Derivations (SGD → AdamW → Muon)</title>
      <link>https://mizore.blog/en/posts/from-transformer-matrices-to-muon/</link>
      <description>&lt;p&gt;Deep learning courses and production codebases often meet across a noticeable conceptual gap. Chapters on neural architectures—such as the Transformer&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-vaswani2017-1&#34; href=&#34;#ref-vaswani2017&#34;&gt;[1]&lt;/a&gt;&lt;/sup&gt;—revolve around three-dimensional activation tensors, multi-head subspace projections, and causal attention matrices. Chapters on optimization—such as SGD&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-robbins1951-1&#34; href=&#34;#ref-robbins1951&#34;&gt;[2]&lt;/a&gt;&lt;/sup&gt; and AdamW&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-loshchilov2019-1&#34; href=&#34;#ref-loshchilov2019&#34;&gt;[3]&lt;/a&gt;&lt;/sup&gt;—collapse every parameter in the network into a flat vector &lt;code&gt;$\theta \in \mathbb{R}^p$&lt;/code&gt; and study scalar coordinate updates on quadratic bowls.&lt;/p&gt;&#xA;&lt;p&gt;The moment you open an actual large language model pretraining script, the seam between those two narratives surfaces as concrete questions about memory layout, matrix contractions, and operator geometry. This post follows a single bottom-up chain of derivations to align both halves into one coherent picture.&lt;/p&gt;&#xA;&lt;h2 id=&#34;five-core-questions-and-roadmap&#34;&gt;Five Core Questions and Roadmap&lt;/h2&gt;&#xA;&lt;p&gt;Specifically, we work through five connected questions in order:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;GPU memory simultaneously holds token embedding tables, &lt;code&gt;$Q/K/V$&lt;/code&gt; projection weights, &lt;code&gt;$T \times T$&lt;/code&gt; attention score matrices, the &lt;code&gt;KV Cache&lt;/code&gt;, gradient buffers, and momentum states. What mathematical role does each of these &amp;quot;matrices&amp;quot; play, which ones belong to the model itself, and which ones exist only transiently during inference or training?&lt;/li&gt;&#xA;&lt;li&gt;Chat inference generates one token at a time sequentially—so why does training code have no token-by-token loop, feeding the entire sequence into the network at once? And why does training the exact same model require several times more VRAM than running inference?&lt;/li&gt;&#xA;&lt;li&gt;The loss function outputs a single scalar &lt;code&gt;$L \in \mathbb{R}$&lt;/code&gt;. Through what exact matrix algebra does &lt;code&gt;loss.backward()&lt;/code&gt; produce a two-dimensional gradient matrix &lt;code&gt;$G$&lt;/code&gt; matching the shape of each weight matrix &lt;code&gt;$W$&lt;/code&gt;—and why is the singular value spectrum of &lt;code&gt;$G$&lt;/code&gt; so heavily skewed?&lt;/li&gt;&#xA;&lt;li&gt;Moving from &lt;code&gt;SGD&lt;/code&gt; to &lt;code&gt;Momentum&lt;/code&gt;, &lt;code&gt;Adam&lt;/code&gt;, and &lt;code&gt;AdamW&lt;/code&gt;, what specific mathematical limitation did each generation solve, and how are bias correction and decoupled weight decay derived from first principles?&lt;/li&gt;&#xA;&lt;li&gt;When a parameter is a two-dimensional linear operator of shape &lt;code&gt;$d_{\mathrm{out}} \times d_{\mathrm{in}}$&lt;/code&gt;, what geometric structure do entrywise adaptive methods ignore? How does the matrix optimizer &lt;code&gt;Muon&lt;/code&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-jordan2024-1&#34; href=&#34;#ref-jordan2024&#34;&gt;[4]&lt;/a&gt;&lt;/sup&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-liu2025-1&#34; href=&#34;#ref-liu2025&#34;&gt;[5]&lt;/a&gt;&lt;/sup&gt; derive the semi-orthogonal update direction &lt;code&gt;$U V^\top$&lt;/code&gt; from induced operator norms, and how does it replace singular value decomposition with five half-precision matrix multiplications?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;We start from the autoregressive factorization of sequence probability and classify every tensor in inference and training into four lifecycle families (Section 1). Next, we derive the forward and backward equations of a single training step, exposing the sum-of-outer-products structure of linear-layer gradients (Section 2). Under a unified variational principle—local linearization plus a proximal penalty or norm-ball constraint—we then derive four generations of entrywise optimizers (&lt;code&gt;SGD&lt;/code&gt; &lt;code&gt;$\to$&lt;/code&gt; &lt;code&gt;Momentum&lt;/code&gt; &lt;code&gt;$\to$&lt;/code&gt; &lt;code&gt;Adam&lt;/code&gt; &lt;code&gt;$\to$&lt;/code&gt; &lt;code&gt;AdamW&lt;/code&gt;, Section 3) followed by two-dimensional spectral optimizers (&lt;code&gt;Shampoo&lt;/code&gt; &lt;code&gt;$\to$&lt;/code&gt; &lt;code&gt;Muon&lt;/code&gt; &lt;code&gt;$\to$&lt;/code&gt; Moonshot AI&#39;s RMS-aligned scaling, Sections 4–5). Finally, we close the loop with a GPU roofline analysis, controlled ablation benchmarks, and a self-contained single-file PyTorch implementation (Sections 6–7).&lt;/p&gt;&#xA;&lt;h2 id=&#34;birds-eye-overview-model-inference-training-and-optimizers-on-one-map&#34;&gt;Bird&#39;s-Eye Overview: Model, Inference, Training, and Optimizers on One Map&lt;/h2&gt;&#xA;&lt;p&gt;Before diving into local equations, it helps to see how the pieces fit together globally. An LLM itself is nothing more than a fixed set of &lt;strong&gt;static parameter matrices &lt;code&gt;$\Theta$&lt;/code&gt;&lt;/strong&gt; persisted on disk and in VRAM—comprising the boundary vocabulary tables &lt;code&gt;$E_{\mathrm{tok}}, W_{\mathrm{head}}$&lt;/code&gt;, &lt;code&gt;$L$&lt;/code&gt; stacked layers of 2D linear operators &lt;code&gt;$W_q, W_k, W_v, W_o, W_{\mathrm{up}}, W_{\mathrm{down}}$&lt;/code&gt;, and 1D normalization gain vectors &lt;code&gt;$\gamma$&lt;/code&gt;. Around that single set of parameters &lt;code&gt;$\Theta$&lt;/code&gt;, &lt;strong&gt;inference&lt;/strong&gt; and &lt;strong&gt;training&lt;/strong&gt; form two distinct dataflows:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Inference is a read-only one-way pipeline&lt;/strong&gt; (Section 1): &lt;code&gt;$\Theta$&lt;/code&gt; remains frozen throughout. Input prompt tokens first pass through a parallel &lt;code&gt;Prefill&lt;/code&gt; GEMM stage that populates the historical &lt;code&gt;KV Cache&lt;/code&gt;; subsequent &lt;code&gt;Decode&lt;/code&gt; steps feed a single new token row via matrix-vector products (GEMV) to sample one token at a time, freeing transient activations immediately after each layer.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Training is a parameter-mutating four-step closed loop&lt;/strong&gt; (Sections 2–5): to propagate prediction errors back through every layer, &lt;strong&gt;1. Parallel Forward&lt;/strong&gt; must retain intermediate activations &lt;code&gt;$X$&lt;/code&gt; in VRAM; &lt;strong&gt;2. Cross-Entropy Loss&lt;/strong&gt; reduces all token predictions into a single scalar &lt;code&gt;$L$&lt;/code&gt;; &lt;strong&gt;3. Backward&lt;/strong&gt; applies the chain-rule contraction &lt;code&gt;$G = \Delta^\top X$&lt;/code&gt; to sum out the batch-and-token axis, producing a gradient matrix &lt;code&gt;$G$&lt;/code&gt; of the exact same shape as each parameter; finally, &lt;strong&gt;4. Optimizer Step&lt;/strong&gt; combines &lt;code&gt;$G$&lt;/code&gt; with historical states to overwrite &lt;code&gt;$\Theta$&lt;/code&gt;—routing boundary lookup/scoring tables to entrywise &lt;code&gt;AdamW&lt;/code&gt; (Section 3) and the internal 2D linear operators (&amp;gt;95% of non-embedding parameters) to spectral &lt;code&gt;Muon&lt;/code&gt; (Sections 4–5).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;figure class=&#34;diagram&#34; style=&#34;--h:292px;--hn:484px&#34;&gt;&lt;figcaption&gt;Bird&amp;#39;s-Eye Overview: How Static Parameters &lt;code&gt;$\Theta$&lt;/code&gt; Sit Between Read-Only Inference and the 4-Step Training Loop&lt;/figcaption&gt;&lt;p&gt;&lt;a href=&#34;https://mizore.blog/en/posts/from-transformer-matrices-to-muon/&#34;&gt;(See the figure in the post.)&lt;/a&gt;&lt;/p&gt;&lt;p class=&#34;figure-note&#34;&gt;Blue denotes static model parameters &lt;code&gt;$\Theta$&lt;/code&gt;; teal denotes transient activations or updates; violet denotes the inference KV Cache or momentum buffers; orange denotes backward gradient matrices.&lt;/p&gt;&lt;/figure&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;1-autoregressive-factorization-and-the-four-tensor-families-in-vram&#34;&gt;1. Autoregressive Factorization and the Four Tensor Families in VRAM&lt;/h2&gt;&#xA;&lt;h3 id=&#34;11-what-a-language-model-computes-chain-rule-of-probability-and-token-embeddings&#34;&gt;1.1 What a Language Model Computes: Chain Rule of Probability and Token Embeddings&lt;/h3&gt;&#xA;&lt;p&gt;Let the vocabulary &lt;code&gt;$\mathcal{V} = \{0, 1, \dots, V-1\}$&lt;/code&gt; contain &lt;code&gt;$V$&lt;/code&gt; discrete tokens. Given a token sequence &lt;code&gt;$x_{1:T} = (x_1, x_2, \dots, x_T) \in \mathcal{V}^T$&lt;/code&gt; of length &lt;code&gt;$T$&lt;/code&gt;, the product rule of probability decomposes the joint distribution of the entire sequence—with zero approximation—into a product of next-token conditional probabilities given each prefix:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$p_\Theta(x_1, x_2, \dots, x_T) = \prod_{t=1}^{T} p_\Theta(x_t \mid x_1, \dots, x_{t-1})$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Here &lt;code&gt;$\Theta$&lt;/code&gt; denotes the collection of all learnable parameters. The modeling objective of an LLM is to construct a &lt;code&gt;$\Theta$&lt;/code&gt;-parameterized function that takes a prefix &lt;code&gt;$x_{1:t}$&lt;/code&gt;, outputs a vector of unnormalized log-scores (logits) &lt;code&gt;$z_t \in \mathbb{R}^V$&lt;/code&gt; over all &lt;code&gt;$V$&lt;/code&gt; candidate next tokens, and maps them to a valid probability distribution via Softmax:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$p_\Theta(x_{t+1} = k \mid x_{1:t}) = \frac{\exp(z_{t,k})}{\sum_{m=0}^{V-1} \exp(z_{t,m})}, \qquad k \in \{0, \dots, V-1\}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Because discrete token IDs are arbitrary dictionary indices—token &lt;code&gt;500&lt;/code&gt; is not &amp;quot;twice&amp;quot; token &lt;code&gt;250&lt;/code&gt;—calculus derivatives cannot act directly on integers. The network therefore begins with a token embedding matrix &lt;code&gt;$E_{\mathrm{tok}} \in \mathbb{R}^{V \times D}$&lt;/code&gt; that maps each integer ID &lt;code&gt;$x_t$&lt;/code&gt; to row &lt;code&gt;$x_t$&lt;/code&gt; in continuous space &lt;code&gt;$\mathbb{R}^D$&lt;/code&gt;. Writing &lt;code&gt;$u_{x_t} \in \{0,1\}^V$&lt;/code&gt; for the one-hot column vector with a &lt;code&gt;$1$&lt;/code&gt; only at index &lt;code&gt;$x_t$&lt;/code&gt;, row lookup is algebraically identical to the sparse matrix product &lt;code&gt;$u_{x_t}^\top E_{\mathrm{tok}} \in \mathbb{R}^{1 \times D}$&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Row lookup alone is still not enough on a sequence of length &lt;code&gt;$T$&lt;/code&gt;: inner products in self-attention are permutation-equivariant with respect to token order (without positional information, swapping &amp;quot;cat chased dog&amp;quot; into &amp;quot;dog chased cat&amp;quot; merely permutes the output rows without changing their representations). Adding absolute or relative positional encodings &lt;code&gt;$E_{\mathrm{pos}} \in \mathbb{R}^{T \times D}$&lt;/code&gt; produces the initial hidden state &lt;code&gt;$X^{(0)} \in \mathbb{R}^{T \times D}$&lt;/code&gt; (or a 3D tensor in &lt;code&gt;$\mathbb{R}^{B \times T \times D}$&lt;/code&gt; across a batch of &lt;code&gt;$B$&lt;/code&gt; sequences). Every subsequent sublayer adds its output back onto this shared highway via &lt;code&gt;$X \leftarrow X + \mathrm{Sublayer}(X)$&lt;/code&gt;, known as the &lt;strong&gt;residual stream&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;12-forward-equations-of-a-single-transformer-block&#34;&gt;1.2 Forward Equations of a Single Transformer Block&lt;/h3&gt;&#xA;&lt;p&gt;Modern open-weights LLMs (such as Llama, Qwen, and DeepSeek) almost universally adopt a bias-free Pre-RMSNorm decoder block&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-vaswani2017-2&#34; href=&#34;#ref-vaswani2017&#34;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-zhang2019-1&#34; href=&#34;#ref-zhang2019&#34;&gt;[6]&lt;/a&gt;&lt;/sup&gt;. Given a single sequence&#39;s residual stream &lt;code&gt;$X \in \mathbb{R}^{T \times D}$&lt;/code&gt; with hidden width &lt;code&gt;$D$&lt;/code&gt;, define row-wise root-mean-square normalization on a row vector &lt;code&gt;$x \in \mathbb{R}^D$&lt;/code&gt; as &lt;code&gt;$\mathrm{RMSNorm}(x) = \frac{x}{\sqrt{\frac{1}{D}\sum_{i=1}^D x_i^2 + \epsilon}} \odot \gamma$&lt;/code&gt;, where &lt;code&gt;$\epsilon &amp;gt; 0$&lt;/code&gt; guards against division by zero, &lt;code&gt;$\gamma \in \mathbb{R}^D$&lt;/code&gt; is a learnable per-channel gain vector, and &lt;code&gt;$\odot$&lt;/code&gt; denotes elementwise (Hadamard) multiplication (whose backward orthogonality we derive in Section 2.1). Each Transformer layer then applies two sublayers:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Sublayer 1: Multi-Head Causal Self-Attention.&lt;/strong&gt; Row-wise normalization &lt;code&gt;$H = \mathrm{RMSNorm}(X) \in \mathbb{R}^{T \times D}$&lt;/code&gt; is projected by three linear matrices into queries, keys, and values:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$Q = H W_q^\top, \qquad K = H W_k^\top, \qquad V_{\mathrm{val}} = H W_v^\top$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;where &lt;code&gt;$W_q, W_k, W_v \in \mathbb{R}^{D \times D}$&lt;/code&gt;. Computing a single inner product across the full &lt;code&gt;$D$&lt;/code&gt;-dimensional space would give each token only one scalar attention distribution per layer, forcing coreference, syntactic modification, and local collocations to compete for the same weights. Instead, the hidden width &lt;code&gt;$D$&lt;/code&gt; is partitioned into &lt;code&gt;$H_{\mathrm{head}}$&lt;/code&gt; parallel subspaces (attention heads) of width &lt;code&gt;$d_k = D / H_{\mathrm{head}}$&lt;/code&gt;. In batched code, a &lt;code&gt;$(B, T, D)$&lt;/code&gt; tensor is reshaped to &lt;code&gt;$(B, T, H_{\mathrm{head}}, d_k)$&lt;/code&gt; and transposed to &lt;code&gt;$(B, H_{\mathrm{head}}, T, d_k)$&lt;/code&gt;. On head &lt;code&gt;$h$&lt;/code&gt;&#39;s slices &lt;code&gt;$Q^{(h)}, K^{(h)}, V_{\mathrm{val}}^{(h)} \in \mathbb{R}^{T \times d_k}$&lt;/code&gt;, scaled causal dot-product attention computes:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$S^{(h)} = \frac{Q^{(h)} \bigl(K^{(h)}\bigr)^\top}{\sqrt{d_k}} + M_{\mathrm{causal}}, \qquad P^{(h)} = \mathrm{softmax}\!\left(S^{(h)}\right), \qquad O^{(h)} = P^{(h)} V_{\mathrm{val}}^{(h)}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Here both the score matrix &lt;code&gt;$S^{(h)}$&lt;/code&gt; and the probability matrix &lt;code&gt;$P^{(h)}$&lt;/code&gt; have shape &lt;code&gt;$T \times T$&lt;/code&gt;. The causal mask &lt;code&gt;$M_{\mathrm{causal}} \in \{0, -\infty\}^{T \times T}$&lt;/code&gt; equals &lt;code&gt;$0$&lt;/code&gt; on and below the main diagonal (&lt;code&gt;$i \ge j$&lt;/code&gt;) and &lt;code&gt;$-\infty$&lt;/code&gt; strictly above it (&lt;code&gt;$i &amp;lt; j$&lt;/code&gt;, where position &lt;code&gt;$i$&lt;/code&gt; would peek at a future token &lt;code&gt;$j$&lt;/code&gt;). Since &lt;code&gt;$\exp(-\infty) = 0$&lt;/code&gt;, row-wise Softmax turns &lt;code&gt;$P^{(h)}$&lt;/code&gt; into a strictly lower-triangular stochastic matrix whose &lt;code&gt;$i$&lt;/code&gt;-th output row depends only on positions &lt;code&gt;$\le i$&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Why divide by &lt;code&gt;$\sqrt{d_k}$&lt;/code&gt;? Suppose the coordinates of &lt;code&gt;$q \in \mathbb{R}^{d_k}$&lt;/code&gt; and &lt;code&gt;$k \in \mathbb{R}^{d_k}$&lt;/code&gt; are independent with zero mean and unit variance. Each product term has &lt;code&gt;$\mathbb{E}[q_m k_m] = 0$&lt;/code&gt; and &lt;code&gt;$\mathrm{Var}(q_m k_m) = \mathbb{E}[q_m^2]\mathbb{E}[k_m^2] - 0 = 1$&lt;/code&gt;, so the variance of the full dot product grows linearly with subspace width:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\mathrm{Var}(q^\top k) = \sum_{m=1}^{d_k} \mathrm{Var}(q_m k_m) = d_k$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Without dividing by &lt;code&gt;$\sqrt{d_k}$&lt;/code&gt;, at &lt;code&gt;$d_k = 64$&lt;/code&gt; or &lt;code&gt;$128$&lt;/code&gt; the dot product&#39;s standard deviation reaches &lt;code&gt;$8$&lt;/code&gt;–&lt;code&gt;$11.3$&lt;/code&gt;, pushing the largest entry in each row far above the rest and driving &lt;code&gt;$P_{i,a} = e^{S_{i,a}} / \sum_c e^{S_{i,c}}$&lt;/code&gt; toward a one-hot corner. Differentiating the quotient shows that the local Jacobian of Softmax is &lt;code&gt;$\partial P_{i,a} / \partial S_{i,b} = P_{i,a}(\delta_{ab} - P_{i,b})$&lt;/code&gt; (where the Kronecker delta &lt;code&gt;$\delta_{ab}$&lt;/code&gt; is &lt;code&gt;$1$&lt;/code&gt; if &lt;code&gt;$a=b$&lt;/code&gt; and &lt;code&gt;$0$&lt;/code&gt; otherwise); once &lt;code&gt;$P$&lt;/code&gt; saturates to &lt;code&gt;$0$&lt;/code&gt;s and &lt;code&gt;$1$&lt;/code&gt;s, every entry of that Jacobian vanishes for both &lt;code&gt;$a=b$&lt;/code&gt; and &lt;code&gt;$a \neq b$&lt;/code&gt;, starving the query and key projections of gradient&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-vaswani2017-3&#34; href=&#34;#ref-vaswani2017&#34;&gt;[1]&lt;/a&gt;&lt;/sup&gt;. Dividing by &lt;code&gt;$\sqrt{d_k}$&lt;/code&gt; restores unit variance.&lt;/p&gt;&#xA;&lt;p&gt;Concatenating all &lt;code&gt;$H_{\mathrm{head}}$&lt;/code&gt; heads back along the last axis into &lt;code&gt;$O = [O^{(1)}, \dots, O^{(H_{\mathrm{head}})}] \in \mathbb{R}^{T \times D}$&lt;/code&gt;, multiplying by &lt;code&gt;$W_o^\top$&lt;/code&gt; (&lt;code&gt;$W_o \in \mathbb{R}^{D \times D}$&lt;/code&gt;), and adding back to the residual pathway yields &lt;code&gt;$X&amp;#39; = X + O W_o^\top$&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Sublayer 2: Position-wise FFN / MLP.&lt;/strong&gt; Normalizing again via &lt;code&gt;$H&amp;#39; = \mathrm{RMSNorm}(X&amp;#39;)$&lt;/code&gt;, the hidden representation expands through &lt;code&gt;$W_{\mathrm{up}} \in \mathbb{R}^{d_{\mathrm{ff}} \times D}$&lt;/code&gt; (classically &lt;code&gt;$d_{\mathrm{ff}} = 4D$&lt;/code&gt;), passes through an elementwise nonlinearity &lt;code&gt;$\sigma(\cdot)$&lt;/code&gt; such as &lt;code&gt;$\mathrm{SiLU}(z) = z / (1 + e^{-z})$&lt;/code&gt;, projects back down via &lt;code&gt;$W_{\mathrm{down}} \in \mathbb{R}^{D \times d_{\mathrm{ff}}}$&lt;/code&gt;, and joins the residual stream:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$X_{\mathrm{out}} = X&amp;#39; + \sigma(H&amp;#39; W_{\mathrm{up}}^\top) W_{\mathrm{down}}^\top$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;After &lt;code&gt;$L$&lt;/code&gt; stacked blocks, a final &lt;code&gt;RMSNorm&lt;/code&gt; followed by the language-modeling head &lt;code&gt;$W_{\mathrm{head}}^\top$&lt;/code&gt; (&lt;code&gt;$W_{\mathrm{head}} \in \mathbb{R}^{V \times D}$&lt;/code&gt;) produces the full-sequence logit matrix &lt;code&gt;$Z \in \mathbb{R}^{T \times V}$&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note on PyTorch &lt;code&gt;nn.Linear&lt;/code&gt; weight shapes&lt;/strong&gt;: calling &lt;code&gt;nn.Linear(in_features=64, out_features=256, bias=False)&lt;/code&gt; stores &lt;code&gt;.weight&lt;/code&gt; with transposed shape &lt;code&gt;(256, 64)&lt;/code&gt;—that is, &lt;code&gt;$(d_{\mathrm{out}}, d_{\mathrm{in}})$&lt;/code&gt;—and evaluates &lt;code&gt;$H W^\top$&lt;/code&gt; in the forward pass. Because C/CUDA arrays are row-major, laying out the &lt;code&gt;$d_{\mathrm{in}}$&lt;/code&gt; weights of each output neuron contiguously along a row makes inner-product reads sequential in memory. Throughout this post, every 2D weight matrix &lt;code&gt;$W \in \mathbb{R}^{A \times B}$&lt;/code&gt; follows PyTorch&#39;s layout with &lt;code&gt;$A = d_{\mathrm{out}}$&lt;/code&gt; rows and &lt;code&gt;$B = d_{\mathrm{in}}$&lt;/code&gt; columns.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;h3 id=&#34;13-the-four-tensor-families-in-gpu-memory&#34;&gt;1.3 The Four Tensor Families in GPU Memory&lt;/h3&gt;&#xA;&lt;p&gt;Every multi-dimensional array appearing in the equations above is casually called a &amp;quot;matrix,&amp;quot; yet by mathematical definition, shape dependence, and memory lifetime, they partition cleanly into four distinct families:&lt;/p&gt;&#xA;&lt;figure class=&#34;diagram&#34; style=&#34;--h:268px;--hn:499px&#34;&gt;&lt;figcaption&gt;Mathematical Roles and Lifetimes of the Four Tensor Families in VRAM&lt;/figcaption&gt;&lt;p&gt;&lt;a href=&#34;https://mizore.blog/en/posts/from-transformer-matrices-to-muon/&#34;&gt;(See the figure in the post.)&lt;/a&gt;&lt;/p&gt;&lt;p class=&#34;figure-note&#34;&gt;Static parameter shapes depend only on architecture hyperparameters; dynamic activations scale with batch B and sequence length T; the KV Cache grows token-by-token only during decoding; gradients and optimizer states are allocated alongside parameters only during training.&lt;/p&gt;&lt;/figure&gt;&#xA;&lt;p&gt;For newcomers, the easiest pair of objects to conflate is the &lt;strong&gt;projection weights &lt;code&gt;$W_q, W_k \in \mathbb{R}^{D \times D}$&lt;/code&gt;&lt;/strong&gt; versus the &lt;strong&gt;attention probability matrix &lt;code&gt;$P \in \mathbb{R}^{T \times T}$&lt;/code&gt;&lt;/strong&gt;. The former are Family 1 static parameters: whether the prompt is 4 tokens or 4,096 tokens long, their shape is permanently &lt;code&gt;$D \times D$&lt;/code&gt;, and they are the actual weights modified by the optimizer. The latter is a Family 2 transient activation: its dimensions stretch and shrink with the current sequence length &lt;code&gt;$T$&lt;/code&gt;, capturing pairwise token alignments inside a single forward pass—never saved to a checkpoint and never directly stepped by an optimizer.&lt;/p&gt;&#xA;&lt;figure class=&#34;diagram&#34; style=&#34;--h:202px;--hn:362px&#34;&gt;&lt;figcaption&gt;Static Projection Weights &lt;code&gt;$W_q, W_k$&lt;/code&gt; vs. Transient Attention Matrix &lt;code&gt;$P$&lt;/code&gt;&lt;/figcaption&gt;&lt;p&gt;&lt;a href=&#34;https://mizore.blog/en/posts/from-transformer-matrices-to-muon/&#34;&gt;(See the figure in the post.)&lt;/a&gt;&lt;/p&gt;&lt;p class=&#34;figure-note&#34;&gt;Projection matrices &lt;code&gt;$W_q, W_k$&lt;/code&gt; have fixed shape &lt;code&gt;$(D, D)$&lt;/code&gt; shared across all inputs; the attention matrix &lt;code&gt;$P$&lt;/code&gt; has dynamic shape &lt;code&gt;$(T, T)$&lt;/code&gt; representing temporary token-to-token routing inside one sequence.&lt;/p&gt;&lt;/figure&gt;&#xA;&lt;p&gt;Comparing the mini Transformer used in Section 7 (&lt;code&gt;$B=20, T=16, D=64, H=4, d_k=16, V=1000$&lt;/code&gt;) against a production 7B-class model summarizes all 14 tensors across the pipeline:&lt;/p&gt;&#xA;&lt;figure class=&#34;data wide&#34;&gt;&lt;figcaption&gt;14 Tensor Types Across Transformer Inference and Training&lt;/figcaption&gt;&lt;div class=&#34;data-scroll&#34; tabindex=&#34;0&#34;&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Tensor &amp;amp; Symbol&lt;/th&gt;&lt;th&gt;Family&lt;/th&gt;&lt;th&gt;Mini Shape&lt;/th&gt;&lt;th&gt;Typical 7B Shape&lt;/th&gt;&lt;th&gt;Inference&lt;/th&gt;&lt;th&gt;Training&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&#34;row-key prose-col&#34;&gt;Inputs &amp;amp; targets &lt;code&gt;$x, y$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Token IDs&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$(20, 16)$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$(B, 4096)$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Prefix only&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Shifted by 1 token&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;row-key prose-col&#34;&gt;Token emb &lt;code&gt;$E_{\mathrm{tok}}$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;1. Parameter&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$(1000, 64)$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$(128256, 4096)$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Read-only lookup&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;AdamW step&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;row-key prose-col&#34;&gt;Pos emb &lt;code&gt;$E_{\mathrm{pos}}$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;1. Parameter&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$(32, 64)$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Parameter-free RoPE&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Broadcast add&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;AdamW step&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&#34;mark&#34;&gt;&lt;td class=&#34;row-key prose-col&#34;&gt;Attention &lt;code&gt;$W_q \dots W_o$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;1. Parameter&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Four &lt;code&gt;$(64, 64)$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$(4096, 4096)$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Read-only GEMM&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Muon orthogonal step&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&#34;mark&#34;&gt;&lt;td class=&#34;row-key prose-col&#34;&gt;FFN &lt;code&gt;$W_{\mathrm{up}} / W_{\mathrm{down}}$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;1. Parameter&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$(256,64)/(64,256)$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$(11008, 4096)$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Read-only GEMM&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Muon orthogonal step&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;row-key prose-col&#34;&gt;Norm gain &lt;code&gt;$\gamma$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;1. Parameter&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$(64,)$&lt;/code&gt; 1D&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$(4096,)$&lt;/code&gt; 1D&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Channel scale&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;AdamW (wd=0)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;row-key prose-col&#34;&gt;LM head &lt;code&gt;$W_{\mathrm{head}}$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;1. Parameter&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$(1000, 64)$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$(128256, 4096)$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Last-row logits&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;AdamW step&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;row-key prose-col&#34;&gt;Residual &amp;amp; norm &lt;code&gt;$X, H$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;2. Activation&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$(20, 16, 64)$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$(B, T, 4096)$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Freed per layer&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Cached for backward&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;row-key prose-col&#34;&gt;Multi-head &lt;code&gt;$Q, K, V_{\mathrm{val}}$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;2. Activation&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$(20, 4, 16, 16)$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$(B, 32, T, 128)$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Freed per layer&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Cached for backward&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;row-key prose-col&#34;&gt;Attention &lt;code&gt;$S, P$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;2. Activation&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$(20, 4, 16, 16)$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$(B, 32, T, T)$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Freed per layer&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Cached or recomputed&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;row-key prose-col&#34;&gt;Logit tensor &lt;code&gt;$Z$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;2. Activation&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$(20, 16, 1000)$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$(B, T, 128256)$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Last row only&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Full-seq CE loss&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;row-key prose-col&#34;&gt;Cache &lt;code&gt;$K/V_{\mathrm{cache}}$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;3. KV Cache&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$(1, 4, t, 16)$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$(B, 8, t, 128)$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;+1 row per step&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Not allocated&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;row-key prose-col&#34;&gt;Weight grad &lt;code&gt;$G$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;4. Train State&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Same as param&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Same as param&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Not allocated&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Written in backward&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;row-key prose-col&#34;&gt;Opt states &lt;code&gt;$M, V$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;4. Train State&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Same as param&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Same as param&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Not allocated&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Resident (Muon drops &lt;code&gt;$V$&lt;/code&gt;)&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p class=&#34;data-note&#34;&gt;Production models (e.g., Llama 3 / Qwen) commonly use Grouped-Query Attention (GQA) to shrink the output rows of &lt;code&gt;$W_k, W_v$&lt;/code&gt; for a smaller KV Cache, and add a gate matrix &lt;code&gt;$W_{\mathrm{gate}}$&lt;/code&gt; in SwiGLU FFNs; all remain dense 2D linear operators.&lt;/p&gt;&lt;/figure&gt;&#xA;&lt;h3 id=&#34;14-why-inference-needs-a-kv-cache-while-training-runs-in-parallel&#34;&gt;1.4 Why Inference Needs a &lt;code&gt;KV Cache&lt;/code&gt; While Training Runs in Parallel&lt;/h3&gt;&#xA;&lt;p&gt;A second payoff of classifying these four families comes from examining the lower-triangular causal mask &lt;code&gt;$M_{\mathrm{causal}}$&lt;/code&gt;, which explains both the &lt;strong&gt;two-stage structure of inference (&lt;code&gt;Prefill&lt;/code&gt; vs. &lt;code&gt;Decode&lt;/code&gt;)&lt;/strong&gt; and &lt;strong&gt;parallel &lt;code&gt;Teacher Forcing&lt;/code&gt; during training&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Consider &lt;strong&gt;inference&lt;/strong&gt; first. Future tokens do not exist yet: given a user prompt &lt;code&gt;$x_{1:T_0}$&lt;/code&gt;, the model must predict &lt;code&gt;$x_{T_0+1}$&lt;/code&gt;, append &lt;code&gt;$x_{T_0+1}$&lt;/code&gt; to the sequence, and only then predict &lt;code&gt;$x_{T_0+2}$&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Prefill stage&lt;/strong&gt;: all &lt;code&gt;$T_0$&lt;/code&gt; prompt tokens are known simultaneously, so &lt;code&gt;$H \in \mathbb{R}^{T_0 \times D}$&lt;/code&gt; multiplies &lt;code&gt;$W^\top \in \mathbb{R}^{D \times D}$&lt;/code&gt; via dense matrix-matrix multiplication (GEMM), computing keys &lt;code&gt;$K_{1:T_0}$&lt;/code&gt; and values &lt;code&gt;$V_{1:T_0}$&lt;/code&gt; across all &lt;code&gt;$T_0$&lt;/code&gt; positions at once and sampling the first generated token &lt;code&gt;$x_{T_0+1}$&lt;/code&gt; from row &lt;code&gt;$T_0$&lt;/code&gt;&#39;s logits.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Autoregressive Decode stage and redundancy&lt;/strong&gt;: at step &lt;code&gt;$t$&lt;/code&gt;, when &lt;code&gt;$x_{1:t}$&lt;/code&gt; is available and we want &lt;code&gt;$x_{t+1}$&lt;/code&gt;, feeding the entire prefix &lt;code&gt;$x_{1:t}$&lt;/code&gt; back through the network would recompute identical hidden states &lt;code&gt;$h_1, \dots, h_{t-1}$&lt;/code&gt; and identical projections &lt;code&gt;$k_1, \dots, k_{t-1}$&lt;/code&gt;, &lt;code&gt;$v_1, \dots, v_{t-1}$&lt;/code&gt; bit-for-bit, because the causal mask at every layer forbids positions &lt;code&gt;$1 \dots t-1$&lt;/code&gt; from reading position &lt;code&gt;$t$&lt;/code&gt;. Moreover, sampling &lt;code&gt;$x_{t+1}$&lt;/code&gt; requires only the final output row &lt;code&gt;$o_t$&lt;/code&gt;:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;code&gt;$$o_t^{(h)} = \sum_{j=1}^{t} P_{t,j}^{(h)} v_j^{(h)}, \qquad P_{t, :}^{(h)} = \mathrm{softmax}\!\left(\frac{q_t^{(h)} K_{1:t}^{(h)\top}}{\sqrt{d_k}}\right) \in \mathbb{R}^{1 \times t}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Neither historical queries &lt;code&gt;$q_1, \dots, q_{t-1}$&lt;/code&gt; nor the upper &lt;code&gt;$t-1$&lt;/code&gt; rows of the &lt;code&gt;$t \times t$&lt;/code&gt; attention table are needed. By caching &lt;code&gt;$K_{1:t-1}$&lt;/code&gt; and &lt;code&gt;$V_{1:t-1}$&lt;/code&gt; in VRAM (the &lt;code&gt;KV Cache&lt;/code&gt;), step &lt;code&gt;$t$&lt;/code&gt; feeds only the single new row &lt;code&gt;$h_t \in \mathbb{R}^{1 \times D}$&lt;/code&gt;, computes &lt;code&gt;$q_t, k_t, v_t$&lt;/code&gt; via matrix-vector products (GEMV), appends &lt;code&gt;$k_t, v_t$&lt;/code&gt; as row &lt;code&gt;$t$&lt;/code&gt; of the cache to form &lt;code&gt;$K_{1:t}, V_{1:t}$&lt;/code&gt;, and executes a lightweight &lt;code&gt;$(1, d_k) \times (d_k, t)$&lt;/code&gt; product.&lt;/p&gt;&#xA;&lt;p&gt;Counting multiply-accumulate operations (MACs, where &lt;code&gt;$1\;\text{MAC} = 2\;\text{FLOPs}$&lt;/code&gt;) per layer of width &lt;code&gt;$D$&lt;/code&gt; makes the asymptotic gap explicit. Without a &lt;code&gt;KV Cache&lt;/code&gt;, recomputing projections at length &lt;code&gt;$t$&lt;/code&gt; costs &lt;code&gt;$\mathcal{O}(t D^2)$&lt;/code&gt; and attention costs &lt;code&gt;$\mathcal{O}(t^2 D)$&lt;/code&gt;; summed from &lt;code&gt;$t = T_0$&lt;/code&gt; to &lt;code&gt;$N$&lt;/code&gt;, cumulative work scales as &lt;code&gt;$\sum_{t=T_0}^N \mathcal{O}(t D^2 + t^2 D) = \mathcal{O}(N^2 D^2 + N^3 D)$&lt;/code&gt;. With a &lt;code&gt;KV Cache&lt;/code&gt;, each decode step projects a single row in &lt;code&gt;$\mathcal{O}(D^2)$&lt;/code&gt; and attends over &lt;code&gt;$t$&lt;/code&gt; cached keys in &lt;code&gt;$\mathcal{O}(t D)$&lt;/code&gt;, reducing cumulative work to &lt;code&gt;$\mathcal{O}(N D^2 + N^2 D)$&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Now contrast &lt;strong&gt;training&lt;/strong&gt;. During training, the complete ground-truth sequence &lt;code&gt;$x_{1:T+1}$&lt;/code&gt; from the corpus is already on hand. Feeding &lt;code&gt;$x_{1:T}$&lt;/code&gt; as input and the one-token-shifted sequence &lt;code&gt;$x_{2:T+1}$&lt;/code&gt; as targets (&lt;strong&gt;Teacher Forcing&lt;/strong&gt;), the causal mask &lt;code&gt;$M_{\mathrm{causal}}$&lt;/code&gt; blocks row &lt;code&gt;$t$&lt;/code&gt; from attending to any column &lt;code&gt;$j &amp;gt; t$&lt;/code&gt; inside the matrix itself. One parallel &lt;code&gt;$(B, T, D) \times (D, D)$&lt;/code&gt; GEMM is therefore mathematically identical to running &lt;code&gt;$B \times T$&lt;/code&gt; prefix-prediction tasks at once—saturating GPU Tensor Cores without ever allocating a &lt;code&gt;KV Cache&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;figure class=&#34;diagram&#34; style=&#34;--h:700px;--hn:604px&#34;&gt;&lt;figcaption&gt;Full-Flow LLM Inference Matrix Shapes: Tracking Dimension Alignment &amp;amp; Contraction with Unit Blocks&lt;/figcaption&gt;&lt;p&gt;&lt;a href=&#34;https://mizore.blog/en/posts/from-transformer-matrices-to-muon/&#34;&gt;(See the figure in the post.)&lt;/a&gt;&lt;/p&gt;&lt;p class=&#34;figure-note&#34;&gt;Each discrete square represents one scalar entry (&lt;code&gt;$T_0=3, D=4, d_k=2, d_{\mathrm{ff}}=6, V=6$&lt;/code&gt;). Dashed arcs connect matching inner dimensions summed out in matrix multiplication; moving from Stage 1 to Stage 2 collapses every &lt;code&gt;$T_0=3$&lt;/code&gt;-row activation into a single &lt;code&gt;$1$&lt;/code&gt;-row strip while appending just &lt;code&gt;$1$&lt;/code&gt; row to the violet KV Cache.&lt;/p&gt;&lt;/figure&gt;&#xA;&lt;h3 id=&#34;15-unfolding-the-matrices-hand-tracing-a-3-token-sentence-through-prefill-and-decode&#34;&gt;1.5 Unfolding the Matrices: Hand-Tracing a 3-Token Sentence Through &lt;code&gt;Prefill&lt;/code&gt; and &lt;code&gt;Decode&lt;/code&gt;&lt;/h3&gt;&#xA;&lt;p&gt;Compact matrix equations and block-shape diagrams summarize the architecture cleanly, yet newcomers often hit a wall when asking what happens &lt;em&gt;inside&lt;/em&gt; the brackets: how do actual numbers transform step by step from token IDs to attention outputs? Shrinking the dimensions to hand-calculable integers lets us unfold every matrix on the page.&lt;/p&gt;&#xA;&lt;p&gt;Take a 5-token toy vocabulary &lt;code&gt;$V = 5$&lt;/code&gt; (&lt;code&gt;0:&amp;lt;pad&amp;gt;&lt;/code&gt;, &lt;code&gt;1:cat&lt;/code&gt;, &lt;code&gt;2:chases&lt;/code&gt;, &lt;code&gt;3:dog&lt;/code&gt;, &lt;code&gt;4:runs&lt;/code&gt;), hidden width &lt;code&gt;$D = 3$&lt;/code&gt;, and single-head width &lt;code&gt;$d_k = 2$&lt;/code&gt;. Suppose the input prompt is the 3-token prefix &lt;code&gt;[&amp;quot;cat&amp;quot;, &amp;quot;chases&amp;quot;, &amp;quot;dog&amp;quot;]&lt;/code&gt;, mapped to integer IDs &lt;code&gt;$(1, 2, 3)$&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Step 1: Embedding lookup as one-hot row selection.&lt;/strong&gt; Unfold the static embedding table &lt;code&gt;$E_{\mathrm{tok}} \in \mathbb{R}^{5 \times 3}$&lt;/code&gt;. Indexing rows &lt;code&gt;$(1, 2, 3)$&lt;/code&gt; is algebraically identical to left-multiplying by a &lt;code&gt;$3 \times 5$&lt;/code&gt; one-hot selector matrix &lt;code&gt;$U$&lt;/code&gt; (omitting positional offsets here and taking the normalized hidden state directly as &lt;code&gt;$H$&lt;/code&gt;, whose three rows already share identical RMS):&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$H = U E_{\mathrm{tok}} = \begin{bmatrix} 0 &amp;amp; \mathbf{1} &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\ 0 &amp;amp; 0 &amp;amp; \mathbf{1} &amp;amp; 0 &amp;amp; 0 \\ 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; \mathbf{1} &amp;amp; 0 \end{bmatrix} \begin{bmatrix} 0 &amp;amp; 0 &amp;amp; 0 \\ 1 &amp;amp; 0 &amp;amp; 1 \\ 0 &amp;amp; 1 &amp;amp; 1 \\ 1 &amp;amp; 1 &amp;amp; 0 \\ 1 &amp;amp; 0 &amp;amp; -1 \end{bmatrix} = \begin{bmatrix} 1 &amp;amp; 0 &amp;amp; 1 \\ 0 &amp;amp; 1 &amp;amp; 1 \\ 1 &amp;amp; 1 &amp;amp; 0 \end{bmatrix} \begin{matrix} \leftarrow \text{token 1 (&amp;#34;cat&amp;#34;)} \\ \leftarrow \text{token 2 (&amp;#34;chases&amp;#34;)} \\ \leftarrow \text{token 3 (&amp;#34;dog&amp;#34;)} \end{matrix}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Nothing mysterious happens here: embedding lookup simply copies rows 1, 2, and 3 out of the vocabulary table into a &lt;code&gt;$3 \times 3$&lt;/code&gt; activation matrix, leaving unused vocabulary rows (0 and 4) untouched.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Step 2: Linear projections into &lt;code&gt;$Q, K, V_{\mathrm{val}}$&lt;/code&gt;.&lt;/strong&gt; Multiply &lt;code&gt;$H\;(3 \times 3)$&lt;/code&gt; on the right by the static transposed projection matrices &lt;code&gt;$W_q^\top, W_k^\top, W_v^\top \in \mathbb{R}^{3 \times 2}$&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$Q = H W_q^\top = \begin{bmatrix} 1 &amp;amp; 0 &amp;amp; 1 \\ 0 &amp;amp; 1 &amp;amp; 1 \\ 1 &amp;amp; 1 &amp;amp; 0 \end{bmatrix} \begin{bmatrix} 1 &amp;amp; 0 \\ 0 &amp;amp; 1 \\ 1 &amp;amp; -1 \end{bmatrix} = \begin{bmatrix} 2 &amp;amp; -1 \\ 1 &amp;amp; 0 \\ 1 &amp;amp; 1 \end{bmatrix}, \quad K = H W_k^\top = \begin{bmatrix} 1 &amp;amp; 0 &amp;amp; 1 \\ 0 &amp;amp; 1 &amp;amp; 1 \\ 1 &amp;amp; 1 &amp;amp; 0 \end{bmatrix} \begin{bmatrix} 1 &amp;amp; 1 \\ 0 &amp;amp; 1 \\ 1 &amp;amp; 0 \end{bmatrix} = \begin{bmatrix} 2 &amp;amp; 1 \\ 1 &amp;amp; 1 \\ 1 &amp;amp; 2 \end{bmatrix}, \quad V_{\mathrm{val}} = H W_v^\top = \begin{bmatrix} 1 &amp;amp; 0 &amp;amp; 1 \\ 0 &amp;amp; 1 &amp;amp; 1 \\ 1 &amp;amp; 1 &amp;amp; 0 \end{bmatrix} \begin{bmatrix} 2 &amp;amp; 0 \\ 0 &amp;amp; 2 \\ 1 &amp;amp; 1 \end{bmatrix} = \begin{bmatrix} 3 &amp;amp; 1 \\ 1 &amp;amp; 3 \\ 2 &amp;amp; 2 \end{bmatrix}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;For instance, top-left entry &lt;code&gt;$Q_{1,1} = 2$&lt;/code&gt; is the dot product of row 1 of &lt;code&gt;$H$&lt;/code&gt; (&lt;code&gt;$[1, 0, 1]$&lt;/code&gt;) with column 1 of &lt;code&gt;$W_q^\top$&lt;/code&gt; (&lt;code&gt;$[1, 0, 1]^\top$&lt;/code&gt;): &lt;code&gt;$1\times 1 + 0\times 0 + 1\times 1 = 2$&lt;/code&gt;. Notice that &lt;strong&gt;linear projections remix feature columns strictly within each token&#39;s own row—the 3 tokens have not exchanged information yet&lt;/strong&gt;. Meanwhile, &lt;code&gt;$K$&lt;/code&gt; and &lt;code&gt;$V_{\mathrm{val}}$&lt;/code&gt; are saved into VRAM as the initial 3-row &lt;code&gt;KV Cache&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Step 3: Four-stage causal self-attention (dot products &lt;code&gt;$\to$&lt;/code&gt; mask &lt;code&gt;$\to$&lt;/code&gt; Softmax &lt;code&gt;$\to$&lt;/code&gt; weighted sum of &lt;code&gt;$V$&lt;/code&gt;).&lt;/strong&gt; Now tokens interact across positions. First multiply &lt;code&gt;$Q\;(3\times 2)$&lt;/code&gt; by &lt;code&gt;$K^\top\;(2\times 3)$&lt;/code&gt; to get all pairwise dot products:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$Q K^\top = \begin{bmatrix} 2 &amp;amp; -1 \\ 1 &amp;amp; 0 \\ 1 &amp;amp; 1 \end{bmatrix} \begin{bmatrix} 2 &amp;amp; 1 &amp;amp; 1 \\ 1 &amp;amp; 1 &amp;amp; 2 \end{bmatrix} = \begin{bmatrix} 3 &amp;amp; 1 &amp;amp; 0 \\ 2 &amp;amp; 1 &amp;amp; 1 \\ 3 &amp;amp; 2 &amp;amp; 3 \end{bmatrix}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Divide by &lt;code&gt;$\sqrt{d_k} = \sqrt{2} \approx 1.414$&lt;/code&gt;, add the causal mask &lt;code&gt;$M_{\mathrm{causal}}$&lt;/code&gt; (replacing every above-diagonal entry &lt;code&gt;$i &amp;lt; j$&lt;/code&gt; with &lt;code&gt;$-\infty$&lt;/code&gt;), and apply row-wise Softmax &lt;code&gt;$P_{i,j} = e^{S_{i,j}} / \sum_c e^{S_{i,c}}$&lt;/code&gt; (since &lt;code&gt;$e^{-\infty} = 0$&lt;/code&gt;, future weights vanish identically):&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$S = \frac{Q K^\top}{\sqrt{2}} + M_{\mathrm{causal}} \approx \begin{bmatrix} 2.12 &amp;amp; -\infty &amp;amp; -\infty \\ 1.41 &amp;amp; 0.71 &amp;amp; -\infty \\ 2.12 &amp;amp; 1.41 &amp;amp; 2.12 \end{bmatrix} \;\xrightarrow{\text{row Softmax}}\; P \approx \begin{bmatrix} 1.00 &amp;amp; 0 &amp;amp; 0 \\ 0.67 &amp;amp; 0.33 &amp;amp; 0 \\ 0.40 &amp;amp; 0.20 &amp;amp; 0.40 \end{bmatrix}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Multiplying the lower-triangular probability table &lt;code&gt;$P\;(3\times 3)$&lt;/code&gt; into &lt;code&gt;$V_{\mathrm{val}}\;(3\times 2)$&lt;/code&gt; yields:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$O = P V_{\mathrm{val}} \approx \begin{bmatrix} 1.00 &amp;amp; 0 &amp;amp; 0 \\ 0.67 &amp;amp; 0.33 &amp;amp; 0 \\ 0.40 &amp;amp; 0.20 &amp;amp; 0.40 \end{bmatrix} \begin{bmatrix} 3 &amp;amp; 1 \\ 1 &amp;amp; 3 \\ 2 &amp;amp; 2 \end{bmatrix} = \begin{bmatrix} 3.00 &amp;amp; 1.00 \\ 2.34 &amp;amp; 1.66 \\ 2.20 &amp;amp; 1.80 \end{bmatrix}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Reading &lt;code&gt;$P V_{\mathrm{val}}$&lt;/code&gt; one row at a time strips away all abstraction:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Row 1 (&lt;code&gt;&amp;quot;cat&amp;quot;&lt;/code&gt;)&lt;/strong&gt;: &lt;code&gt;$1.00 \times [3, 1] + 0 + 0 = [3.00, 1.00]$&lt;/code&gt;, seeing only itself;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Row 2 (&lt;code&gt;&amp;quot;chases&amp;quot;&lt;/code&gt;)&lt;/strong&gt;: &lt;code&gt;$0.67 \times [3, 1] + 0.33 \times [1, 3] + 0 = [2.34, 1.66]$&lt;/code&gt;, pulling &lt;code&gt;$67\%$&lt;/code&gt; of &lt;code&gt;&amp;quot;cat&amp;quot;&lt;/code&gt;&#39;s value vector into &lt;code&gt;&amp;quot;chases&amp;quot;&lt;/code&gt; while remaining blind to future token &lt;code&gt;&amp;quot;dog&amp;quot;&lt;/code&gt;;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Row 3 (&lt;code&gt;&amp;quot;dog&amp;quot;&lt;/code&gt;)&lt;/strong&gt;: &lt;code&gt;$0.40 \times [3, 1] + 0.20 \times [1, 3] + 0.40 \times [2, 2] = [2.20, 1.80]$&lt;/code&gt;, pooling context across all 3 prefix tokens. At the end of &lt;code&gt;Prefill&lt;/code&gt;, only this final row is projected through the FFN and LM head &lt;code&gt;$W_{\mathrm{head}}^\top$&lt;/code&gt;—suppose sampling picks token &lt;code&gt;4:runs&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Step 4: Advancing to &lt;code&gt;Decode&lt;/code&gt; step &lt;code&gt;$t = 4$&lt;/code&gt; (why a single row suffices).&lt;/strong&gt; To predict token 5 given newly sampled &lt;code&gt;4:runs&lt;/code&gt;, causal masking guarantees that rows 1..3 of &lt;code&gt;$K$&lt;/code&gt; and &lt;code&gt;$V_{\mathrm{val}}$&lt;/code&gt; would never change even if we reran the whole 4-word sequence. So step 4 &lt;strong&gt;does not build a &lt;code&gt;$4 \times 3$&lt;/code&gt; input matrix&lt;/strong&gt;: it looks up only the single row &lt;code&gt;$h_4 = [1, 0, -1] \in \mathbb{R}^{1 \times 3}$&lt;/code&gt; and runs three vector-matrix products:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$q_4 = h_4 W_q^\top = \begin{bmatrix} 0 &amp;amp; 1 \end{bmatrix}, \qquad k_4 = h_4 W_k^\top = \begin{bmatrix} 0 &amp;amp; 1 \end{bmatrix}, \qquad v_4 = h_4 W_v^\top = \begin{bmatrix} 1 &amp;amp; -1 \end{bmatrix}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Appending &lt;code&gt;$k_4, v_4$&lt;/code&gt; as row 4 of the cached &lt;code&gt;$3 \times 2$&lt;/code&gt; tables forms &lt;code&gt;$K_{1:4}, V_{1:4} \in \mathbb{R}^{4 \times 2}$&lt;/code&gt;, after which attention reduces to a single &lt;code&gt;$1 \times 4$&lt;/code&gt; dot-product strip:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$q_4 K_{1:4}^\top = \begin{bmatrix} 0 &amp;amp; 1 \end{bmatrix} \begin{bmatrix} 2 &amp;amp; 1 &amp;amp; 1 &amp;amp; \mathbf{0} \\ 1 &amp;amp; 1 &amp;amp; 2 &amp;amp; \mathbf{1} \end{bmatrix} = \begin{bmatrix} 1 &amp;amp; 1 &amp;amp; 2 &amp;amp; 1 \end{bmatrix} \;\xrightarrow{\mathrm{softmax}(\cdot / \sqrt{2})}\; p_4 \approx \begin{bmatrix} 0.20 &amp;amp; 0.20 &amp;amp; 0.40 &amp;amp; 0.20 \end{bmatrix}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Taking that 4-weight average of &lt;code&gt;$V_{1:4}$&lt;/code&gt; gives &lt;code&gt;$o_4 = p_4 V_{1:4} = 0.20[3,1] + 0.20[1,3] + 0.40[2,2] + 0.20[1,-1] = [1.80, 1.40] \in \mathbb{R}^{1 \times 2}$&lt;/code&gt;—without ever materializing the upper 3 rows of a &lt;code&gt;$4 \times 4$&lt;/code&gt; attention matrix.&lt;/p&gt;&#xA;&lt;figure class=&#34;diagram&#34; style=&#34;--h:494px;--hn:602px&#34;&gt;&lt;figcaption&gt;Unfolded Numeric Walkthrough: Cell-by-Cell Matrix Transformations in 3-Token Prefill and Step-4 Decode&lt;/figcaption&gt;&lt;p&gt;&lt;a href=&#34;https://mizore.blog/en/posts/from-transformer-matrices-to-muon/&#34;&gt;(See the figure in the post.)&lt;/a&gt;&lt;/p&gt;&lt;p class=&#34;figure-note&#34;&gt;Replacing abstract symbols with hand-verifiable numbers (&lt;code&gt;$d_k=2$&lt;/code&gt;, scale &lt;code&gt;$\sqrt{2}\approx 1.41$&lt;/code&gt;). Stage 1 shows how causal masking turns each output row into a convex combination of visible value vectors; Stage 2 shows step-4 decoding computing &lt;code&gt;$o_4$&lt;/code&gt; from a single query row &lt;code&gt;$q_4$&lt;/code&gt; and a 1-row append to the violet KV Cache.&lt;/p&gt;&lt;/figure&gt;&#xA;&lt;p&gt;The two empirical figures below quantify both memory footprint and compute scaling. In the 6-layer &lt;code&gt;float32&lt;/code&gt; model of the first chart (&lt;code&gt;$V=2000, D=256, L=6$&lt;/code&gt;, 4 bytes per parameter), static weights total &lt;code&gt;$5.82 \times 10^6$&lt;/code&gt; parameters (&lt;code&gt;$1.04 \times 10^6$&lt;/code&gt; in embeddings/head and &lt;code&gt;$4.72 \times 10^6$&lt;/code&gt; in internal 2D matrices), occupying &lt;code&gt;$22.2\;\text{MB}$&lt;/code&gt;; during training at &lt;code&gt;$B=16, T=64$&lt;/code&gt;, cached forward activations across the 6 layers take &lt;code&gt;$103.8\;\text{MB}$&lt;/code&gt;; and under &lt;code&gt;Muon+AdamW&lt;/code&gt;, dropping the second-moment buffer &lt;code&gt;$V$&lt;/code&gt; from all internal 2D matrices leaves only &lt;code&gt;$4.2\;\text{MB}$&lt;/code&gt; of &lt;code&gt;$V$&lt;/code&gt; states on the boundary layers. The second chart tracks cumulative MACs across a 4-layer model decoding 112 tokens from &lt;code&gt;$T_0=8$&lt;/code&gt; to &lt;code&gt;$t=120$&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;figure class=&#34;echart&#34; style=&#34;--h:360px&#34;&gt;&lt;figcaption&gt;VRAM Breakdown of a 6-Layer Transformer Across Inference and Three Training Optimizers&lt;/figcaption&gt;&lt;p&gt;&lt;a href=&#34;https://mizore.blog/en/posts/from-transformer-matrices-to-muon/&#34;&gt;(See the figure in the post.)&lt;/a&gt;&lt;/p&gt;&lt;p class=&#34;figure-note&#34;&gt;Measured tensor byte counts on a 6-layer Transformer (&lt;code&gt;$V=2000, D=256$&lt;/code&gt;, 8 heads, fp32, batch &lt;code&gt;$B=16$&lt;/code&gt;, length &lt;code&gt;$T=64$&lt;/code&gt;). Training retains forward activations and allocates gradients &lt;code&gt;$G$&lt;/code&gt; plus state buffers; Muon+AdamW eliminates second-moment &lt;code&gt;$V$&lt;/code&gt; on all internal 2D layers (keeping only 4.2 MB on boundary params).&lt;/p&gt;&lt;/figure&gt;&#xA;&lt;figure class=&#34;plotfig&#34;&gt;&lt;figcaption&gt;Autoregressive Decoding from Prefix 8 to Length 120: KV Cache Cuts Cumulative MACs to Near-Linear&lt;/figcaption&gt;&lt;p&gt;&lt;a href=&#34;https://mizore.blog/en/posts/from-transformer-matrices-to-muon/&#34;&gt;(See the figure in the post.)&lt;/a&gt;&lt;/p&gt;&lt;p class=&#34;plot-xlabel&#34;&gt;Sequence length &lt;code&gt;$t$&lt;/code&gt; (Prefill finishes at &lt;code&gt;$t=8$&lt;/code&gt;, followed by 112 Decode steps for &lt;code&gt;$t=9 \dots 120$&lt;/code&gt;)&lt;/p&gt;&lt;p class=&#34;figure-note&#34;&gt;4-layer Transformer (&lt;code&gt;$D=128, V=512$&lt;/code&gt;) after an 8-token Prefill (&lt;code&gt;$T_0=8$&lt;/code&gt;), followed by 112 autoregressive Decode steps (&lt;code&gt;$t=9 \dots 120$&lt;/code&gt;). Cumulative MACs drop from 6,758.5M to 109.7M (-98.4%).&lt;/p&gt;&lt;/figure&gt;&#xA;&lt;p&gt;With &amp;quot;optimizers only mutate Family 1 static parameters &lt;code&gt;$\Theta$&lt;/code&gt;&amp;quot; established, the next question is how a single scalar loss &lt;code&gt;$L$&lt;/code&gt; differentiates backward into a full two-dimensional gradient matrix &lt;code&gt;$G$&lt;/code&gt; for every weight layer.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;2-normalization-scale-invariance-and-matrix-backpropagation&#34;&gt;2. Normalization Scale Invariance and Matrix Backpropagation&lt;/h2&gt;&#xA;&lt;p&gt;Walking through the calculus inside a single training step explains why forward activations dominate training VRAM and establishes two foundational properties used throughout the rest of the post: &lt;strong&gt;how &lt;code&gt;RMSNorm&lt;/code&gt; fixes the input RMS scale of hidden layers&lt;/strong&gt;, and &lt;strong&gt;why linear-layer gradients &lt;code&gt;$G$&lt;/code&gt; form a sum of rank-one outer products&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;21-origin-of-rmsnorm-and-proof-of-radial-gradient-orthogonality&#34;&gt;2.1 Origin of &lt;code&gt;RMSNorm&lt;/code&gt; and Proof of Radial Gradient Orthogonality&lt;/h3&gt;&#xA;&lt;p&gt;Original Transformers used &lt;code&gt;LayerNorm&lt;/code&gt;: given a token vector &lt;code&gt;$x \in \mathbb{R}^D$&lt;/code&gt;, compute its mean &lt;code&gt;$\mu = \frac{1}{D}\sum_{i=1}^D x_i$&lt;/code&gt;, then its variance &lt;code&gt;$\sigma^2 = \frac{1}{D}\sum_{i=1}^D (x_i - \mu)^2$&lt;/code&gt;, and output &lt;code&gt;$\frac{x - \mu}{\sqrt{\sigma^2 + \epsilon}} \odot \gamma + \beta$&lt;/code&gt;. On GPUs, because variance depends on the mean, every token vector requires two cross-channel reductions whose memory latency outweighs arithmetic cost.&lt;/p&gt;&#xA;&lt;p&gt;In 2019, Zhang and Sennrich hypothesized that &lt;code&gt;LayerNorm&lt;/code&gt; stabilizes deep networks not through mean-centering (shift invariance), but through rescaling vector magnitude (scale invariance)&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-zhang2019-2&#34; href=&#34;#ref-zhang2019&#34;&gt;[6]&lt;/a&gt;&lt;/sup&gt;. Dropping mean subtraction and bias &lt;code&gt;$\beta$&lt;/code&gt; yields Root Mean Square Layer Normalization (&lt;code&gt;RMSNorm&lt;/code&gt;):&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$r(x) = \sqrt{\frac{1}{D} \sum_{i=1}^{D} x_i^2 + \epsilon}, \qquad y = \mathrm{RMSNorm}(x) = \frac{x}{r(x)} \odot \gamma = \hat{x} \odot \gamma$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;where &lt;code&gt;$\gamma \in \mathbb{R}^D$&lt;/code&gt; is initialized to all ones. Two algebraic consequences follow directly:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Unit-RMS forward outputs&lt;/strong&gt;: as &lt;code&gt;$\epsilon \to 0$&lt;/code&gt; with &lt;code&gt;$\gamma = \mathbf{1}$&lt;/code&gt;, &lt;code&gt;$\hat{x} = x / r(x)$&lt;/code&gt; satisfies &lt;code&gt;$\frac{1}{D}\|\hat{x}\|_2^2 = \frac{\frac{1}{D}\|x\|_2^2}{\frac{1}{D}\|x\|_2^2} = 1$&lt;/code&gt;. Consequently, every linear projection &lt;code&gt;$W$&lt;/code&gt; immediately following &lt;code&gt;RMSNorm&lt;/code&gt; receives input vectors normalized to unit root-mean-square magnitude—a fact that directly dictates the natural operator norm for measuring weight updates &lt;code&gt;$\Delta W$&lt;/code&gt; in Section 4.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Inverse-scale backward gradients and radial orthogonality&lt;/strong&gt;: at &lt;code&gt;$\epsilon = 0$&lt;/code&gt;, for any scalar &lt;code&gt;$\alpha &amp;gt; 0$&lt;/code&gt;, &lt;code&gt;$\mathrm{RMSNorm}(\alpha x) = \frac{\alpha x}{\alpha r(x)} \odot \gamma = \mathrm{RMSNorm}(x)$&lt;/code&gt;. Let the downstream loss be &lt;code&gt;$L(y)$&lt;/code&gt; with upstream gradient &lt;code&gt;$\delta_y = \partial L / \partial y \in \mathbb{R}^D$&lt;/code&gt;, and set &lt;code&gt;$\tilde{\delta} = \delta_y \odot \gamma$&lt;/code&gt;. Differentiating with respect to coordinate &lt;code&gt;$x_j$&lt;/code&gt; (using &lt;code&gt;$\partial r / \partial x_j = \frac{x_j}{D r}$&lt;/code&gt;) gives:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\frac{\partial L}{\partial x_j} = \sum_{i=1}^{D} \tilde{\delta}_i \frac{\partial}{\partial x_j}\left(\frac{x_i}{r}\right) = \frac{\tilde{\delta}_j}{r} - \sum_{i=1}^{D} \tilde{\delta}_i \frac{x_i x_j}{D r^3} = \frac{1}{r}\left(\tilde{\delta}_j - \hat{x}_j \cdot \frac{1}{D}\langle \tilde{\delta}, \hat{x} \rangle\right)$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;In vector form:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\nabla_x L = \frac{1}{r(x)}\left(I_D - \frac{\hat{x} \hat{x}^\top}{D}\right) \tilde{\delta}, \qquad \nabla_\gamma L = \delta_y \odot \hat{x}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Since &lt;code&gt;$\frac{1}{D}\hat{x}^\top \hat{x} = 1$&lt;/code&gt;, left-multiplying &lt;code&gt;$\nabla_x L$&lt;/code&gt; by &lt;code&gt;$x^\top = r(x)\hat{x}^\top$&lt;/code&gt; yields:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$x^\top \nabla_x L = \hat{x}^\top \tilde{\delta} - \frac{\hat{x}^\top \hat{x}}{D} \hat{x}^\top \tilde{\delta} = 0$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Thus the gradient propagated back to &lt;code&gt;$x$&lt;/code&gt; is strictly orthogonal to &lt;code&gt;$x$&lt;/code&gt; itself (zero directional derivative along radial rescaling of &lt;code&gt;$x$&lt;/code&gt;) and scales inversely with &lt;code&gt;$r(x)$&lt;/code&gt;: inflating activations by &lt;code&gt;$\alpha$&lt;/code&gt; shrinks backward gradients by &lt;code&gt;$1/\alpha$&lt;/code&gt;, preventing norm explosion in deep residual stacks&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-zhang2019-3&#34; href=&#34;#ref-zhang2019&#34;&gt;[6]&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;22-derivative-of-cross-entropy-loss-with-respect-to-logits&#34;&gt;2.2 Derivative of Cross-Entropy Loss with Respect to Logits&lt;/h3&gt;&#xA;&lt;p&gt;Now trace a training batch of &lt;code&gt;$B=20$&lt;/code&gt; sequences of length &lt;code&gt;$T=16$&lt;/code&gt;, giving &lt;code&gt;$N = B \times T = 320$&lt;/code&gt; next-token prediction positions. Flatten the final logits into &lt;code&gt;$Z \in \mathbb{R}^{N \times V}$&lt;/code&gt;, and let &lt;code&gt;$y_n \in \{0, \dots, V-1\}$&lt;/code&gt; denote the ground-truth next token at position &lt;code&gt;$n$&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Cross-entropy loss averages the negative log-likelihood of the true token across all &lt;code&gt;$N$&lt;/code&gt; positions:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$L = -\frac{1}{N} \sum_{n=1}^{N} \ln P_{n, y_n} = -\frac{1}{N} \sum_{n=1}^{N} \left(Z_{n, y_n} - \ln \sum_{m=0}^{V-1} e^{Z_{n, m}}\right)$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;where &lt;code&gt;$P_{n, k} = e^{Z_{n,k}} / \sum_{m=0}^{V-1} e^{Z_{n,m}}$&lt;/code&gt;. At random initialization, all logits are nearly equal so &lt;code&gt;$P_{n, k} \approx 1/V$&lt;/code&gt;, placing the theoretical initial loss right at &lt;code&gt;$\ln V$&lt;/code&gt; (&lt;code&gt;$\ln 1000 \approx 6.91$&lt;/code&gt; for &lt;code&gt;$V=1000$&lt;/code&gt;, or &lt;code&gt;$\ln 128 \approx 4.85$&lt;/code&gt; for &lt;code&gt;$V=128$&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;p&gt;Differentiating with respect to logit &lt;code&gt;$Z_{n, j}$&lt;/code&gt;—noting that row &lt;code&gt;$n$&lt;/code&gt;&#39;s probabilities depend only on row &lt;code&gt;$n$&lt;/code&gt;&#39;s logits—eliminates all terms &lt;code&gt;$n&amp;#39; \neq n$&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\frac{\partial L}{\partial Z_{n, j}} = -\frac{1}{N}\left(\frac{\partial Z_{n, y_n}}{\partial Z_{n, j}} - \frac{1}{\sum_{m=0}^{V-1} e^{Z_{n, m}}} \cdot \frac{\partial}{\partial Z_{n, j}} \sum_{m=0}^{V-1} e^{Z_{n, m}}\right) = -\frac{1}{N}\left(\mathbf{1}_{j = y_n} - \frac{e^{Z_{n, j}}}{\sum_{m=0}^{V-1} e^{Z_{n, m}}}\right)$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Collecting entries yields the root backward error matrix &lt;code&gt;$\Delta^{(Z)} = \partial L / \partial Z \in \mathbb{R}^{N \times V}$&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\Delta_{n, j}^{(Z)} = \frac{\partial L}{\partial Z_{n, j}} = \frac{1}{N}\left(P_{n, j} - \mathbf{1}_{j = y_n}\right)$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Its sign structure is transparent: on the ground-truth column &lt;code&gt;$j = y_n$&lt;/code&gt;, since &lt;code&gt;$P_{n, y_n} \le 1$&lt;/code&gt;, the derivative &lt;code&gt;$(P_{n, y_n} - 1)/N$&lt;/code&gt; is negative, instructing gradient descent to push that logit up; on every incorrect column &lt;code&gt;$j \neq y_n$&lt;/code&gt;, the derivative &lt;code&gt;$+P_{n, j}/N$&lt;/code&gt; is positive and proportional to the probability mass mistakenly assigned to token &lt;code&gt;$j$&lt;/code&gt;; and every row sums identically to &lt;code&gt;$\frac{1}{N}(1 - 1) = 0$&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;23-linear-layer-matrix-calculus-and-the-root-cause-of-spectral-skew&#34;&gt;2.3 Linear-Layer Matrix Calculus and the Root Cause of Spectral Skew&lt;/h3&gt;&#xA;&lt;p&gt;With the top-level error matrix in hand, consider any internal bias-free linear layer &lt;code&gt;$Y = X W^\top$&lt;/code&gt;, where flattened inputs are &lt;code&gt;$X \in \mathbb{R}^{N \times d_{\mathrm{in}}}$&lt;/code&gt;, weights are &lt;code&gt;$W \in \mathbb{R}^{d_{\mathrm{out}} \times d_{\mathrm{in}}}$&lt;/code&gt;, outputs are &lt;code&gt;$Y \in \mathbb{R}^{N \times d_{\mathrm{out}}}$&lt;/code&gt;, and the upstream gradient &lt;code&gt;$\Delta = \partial L / \partial Y \in \mathbb{R}^{N \times d_{\mathrm{out}}}$&lt;/code&gt; (&lt;code&gt;$\Delta_{n, i} = \partial L / \partial Y_{n, i}$&lt;/code&gt;) has arrived from above.&lt;/p&gt;&#xA;&lt;p&gt;Expanding &lt;code&gt;$Y$&lt;/code&gt; coordinate by coordinate:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$Y_{n, i} = \sum_{k=1}^{d_{\mathrm{in}}} X_{n, k} W_{i, k}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Ask where a single scalar weight &lt;code&gt;$W_{i, j}$&lt;/code&gt; participates: across every token &lt;code&gt;$n = 1, \dots, N$&lt;/code&gt;, &lt;code&gt;$W_{i, j}$&lt;/code&gt; appears exclusively in output channel &lt;code&gt;$i$&lt;/code&gt;&#39;s &lt;code&gt;$k = j$&lt;/code&gt; term with local derivative &lt;code&gt;$\partial Y_{n, i} / \partial W_{i, j} = X_{n, j}$&lt;/code&gt; (and &lt;code&gt;$\partial Y_{n, p} / \partial W_{i, j} = 0$&lt;/code&gt; whenever &lt;code&gt;$p \neq i$&lt;/code&gt;). Summing over all paths via the multivariable chain rule gives:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$G_{i, j} \triangleq \frac{\partial L}{\partial W_{i, j}} = \sum_{n=1}^{N} \sum_{p=1}^{d_{\mathrm{out}}} \frac{\partial L}{\partial Y_{n, p}} \frac{\partial Y_{n, p}}{\partial W_{i, j}} = \sum_{n=1}^{N} \Delta_{n, i} X_{n, j} = \sum_{n=1}^{N} (\Delta^\top)_{i, n} X_{n, j}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;By definition of matrix multiplication, the right-hand side is entry &lt;code&gt;$(i, j)$&lt;/code&gt; of &lt;code&gt;$\Delta^\top \in \mathbb{R}^{d_{\mathrm{out}} \times N}$&lt;/code&gt; times &lt;code&gt;$X \in \mathbb{R}^{N \times d_{\mathrm{in}}}$&lt;/code&gt;. By the same reasoning, input coordinate &lt;code&gt;$X_{n, j}$&lt;/code&gt; contributes to all &lt;code&gt;$d_{\mathrm{out}}$&lt;/code&gt; output channels of row &lt;code&gt;$n$&lt;/code&gt; with &lt;code&gt;$\partial Y_{n, i} / \partial X_{n, j} = W_{i, j}$&lt;/code&gt;, yielding &lt;code&gt;$\frac{\partial L}{\partial X_{n, j}} = \sum_{i=1}^{d_{\mathrm{out}}} \Delta_{n, i} W_{i, j} = (\Delta W)_{n, j}$&lt;/code&gt;. Together:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$G = \frac{\partial L}{\partial W} = \Delta^\top X = \sum_{n=1}^{N} \delta_n x_n^\top \in \mathbb{R}^{d_{\mathrm{out}} \times d_{\mathrm{in}}}, \qquad \frac{\partial L}{\partial X} = \Delta W \in \mathbb{R}^{N \times d_{\mathrm{in}}}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;where &lt;code&gt;$\delta_n \in \mathbb{R}^{d_{\mathrm{out}}}$&lt;/code&gt; and &lt;code&gt;$x_n \in \mathbb{R}^{d_{\mathrm{in}}}$&lt;/code&gt; are the column vectors for token &lt;code&gt;$n$&lt;/code&gt;&#39;s upstream error and layer input.&lt;/p&gt;&#xA;&lt;figure class=&#34;diagram&#34; style=&#34;--h:684px;--hn:629px&#34;&gt;&lt;figcaption&gt;Full-Flow LLM Training Matrix Shapes: Tracking Cached Activations, Transpose Contraction &amp;amp; Dual Optimizers&lt;/figcaption&gt;&lt;p&gt;&lt;a href=&#34;https://mizore.blog/en/posts/from-transformer-matrices-to-muon/&#34;&gt;(See the figure in the post.)&lt;/a&gt;&lt;/p&gt;&lt;p class=&#34;figure-note&#34;&gt;Batch tokens &lt;code&gt;$N = B \times T = 5$&lt;/code&gt; (clay rows), input dim &lt;code&gt;$d_{\mathrm{in}}=4$&lt;/code&gt; (blue cols), output dim &lt;code&gt;$d_{\mathrm{out}}=3$&lt;/code&gt; (violet cols). Stage 2 right shows how the &lt;code&gt;$5$&lt;/code&gt; horizontal columns of &lt;code&gt;$\Delta_Y^\top$&lt;/code&gt; pair with and cancel the &lt;code&gt;$5$&lt;/code&gt; vertical rows of cached &lt;code&gt;$X$&lt;/code&gt;, leaving a &lt;code&gt;$12$&lt;/code&gt;-cell gradient &lt;code&gt;$G\;[3\times 4]$&lt;/code&gt; identical in shape to &lt;code&gt;$W$&lt;/code&gt;.&lt;/p&gt;&lt;/figure&gt;&#xA;&lt;p&gt;These two compact equations simultaneously explain four central facts of LLM engineering and optimization:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Why &lt;code&gt;$G$&lt;/code&gt; always has the exact shape of &lt;code&gt;$W$&lt;/code&gt;&lt;/strong&gt;: the batch-and-token dimension &lt;code&gt;$N$&lt;/code&gt; is the shared inner axis contracted out in &lt;code&gt;$\Delta^\top X$&lt;/code&gt;, leaving &lt;code&gt;$(d_{\mathrm{out}}, d_{\mathrm{in}})$&lt;/code&gt; regardless of batch size &lt;code&gt;$B$&lt;/code&gt; or context length &lt;code&gt;$T$&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Why training VRAM dwarfs inference VRAM&lt;/strong&gt;: evaluating &lt;code&gt;$\Delta^\top X$&lt;/code&gt; in the backward pass explicitly requires the forward activation &lt;code&gt;$X$&lt;/code&gt; saved from Stage 1. Attention behaves identically—differentiating &lt;code&gt;$O = P V_{\mathrm{val}}$&lt;/code&gt; and &lt;code&gt;$S = Q K^\top / \sqrt{d_k}$&lt;/code&gt; gives &lt;code&gt;$\Delta_V = P^\top \Delta_O$&lt;/code&gt;, &lt;code&gt;$\Delta_P = \Delta_O V_{\mathrm{val}}^\top$&lt;/code&gt;, &lt;code&gt;$\Delta_Q = \frac{1}{\sqrt{d_k}}\Delta_S K$&lt;/code&gt;, and &lt;code&gt;$\Delta_K = \frac{1}{\sqrt{d_k}}\Delta_S^\top Q$&lt;/code&gt;, requiring forward &lt;code&gt;$Q, K, V_{\mathrm{val}}, P$&lt;/code&gt; (FlashAttention avoids materializing the &lt;code&gt;$T \times T$&lt;/code&gt; matrix &lt;code&gt;$P$&lt;/code&gt; in HBM by recomputing tiles in SRAM, but &lt;code&gt;$Q, K, V_{\mathrm{val}}$&lt;/code&gt; and layer inputs still stay resident unless activation checkpointing trades extra forward compute for memory).&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Why &lt;code&gt;zero_grad()&lt;/code&gt; is required before backward&lt;/strong&gt;: when full batches exceed GPU memory, training splits each step into micro-batches and calls &lt;code&gt;loss.backward()&lt;/code&gt; repeatedly so PyTorch accumulates (&lt;code&gt;+=&lt;/code&gt;) each micro-batch&#39;s &lt;code&gt;$\Delta^\top X$&lt;/code&gt; into &lt;code&gt;W.grad&lt;/code&gt; before stepping once. Standard single-batch steps must therefore zero out stale gradients explicitly.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Why neural network gradient matrices exhibit extreme singular-value skew&lt;/strong&gt;: look at the outer-product sum &lt;code&gt;$G = \sum_{n=1}^N \delta_n x_n^\top$&lt;/code&gt;. Natural language token frequencies follow a heavy-tailed Zipf distribution, so frequent function words and shared syntactic directions dominate every batch, concentrating the eigenvalues of &lt;code&gt;$\frac{1}{N}X^\top X$&lt;/code&gt; into a handful of top principal components. Consequently, &lt;code&gt;$G$&lt;/code&gt; is severely anisotropic: its top few singular values are orders of magnitude larger than the dozens or hundreds of tail singular directions carrying rare facts and fine-grained contextual circuits.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h3 id=&#34;24-unfolding-backpropagation-hand-tracing-2-token-cross-entropy-and-outer-product-gradients&#34;&gt;2.4 Unfolding Backpropagation: Hand-Tracing 2-Token Cross-Entropy and Outer-Product Gradients&lt;/h3&gt;&#xA;&lt;p&gt;Let us likewise substitute concrete numbers into Sections 2.2 and 2.3 so we can watch a single scalar loss &lt;code&gt;$L$&lt;/code&gt; differentiate back into a 2D weight gradient matrix &lt;code&gt;$G$&lt;/code&gt;—and see firsthand why &lt;code&gt;$G$&lt;/code&gt; naturally exhibits severe singular-value skew.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Step 1: From logits &lt;code&gt;$Z$&lt;/code&gt; to top-level gradient &lt;code&gt;$\Delta^{(Z)}$&lt;/code&gt;.&lt;/strong&gt; Consider &lt;code&gt;$N = 2$&lt;/code&gt; token positions over a 3-word vocabulary &lt;code&gt;$V = 3$&lt;/code&gt;, with ground-truth target IDs &lt;code&gt;$y_1 = 0$&lt;/code&gt; and &lt;code&gt;$y_2 = 1$&lt;/code&gt; (one-hot matrix &lt;code&gt;$Y_{\mathrm{true}} = \begin{bsmallmatrix} 1 &amp;amp; 0 &amp;amp; 0 \\ 0 &amp;amp; 1 &amp;amp; 0 \end{bsmallmatrix}$&lt;/code&gt;). Suppose forward logits &lt;code&gt;$Z \in \mathbb{R}^{2 \times 3}$&lt;/code&gt; are:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$Z = \begin{bmatrix} 2.0 &amp;amp; 1.0 &amp;amp; 0.0 \\ 0.0 &amp;amp; 2.0 &amp;amp; 1.0 \end{bmatrix} \;\xrightarrow{\text{row Softmax}}\; P \approx \begin{bmatrix} 0.67 &amp;amp; 0.24 &amp;amp; 0.09 \\ 0.09 &amp;amp; 0.67 &amp;amp; 0.24 \end{bmatrix}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Mean cross-entropy is the scalar &lt;code&gt;$L = -\frac{1}{2}(\ln 0.67 + \ln 0.67) \approx 0.40$&lt;/code&gt;. Plugging &lt;code&gt;$P$&lt;/code&gt; and &lt;code&gt;$Y_{\mathrm{true}}$&lt;/code&gt; into &lt;code&gt;$\Delta^{(Z)} = \frac{1}{N}(P - Y_{\mathrm{true}})$&lt;/code&gt; with &lt;code&gt;$N = 2$&lt;/code&gt; gives:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\Delta^{(Z)} = \frac{1}{2} \left( \begin{bmatrix} 0.67 &amp;amp; 0.24 &amp;amp; 0.09 \\ 0.09 &amp;amp; 0.67 &amp;amp; 0.24 \end{bmatrix} - \begin{bmatrix} 1 &amp;amp; 0 &amp;amp; 0 \\ 0 &amp;amp; 1 &amp;amp; 0 \end{bmatrix} \right) = \begin{bmatrix} \mathbf{-0.17} &amp;amp; +0.12 &amp;amp; +0.05 \\ +0.05 &amp;amp; \mathbf{-0.17} &amp;amp; +0.12 \end{bmatrix}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Every sign has a direct physical meaning: ground-truth columns receive negative derivatives (&lt;code&gt;$-0.17$&lt;/code&gt;) so gradient descent &lt;code&gt;$Z - \eta \Delta^{(Z)}$&lt;/code&gt; pushes those target scores up, while wrong candidates receive positive derivatives (&lt;code&gt;$+0.12, +0.05$&lt;/code&gt;) proportional to the probability mass mistakenly assigned to them.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Step 2: Forward caching and two-way backward split inside &lt;code&gt;$Y = X W^\top$&lt;/code&gt;.&lt;/strong&gt; Zoom into an internal linear layer mapping &lt;code&gt;$d_{\mathrm{in}} = 3 \to d_{\mathrm{out}} = 2$&lt;/code&gt;. Let the cached forward input for our &lt;code&gt;$N = 2$&lt;/code&gt; tokens be &lt;code&gt;$X \in \mathbb{R}^{2 \times 3}$&lt;/code&gt; and weights be &lt;code&gt;$W \in \mathbb{R}^{2 \times 3}$&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$X = \begin{bmatrix} 1 &amp;amp; 2 &amp;amp; 0 \\ 1 &amp;amp; 2 &amp;amp; 1 \end{bmatrix}, \qquad W = \begin{bmatrix} 1.0 &amp;amp; 0.5 &amp;amp; -1.0 \\ -0.5 &amp;amp; 1.0 &amp;amp; 1.0 \end{bmatrix}, \qquad Y = X W^\top = \begin{bmatrix} 1 &amp;amp; 2 &amp;amp; 0 \\ 1 &amp;amp; 2 &amp;amp; 1 \end{bmatrix} \begin{bmatrix} 1.0 &amp;amp; -0.5 \\ 0.5 &amp;amp; 1.0 \\ -1.0 &amp;amp; 1.0 \end{bmatrix} = \begin{bmatrix} 2.0 &amp;amp; 1.5 \\ 1.0 &amp;amp; 2.5 \end{bmatrix}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Suppose upstream backpropagation hands back &lt;code&gt;$\Delta_Y = \begin{bsmallmatrix} -0.6 &amp;amp; 0.2 \\ -0.4 &amp;amp; 0.2 \end{bsmallmatrix} \in \mathbb{R}^{2 \times 2}$&lt;/code&gt;. The backward pass splits into two matrix products:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Left branch (propagating error to earlier layer input &lt;code&gt;$X$&lt;/code&gt;)&lt;/strong&gt;: multiply by &lt;code&gt;$W$&lt;/code&gt; (untransposed), contracting out &lt;code&gt;$d_{\mathrm{out}} = 2$&lt;/code&gt; to recover a &lt;code&gt;$2 \times 3$&lt;/code&gt; activation gradient matching &lt;code&gt;$X$&lt;/code&gt;:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\Delta_X = \Delta_Y W = \begin{bmatrix} -0.6 &amp;amp; 0.2 \\ -0.4 &amp;amp; 0.2 \end{bmatrix} \begin{bmatrix} 1.0 &amp;amp; 0.5 &amp;amp; -1.0 \\ -0.5 &amp;amp; 1.0 &amp;amp; 1.0 \end{bmatrix} = \begin{bmatrix} -0.7 &amp;amp; -0.1 &amp;amp; 0.8 \\ -0.5 &amp;amp; 0.0 &amp;amp; 0.6 \end{bmatrix} \in \mathbb{R}^{2 \times 3}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;ol start=&#34;2&#34;&gt;&#xA;&lt;li&gt;&lt;strong&gt;Right branch (joining with cached &lt;code&gt;$X$&lt;/code&gt; to form weight gradient &lt;code&gt;$G$&lt;/code&gt;)&lt;/strong&gt;: transpose &lt;code&gt;$\Delta_Y$&lt;/code&gt; and multiply into &lt;code&gt;$X\;(2 \times 3)$&lt;/code&gt;. Expanding across tokens &lt;code&gt;$n = 1, 2$&lt;/code&gt; exposes the sum of rank-one outer products &lt;code&gt;$\delta_1 x_1^\top + \delta_2 x_2^\top$&lt;/code&gt;:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;code&gt;$$G = \Delta_Y^\top X = \begin{bmatrix} -0.6 &amp;amp; -0.4 \\ 0.2 &amp;amp; 0.2 \end{bmatrix} \begin{bmatrix} 1 &amp;amp; 2 &amp;amp; 0 \\ 1 &amp;amp; 2 &amp;amp; 1 \end{bmatrix} = \underbrace{\begin{bmatrix} -0.6 \\ 0.2 \end{bmatrix} \begin{bmatrix} 1 &amp;amp; 2 &amp;amp; 0 \end{bmatrix}}_{\text{token 1 outer }\delta_1 x_1^\top} + \underbrace{\begin{bmatrix} -0.4 \\ 0.2 \end{bmatrix} \begin{bmatrix} 1 &amp;amp; 2 &amp;amp; 1 \end{bmatrix}}_{\text{token 2 outer }\delta_2 x_2^\top} = \begin{bmatrix} -0.6 &amp;amp; -1.2 &amp;amp; 0.0 \\ 0.2 &amp;amp; 0.4 &amp;amp; 0.0 \end{bmatrix} + \begin{bmatrix} -0.4 &amp;amp; -0.8 &amp;amp; -0.4 \\ 0.2 &amp;amp; 0.4 &amp;amp; 0.2 \end{bmatrix} = \begin{bmatrix} -1.0 &amp;amp; -2.0 &amp;amp; -0.4 \\ 0.4 &amp;amp; 0.8 &amp;amp; 0.2 \end{bmatrix}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Inspect the resulting &lt;code&gt;$2 \times 3$&lt;/code&gt; gradient &lt;code&gt;$G = \begin{bsmallmatrix} -1.0 &amp;amp; -2.0 &amp;amp; -0.4 \\ 0.4 &amp;amp; 0.8 &amp;amp; 0.2 \end{bsmallmatrix}$&lt;/code&gt;: because both tokens shared the frequent prefix features &lt;code&gt;$[1, 2]$&lt;/code&gt; in columns 1 and 2, row 1 is &lt;code&gt;$-2.5\times$&lt;/code&gt; row 2 across the first two columns; only column 3 (&lt;code&gt;$-0.4$&lt;/code&gt; vs. &lt;code&gt;$0.2$&lt;/code&gt;, contributed by token 2&#39;s unique 3rd coordinate &lt;code&gt;1&lt;/code&gt;) breaks exact collinearity. Taking the square roots of the eigenvalues of &lt;code&gt;$G G^\top = \begin{bsmallmatrix} 5.16 &amp;amp; -2.08 \\ -2.08 &amp;amp; 0.84 \end{bsmallmatrix}$&lt;/code&gt; gives the two singular values of &lt;code&gt;$G$&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\sigma_1(G) \approx 2.449, \qquad \sigma_2(G) \approx 0.037 \qquad (\sigma_1 / \sigma_2 \approx 67.1)$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Even across a 2-token toy batch, shared input directions open a &lt;strong&gt;&lt;code&gt;$67\times$&lt;/code&gt; singular-value gap&lt;/strong&gt;—setting the stage for Section 4.&lt;/p&gt;&#xA;&lt;figure class=&#34;diagram&#34; style=&#34;--h:432px;--hn:551px&#34;&gt;&lt;figcaption&gt;Unfolded Numeric Walkthrough: 2-Token Cross-Entropy Gradient and Rank-One Outer-Product Weight Gradient&lt;/figcaption&gt;&lt;p&gt;&lt;a href=&#34;https://mizore.blog/en/posts/from-transformer-matrices-to-muon/&#34;&gt;(See the figure in the post.)&lt;/a&gt;&lt;/p&gt;&lt;p class=&#34;figure-note&#34;&gt;Step 1 shows &lt;code&gt;$\Delta^{(Z)} = (P - Y_{\mathrm{true}})/N$&lt;/code&gt; assigning negative entries to ground-truth columns and positive entries elsewhere; Step 2 unfolds &lt;code&gt;$G = \Delta_Y^\top X$&lt;/code&gt; as the cellwise sum of token rank-1 matrices &lt;code&gt;$\delta_1 x_1^\top + \delta_2 x_2^\top$&lt;/code&gt;, revealing how shared features create a 67× singular-value skew.&lt;/p&gt;&lt;/figure&gt;&#xA;&lt;p&gt;Once &lt;code&gt;$G$&lt;/code&gt; is computed, how should &lt;code&gt;optimizer.step()&lt;/code&gt; update the weights? We begin with flat vectors and derive four generations of entrywise optimizers.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;3-proximal-steepest-descent-and-four-generations-of-entrywise-optimizers&#34;&gt;3. Proximal Steepest Descent and Four Generations of Entrywise Optimizers&lt;/h2&gt;&#xA;&lt;p&gt;To compare &lt;code&gt;SGD&lt;/code&gt;, &lt;code&gt;Momentum&lt;/code&gt;, &lt;code&gt;Adam&lt;/code&gt;, &lt;code&gt;AdamW&lt;/code&gt;, and eventually &lt;code&gt;Muon&lt;/code&gt; on equal footing, we formulate first-order updates in &lt;strong&gt;proximal steepest-descent form&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Let &lt;code&gt;$\theta_{t-1} \in \mathbb{R}^p$&lt;/code&gt; be the parameter vector after step &lt;code&gt;$t-1$&lt;/code&gt;, and let &lt;code&gt;$g_t = \nabla L_t(\theta_{t-1}) \in \mathbb{R}^p$&lt;/code&gt; be the current mini-batch gradient. A first-order Taylor expansion around &lt;code&gt;$\theta_{t-1}$&lt;/code&gt; gives &lt;code&gt;$L_t(\theta) \approx L_t(\theta_{t-1}) + \langle g_t, \theta - \theta_{t-1} \rangle$&lt;/code&gt;. Because this linear approximation holds only locally—minimizing a bare linear function over &lt;code&gt;$\mathbb{R}^p$&lt;/code&gt; would diverge to &lt;code&gt;$-\infty$&lt;/code&gt;—we add a quadratic proximal penalty measuring step size:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\theta_t = \mathrm{arg}\min_{\theta \in \mathbb{R}^p} \left\{ \langle g_t, \theta - \theta_{t-1} \rangle + \frac{1}{2\eta} \|\theta - \theta_{t-1}\|_2^2 \right\}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;with learning rate &lt;code&gt;$\eta &amp;gt; 0$&lt;/code&gt;. Setting the gradient of this strictly convex quadratic with respect to &lt;code&gt;$\theta$&lt;/code&gt; to zero yields:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$g_t + \frac{1}{\eta}(\theta_t - \theta_{t-1}) = 0 \quad \Longrightarrow \quad \theta_t = \theta_{t-1} - \eta g_t$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;This is classical &lt;strong&gt;Stochastic Gradient Descent (SGD)&lt;/strong&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-robbins1951-2&#34; href=&#34;#ref-robbins1951&#34;&gt;[2]&lt;/a&gt;&lt;/sup&gt;. Crucially, the statement that &amp;quot;&lt;code&gt;$-\eta g_t$&lt;/code&gt; is the steepest descent step&amp;quot; &lt;strong&gt;depends entirely on choosing the isotropic Euclidean norm &lt;code&gt;$\|\cdot\|_2$&lt;/code&gt; to measure parameter displacement&lt;/strong&gt;. Whenever loss curvature varies wildly across directions, Euclidean distance becomes a poor local metric.&lt;/p&gt;&#xA;&lt;h3 id=&#34;31-generation-1-sgd-bottlenecks-under-ill-conditioned-curvature&#34;&gt;3.1 Generation 1: &lt;code&gt;SGD&lt;/code&gt; Bottlenecks Under Ill-Conditioned Curvature&lt;/h3&gt;&#xA;&lt;p&gt;Consider the simplest 2D anisotropic quadratic loss—a narrow canyon whose Hessian eigenvalues differ sharply:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$L(\theta_1, \theta_2) = \frac{1}{2}\lambda_1 \theta_1^2 + \frac{1}{2}\lambda_2 \theta_2^2, \qquad 0 &amp;lt; \lambda_1 \ll \lambda_2$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Its gradient is &lt;code&gt;$\nabla L(\theta) = (\lambda_1 \theta_1, \lambda_2 \theta_2)^\top$&lt;/code&gt;, its unique minimum sits at &lt;code&gt;$(0, 0)$&lt;/code&gt;, and its &lt;strong&gt;condition number&lt;/strong&gt; is &lt;code&gt;$\kappa \triangleq \lambda_2 / \lambda_1 \gg 1$&lt;/code&gt;. Under vanilla gradient descent, the two coordinates decouple into geometric progressions:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\theta_{t, 1} = (1 - \eta \lambda_1)^t \theta_{0, 1}, \qquad \theta_{t, 2} = (1 - \eta \lambda_2)^t \theta_{0, 2}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Preventing divergence along the steep wall &lt;code&gt;$\theta_2$&lt;/code&gt; requires &lt;code&gt;$|1 - \eta \lambda_2| &amp;lt; 1$&lt;/code&gt;, imposing a strict ceiling on the learning rate:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$0 &amp;lt; \eta &amp;lt; \frac{2}{\lambda_2}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Whenever &lt;code&gt;$\frac{1}{\lambda_2} &amp;lt; \eta &amp;lt; \frac{2}{\lambda_2}$&lt;/code&gt;, the factor &lt;code&gt;$1 - \eta \lambda_2$&lt;/code&gt; is negative, so &lt;code&gt;$\theta_{t, 2}$&lt;/code&gt; flips sign every step and zigzags across the canyon walls. Worse still, capping &lt;code&gt;$\eta &amp;lt; 2/\lambda_2$&lt;/code&gt; forces the contraction factor along the flat valley floor &lt;code&gt;$\theta_1$&lt;/code&gt; to satisfy:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$1 - \eta \lambda_1 &amp;gt; 1 - \frac{2\lambda_1}{\lambda_2} = 1 - \frac{2}{\kappa}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Using &lt;code&gt;$\ln(1 - u) \approx -u$&lt;/code&gt;, shrinking &lt;code&gt;$\theta_1$&lt;/code&gt;&#39;s initial error by &lt;code&gt;$\varepsilon$&lt;/code&gt; takes &lt;code&gt;$t \ge \frac{\kappa}{2}\ln(1/\varepsilon)$&lt;/code&gt; steps. In deep networks where Hessian condition numbers routinely reach &lt;code&gt;$\kappa \sim 10^4$&lt;/code&gt;–&lt;code&gt;$10^6$&lt;/code&gt;, progress along flat directions crawls.&lt;/p&gt;&#xA;&lt;h3 id=&#34;32-generation-2-polyak-heavy-ball-momentum-and-nesterov-lookahead-reformulation&#34;&gt;3.2 Generation 2: Polyak Heavy-Ball Momentum and Nesterov Lookahead Reformulation&lt;/h3&gt;&#xA;&lt;p&gt;How can we damp sign-flipping oscillations across steep walls while accelerating consistent progress down the valley floor? In 1964, Boris Polyak drew on the damped mechanics of a heavy ball rolling on a potential surface, accumulating an exponential moving average (EMA) of past gradients&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-polyak1964-1&#34; href=&#34;#ref-polyak1964&#34;&gt;[7]&lt;/a&gt;&lt;/sup&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$m_t = \beta_1 m_{t-1} + (1 - \beta_1) g_t, \qquad \theta_t = \theta_{t-1} - \eta m_t$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;(Implementations often omit &lt;code&gt;$(1 - \beta_1)$&lt;/code&gt; as &lt;code&gt;$u_t = \mu u_{t-1} + g_t$&lt;/code&gt;, absorbing the constant &lt;code&gt;$1/(1-\mu)$&lt;/code&gt; into &lt;code&gt;$\eta$&lt;/code&gt;.) Evaluating steady-state gain on two canonical gradient sequences shows why this works:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Consistent flat direction&lt;/strong&gt; (&lt;code&gt;$g_\tau = g$&lt;/code&gt; every step): for large &lt;code&gt;$t$&lt;/code&gt;, &lt;code&gt;$m_t = (1 - \beta_1)\sum_{k=0}^\infty \beta_1^k g = g$&lt;/code&gt;, preserving full forward drive (or amplifying effective step size by &lt;code&gt;$\frac{1}{1-\mu} = 10\times$&lt;/code&gt; at &lt;code&gt;$\mu = 0.9$&lt;/code&gt; in the unscaled convention);&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Alternating steep direction&lt;/strong&gt; (&lt;code&gt;$g_\tau = (-1)^\tau g$&lt;/code&gt; flipping sign every step): the steady-state amplitude is&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;code&gt;$$|m_t| = (1 - \beta_1) |g| \left|\sum_{k=0}^{\infty} (-\beta_1)^k\right| = \frac{1 - \beta_1}{1 + \beta_1} |g|$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;At &lt;code&gt;$\beta_1 = 0.9$&lt;/code&gt;, &lt;code&gt;$\frac{1 - 0.9}{1 + 0.9} \approx 0.0526$&lt;/code&gt;, damping cross-wall oscillation by nearly &lt;code&gt;$95\%$&lt;/code&gt;. On convex quadratics, optimal momentum improves iteration complexity from &lt;code&gt;$\mathcal{O}(\kappa)$&lt;/code&gt; to &lt;code&gt;$\mathcal{O}(\sqrt{\kappa})$&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;In 1983, Yurii Nesterov observed a further refinement: since momentum is about to carry the iterate forward by &lt;code&gt;$\mu v_{t-1}$&lt;/code&gt; anyway, rather than evaluating the gradient at the old point &lt;code&gt;$x_{t-1}$&lt;/code&gt;, we should &lt;strong&gt;step to the lookahead point &lt;code&gt;$x_{t-1} + \mu v_{t-1}$&lt;/code&gt; first and evaluate the gradient there&lt;/strong&gt; to correct course earlier&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-nesterov1983-1&#34; href=&#34;#ref-nesterov1983&#34;&gt;[8]&lt;/a&gt;&lt;/sup&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$v_t = \mu v_{t-1} - \eta \nabla L(x_{t-1} + \mu v_{t-1}), \qquad x_t = x_{t-1} + v_t$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;At first glance, evaluating &lt;code&gt;$\nabla L(x_{t-1} + \mu v_{t-1})$&lt;/code&gt; seems to require a second forward/backward pass at a temporary point. Deep learning frameworks (both PyTorch&#39;s &lt;code&gt;SGD(..., nesterov=True)&lt;/code&gt; and &lt;code&gt;Muon&lt;/code&gt; below) eliminate that extra pass via a change of variables: store the lookahead point itself as the model parameter &lt;code&gt;$\theta_{t-1} \triangleq x_{t-1} + \mu v_{t-1}$&lt;/code&gt;, so the standard backward pass directly yields &lt;code&gt;$g_t = \nabla L(\theta_{t-1})$&lt;/code&gt;. Defining &lt;code&gt;$M_t \triangleq -v_t / \eta$&lt;/code&gt; gives &lt;code&gt;$v_t = -\eta M_t$&lt;/code&gt; with &lt;code&gt;$M_t = \mu M_{t-1} + g_t$&lt;/code&gt;. Expressing &lt;code&gt;$\theta_t$&lt;/code&gt; in terms of &lt;code&gt;$\theta_{t-1}$&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\begin{aligned} \theta_t &amp;amp;= x_t + \mu v_t = (x_{t-1} + v_t) + \mu v_t \\ &amp;amp;= (x_{t-1} + \mu v_{t-1}) - \mu v_{t-1} + (1 + \mu) v_t \\ &amp;amp;= \theta_{t-1} + \eta \mu M_{t-1} - \eta (1 + \mu)(\mu M_{t-1} + g_t) \\ &amp;amp;= \theta_{t-1} - \eta \bigl(g_t + \mu (\mu M_{t-1} + g_t)\bigr) = \theta_{t-1} - \eta (g_t + \mu M_t) \end{aligned}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Setting &lt;code&gt;$\tilde{M}_t \triangleq g_t + \mu M_t$&lt;/code&gt; produces the exact two-line recurrence &lt;code&gt;M = mu * M + G; tilde_M = G + mu * M&lt;/code&gt; used inside &lt;code&gt;Muon&lt;/code&gt; in Section 7. Compared with heavy-ball momentum &lt;code&gt;$M_t = g_t + \mu M_{t-1}$&lt;/code&gt;, Nesterov lookahead &lt;code&gt;$\tilde{M}_t = (1 + \mu)g_t + \mu^2 M_{t-1}$&lt;/code&gt; weights the freshest gradient &lt;code&gt;$g_t$&lt;/code&gt; by &lt;code&gt;$(1 + \mu)$&lt;/code&gt;, braking earlier around curved ravines.&lt;/p&gt;&#xA;&lt;h3 id=&#34;33-generation-3-adaptive-preconditioning-and-adams-bias-correction&#34;&gt;3.3 Generation 3: Adaptive Preconditioning and Adam&#39;s Bias Correction&lt;/h3&gt;&#xA;&lt;p&gt;Momentum tames curvature within a layer, but deep Transformers also exhibit multi-order-of-magnitude gradient disparities across layers and token frequencies: a rare token&#39;s embedding row may see gradients of &lt;code&gt;$10^{-5}$&lt;/code&gt; while an attention projection sees &lt;code&gt;$10^1$&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Returning to the proximal framework, replace the isotropic Euclidean penalty &lt;code&gt;$\|\theta - \theta_{t-1}\|_2^2$&lt;/code&gt; with a coordinate-weighted diagonal Riemannian metric &lt;code&gt;$(\theta - \theta_{t-1})^\top D_t (\theta - \theta_{t-1})$&lt;/code&gt; for &lt;code&gt;$D_t = \mathrm{diag}(d_{t,1}, \dots, d_{t,p}) \succ 0$&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\theta_t = \mathrm{arg}\min_{\theta \in \mathbb{R}^p} \left\{ \langle g_t, \theta - \theta_{t-1} \rangle + \frac{1}{2\eta} (\theta - \theta_{t-1})^\top D_t (\theta - \theta_{t-1}) \right\} \quad \Longrightarrow \quad \theta_t = \theta_{t-1} - \eta D_t^{-1} g_t$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Three classic algorithms construct &lt;code&gt;$D_t$&lt;/code&gt; progressively:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;AdaGrad (Duchi et al., 2011)&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-duchi2011-1&#34; href=&#34;#ref-duchi2011&#34;&gt;[9]&lt;/a&gt;&lt;/sup&gt;&lt;/strong&gt;: accumulate all historical squared gradients &lt;code&gt;$G_{\mathrm{sum}, t} = \sum_{\tau=1}^t g_\tau \odot g_\tau$&lt;/code&gt; and set &lt;code&gt;$D_t = \mathrm{diag}\!\left(\sqrt{G_{\mathrm{sum}, t}} + \epsilon\right)$&lt;/code&gt;. Optimal for sparse convex online learning, its non-decreasing denominator &lt;code&gt;$\sqrt{G_{\mathrm{sum}, t}}$&lt;/code&gt; steadily shrinks effective learning rates toward zero over tens of thousands of non-convex training steps.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;RMSProp (Hinton, 2012)&lt;/strong&gt;: introduce a decay factor &lt;code&gt;$\beta_2 \in (0, 1)$&lt;/code&gt; (e.g., &lt;code&gt;$0.999$&lt;/code&gt; or &lt;code&gt;$0.95$&lt;/code&gt;) to replace infinite summation with a leaky EMA over an effective window of &lt;code&gt;$\frac{1}{1-\beta_2}$&lt;/code&gt; steps: &lt;code&gt;$v_t = \beta_2 v_{t-1} + (1 - \beta_2) (g_t \odot g_t)$&lt;/code&gt;, dividing by &lt;code&gt;$\sqrt{v_t} + \epsilon$&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Adam (Kingma &amp;amp; Ba, 2015) and cold-start bias correction&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-kingma2015-1&#34; href=&#34;#ref-kingma2015&#34;&gt;[10]&lt;/a&gt;&lt;/sup&gt;&lt;/strong&gt;: combine first-moment momentum &lt;code&gt;$m_t$&lt;/code&gt; in the numerator with second-moment &lt;code&gt;$v_t$&lt;/code&gt; in the denominator, initialized at &lt;code&gt;$m_0 = 0, v_0 = 0$&lt;/code&gt;:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;code&gt;$$m_t = \beta_1 m_{t-1} + (1 - \beta_1) g_t, \qquad v_t = \beta_2 v_{t-1} + (1 - \beta_2) g_t^2$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;(where &lt;code&gt;$g_t^2$&lt;/code&gt; denotes elementwise &lt;code&gt;$g_t \odot g_t$&lt;/code&gt;). Why is bias correction essential? Unrolling &lt;code&gt;$v_t$&lt;/code&gt; back to &lt;code&gt;$t=1$&lt;/code&gt; by induction gives:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$v_t = (1 - \beta_2) \sum_{i=1}^{t} \beta_2^{t-i} g_i^2$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Taking expectations on both sides—letting &lt;code&gt;$\sigma_{g,t}^2 \triangleq \mathbb{E}[g_t^2]$&lt;/code&gt; and writing &lt;code&gt;$\mathbb{E}[g_i^2] = \sigma_{g,t}^2 + (\mathbb{E}[g_i^2] - \sigma_{g,t}^2)$&lt;/code&gt; so the non-stationarity remainder &lt;code&gt;$\zeta = 0$&lt;/code&gt; under locally stationary gradients—the finite geometric series &lt;code&gt;$\sum_{k=0}^{t-1} \beta_2^k = \frac{1 - \beta_2^t}{1 - \beta_2}$&lt;/code&gt; yields:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\mathbb{E}[v_t] = (1 - \beta_2) \sum_{i=1}^{t} \beta_2^{t-i} \mathbb{E}[g_i^2] = \sigma_{g,t}^2 (1 - \beta_2) \frac{1 - \beta_2^t}{1 - \beta_2} + \zeta = \sigma_{g,t}^2 (1 - \beta_2^t) + \zeta$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Similarly, &lt;code&gt;$\mathbb{E}[m_t] = \mathbb{E}[g_t](1 - \beta_1^t) + \zeta&amp;#39;$&lt;/code&gt;. Because &lt;code&gt;$m_0 = 0$&lt;/code&gt; and &lt;code&gt;$v_0 = 0$&lt;/code&gt; carry the remaining weights &lt;code&gt;$\beta_1^t$&lt;/code&gt; and &lt;code&gt;$\beta_2^t$&lt;/code&gt;, both raw estimators are biased toward zero early in training. At step &lt;code&gt;$t = 1$&lt;/code&gt; with standard defaults &lt;code&gt;$\beta_1 = 0.9, \beta_2 = 0.999$&lt;/code&gt;, the uncorrected ratio for any nonzero gradient &lt;code&gt;$g_1$&lt;/code&gt; has magnitude:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\frac{|m_1|}{\sqrt{v_1}} = \frac{(1 - \beta_1)|g_1|}{\sqrt{(1 - \beta_2) g_1^2}} = \frac{1 - 0.9}{\sqrt{1 - 0.999}} = \frac{0.1}{\sqrt{0.001}} \approx 3.162$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Because &lt;code&gt;$\beta_2$&lt;/code&gt; is much closer to &lt;code&gt;$1$&lt;/code&gt; than &lt;code&gt;$\beta_1$&lt;/code&gt;, the denominator is biased toward zero far more strongly than the numerator, inflating the very first step by &lt;code&gt;$3.16\times$&lt;/code&gt; (or &lt;code&gt;$10\times$&lt;/code&gt; at &lt;code&gt;$\beta_2 = 0.9999$&lt;/code&gt;) and risking early divergence.&lt;/p&gt;&#xA;&lt;p&gt;Dividing each EMA by the sum of its weights &lt;code&gt;$(1 - \beta_1^t)$&lt;/code&gt; and &lt;code&gt;$(1 - \beta_2^t)$&lt;/code&gt; yields the unbiased estimators &lt;code&gt;$\hat{m}_t, \hat{v}_t$&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\hat{m}_t = \frac{m_t}{1 - \beta_1^t}, \qquad \hat{v}_t = \frac{v_t}{1 - \beta_2^t}, \qquad \theta_t = \theta_{t-1} - \eta \frac{\hat{m}_t}{\sqrt{\hat{v}_t} + \epsilon}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Now &lt;code&gt;$|\hat{m}_1| / \sqrt{\hat{v}_1} = |g_1| / |g_1| = 1$&lt;/code&gt; at step &lt;code&gt;$1$&lt;/code&gt;, while &lt;code&gt;$\beta_1^t, \beta_2^t \to 0$&lt;/code&gt; smoothly as &lt;code&gt;$t \to \infty$&lt;/code&gt;. Statistically, &lt;code&gt;$\hat{m}_t / \sqrt{\hat{v}_t}$&lt;/code&gt; acts as a per-coordinate &lt;strong&gt;empirical signal-to-noise ratio (SNR)&lt;/strong&gt;: near a minimum where &lt;code&gt;$\mathbb{E}[g_t] \to 0$&lt;/code&gt;, mini-batch variance keeps &lt;code&gt;$\hat{v}_t &amp;gt; 0$&lt;/code&gt; while sign cancellation drives &lt;code&gt;$\hat{m}_t \to 0$&lt;/code&gt;, automatically annealing step sizes&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-kingma2015-2&#34; href=&#34;#ref-kingma2015&#34;&gt;[10]&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;34-generation-4-non-equivalence-of-l_2-regularization-and-decoupled-weight-decay-adamw&#34;&gt;3.4 Generation 4: Non-Equivalence of &lt;code&gt;$L_2$&lt;/code&gt; Regularization and Decoupled Weight Decay (&lt;code&gt;AdamW&lt;/code&gt;)&lt;/h3&gt;&#xA;&lt;p&gt;Without norm control on overparameterized networks, minimizing finite-sample cross-entropy drives redundant weights to large magnitudes, sharpening logits and hurting generalization. From a Bayesian MAP perspective, placing an isotropic zero-mean Gaussian prior &lt;code&gt;$p(\theta) \propto \exp\!\left(-\frac{\lambda}{2}\|\theta\|_2^2\right)$&lt;/code&gt; on the parameters adds a quadratic &lt;strong&gt;&lt;code&gt;$L_2$&lt;/code&gt; penalty&lt;/strong&gt; to the loss:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$L_{\mathrm{reg}}(\theta) = L(\theta) + \frac{\lambda}{2}\|\theta\|_2^2 \quad \Longrightarrow \quad \nabla L_{\mathrm{reg}}(\theta) = \nabla L(\theta) + \lambda \theta$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Independently, Hanson and Pratt (1988) defined &lt;strong&gt;weight decay&lt;/strong&gt; as directly shrinking parameters each step via &lt;code&gt;$(1 - w)\theta_{t-1}$&lt;/code&gt;. Substituting &lt;code&gt;$\nabla L_{\mathrm{reg}}$&lt;/code&gt; into vanilla &lt;code&gt;SGD&lt;/code&gt; gives:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\theta_t = \theta_{t-1} - \eta (g_t + \lambda \theta_{t-1}) = (1 - \eta \lambda)\theta_{t-1} - \eta g_t$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Setting &lt;code&gt;$w = \eta \lambda$&lt;/code&gt; makes the two identical. Because of this coincidence, deep learning libraries implemented &lt;code&gt;weight_decay&lt;/code&gt; by adding &lt;code&gt;wd * theta&lt;/code&gt; onto &lt;code&gt;g_t&lt;/code&gt; before running the optimizer. Yet once &lt;code&gt;Adam&lt;/code&gt; became popular, models trained with &lt;code&gt;Adam&lt;/code&gt; + &lt;code&gt;$L_2$&lt;/code&gt; regularization generalized noticeably worse than &lt;code&gt;SGD + Momentum&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;In 2019, Loshchilov and Hutter proved why the two are inequivalent under adaptive preconditioning&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-loshchilov2019-2&#34; href=&#34;#ref-loshchilov2019&#34;&gt;[3]&lt;/a&gt;&lt;/sup&gt;. Consider any preconditioned update with symmetric positive-definite preconditioner &lt;code&gt;$P_t \succ 0$&lt;/code&gt; and decoupled decay rate &lt;code&gt;$w$&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\theta_t = (1 - w)\theta_{t-1} - \eta P_t^{-1} \nabla L(\theta_{t-1})$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Does there exist a fixed differentiable regularizer &lt;code&gt;$R(\theta)$&lt;/code&gt; such that running the same preconditioner without decoupled decay on &lt;code&gt;$\tilde{L}(\theta) = L(\theta) + R(\theta)$&lt;/code&gt; produces the exact same iterate? First, when &lt;code&gt;$P_t$&lt;/code&gt; evolves with historical gradients, no time-independent function &lt;code&gt;$R(\theta)$&lt;/code&gt; can match it at all; even if &lt;code&gt;$P_t = P$&lt;/code&gt; is held constant, equating the two updates requires:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\theta_{t-1} - \eta P^{-1}\bigl(\nabla L(\theta_{t-1}) + \nabla R(\theta_{t-1})\bigr) = (1 - w)\theta_{t-1} - \eta P^{-1} \nabla L(\theta_{t-1})$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Canceling common terms and left-multiplying by &lt;code&gt;$P$&lt;/code&gt; yields the exact condition:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\nabla R(\theta_{t-1}) = \frac{w}{\eta} P \theta_{t-1} \quad \Longleftrightarrow \quad R(\theta) = \frac{w}{2\eta} \theta^\top P \theta$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Two conclusions follow immediately:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Necessary and sufficient condition&lt;/strong&gt;: isotropic &lt;code&gt;$L_2$&lt;/code&gt; regularization &lt;code&gt;$R(\theta) = \frac{\lambda}{2}\|\theta\|_2^2$&lt;/code&gt; equals weight decay &lt;strong&gt;if and only if &lt;code&gt;$P_t = c I$&lt;/code&gt; is a scalar multiple of the identity&lt;/strong&gt; (&lt;code&gt;SGD&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Distortion of coupled &lt;code&gt;$L_2$&lt;/code&gt; inside &lt;code&gt;Adam&lt;/code&gt;&lt;/strong&gt;: in &lt;code&gt;Adam&lt;/code&gt;, &lt;code&gt;$P_t = \mathrm{diag}\!\left(\sqrt{\hat{v}_t} + \epsilon\right)$&lt;/code&gt; varies across coordinates. Mixing &lt;code&gt;$\lambda \theta_{t-1}$&lt;/code&gt; into &lt;code&gt;$g_t^{\mathrm{L2}} = g_t + \lambda \theta_{t-1}$&lt;/code&gt; both contaminates &lt;code&gt;$\hat{v}_t^{\mathrm{L2}}$&lt;/code&gt; and (taking &lt;code&gt;$\beta_1 = 0$&lt;/code&gt; to inspect a single step) produces:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\theta_{t, i} = \theta_{t-1, i} - \eta \frac{g_{t, i} + \lambda \theta_{t-1, i}}{\sqrt{\hat{v}_{t, i}^{\mathrm{L2}}} + \epsilon} = \left(1 - \frac{\eta \lambda}{\sqrt{\hat{v}_{t, i}^{\mathrm{L2}}} + \epsilon}\right)\theta_{t-1, i} - \eta \frac{g_{t, i}}{\sqrt{\hat{v}_{t, i}^{\mathrm{L2}}} + \epsilon}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Coordinate &lt;code&gt;$i$&lt;/code&gt;&#39;s effective shrinkage rate becomes &lt;code&gt;$\frac{\eta \lambda}{\sqrt{\hat{v}_{t, i}^{\mathrm{L2}}} + \epsilon}$&lt;/code&gt;, divided by its historical gradient RMS: active weights with large gradients (&lt;code&gt;$\sqrt{\hat{v}_{t,i}} \gg 1$&lt;/code&gt;) barely decay at all, whereas quiet weights (&lt;code&gt;$\sqrt{\hat{v}_{t,i}} \ll 1$&lt;/code&gt;) are aggressively crushed—the exact opposite of an isotropic Gaussian prior.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;AdamW&lt;/code&gt; fixes this by decoupling weight shrinkage from the adaptive gradient ratio:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\theta_t = (1 - \eta \lambda)\theta_{t-1} - \eta \frac{\hat{m}_t}{\sqrt{\hat{v}_t} + \epsilon}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;figure class=&#34;diagram&#34; style=&#34;--h:224px;--hn:339px&#34;&gt;&lt;figcaption&gt;Dataflow Comparison: Coupled &lt;code&gt;$L_2$&lt;/code&gt; Regularization vs. Decoupled Weight Decay (AdamW)&lt;/figcaption&gt;&lt;p&gt;&lt;a href=&#34;https://mizore.blog/en/posts/from-transformer-matrices-to-muon/&#34;&gt;(See the figure in the post.)&lt;/a&gt;&lt;/p&gt;&lt;p class=&#34;figure-note&#34;&gt;Under coupled &lt;code&gt;$L_2$&lt;/code&gt;, the penalty &lt;code&gt;$\lambda\theta_{t-1}$&lt;/code&gt; enters the gradient and gets divided by &lt;code&gt;$\sqrt{\hat{v}_t}$&lt;/code&gt;, distorting per-coordinate shrinkage; AdamW applies uniform multiplicative decay directly to the weights.&lt;/p&gt;&lt;/figure&gt;&#xA;&lt;p&gt;The numerical verification below illustrates both derivations: the left panel plots 26 steps of &lt;code&gt;SGD&lt;/code&gt;, &lt;code&gt;Momentum&lt;/code&gt;, and &lt;code&gt;AdamW&lt;/code&gt; on the &lt;code&gt;$\kappa = 36$&lt;/code&gt; canyon &lt;code&gt;$L(\theta_1, \theta_2) = 0.5\theta_1^2 + 18\theta_2^2$&lt;/code&gt;; the right panel runs &lt;code&gt;Adam+L2&lt;/code&gt; versus &lt;code&gt;AdamW&lt;/code&gt; on two redundant parameters initialized at &lt;code&gt;$2.5$&lt;/code&gt; under zero-mean alternating gradient noise of amplitude &lt;code&gt;$40$&lt;/code&gt; versus &lt;code&gt;$0.05$&lt;/code&gt;, showing &lt;code&gt;Adam+L2&lt;/code&gt;&#39;s noisy coordinate stalling at &lt;code&gt;$2.39$&lt;/code&gt; while both &lt;code&gt;AdamW&lt;/code&gt; trajectories overlap identically down to &lt;code&gt;$0.74$&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;figure class=&#34;plotfig&#34;&gt;&lt;figcaption&gt;Entrywise Optimizer Verification: Ill-Conditioned Trajectories and Coupled &lt;code&gt;$L_2$&lt;/code&gt; Decay Distortion&lt;/figcaption&gt;&lt;p&gt;&lt;a href=&#34;https://mizore.blog/en/posts/from-transformer-matrices-to-muon/&#34;&gt;(See the figure in the post.)&lt;/a&gt;&lt;/p&gt;&lt;p class=&#34;figure-note&#34;&gt;Left: 26 steps on &lt;code&gt;$L(\theta_1, \theta_2) = 0.5\theta_1^2 + 18\theta_2^2$&lt;/code&gt; (&lt;code&gt;$\kappa = 36$&lt;/code&gt;). Right: decay toward zero under zero-mean alternating noise (&lt;code&gt;$\theta_1$&lt;/code&gt; amp 40, &lt;code&gt;$\theta_2$&lt;/code&gt; amp 0.05, init &lt;code&gt;$2.5$&lt;/code&gt;, &lt;code&gt;$\eta=0.02, \lambda=0.4$&lt;/code&gt;).&lt;/p&gt;&lt;/figure&gt;&#xA;&lt;p&gt;One practical corollary: why is &lt;code&gt;weight_decay&lt;/code&gt; set to &lt;code&gt;0.0&lt;/code&gt; on 1D &lt;code&gt;RMSNorm&lt;/code&gt; gains &lt;code&gt;$\gamma$&lt;/code&gt; (and biases) in &lt;code&gt;AdamW&lt;/code&gt;? Initialized to &lt;code&gt;$1$&lt;/code&gt;, &lt;code&gt;$\gamma$&lt;/code&gt; rescales unit-RMS activations per channel and accounts for less than &lt;code&gt;$0.05\%$&lt;/code&gt; of model parameters; pulling &lt;code&gt;$\gamma$&lt;/code&gt; toward &lt;code&gt;$0$&lt;/code&gt; does not regularize high-rank capacity and merely dampens layer outputs.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;4-from-entrywise-norms-to-2d-operator-spectral-norms-deriving-muon&#34;&gt;4. From Entrywise Norms to 2D Operator Spectral Norms: Deriving &lt;code&gt;Muon&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;AdamW&lt;/code&gt; gives us the modern entrywise baseline. Now return to the structural facts from Sections 1 and 2: over &lt;code&gt;$95\%$&lt;/code&gt; of non-embedding parameters in a Transformer (&lt;code&gt;$W_q, W_k, W_v, W_o, W_{\mathrm{up}}, W_{\mathrm{down}}$&lt;/code&gt;) are 2D linear operators &lt;code&gt;$W \in \mathbb{R}^{d_{\mathrm{out}} \times d_{\mathrm{in}}}$&lt;/code&gt; whose gradients &lt;code&gt;$G = \sum_{n=1}^N \delta_n x_n^\top$&lt;/code&gt; have heavily skewed singular spectra. What geometry does &lt;code&gt;AdamW&lt;/code&gt; implicitly impose when handed such a 2D matrix?&lt;/p&gt;&#xA;&lt;h3 id=&#34;41-adamws-hidden-geometry-steepest-descent-under-the-entrywise-max-norm&#34;&gt;4.1 AdamW&#39;s Hidden Geometry: Steepest Descent Under the Entrywise Max Norm&lt;/h3&gt;&#xA;&lt;p&gt;To compare non-Euclidean norms cleanly, rewrite the proximal penalty of Section 3 in constrained &lt;strong&gt;normalized steepest descent&lt;/strong&gt; form. Let &lt;code&gt;$\langle A, B \rangle_F \triangleq \mathrm{tr}(A^\top B) = \sum_{i, j} A_{i, j} B_{i, j}$&lt;/code&gt; denote the Frobenius inner product, with Frobenius norm &lt;code&gt;$\|A\|_F = \sqrt{\langle A, A \rangle_F}$&lt;/code&gt;. Given any matrix norm &lt;code&gt;$\|\cdot\|$&lt;/code&gt; and step budget &lt;code&gt;$\eta &amp;gt; 0$&lt;/code&gt;, steepest descent on the &lt;code&gt;$\|\cdot\|$&lt;/code&gt;-ball solves:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\Delta W^* = \mathrm{arg}\min_{\|\Delta W\| \le \eta} \langle G, \Delta W \rangle_F$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;(By Lagrangian duality, the ball-constrained solution shares the exact direction of the quadratic penalty problem while fixing step length &lt;code&gt;$\|\Delta W^*\| = \eta$&lt;/code&gt;; under the Frobenius norm &lt;code&gt;$\|\Delta W\|_F \le \eta$&lt;/code&gt;, for instance, &lt;code&gt;$\Delta W^* = -\eta G / \|G\|_F$&lt;/code&gt;.)&lt;/p&gt;&#xA;&lt;p&gt;Now inspect &lt;code&gt;Adam&lt;/code&gt; in the memoryless limit (&lt;code&gt;$\beta_1 = 0, \beta_2 = 0, \epsilon \to 0$&lt;/code&gt;): each entry &lt;code&gt;$(i, j)$&lt;/code&gt; steps by &lt;code&gt;$-\eta \frac{G_{i, j}}{\sqrt{G_{i, j}^2}} = -\eta \,\mathrm{sign}(G_{i, j})$&lt;/code&gt; (&lt;code&gt;SignSGD&lt;/code&gt;). That is the exact steepest-descent step under the &lt;strong&gt;entrywise max norm&lt;/strong&gt; &lt;code&gt;$\|\Delta W\|_{\max} \triangleq \max_{i, j} |\Delta W_{i, j}|$&lt;/code&gt; (the &lt;code&gt;$\ell_\infty$&lt;/code&gt; norm of the flattened matrix):&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\min_{\|\Delta W\|_{\max} \le \eta} \langle G, \Delta W \rangle_F = \min_{\forall i, j:\; |\Delta W_{i, j}| \le \eta} \sum_{i=1}^{d_{\mathrm{out}}} \sum_{j=1}^{d_{\mathrm{in}}} G_{i, j} \Delta W_{i, j} \quad \Longrightarrow \quad \Delta W_{i, j}^* = -\eta \,\mathrm{sign}(G_{i, j})$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Geometrically, &lt;code&gt;AdamW&lt;/code&gt; is &lt;strong&gt;EMA-smoothed steepest descent under the entrywise &lt;code&gt;$\ell_\infty$&lt;/code&gt; norm&lt;/strong&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-bernstein2024-1&#34; href=&#34;#ref-bernstein2024&#34;&gt;[12]&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Treating a &lt;code&gt;$d_{\mathrm{out}} \times d_{\mathrm{in}}$&lt;/code&gt; linear map as &lt;code&gt;$d_{\mathrm{out}} \cdot d_{\mathrm{in}}$&lt;/code&gt; uncoupled scalar boxes has two fundamental limitations:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Basis dependence&lt;/strong&gt;: rotating the hidden representation by an orthogonal basis change &lt;code&gt;$h \mapsto Q h$&lt;/code&gt; (&lt;code&gt;$Q^\top Q = I$&lt;/code&gt;) leaves Euclidean/RMS geometry invariant, yet entrywise sign is not rotation-equivariant (&lt;code&gt;$\mathrm{sign}(Q G) \neq Q \,\mathrm{sign}(G)$&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Equalizing entries does not equalize singular subspaces&lt;/strong&gt;: if &lt;code&gt;$G = \sum_n \delta_n x_n^\top$&lt;/code&gt; is dominated by a rank-&lt;code&gt;$1$&lt;/code&gt; outer product &lt;code&gt;$u v^\top$&lt;/code&gt;, taking elementwise signs yields &lt;code&gt;$\mathrm{sign}(u v^\top) = \mathrm{sign}(u)\,\mathrm{sign}(v)^\top$&lt;/code&gt;—&lt;strong&gt;still a rank-&lt;code&gt;$1$&lt;/code&gt; matrix&lt;/strong&gt;! Dividing each cell by &lt;code&gt;$\sqrt{\hat{v}_{i, j}}$&lt;/code&gt; cannot amplify updates along the dozens of low-singular-value subspaces buried underneath dominant directions.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Substituting the exact &lt;code&gt;$2 \times 3$&lt;/code&gt; gradient matrix &lt;code&gt;$G = \begin{bsmallmatrix} -1.0 &amp;amp; -2.0 &amp;amp; -0.4 \\ 0.4 &amp;amp; 0.8 &amp;amp; 0.2 \end{bsmallmatrix}$&lt;/code&gt; hand-computed in Section 2.4 into step &lt;code&gt;$t = 1$&lt;/code&gt; of bias-corrected &lt;code&gt;Adam&lt;/code&gt; (&lt;code&gt;$\hat{M}_1 = G$&lt;/code&gt;, &lt;code&gt;$\hat{V}_1 = G \odot G = \begin{bsmallmatrix} 1.00 &amp;amp; 4.00 &amp;amp; 0.16 \\ 0.16 &amp;amp; 0.64 &amp;amp; 0.04 \end{bsmallmatrix}$&lt;/code&gt;, neglecting tiny &lt;code&gt;$\epsilon$&lt;/code&gt;) makes this blind spot concrete:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$U_{\mathrm{Adam}, 1} = \frac{\hat{M}_1}{\sqrt{\hat{V}_1}} = \begin{bmatrix} -1.0 / 1.0 &amp;amp; -2.0 / 2.0 &amp;amp; -0.4 / 0.4 \\ 0.4 / 0.4 &amp;amp; 0.8 / 0.8 &amp;amp; 0.2 / 0.2 \end{bmatrix} = \begin{bmatrix} -1 &amp;amp; -1 &amp;amp; -1 \\ +1 &amp;amp; +1 &amp;amp; +1 \end{bmatrix}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;All six cells now have unit magnitude, yet because row 2 has become the exact negative of row 1, the update has collapsed into a &lt;strong&gt;rank-1 matrix&lt;/strong&gt; (&lt;code&gt;$\sigma_1 \approx 2.45,\; \sigma_2 = \mathbf{0.00}$&lt;/code&gt;)—completely erasing the subtle column-3 feature signal (&lt;code&gt;$\sigma_2 \approx 0.037$&lt;/code&gt;) that distinguished token 2 from token 1. By contrast, the semi-orthogonal polar factor &lt;code&gt;$U V^\top$&lt;/code&gt; derived next maps the very same &lt;code&gt;$G$&lt;/code&gt; to the full-rank matrix &lt;code&gt;$\begin{bsmallmatrix} -0.438 &amp;amp; -0.877 &amp;amp; +0.199 \\ +0.089 &amp;amp; +0.178 &amp;amp; \mathbf{+0.980} \end{bsmallmatrix}$&lt;/code&gt; (orthogonal rows, &lt;code&gt;$\sigma_1 = \sigma_2 = 1$&lt;/code&gt;), automatically steering &lt;code&gt;$98\%$&lt;/code&gt; of neuron 2&#39;s step along the novel 3rd feature.&lt;/p&gt;&#xA;&lt;h3 id=&#34;42-algebraic-simplification-from-shampoo-to-its-stateless-limit&#34;&gt;4.2 Algebraic Simplification from &lt;code&gt;Shampoo&lt;/code&gt; to Its Stateless Limit&lt;/h3&gt;&#xA;&lt;p&gt;How can we precondition a matrix gradient without losing row-column coupling? Flattening &lt;code&gt;$W \in \mathbb{R}^{A \times B}$&lt;/code&gt; into full-matrix &lt;code&gt;AdaGrad&lt;/code&gt; would require an &lt;code&gt;$(AB) \times (AB)$&lt;/code&gt; covariance matrix—&lt;code&gt;$2.8 \times 10^{14}$&lt;/code&gt; floats for a single &lt;code&gt;$4096 \times 4096$&lt;/code&gt; layer, completely intractable.&lt;/p&gt;&#xA;&lt;p&gt;In 2018, Gupta, Koren, and Singer proposed &lt;strong&gt;Shampoo&lt;/strong&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-gupta2018-1&#34; href=&#34;#ref-gupta2018&#34;&gt;[11]&lt;/a&gt;&lt;/sup&gt;, factoring the preconditioner via a Kronecker product into a left row-covariance accumulator &lt;code&gt;$L_t = \sum_{s=1}^t G_s G_s^\top \in \mathbb{R}^{A \times A}$&lt;/code&gt; and a right column-covariance accumulator &lt;code&gt;$R_t = \sum_{s=1}^t G_s^\top G_s \in \mathbb{R}^{B \times B}$&lt;/code&gt;, stepping along &lt;code&gt;$L_t^{-1/4} G_t R_t^{-1/4}$&lt;/code&gt;. Why the &lt;code&gt;$-1/4$&lt;/code&gt; exponent rather than &lt;code&gt;AdaGrad&lt;/code&gt;&#39;s &lt;code&gt;$-1/2$&lt;/code&gt;? Because both &lt;code&gt;$L_t$&lt;/code&gt; and &lt;code&gt;$R_t$&lt;/code&gt; are quadratic in &lt;code&gt;$G$&lt;/code&gt; (units &lt;code&gt;$G^2$&lt;/code&gt;), multiplying on the left by &lt;code&gt;$L_t^{-1/4}$&lt;/code&gt; (&lt;code&gt;$G^{-1/2}$&lt;/code&gt;) and on the right by &lt;code&gt;$R_t^{-1/4}$&lt;/code&gt; (&lt;code&gt;$G^{-1/2}$&lt;/code&gt;) together cancel one power of &lt;code&gt;$G$&lt;/code&gt;, matching &lt;code&gt;AdaGrad&lt;/code&gt;&#39;s zero-order scaling &lt;code&gt;$(G^2)^{-1/2} G$&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Subsequent experiments revealed a striking empirical fact: turning off cross-step accumulation in &lt;code&gt;Shampoo&lt;/code&gt; and evaluating the instantaneous stateless form &lt;code&gt;$((G G^\top)^+)^{1/4} G ((G^\top G)^+)^{1/4}$&lt;/code&gt; (where &lt;code&gt;$(\cdot)^+$&lt;/code&gt; is the Moore-Penrose pseudoinverse) on the current momentum matrix not only avoids degradation, but often converges faster&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-bernstein2024-2&#34; href=&#34;#ref-bernstein2024&#34;&gt;[12]&lt;/a&gt;&lt;/sup&gt;. Let us simplify that expression algebraically.&lt;/p&gt;&#xA;&lt;p&gt;Let &lt;code&gt;$G \in \mathbb{R}^{A \times B}$&lt;/code&gt; have rank &lt;code&gt;$r \le \min(A, B)$&lt;/code&gt; with &lt;strong&gt;reduced singular value decomposition (SVD)&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$G = U \Sigma V^\top$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;where &lt;code&gt;$U \in \mathbb{R}^{A \times r}$&lt;/code&gt; has orthonormal columns (&lt;code&gt;$U^\top U = I_r$&lt;/code&gt;), &lt;code&gt;$\Sigma = \mathrm{diag}(\sigma_1, \dots, \sigma_r) \in \mathbb{R}^{r \times r}$&lt;/code&gt; has positive singular values &lt;code&gt;$\sigma_1 \ge \dots \ge \sigma_r &amp;gt; 0$&lt;/code&gt;, and &lt;code&gt;$V \in \mathbb{R}^{B \times r}$&lt;/code&gt; has orthonormal columns (&lt;code&gt;$V^\top V = I_r$&lt;/code&gt;). (Note also the Frobenius identity &lt;code&gt;$\|G\|_F^2 = \mathrm{tr}(G^\top G) = \mathrm{tr}(\Sigma^2 V^\top V) = \sum_{i=1}^r \sigma_i^2$&lt;/code&gt;.) Forming the left and right Gram matrices gives:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$G G^\top = (U \Sigma V^\top)(V \Sigma U^\top) = U \Sigma^2 U^\top, \qquad G^\top G = (V \Sigma U^\top)(U \Sigma V^\top) = V \Sigma^2 V^\top$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Taking the &lt;code&gt;$1/4$&lt;/code&gt; power of the pseudoinverse on the active range space raises each positive diagonal entry of &lt;code&gt;$\Sigma^2$&lt;/code&gt; to &lt;code&gt;$-1/4$&lt;/code&gt;, i.e., &lt;code&gt;$\Sigma^{-1/2}$&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$((G G^\top)^+)^{1/4} = U \Sigma^{-1/2} U^\top, \qquad ((G^\top G)^+)^{1/4} = V \Sigma^{-1/2} V^\top$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Multiplying all three factors and applying &lt;code&gt;$U^\top U = I_r$&lt;/code&gt;, &lt;code&gt;$V^\top V = I_r$&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$((G G^\top)^+)^{1/4} G ((G^\top G)^+)^{1/4} = \bigl(U \Sigma^{-1/2} U^\top\bigr)(U \Sigma V^\top)\bigl(V \Sigma^{-1/2} V^\top\bigr) = U \Sigma^{-1/2} \Sigma \Sigma^{-1/2} V^\top = U I_r V^\top = U V^\top$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Every nonzero singular value &lt;code&gt;$\sigma_1, \dots, \sigma_r$&lt;/code&gt;—no matter how many orders of magnitude apart—cancels out identically to &lt;code&gt;$1$&lt;/code&gt;. When &lt;code&gt;$G$&lt;/code&gt; has full rank &lt;code&gt;$r = \min(A, B)$&lt;/code&gt; (which holds almost surely under stochastic gradients), &lt;code&gt;$U V^\top \in \mathbb{R}^{A \times B}$&lt;/code&gt; is the nearest &lt;strong&gt;semi-orthogonal matrix&lt;/strong&gt; to &lt;code&gt;$G$&lt;/code&gt; (&lt;code&gt;$(U V^\top)^\top (U V^\top) = I_B$&lt;/code&gt; if &lt;code&gt;$A \ge B$&lt;/code&gt;, or &lt;code&gt;$(U V^\top)(U V^\top)^\top = I_A$&lt;/code&gt; if &lt;code&gt;$A \le B$&lt;/code&gt;; if &lt;code&gt;$r &amp;lt; \min(A, B)$&lt;/code&gt;, it is a rank-&lt;code&gt;$r$&lt;/code&gt; partial isometry).&lt;/p&gt;&#xA;&lt;h3 id=&#34;43-first-principles-derivation-steepest-descent-under-the-induced-mathrmrms-to-mathrmrms-operator-norm&#34;&gt;4.3 First-Principles Derivation: Steepest Descent Under the Induced &lt;code&gt;$\mathrm{RMS} \to \mathrm{RMS}$&lt;/code&gt; Operator Norm&lt;/h3&gt;&#xA;&lt;p&gt;In &lt;em&gt;Old Optimizer, New Norm&lt;/em&gt; (2024), Bernstein and Newhouse proved that &lt;code&gt;$U V^\top$&lt;/code&gt; needs no second-order curvature approximation to justify it: it is the &lt;strong&gt;exact first-order steepest-descent step under the natural induced operator norm of hidden linear layers&lt;/strong&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-bernstein2024-3&#34; href=&#34;#ref-bernstein2024&#34;&gt;[12]&lt;/a&gt;&lt;/sup&gt;. Here is the complete proof.&lt;/p&gt;&#xA;&lt;p&gt;Consider a hidden linear map &lt;code&gt;$y = W x$&lt;/code&gt; taking &lt;code&gt;$x \in \mathbb{R}^{d_{\mathrm{in}}}$&lt;/code&gt; to &lt;code&gt;$y \in \mathbb{R}^{d_{\mathrm{out}}}$&lt;/code&gt;. Recall from Section 2.1 that &lt;code&gt;RMSNorm&lt;/code&gt; normalizes hidden token vectors in &lt;strong&gt;root-mean-square norm&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\|x\|_{\mathrm{RMS}} \triangleq \frac{1}{\sqrt{d_{\mathrm{in}}}} \|x\|_2, \qquad \|y\|_{\mathrm{RMS}} \triangleq \frac{1}{\sqrt{d_{\mathrm{out}}}} \|y\|_2$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Perturbing &lt;code&gt;$W \to W + \Delta W$&lt;/code&gt; shifts the layer&#39;s output on input &lt;code&gt;$x$&lt;/code&gt; by &lt;code&gt;$\Delta y = \Delta W x$&lt;/code&gt;. To keep the maximum output RMS perturbation bounded across arbitrary layer widths &lt;code&gt;$d_{\mathrm{in}}, d_{\mathrm{out}}$&lt;/code&gt;, the physically meaningful ruler on &lt;code&gt;$\Delta W$&lt;/code&gt; is the worst-case output RMS change per unit input RMS—the &lt;strong&gt;induced &lt;code&gt;$\mathrm{RMS} \to \mathrm{RMS}$&lt;/code&gt; operator norm&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\|\Delta W\|_{\mathrm{RMS} \to \mathrm{RMS}} \triangleq \max_{x \neq 0} \frac{\|\Delta W x\|_{\mathrm{RMS}}}{\|x\|_{\mathrm{RMS}}} = \max_{x \neq 0} \frac{\frac{1}{\sqrt{d_{\mathrm{out}}}}\|\Delta W x\|_2}{\frac{1}{\sqrt{d_{\mathrm{in}}}}\|x\|_2} = \sqrt{\frac{d_{\mathrm{in}}}{d_{\mathrm{out}}}} \max_{\|x\|_2 = 1} \|\Delta W x\|_2 = \sqrt{\frac{d_{\mathrm{in}}}{d_{\mathrm{out}}}}\, \sigma_1(\Delta W)$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;where &lt;code&gt;$\sigma_1(\Delta W) = \|\Delta W\|_2$&lt;/code&gt; is the largest singular value (spectral norm) of &lt;code&gt;$\Delta W$&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Given the current lookahead momentum matrix &lt;code&gt;$\tilde{M} \in \mathbb{R}^{d_{\mathrm{out}} \times d_{\mathrm{in}}}$&lt;/code&gt; with reduced SVD &lt;code&gt;$\tilde{M} = U \Sigma V^\top = \sum_{i=1}^r \sigma_i u_i v_i^\top$&lt;/code&gt; (&lt;code&gt;$\sigma_i &amp;gt; 0$&lt;/code&gt;), steepest descent inside this induced operator-norm ball solves:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\min_{\|\Delta W\|_{\mathrm{RMS} \to \mathrm{RMS}} \le \eta} \langle \tilde{M}, \Delta W \rangle_F \quad \Longleftrightarrow \quad \min_{\sigma_1(\Delta W) \le \eta \sqrt{d_{\mathrm{out}} / d_{\mathrm{in}}}} \mathrm{tr}(\tilde{M}^\top \Delta W)$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;By cyclic invariance of the trace:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\langle \tilde{M}, \Delta W \rangle_F = \mathrm{tr}\!\left(\sum_{i=1}^{r} \sigma_i v_i u_i^\top \Delta W\right) = \sum_{i=1}^{r} \sigma_i \, u_i^\top \Delta W v_i$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Since &lt;code&gt;$\|u_i\|_2 = \|v_i\|_2 = 1$&lt;/code&gt;, Cauchy-Schwarz and the definition of &lt;code&gt;$\sigma_1(\Delta W)$&lt;/code&gt; bound every term &lt;code&gt;$i \in \{1, \dots, r\}$&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$|u_i^\top \Delta W v_i| \le \|u_i\|_2 \, \|\Delta W v_i\|_2 \le \sigma_1(\Delta W) \le \eta \sqrt{\frac{d_{\mathrm{out}}}{d_{\mathrm{in}}}}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Because &lt;code&gt;$\sigma_i &amp;gt; 0$&lt;/code&gt;, summing over &lt;code&gt;$i$&lt;/code&gt; yields a tight lower bound on the objective:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\langle \tilde{M}, \Delta W \rangle_F = \sum_{i=1}^{r} \sigma_i \, u_i^\top \Delta W v_i \ge -\eta \sqrt{\frac{d_{\mathrm{out}}}{d_{\mathrm{in}}}} \sum_{i=1}^{r} \sigma_i$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;When is equality achieved? If and only if &lt;code&gt;$u_i^\top \Delta W v_i = -\eta \sqrt{d_{\mathrm{out}} / d_{\mathrm{in}}}$&lt;/code&gt; holds &lt;strong&gt;simultaneously for every active singular direction &lt;code&gt;$i = 1, \dots, r$&lt;/code&gt;&lt;/strong&gt;. Substituting the semi-orthogonal candidate&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\Delta W^* = -\eta \sqrt{\frac{d_{\mathrm{out}}}{d_{\mathrm{in}}}} \, U V^\top$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;verifies feasibility (&lt;code&gt;$\sigma_1(\Delta W^*) = \eta \sqrt{d_{\mathrm{out}} / d_{\mathrm{in}}}$&lt;/code&gt;) and attains the lower bound identically: &lt;code&gt;$u_i^\top \Delta W^* v_i = -\eta \sqrt{d_{\mathrm{out}} / d_{\mathrm{in}}} \, u_i^\top \left(\sum_{k=1}^r u_k v_k^\top\right) v_i = -\eta \sqrt{d_{\mathrm{out}} / d_{\mathrm{in}}}$&lt;/code&gt; (unique whenever &lt;code&gt;$r = \min(d_{\mathrm{out}}, d_{\mathrm{in}})$&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;p&gt;That is the geometric core of &lt;strong&gt;Muon&lt;/strong&gt;: a Frobenius ball steps proportionally to raw skewed singular values, an entrywise &lt;code&gt;$\ell_\infty$&lt;/code&gt; cube equalizes isolated matrix cells, whereas the &lt;code&gt;$\mathrm{RMS} \to \mathrm{RMS}$&lt;/code&gt; operator ball &lt;strong&gt;advances all &lt;code&gt;$r$&lt;/code&gt; orthogonal feature subspaces at the exact same speed&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;figure class=&#34;diagram&#34; style=&#34;--h:228px;--hn:469px&#34;&gt;&lt;figcaption&gt;Geometric Comparison of Steepest Descent Under Three Matrix Norm Balls&lt;/figcaption&gt;&lt;p&gt;&lt;a href=&#34;https://mizore.blog/en/posts/from-transformer-matrices-to-muon/&#34;&gt;(See the figure in the post.)&lt;/a&gt;&lt;/p&gt;&lt;p class=&#34;figure-note&#34;&gt;Under the Frobenius ball, updates concentrate along the top singular direction; under the entrywise &lt;code&gt;$\ell_\infty$&lt;/code&gt; cube, cell magnitudes equalize without fixing low-rank skew; under the operator spectral norm, all nonzero singular values map to &lt;code&gt;$1$&lt;/code&gt;.&lt;/p&gt;&lt;/figure&gt;&#xA;&lt;h3 id=&#34;44-deriving-the-dual-optimizer-parameter-routing-rule-from-induced-norms&#34;&gt;4.4 Deriving the Dual-Optimizer Parameter Routing Rule from Induced Norms&lt;/h3&gt;&#xA;&lt;p&gt;Every production &lt;code&gt;Muon&lt;/code&gt; recipe follows a strict parameter split: internal 2D hidden projections (&lt;code&gt;W_q, W_k, W_v, W_o, W_up, W_down&lt;/code&gt;) go to &lt;code&gt;Muon&lt;/code&gt;, while boundary embeddings (&lt;code&gt;tok_emb, pos_emb&lt;/code&gt;), the output &lt;code&gt;lm_head&lt;/code&gt;, and 1D &lt;code&gt;RMSNorm&lt;/code&gt; gains stay on &lt;code&gt;AdamW&lt;/code&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-jordan2024-2&#34; href=&#34;#ref-jordan2024&#34;&gt;[4]&lt;/a&gt;&lt;/sup&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-liu2025-2&#34; href=&#34;#ref-liu2025&#34;&gt;[5]&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Why shouldn&#39;t &lt;code&gt;$E_{\mathrm{tok}}$&lt;/code&gt; and &lt;code&gt;$W_{\mathrm{head}}$&lt;/code&gt;—which are also 2D matrices—be globally orthogonalized? Checking the &lt;strong&gt;induced norms of their own input and output spaces&lt;/strong&gt; gives the answer directly&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-bernstein2024-4&#34; href=&#34;#ref-bernstein2024&#34;&gt;[12]&lt;/a&gt;&lt;/sup&gt;:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Token embedding table &lt;code&gt;$E_{\mathrm{tok}} \in \mathbb{R}^{V \times D}$&lt;/code&gt; (&lt;code&gt;$\ell_1 \to \mathrm{RMS}$&lt;/code&gt;)&lt;/strong&gt;: as shown in Section 1.1, the input is a one-hot vector &lt;code&gt;$u \in \mathbb{R}^V$&lt;/code&gt; naturally measured in &lt;code&gt;$\ell_1$&lt;/code&gt; norm &lt;code&gt;$\|u\|_1 = 1$&lt;/code&gt;, while the output enters the residual stream measured in &lt;code&gt;$\|\cdot\|_{\mathrm{RMS}}$&lt;/code&gt;. Because a convex function over the &lt;code&gt;$\ell_1$&lt;/code&gt; polytope attains its maximum at one of the &lt;code&gt;$V$&lt;/code&gt; extreme vertices &lt;code&gt;$u = e_v$&lt;/code&gt;:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\|\Delta E_{\mathrm{tok}}^\top\|_{\ell_1 \to \mathrm{RMS}} = \max_{\|u\|_1 = 1} \|\Delta E_{\mathrm{tok}}^\top u\|_{\mathrm{RMS}} = \max_{v \in \{0, \dots, V-1\}} \|\Delta E_{\mathrm{tok}}[v, :]\|_{\mathrm{RMS}}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;This norm takes an independent maximum over vocabulary rows—&lt;strong&gt;vocabulary rows are geometrically decoupled&lt;/strong&gt; (the exact &lt;code&gt;$\ell_1 \to \mathrm{RMS}$&lt;/code&gt; steepest step normalizes each active row independently rather than orthogonalizing across tokens). Furthermore, a mini-batch activates at most &lt;code&gt;$B \times T$&lt;/code&gt; rows while most rows are zero; global orthogonalization would mix frequent and rare token subspaces.&#xA;2. &lt;strong&gt;Output LM head &lt;code&gt;$W_{\mathrm{head}} \in \mathbb{R}^{V \times D}$&lt;/code&gt; (&lt;code&gt;$\mathrm{RMS} \to \ell_\infty$&lt;/code&gt;)&lt;/strong&gt;: taking a unit-RMS hidden vector &lt;code&gt;$h \in \mathbb{R}^D$&lt;/code&gt; to logits &lt;code&gt;$z = W_{\mathrm{head}} h \in \mathbb{R}^V$&lt;/code&gt;, Softmax shifts are controlled by &lt;code&gt;$\max_v |z_v| = \|z\|_\infty$&lt;/code&gt;. Its induced norm &lt;code&gt;$\|\Delta W_{\mathrm{head}}\|_{\mathrm{RMS} \to \ell_\infty} = \max_v \sqrt{D}\,\|\Delta W_{\mathrm{head}}[v, :]\|_2$&lt;/code&gt; again decouples row by row across the vocabulary. Routing &lt;code&gt;tok_emb&lt;/code&gt; and &lt;code&gt;lm_head&lt;/code&gt; to &lt;code&gt;AdamW&lt;/code&gt; respects row-wise decoupling while adapting per-token logit scales&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-jordan2024-3&#34; href=&#34;#ref-jordan2024&#34;&gt;[4]&lt;/a&gt;&lt;/sup&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-liu2025-3&#34; href=&#34;#ref-liu2025&#34;&gt;[5]&lt;/a&gt;&lt;/sup&gt;.&#xA;3. &lt;strong&gt;1D &lt;code&gt;RMSNorm&lt;/code&gt; vector &lt;code&gt;$\gamma \in \mathbb{R}^D$&lt;/code&gt;&lt;/strong&gt;: viewed as a &lt;code&gt;$D \times 1$&lt;/code&gt; matrix, its rank is at most &lt;code&gt;$\min(D, 1) = 1$&lt;/code&gt; with a single singular value &lt;code&gt;$\sigma_1 = \|\gamma\|_2$&lt;/code&gt;, so no inter-direction skew exists; orthogonalizing it would collapse per-channel gains into a unit vector.&lt;/p&gt;&#xA;&lt;figure class=&#34;diagram&#34; style=&#34;--h:218px;--hn:374px&#34;&gt;&lt;figcaption&gt;Dual-Optimizer Parameter Routing Dictated by Input-Output Space Norms&lt;/figcaption&gt;&lt;p&gt;&lt;a href=&#34;https://mizore.blog/en/posts/from-transformer-matrices-to-muon/&#34;&gt;(See the figure in the post.)&lt;/a&gt;&lt;/p&gt;&lt;p class=&#34;figure-note&#34;&gt;Only 2D linear operators mapping continuous hidden RMS spaces to RMS spaces (&lt;code&gt;$\mathrm{RMS} \to \mathrm{RMS}$&lt;/code&gt;) call for spectral orthogonalization; row-decoupled vocabulary boundaries and 1D gains belong to AdamW.&lt;/p&gt;&lt;/figure&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;5-odd-degree-newton-schulz-iteration-and-scalable-rms-alignment&#34;&gt;5. Odd-Degree Newton-Schulz Iteration and Scalable RMS Alignment&lt;/h2&gt;&#xA;&lt;p&gt;Theory asks for &lt;code&gt;$O_t = U V^\top$&lt;/code&gt;, yet calling exact &lt;code&gt;torch.linalg.svd&lt;/code&gt; on hundreds of &lt;code&gt;$4096 \times 4096$&lt;/code&gt; matrices every training step would stall GPU pipelines: exact SVD relies on sequential bidiagonalization and &lt;code&gt;float32&lt;/code&gt; Givens sweeps that cannot run on half-precision Tensor Cores.&lt;/p&gt;&#xA;&lt;p&gt;In October 2024, Keller Jordan, Bernstein, and collaborators introduced &lt;strong&gt;Muon (MomentUm Orthogonalized by Newton-Schulz)&lt;/strong&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-jordan2024-4&#34; href=&#34;#ref-jordan2024&#34;&gt;[4]&lt;/a&gt;&lt;/sup&gt;, replacing exact SVD with &lt;strong&gt;five &lt;code&gt;bfloat16&lt;/code&gt; odd-degree matrix polynomial steps&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;51-why-odd-matrix-polynomials-preserve-left-and-right-singular-vectors&#34;&gt;5.1 Why Odd Matrix Polynomials Preserve Left and Right Singular Vectors&lt;/h3&gt;&#xA;&lt;p&gt;Let &lt;code&gt;$X \in \mathbb{R}^{A \times B}$&lt;/code&gt; have reduced SVD &lt;code&gt;$X = U \Sigma V^\top$&lt;/code&gt;. Inspect alternating odd products of &lt;code&gt;$X$&lt;/code&gt; and &lt;code&gt;$X^\top$&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\begin{aligned} (X X^\top) X &amp;amp;= (U \Sigma V^\top)(V \Sigma U^\top)(U \Sigma V^\top) = U \Sigma (V^\top V) \Sigma (U^\top U) \Sigma V^\top = U \Sigma^3 V^\top \\ (X X^\top)^2 X &amp;amp;= (U \Sigma^2 U^\top)^2 (U \Sigma V^\top) = U \Sigma^5 V^\top \end{aligned}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;(Even powers such as &lt;code&gt;$X X^\top = U \Sigma^2 U^\top$&lt;/code&gt; annihilate &lt;code&gt;$V^\top$&lt;/code&gt; and change shape to &lt;code&gt;$A \times A$&lt;/code&gt;; only odd products &lt;code&gt;$(X X^\top)^m X$&lt;/code&gt; preserve the bilateral basis &lt;code&gt;$U \cdot (\dots) \cdot V^\top$&lt;/code&gt;.)&lt;/p&gt;&#xA;&lt;p&gt;By linearity, for any odd quintic &lt;code&gt;$\varphi(\sigma) = a \sigma + b \sigma^3 + c \sigma^5$&lt;/code&gt;, setting &lt;code&gt;$A_k = X_k X_k^\top$&lt;/code&gt; and iterating pure matrix multiplications&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$X_{k+1} = a X_k + (b A_k + c A_k^2) X_k$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;holds &lt;code&gt;$U$&lt;/code&gt; and &lt;code&gt;$V^\top$&lt;/code&gt; fixed while applying the scalar map &lt;code&gt;$\varphi$&lt;/code&gt; independently to every singular value on the diagonal:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$X_{k+1} = U \varphi(\Sigma_k) V^\top, \qquad \sigma_{k+1, i} = \varphi(\sigma_{k, i}) = a \sigma_{k, i} + b \sigma_{k, i}^3 + c \sigma_{k, i}^5$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Two preprocessing steps precede &lt;code&gt;$k = 0$&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Frobenius pre-normalization into &lt;code&gt;$[0, 1]$&lt;/code&gt;&lt;/strong&gt;: because &lt;code&gt;$c \sigma^5$&lt;/code&gt; diverges rapidly for large &lt;code&gt;$\sigma$&lt;/code&gt;, all initial singular values must lie in &lt;code&gt;$[0, 1]$&lt;/code&gt;. Using &lt;code&gt;$\|\tilde{M}_t\|_F^2 = \sum_{j=1}^r \sigma_j^2 \ge \sigma_1^2$&lt;/code&gt;, setting&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;code&gt;$$X_0 = \frac{\tilde{M}_t}{\|\tilde{M}_t\|_F + \epsilon}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;guarantees &lt;code&gt;$0 \le \sigma_{0, i} \le 1$&lt;/code&gt; without estimating &lt;code&gt;$\sigma_1$&lt;/code&gt;. Notice also that any positive constant &lt;code&gt;$c &amp;gt; 0$&lt;/code&gt; cancels out identically in &lt;code&gt;$\frac{c \tilde{M}_t}{\|c \tilde{M}_t\|_F}$&lt;/code&gt;, which is why &lt;code&gt;Muon&lt;/code&gt;&#39;s momentum &lt;code&gt;$M_t = \mu M_{t-1} + G_t$&lt;/code&gt; needs neither a &lt;code&gt;$(1-\mu)$&lt;/code&gt; factor nor &lt;code&gt;Adam&lt;/code&gt;-style cold-start bias correction.&#xA;2. &lt;strong&gt;Tall-matrix transpose trick (&lt;code&gt;$A &amp;gt; B$&lt;/code&gt;)&lt;/strong&gt;: when rows exceed columns (e.g., &lt;code&gt;$W_{\mathrm{up}} \in \mathbb{R}^{256 \times 64}$&lt;/code&gt; with &lt;code&gt;$A = 4B$&lt;/code&gt;), forming &lt;code&gt;$A_k = X_k X_k^\top$&lt;/code&gt; builds a large &lt;code&gt;$A \times A$&lt;/code&gt; Gram matrix costing &lt;code&gt;$(2A^2 B + A^3)$&lt;/code&gt; MACs per step; transposing &lt;code&gt;$X_0$&lt;/code&gt; first into a &lt;code&gt;$B \times A$&lt;/code&gt; wide matrix shrinks &lt;code&gt;$A_k$&lt;/code&gt; to &lt;code&gt;$B \times B$&lt;/code&gt;, cutting per-step MACs to &lt;code&gt;$(2AB^2 + B^3)$&lt;/code&gt;—from &lt;code&gt;$96 B^3$&lt;/code&gt; down to &lt;code&gt;$9 B^3$&lt;/code&gt; at &lt;code&gt;$A = 4B$&lt;/code&gt; (&amp;gt;90% compute saved). Since &lt;code&gt;$\bigl(a X^\top + b (X^\top X) X^\top + c (X^\top X)^2 X^\top\bigr)^\top = a X + b (X X^\top) X + c (X X^\top)^2 X$&lt;/code&gt;, transposing back at the end is bit-exact.&lt;/p&gt;&#xA;&lt;h3 id=&#34;52-classical-newton-schulz-vs-muons-minimax-coefficients&#34;&gt;5.2 Classical Newton-Schulz vs. &lt;code&gt;Muon&lt;/code&gt;&#39;s Minimax Coefficients&lt;/h3&gt;&#xA;&lt;p&gt;How are &lt;code&gt;$(a, b, c)$&lt;/code&gt; chosen? Start with &lt;strong&gt;classical Newton-Schulz&lt;/strong&gt; from numerical linear algebra.&lt;/p&gt;&#xA;&lt;p&gt;Applying Newton&#39;s method directly to &lt;code&gt;$g(s) = s^2 - 1 = 0$&lt;/code&gt; gives &lt;code&gt;$s_{k+1} = \frac{1}{2}(s_k + s_k^{-1})$&lt;/code&gt;, which still requires matrix inversion &lt;code&gt;$X_k^{-1}$&lt;/code&gt;. Applying Newton&#39;s tangent update instead to &lt;code&gt;$f(s) = s^{-2} - 1 = 0$&lt;/code&gt; puts &lt;code&gt;$f&amp;#39;(s) = -2s^{-3}$&lt;/code&gt; in the denominator, flipping negative exponents into pure odd positive powers:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$s_{k+1} = s_k - \frac{f(s_k)}{f&amp;#39;(s_k)} = s_k - \frac{s_k^{-2} - 1}{-2 s_k^{-3}} = \frac{3}{2}s_k - \frac{1}{2}s_k^3$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;That is the classical cubic &lt;code&gt;$(a, b) = (1.5, -0.5)$&lt;/code&gt;. Extending to a quintic &lt;code&gt;$\varphi_{\mathrm{classic}}(\sigma) = a\sigma + b\sigma^3 + c\sigma^5$&lt;/code&gt; with third-order local convergence at the fixed point &lt;code&gt;$\sigma = 1$&lt;/code&gt; (&lt;code&gt;$\varphi(1) = 1,\; \varphi&amp;#39;(1) = 0,\; \varphi&amp;#39;&amp;#39;(1) = 0$&lt;/code&gt;) solves the linear system:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\begin{cases} a + b + c = 1 \\ a + 3b + 5c = 0 \\ 6b + 20c = 0 \end{cases} \quad \Longrightarrow \quad (a, b, c)_{\mathrm{classic}} = \left(\frac{15}{8},\; -\frac{10}{8},\; \frac{3}{8}\right) = (1.875,\; -1.25,\; 0.375)$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;In neural network training, however, dividing a &lt;code&gt;$4096 \times 4096$&lt;/code&gt; skewed gradient by &lt;code&gt;$\|\tilde{M}_t\|_F$&lt;/code&gt; pushes many tail singular values down into &lt;code&gt;$\sigma_0 \in [10^{-3}, 10^{-2}]$&lt;/code&gt;. Near &lt;code&gt;$\sigma = 0$&lt;/code&gt;, &lt;code&gt;$\sigma^3$&lt;/code&gt; and &lt;code&gt;$\sigma^5$&lt;/code&gt; are negligible, so per-step amplification equals the origin slope &lt;code&gt;$\varphi&amp;#39;(0) = a$&lt;/code&gt;. Five steps of &lt;code&gt;$a = 1.875$&lt;/code&gt; amplify small singular values by at most &lt;code&gt;$1.875^5 \approx 23.2\times$&lt;/code&gt;—lifting &lt;code&gt;$\sigma_0 = 0.01$&lt;/code&gt; only to &lt;code&gt;$0.21$&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Jordan et al. observed that under noisy &lt;code&gt;bfloat16&lt;/code&gt; gradients (7 mantissa bits), converging to &lt;code&gt;$1.000000$&lt;/code&gt; is pointless; what matters is &lt;strong&gt;maximizing the origin slope &lt;code&gt;$a$&lt;/code&gt; within a fixed 5-step budget without diverging on &lt;code&gt;$[0, 1]$&lt;/code&gt;&lt;/strong&gt;. Relaxing &lt;code&gt;$\varphi(1) = 1$&lt;/code&gt; so &lt;code&gt;$\varphi^{(5)}(\sigma)$&lt;/code&gt; equiripples inside a narrow band &lt;code&gt;$[1 - \delta, 1 + \delta]$&lt;/code&gt; around &lt;code&gt;$1$&lt;/code&gt; yields &lt;code&gt;Muon&lt;/code&gt;&#39;s minimax-tuned coefficients&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-jordan2024-5&#34; href=&#34;#ref-jordan2024&#34;&gt;[4]&lt;/a&gt;&lt;/sup&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$(a, b, c)_{\mathrm{Muon}} = (3.4445,\; -4.7750,\; 2.0315)$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Checking two numbers confirms the tradeoff:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Small-singular-value amplification&lt;/strong&gt;: raising the origin slope from &lt;code&gt;$1.875$&lt;/code&gt; to &lt;code&gt;$3.4445$&lt;/code&gt; boosts 5-step linear gain to &lt;code&gt;$3.4445^5 \approx 484.4\times$&lt;/code&gt; (&lt;code&gt;$20.9\times$&lt;/code&gt; stronger than classical), lifting &lt;code&gt;$\sigma_0 = 0.01$&lt;/code&gt; right up to &lt;code&gt;$\varphi^{(5)}(0.01) \approx 0.70$&lt;/code&gt;;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Why &lt;code&gt;$\varphi(1) = 3.4445 - 4.7750 + 2.0315 = 0.7010 \neq 1$&lt;/code&gt;&lt;/strong&gt;: this is not a typo, but the deliberate trough of the equiripple band—every &lt;code&gt;$\sigma_0 \in [0.01, 1.0]$&lt;/code&gt; lands inside &lt;code&gt;$[0.68, 1.13]$&lt;/code&gt; after 5 compositions (while tiny values in &lt;code&gt;$(0, 0.01)$&lt;/code&gt; climbing through the peak of &lt;code&gt;$\varphi$&lt;/code&gt; reach at most &lt;code&gt;$\max \varphi \approx 1.20$&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;To demystify how pure matrix multiplications can uncover a buried singular direction without ever calling SVD, let us unfold all 5 iterations on a concrete &lt;code&gt;$2 \times 2$&lt;/code&gt; skewed momentum matrix:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\tilde{M} = \underbrace{\begin{bmatrix} 10 &amp;amp; 10 \\ 10 &amp;amp; 10 \end{bmatrix}}_{\text{dominant mode }\sigma_1 = 20.0} + \underbrace{\begin{bmatrix} -0.1 &amp;amp; +0.1 \\ +0.1 &amp;amp; -0.1 \end{bmatrix}}_{\text{weak orthogonal mode }\sigma_2 = 0.2} = \begin{bmatrix} 9.9 &amp;amp; 10.1 \\ 10.1 &amp;amp; 9.9 \end{bmatrix}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;At a glance, all four entries sit right around &lt;code&gt;$+10$&lt;/code&gt;, differing by just &lt;code&gt;$0.2$&lt;/code&gt; between diagonal and anti-diagonal. Taking entrywise signs (the memoryless &lt;code&gt;Adam&lt;/code&gt; limit) sees four positive numbers and outputs the rank-1 all-ones matrix &lt;code&gt;$\mathrm{sign}(\tilde{M}) = \begin{bsmallmatrix} 1 &amp;amp; 1 \\ 1 &amp;amp; 1 \end{bsmallmatrix}$&lt;/code&gt; (&lt;code&gt;$\sigma = [2, 0]$&lt;/code&gt;), destroying the anti-diagonal subspace; whereas the exact orthogonal polar factor is the permutation matrix &lt;code&gt;$U V^\top = \frac{1}{2}\begin{bsmallmatrix} 1 &amp;amp; 1 \\ 1 &amp;amp; 1 \end{bsmallmatrix} + \frac{1}{2}\begin{bsmallmatrix} -1 &amp;amp; 1 \\ 1 &amp;amp; -1 \end{bsmallmatrix} = \begin{bsmallmatrix} 0 &amp;amp; 1 \\ 1 &amp;amp; 0 \end{bsmallmatrix}$&lt;/code&gt; (&lt;code&gt;$\sigma = [1, 1]$&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;p&gt;Now run &lt;code&gt;Muon&lt;/code&gt;&#39;s pre-normalization and quintic recursion &lt;code&gt;$X_{k+1} = 3.4445 X_k + (-4.7750 A_k + 2.0315 A_k^2) X_k$&lt;/code&gt; (&lt;code&gt;$A_k = X_k X_k^\top$&lt;/code&gt;) with zero SVD:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Step 0 pre-normalization&lt;/strong&gt;: &lt;code&gt;$\|\tilde{M}\|_F = \sqrt{9.9^2 + 10.1^2 + 10.1^2 + 9.9^2} = \sqrt{400.04} \approx 20.001$&lt;/code&gt;, giving &lt;code&gt;$X_0 = \begin{bsmallmatrix} 0.495 &amp;amp; 0.505 \\ 0.505 &amp;amp; 0.495 \end{bsmallmatrix}$&lt;/code&gt; with singular values &lt;code&gt;$(1.000, 0.010)$&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Why step 1 separates &lt;code&gt;$0.495$&lt;/code&gt; from &lt;code&gt;$0.505$&lt;/code&gt;&lt;/strong&gt;: Gram matrix &lt;code&gt;$A_0 = X_0 X_0^\top \approx \begin{bsmallmatrix} 0.50005 &amp;amp; 0.49995 \\ 0.49995 &amp;amp; 0.50005 \end{bsmallmatrix}$&lt;/code&gt; has eigenvalue &lt;code&gt;$1^2 = 1$&lt;/code&gt; along the common-mode vector &lt;code&gt;$\begin{bsmallmatrix} 1 \\ 1 \end{bsmallmatrix}$&lt;/code&gt;, so the negative cubic term &lt;code&gt;$-4.7750 A_0 X_0$&lt;/code&gt; strongly damps the dominant mode down to &lt;code&gt;$3.4445 - 4.7750 + 2.0315 = 0.701$&lt;/code&gt;. Along the differential vector &lt;code&gt;$\begin{bsmallmatrix} -1 \\ 1 \end{bsmallmatrix}$&lt;/code&gt;, however, &lt;code&gt;$A_0$&lt;/code&gt; has eigenvalue &lt;code&gt;$0.01^2 = 0.0001$&lt;/code&gt;, so cubic and quintic terms virtually vanish while linear term &lt;code&gt;$3.4445 X_0$&lt;/code&gt; amplifies the anti-diagonal gap by &lt;code&gt;$3.4445\times$&lt;/code&gt;, yielding &lt;code&gt;$X_1 = \begin{bsmallmatrix} 0.333 &amp;amp; 0.368 \\ 0.368 &amp;amp; 0.333 \end{bsmallmatrix}$&lt;/code&gt; (&lt;code&gt;$\sigma = [0.701, 0.034]$&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Unfolding all five matrix-multiply iterations (&lt;code&gt;$k = 1 \dots 5$&lt;/code&gt;)&lt;/strong&gt;:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\begin{aligned} X_0 &amp;amp;= \begin{bmatrix} 0.495 &amp;amp; 0.505 \\ 0.505 &amp;amp; 0.495 \end{bmatrix} \xrightarrow{k=1} X_1 = \begin{bmatrix} 0.333 &amp;amp; 0.368 \\ 0.368 &amp;amp; 0.333 \end{bmatrix} \xrightarrow{k=2} X_2 = \begin{bmatrix} 0.498 &amp;amp; 0.616 \\ 0.616 &amp;amp; 0.498 \end{bmatrix} \\[6pt] &amp;amp;\xrightarrow{k=3} X_3 = \begin{bmatrix} 0.160 &amp;amp; 0.560 \\ 0.560 &amp;amp; 0.160 \end{bmatrix} \xrightarrow{k=4} X_4 = \begin{bmatrix} -0.002 &amp;amp; 1.092 \\ 1.092 &amp;amp; -0.002 \end{bmatrix} \xrightarrow{k=5} X_5 = \begin{bmatrix} -0.001 &amp;amp; 0.698 \\ 0.698 &amp;amp; -0.001 \end{bmatrix} \end{aligned}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;In five plain matrix multiplications, &lt;code&gt;$\begin{bsmallmatrix} 0.495 &amp;amp; 0.505 \\ 0.505 &amp;amp; 0.495 \end{bsmallmatrix}$&lt;/code&gt; cancels its diagonal common-mode background down to &lt;code&gt;$-0.001$&lt;/code&gt; and extracts the orthogonal swap operator &lt;code&gt;$\approx 0.70\begin{bsmallmatrix} 0 &amp;amp; 1 \\ 1 &amp;amp; 0 \end{bsmallmatrix}$&lt;/code&gt;, flattening the singular-value ratio from &lt;code&gt;$100:1$&lt;/code&gt; to &lt;code&gt;$(0.699,\; 0.697)$&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;figure class=&#34;diagram&#34; style=&#34;--h:446px;--hn:576px&#34;&gt;&lt;figcaption&gt;Unfolded Numeric Walkthrough: Cell-by-Cell Evolution of a 100:1 Skewed Matrix Under SGD, Sign/Adam, and 5-Step Newton-Schulz&lt;/figcaption&gt;&lt;p&gt;&lt;a href=&#34;https://mizore.blog/en/posts/from-transformer-matrices-to-muon/&#34;&gt;(See the figure in the post.)&lt;/a&gt;&lt;/p&gt;&lt;p class=&#34;figure-note&#34;&gt;Input &lt;code&gt;$\tilde{M} = \begin{bsmallmatrix}9.9 &amp;amp; 10.1\\10.1 &amp;amp; 9.9\end{bsmallmatrix}$&lt;/code&gt; combines dominant &lt;code&gt;$\sigma_1=20.0$&lt;/code&gt; with tail &lt;code&gt;$\sigma_2=0.2$&lt;/code&gt;. Entrywise sign collapses to a rank-1 all-ones matrix because all 4 entries are positive; 5 Newton-Schulz polynomial steps isolate the hidden orthogonal swap matrix via pure matrix multiplications.&lt;/p&gt;&lt;/figure&gt;&#xA;&lt;p&gt;The left panel below plots &lt;code&gt;$\varphi^{(k)}(\sigma)$&lt;/code&gt; at &lt;code&gt;$k = 1, 3, 5$&lt;/code&gt;; the right panel measures all 64 singular values of Layer 1&#39;s &lt;code&gt;W_q&lt;/code&gt; momentum at step 25 of our 2-layer Transformer. Raw momentum spans &lt;code&gt;$13{,}669\times$&lt;/code&gt;, and even &lt;code&gt;AdamW&lt;/code&gt;&#39;s entrywise update still decays by over &lt;code&gt;$2{,}000\times$&lt;/code&gt;—whereas 5 Newton-Schulz steps place the top 53 singular values squarely inside &lt;code&gt;$[0.68, 1.20]$&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;figure class=&#34;plotfig&#34;&gt;&lt;figcaption&gt;Newton-Schulz Quintic Composition Curves and Measured Transformer &lt;code&gt;$W_q$&lt;/code&gt; Singular Spectrum&lt;/figcaption&gt;&lt;p&gt;&lt;a href=&#34;https://mizore.blog/en/posts/from-transformer-matrices-to-muon/&#34;&gt;(See the figure in the post.)&lt;/a&gt;&lt;/p&gt;&lt;p class=&#34;figure-note&#34;&gt;Left: &lt;code&gt;$\varphi(\sigma) = 3.4445\sigma - 4.7750\sigma^3 + 2.0315\sigma^5$&lt;/code&gt; composed 1, 3, and 5 times. Right: all 64 singular values of Layer-1 &lt;code&gt;$W_q$&lt;/code&gt; at step 25 of a 2-layer Mini-Transformer (&lt;code&gt;$D=64$&lt;/code&gt;; raw momentum and AdamW updates normalized by &lt;code&gt;$\sigma_1$&lt;/code&gt; to compare spectral shape).&lt;/p&gt;&lt;/figure&gt;&#xA;&lt;h3 id=&#34;53-moonshot-ais-scaling-improvements-update-rms-alignment-and-decoupled-weight-decay&#34;&gt;5.3 Moonshot AI&#39;s Scaling Improvements: Update RMS Alignment and Decoupled Weight Decay&lt;/h3&gt;&#xA;&lt;p&gt;Scaling &lt;code&gt;Muon&lt;/code&gt; from small benchmarks to multi-billion-parameter LLM pretraining required solving two hyperparameter-transfer bottlenecks, derived by Moonshot AI (Liu, Su et al., 2025) in &lt;em&gt;Muon is Scalable for LLM Training&lt;/em&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-liu2025-4&#34; href=&#34;#ref-liu2025&#34;&gt;[5]&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;First: aligning entrywise update RMS across matrix shapes and with &lt;code&gt;AdamW&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Let &lt;code&gt;$O_t \in \mathbb{R}^{A \times B}$&lt;/code&gt; have rank &lt;code&gt;$r = \min(A, B)$&lt;/code&gt; with nonzero singular values near &lt;code&gt;$1$&lt;/code&gt;. Its squared Frobenius norm equals the sum of squared singular values:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\|O_t\|_F^2 = \sum_{i=1}^{A} \sum_{j=1}^{B} O_{t, ij}^2 = \sum_{k=1}^{\min(A, B)} \sigma_k^2 \approx \min(A, B)$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Dividing across all &lt;code&gt;$A \cdot B$&lt;/code&gt; entries gives the per-element root-mean-square update magnitude:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\mathrm{RMS}(O_t) \triangleq \sqrt{\frac{1}{A B} \|O_t\|_F^2} \approx \sqrt{\frac{\min(A, B)}{A B}} = \frac{1}{\sqrt{\max(A, B)}}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Compare this against earlier aspect-ratio factors: Section 4.3&#39;s induced norm gave &lt;code&gt;$\sqrt{A / B}$&lt;/code&gt; (entrywise RMS &lt;code&gt;$\sqrt{A}/B$&lt;/code&gt; when &lt;code&gt;$A &amp;lt; B$&lt;/code&gt;), which Keller Jordan clamped to &lt;code&gt;$\sqrt{\max(1, A/B)}$&lt;/code&gt; (entrywise RMS &lt;code&gt;$1/\sqrt{B}$&lt;/code&gt;). Under either formula, entrywise update RMS shrinks as &lt;code&gt;$1/\sqrt{d_{\mathrm{in}}}$&lt;/code&gt; whenever model width &lt;code&gt;$B = d_{\mathrm{in}}$&lt;/code&gt; grows—forcing separate learning-rate sweeps (e.g., &lt;code&gt;lr = 0.02&lt;/code&gt;) across widths and across attention, MLP, and MoE layers.&lt;/p&gt;&#xA;&lt;p&gt;What is the steady-state entrywise update RMS of &lt;code&gt;AdamW&lt;/code&gt;? Model coordinate gradients &lt;code&gt;$\{g_t\}$&lt;/code&gt; in late training as zero-mean i.i.d. random variables with variance &lt;code&gt;$\sigma^2$&lt;/code&gt; (&lt;code&gt;$\mathbb{E}[g_t] = 0,\; \mathbb{E}[g_t^2] = \sigma^2$&lt;/code&gt;). For large &lt;code&gt;$t$&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;$\mathbb{E}[v_t] = (1 - \beta_2)\sum_{k=0}^\infty \beta_2^k \mathbb{E}[g_{t-k}^2] = \sigma^2$&lt;/code&gt;;&lt;/li&gt;&#xA;&lt;li&gt;Because cross-step terms &lt;code&gt;$\mathbb{E}[g_i g_j] = 0$&lt;/code&gt; vanish:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\mathbb{E}[m_t^2] = (1 - \beta_1)^2 \sum_{k=0}^{\infty} \beta_1^{2k} \mathbb{E}[g_{t-k}^2] = \frac{(1 - \beta_1)^2}{1 - \beta_1^2} \sigma^2 = \frac{1 - \beta_1}{1 + \beta_1} \sigma^2$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;With &lt;code&gt;$\beta_2$&lt;/code&gt; near &lt;code&gt;$1$&lt;/code&gt; concentrating &lt;code&gt;$v_t$&lt;/code&gt; tightly around &lt;code&gt;$\sigma^2$&lt;/code&gt;, the first-order ratio approximation &lt;code&gt;$\mathbb{E}[m_t^2 / v_t] \approx \mathbb{E}[m_t^2] / \mathbb{E}[v_t]$&lt;/code&gt; gives the dimensionless &lt;code&gt;AdamW&lt;/code&gt; step &lt;code&gt;$u_t = m_t / \sqrt{v_t}$&lt;/code&gt; an entrywise RMS of:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\mathrm{RMS}(u_t^{\mathrm{AdamW}}) \approx \sqrt{\frac{\mathbb{E}[m_t^2]}{\mathbb{E}[v_t]}} = \sqrt{\frac{1 - \beta_1}{1 + \beta_1}}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;At &lt;code&gt;$\beta_1 = 0.9$&lt;/code&gt;, &lt;code&gt;$\sqrt{0.1 / 1.9} \approx 0.229$&lt;/code&gt; (empirically &lt;code&gt;$0.2$&lt;/code&gt;–&lt;code&gt;$0.4$&lt;/code&gt; in real LLM runs with positive local gradient autocorrelation&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-liu2025-5&#34; href=&#34;#ref-liu2025&#34;&gt;[5]&lt;/a&gt;&lt;/sup&gt;).&lt;/p&gt;&#xA;&lt;p&gt;Multiplying &lt;code&gt;$O_t$&lt;/code&gt; by &lt;code&gt;$0.2\sqrt{\max(A, B)}$&lt;/code&gt; cancels the &lt;code&gt;$1/\sqrt{\max(A, B)}$&lt;/code&gt; denominator and pins &lt;code&gt;Muon&lt;/code&gt;&#39;s entrywise update RMS right around &lt;code&gt;$0.2$&lt;/code&gt; across every matrix shape:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$W_t = (1 - \eta \lambda) W_{t-1} - \eta \cdot 0.2\sqrt{\max(A, B)} \, O_t$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;With this alignment, &lt;code&gt;Muon&lt;/code&gt; and boundary &lt;code&gt;AdamW&lt;/code&gt; &lt;strong&gt;share the exact same learning rate schedule &lt;code&gt;$\eta_t$&lt;/code&gt; and weight decay &lt;code&gt;$\lambda$&lt;/code&gt;&lt;/strong&gt; out of the box.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Second: why long-horizon pretraining requires decoupled weight decay.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Without weight decay (&lt;code&gt;$\lambda = 0$&lt;/code&gt;), writing &lt;code&gt;$\Delta_t = \eta \cdot 0.2\sqrt{\max(A,B)}\,O_t$&lt;/code&gt;, the squared Frobenius norm evolves as:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\|W_t\|_F^2 = \|W_{t-1} - \Delta_t\|_F^2 = \|W_{t-1}\|_F^2 - 2\langle W_{t-1}, \Delta_t \rangle_F + \|\Delta_t\|_F^2$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Under noisy late-stage gradients nearly orthogonal to &lt;code&gt;$W_{t-1}$&lt;/code&gt;, the positive quadratic injection &lt;code&gt;$\|\Delta_t\|_F^2 \approx 0.04 \eta^2 A B$&lt;/code&gt; accumulates every step without any restoring force, causing &lt;code&gt;$\|W_t\|_F$&lt;/code&gt; to drift upward monotonically until attention logits saturate. Decoupled decay &lt;code&gt;$(1 - \eta \lambda)W_{t-1}$&lt;/code&gt; contributes &lt;code&gt;$-2\eta\lambda\|W_{t-1}\|_F^2$&lt;/code&gt; per step; balancing shrinkage against &lt;code&gt;$0.04 \eta^2 A B$&lt;/code&gt; stabilizes weights at the bounded equilibrium &lt;code&gt;$\mathrm{RMS}(W_{\mathrm{eq}}) \approx \sqrt{0.02 \eta / \lambda}$&lt;/code&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-liu2025-6&#34; href=&#34;#ref-liu2025&#34;&gt;[5]&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The three controlled ablations below verify each claim: applying &lt;code&gt;Muon&lt;/code&gt; to embeddings and the LM head degrades validation loss; omitting weight decay causes &lt;code&gt;$\|W\|_F$&lt;/code&gt; to grow linearly; and &lt;code&gt;$0.2\sqrt{\max(A, B)}$&lt;/code&gt; holds entrywise update RMS steady at &lt;code&gt;$0.17$&lt;/code&gt;–&lt;code&gt;$0.19$&lt;/code&gt; from &lt;code&gt;$64 \times 64$&lt;/code&gt; up to &lt;code&gt;$2048 \times 512$&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;figure class=&#34;plotfig&#34;&gt;&lt;figcaption&gt;Controlled Ablations: Parameter Routing, Decoupled Weight Decay, and Cross-Shape RMS Alignment&lt;/figcaption&gt;&lt;p&gt;&lt;a href=&#34;https://mizore.blog/en/posts/from-transformer-matrices-to-muon/&#34;&gt;(See the figure in the post.)&lt;/a&gt;&lt;/p&gt;&lt;p class=&#34;figure-note&#34;&gt;Left &amp;amp; center: 360 steps on a 2-layer Mini-Transformer. Right: measured entrywise RMS of Gaussian matrices after 5 Newton-Schulz steps across longer dimension &lt;code&gt;$A=\max(A,B)$&lt;/code&gt; (&lt;code&gt;$64\times 64$&lt;/code&gt; square, then &lt;code&gt;$4:1$&lt;/code&gt; aspect ratio from &lt;code&gt;$256\times 64$&lt;/code&gt; to &lt;code&gt;$2048\times 512$&lt;/code&gt;).&lt;/p&gt;&lt;/figure&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;6-roofline-arithmetic-intensity-and-four-generation-controlled-benchmark&#34;&gt;6. Roofline Arithmetic Intensity and Four-Generation Controlled Benchmark&lt;/h2&gt;&#xA;&lt;h3 id=&#34;61-why-five-extra-matrix-multiplications-barely-move-wall-clock-step-time&#34;&gt;6.1 Why Five Extra Matrix Multiplications Barely Move Wall-Clock Step Time&lt;/h3&gt;&#xA;&lt;p&gt;At first glance, running five matrix-multiplication iterations per weight layer sounds far more expensive than &lt;code&gt;AdamW&lt;/code&gt;&#39;s scalar arithmetic. A quick GPU &lt;strong&gt;Roofline&lt;/strong&gt; calculation—measuring arithmetic intensity in &lt;code&gt;$\text{FLOPs/Byte}$&lt;/code&gt; (&lt;code&gt;$1\;\text{MAC} = 2\;\text{FLOPs}$&lt;/code&gt;)—explains why wall-clock overhead is negligible.&lt;/p&gt;&#xA;&lt;p&gt;For &lt;code&gt;$W \in \mathbb{R}^{A \times B}$&lt;/code&gt; with short side &lt;code&gt;$m = \min(A, B)$&lt;/code&gt;, long side &lt;code&gt;$M = \max(A, B)$&lt;/code&gt;, and &lt;code&gt;float32&lt;/code&gt; master weights/states (4 bytes/entry) in HBM:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Memory-bound fused &lt;code&gt;AdamW&lt;/code&gt;&lt;/strong&gt;: each step reads &lt;code&gt;$(W, G, M, V)$&lt;/code&gt; and writes &lt;code&gt;$(W, M, V)$&lt;/code&gt;—roughly &lt;code&gt;$7 \times 4 A B = 28 A B$&lt;/code&gt; bytes of HBM traffic for &lt;del&gt;12 scalar FLOPs per parameter. Its arithmetic intensity is &lt;code&gt;$\frac{12 A B}{28 A B} \approx 0.43\;\text{FLOPs/Byte}$&lt;/code&gt;, hundreds of times below a modern GPU&#39;s ridge point (&lt;/del&gt;&lt;code&gt;$295\;\text{FLOPs/Byte}$&lt;/code&gt; for H100 &lt;code&gt;bfloat16&lt;/code&gt; Tensor Cores), while holding two full state buffers.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Compute share of &lt;code&gt;Muon&lt;/code&gt;&#39;s NS5&lt;/strong&gt;: &lt;code&gt;Muon&lt;/code&gt; drops &lt;code&gt;$V$&lt;/code&gt; (halving 2D optimizer state memory). After transposing to &lt;code&gt;$m \times M$&lt;/code&gt; in &lt;code&gt;bfloat16&lt;/code&gt; (2 bytes/entry), each NS step performs &lt;code&gt;$A_k = X_k X_k^\top$&lt;/code&gt; (&lt;code&gt;$2 m^2 M$&lt;/code&gt; FLOPs), &lt;code&gt;$A_k^2$&lt;/code&gt; (&lt;code&gt;$2 m^3$&lt;/code&gt; FLOPs), and &lt;code&gt;$B_k X_k$&lt;/code&gt; (&lt;code&gt;$2 m^2 M$&lt;/code&gt; FLOPs), totaling &lt;code&gt;$5 \times (4 m^2 M + 2 m^3) = (20 + 10 m / M) m A B \le 30 m A B$&lt;/code&gt; FLOPs over 5 steps, at high arithmetic intensity (&lt;code&gt;$\frac{m}{3}$&lt;/code&gt;–&lt;code&gt;$\frac{m}{2}\;\text{FLOPs/Byte}$&lt;/code&gt;, or &lt;code&gt;$1{,}365$&lt;/code&gt;–&lt;code&gt;$2{,}048\;\text{FLOPs/Byte}$&lt;/code&gt; at &lt;code&gt;$m = 4096$&lt;/code&gt;) right in the Tensor Core sweet spot. Meanwhile, on a global token batch &lt;code&gt;$N_{\mathrm{tok}} = B_{\mathrm{batch}} T$&lt;/code&gt;, the forward &lt;code&gt;$X W^\top$&lt;/code&gt; and backward &lt;code&gt;$\Delta^\top X, \Delta W$&lt;/code&gt; passes execute &lt;code&gt;$6 N_{\mathrm{tok}} A B$&lt;/code&gt; FLOPs, bounding &lt;code&gt;Muon&lt;/code&gt;&#39;s relative FLOP overhead by:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\frac{\mathrm{FLOPs}_{\mathrm{NS5}}}{\mathrm{FLOPs}_{\mathrm{fwd+bwd}}} = \frac{(20 + 10 m / M) m A B}{6 N_{\mathrm{tok}} A B} \le \frac{5 \min(A, B)}{N_{\mathrm{tok}}}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;In standard LLM pretraining where &lt;code&gt;$\min(A, B) \in [4{,}096,\; 8{,}192]$&lt;/code&gt; and &lt;code&gt;$N_{\mathrm{tok}} \in [10^6,\; 4 \times 10^6]$&lt;/code&gt;, this ratio is just &lt;strong&gt;&lt;code&gt;$0.5\%$&lt;/code&gt;–&lt;code&gt;$2\%$&lt;/code&gt;&lt;/strong&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-jordan2024-6&#34; href=&#34;#ref-jordan2024&#34;&gt;[4]&lt;/a&gt;&lt;/sup&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-liu2025-7&#34; href=&#34;#ref-liu2025&#34;&gt;[5]&lt;/a&gt;&lt;/sup&gt;—trading under &lt;code&gt;$2\%$&lt;/code&gt; extra Tensor Core FLOPs for ~48% fewer training tokens to reach the same validation loss in Moonshot AI&#39;s scaling-law runs&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-liu2025-8&#34; href=&#34;#ref-liu2025&#34;&gt;[5]&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;62-controlled-benchmark-across-four-optimizer-generations-on-a-2-layer-transformer&#34;&gt;6.2 Controlled Benchmark Across Four Optimizer Generations on a 2-Layer Transformer&lt;/h3&gt;&#xA;&lt;p&gt;To observe every mechanism on a transparent task, we construct a synthetic language modeling benchmark combining &lt;strong&gt;Zipf-skewed background tokens&lt;/strong&gt; with &lt;strong&gt;in-context associative recall&lt;/strong&gt;: vocabulary &lt;code&gt;$V = 128$&lt;/code&gt;, length &lt;code&gt;$T = 32$&lt;/code&gt;, with four random &lt;code&gt;Key → Value&lt;/code&gt; pairs planted in the first half of each sequence and one &lt;code&gt;Key&lt;/code&gt; queried amidst Zipfian filler in the second half. Answering correctly requires multi-head attention to form an induction circuit aligning query and key subspaces.&lt;/p&gt;&#xA;&lt;p&gt;We train an identical 2-layer, 4-head Mini-Transformer (&lt;code&gt;$D = 64, B = 32$&lt;/code&gt;) for 360 steps under &lt;code&gt;SGD&lt;/code&gt;, &lt;code&gt;SGD + Momentum&lt;/code&gt;, full-model &lt;code&gt;AdamW&lt;/code&gt;, and hybrid &lt;code&gt;Muon + AdamW&lt;/code&gt; (with &lt;code&gt;Muon + AdamW&lt;/code&gt; and &lt;code&gt;AdamW&lt;/code&gt; sharing the exact same &lt;code&gt;$\eta = 5 \times 10^{-3}$&lt;/code&gt; and &lt;code&gt;$\lambda = 0.02$&lt;/code&gt;):&lt;/p&gt;&#xA;&lt;figure class=&#34;plotfig&#34;&gt;&lt;figcaption&gt;Four Optimizer Generations on a 2-Layer 4-Head Mini-Transformer: Val Loss &amp;amp; Associative Recall&lt;/figcaption&gt;&lt;p&gt;&lt;a href=&#34;https://mizore.blog/en/posts/from-transformer-matrices-to-muon/&#34;&gt;(See the figure in the post.)&lt;/a&gt;&lt;/p&gt;&lt;p class=&#34;plot-xlabel&#34;&gt;Training step (2-layer 4-head Mini-Transformer, Zipf background + associative recall, mean ±1 SD over 2 seeds)&lt;/p&gt;&lt;p class=&#34;figure-note&#34;&gt;Vocab &lt;code&gt;$V=128$&lt;/code&gt;, length &lt;code&gt;$T=32$&lt;/code&gt;, &lt;code&gt;$D=64$&lt;/code&gt;, 4 heads, batch &lt;code&gt;$B=32$&lt;/code&gt;; solid curves show 2-seed means and shaded bands show &lt;code&gt;$\pm 1$&lt;/code&gt; SD. Uniform random cross-entropy starts at &lt;code&gt;$\ln(128) \approx 4.85$&lt;/code&gt;.&lt;/p&gt;&lt;/figure&gt;&#xA;&lt;p&gt;The training phases mirror our derivations: within the first 50 steps, all four optimizers fit the unigram frequencies of high-probability Zipfian filler, dropping loss from &lt;code&gt;$4.85$&lt;/code&gt; to ~&lt;code&gt;$2.80$&lt;/code&gt;. Beyond that point, &lt;code&gt;SGD&lt;/code&gt; and &lt;code&gt;Momentum&lt;/code&gt; remain swamped by dominant filler gradients, leaving the low-singular-value induction-head directions stalled at &lt;code&gt;$7.3\%$&lt;/code&gt;–&lt;code&gt;$7.4\%$&lt;/code&gt; recall; &lt;code&gt;AdamW&lt;/code&gt; begins aligning subspaces after step 150 to reach &lt;code&gt;$23.7\%$&lt;/code&gt; by step 360; whereas &lt;code&gt;Muon + AdamW&lt;/code&gt; crosses the induction phase transition around step 120 and reaches &lt;strong&gt;&lt;code&gt;$77.0\%$&lt;/code&gt;&lt;/strong&gt; associative recall (its slight overall validation loss uptick past step 250 reflects mild overfitting on fixed-corpus background tokens while associative recall continues climbing).&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;7-complete-single-file-pytorch-implementation-mini-transformer-with-muon--adamw&#34;&gt;7. Complete Single-File PyTorch Implementation: Mini-Transformer with &lt;code&gt;Muon + AdamW&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;The self-contained PyTorch script below maps every equation in this post—mixed-precision-safe &lt;code&gt;RMSNorm&lt;/code&gt;, multi-head causal self-attention, 5-step Newton-Schulz orthogonalization, Moonshot RMS-aligned &lt;code&gt;Muon&lt;/code&gt;, induced-norm parameter routing, and a 1-epoch (50-step) training loop—directly onto runnable code:&lt;/p&gt;&#xA;&lt;figure class=&#34;code&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;torch&lt;/span&gt;&#xA;&lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;torch.nn&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;as&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;nn&lt;/span&gt;&#xA;&lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;torch.nn.functional&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;as&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;F&lt;/span&gt;&#xA;&lt;span class=&#34;kn&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;torch.utils.data&lt;/span&gt; &lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TensorDataset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;DataLoader&lt;/span&gt;&#xA;&#xA;&#xA;&lt;span class=&#34;c1&#34;&gt;# =====================================================================&lt;/span&gt;&#xA;&lt;span class=&#34;c1&#34;&gt;# 1. Quintic Newton-Schulz Iteration &amp;amp; Custom Muon Optimizer&lt;/span&gt;&#xA;&lt;span class=&#34;c1&#34;&gt;# =====================================================================&lt;/span&gt;&#xA;&lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;zeropower_via_newtonschulz5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;G&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;torch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Tensor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;steps&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;eps&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;float&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;1e-7&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;torch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Tensor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&#xA;    &lt;span class=&#34;s2&#34;&gt;&amp;#34;&amp;#34;&amp;#34;Map G = U * Sigma * V^T to approximate semi-orthogonal U * V^T in 5 matmul steps.&amp;#34;&amp;#34;&amp;#34;&lt;/span&gt;&#xA;    &lt;span class=&#34;k&#34;&gt;assert&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;G&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ndim&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Newton-Schulz orthogonalization applies only to 2D matrix parameters&amp;#34;&lt;/span&gt;&#xA;    &lt;span class=&#34;n&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;b&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;c&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;3.4445&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;4.7750&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;2.0315&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;    &lt;span class=&#34;n&#34;&gt;X&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;G&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;bfloat16&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;G&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;is_cuda&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;G&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;float&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&#xA;    &lt;span class=&#34;c1&#34;&gt;# Pre-normalize by Frobenius norm so all initial singular values lie in [0, 1]&lt;/span&gt;&#xA;    &lt;span class=&#34;n&#34;&gt;X&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;X&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;/&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;X&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;norm&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;eps&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&#xA;    &lt;span class=&#34;c1&#34;&gt;# Transpose tall matrices (A &amp;gt; B) so A_k = X @ X.T has smaller shape B x B&lt;/span&gt;&#xA;    &lt;span class=&#34;n&#34;&gt;transposed&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;False&lt;/span&gt;&#xA;    &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;X&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;size&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;X&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;size&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;X&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;X&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;T&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;transposed&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;True&lt;/span&gt;&#xA;&#xA;    &lt;span class=&#34;c1&#34;&gt;# Odd matrix polynomial recurrence: X_{k+1} = a * X_k + (b * A_k + c * A_k^2) * X_k&lt;/span&gt;&#xA;    &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;range&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;steps&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;A&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;X&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;@&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;X&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;T&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;B&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;b&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;A&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;c&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;A&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;@&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;A&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;X&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;X&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;B&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;@&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;X&lt;/span&gt;&#xA;&#xA;    &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;transposed&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;X&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;X&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;T&lt;/span&gt;&#xA;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;X&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;to&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;G&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;dtype&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&#xA;&#xA;&lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;Muon&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;torch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;optim&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Optimizer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;&#xA;    &lt;span class=&#34;s2&#34;&gt;&amp;#34;&amp;#34;&amp;#34;Muon optimizer for internal 2D Transformer matrices (with decoupled WD &amp;amp; RMS scaling).&amp;#34;&amp;#34;&amp;#34;&lt;/span&gt;&#xA;    &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;fm&#34;&gt;__init__&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;params&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;lr&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;3e-3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;momentum&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;0.95&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;weight_decay&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;0.01&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;scale_mode&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;moonshot&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;defaults&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;dict&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;lr&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;lr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;momentum&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;momentum&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;weight_decay&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;weight_decay&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;scale_mode&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;scale_mode&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;        &lt;span class=&#34;nb&#34;&gt;super&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;fm&#34;&gt;__init__&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;params&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;defaults&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&#xA;    &lt;span class=&#34;nd&#34;&gt;@torch.no_grad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;    &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;step&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;closure&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;None&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;loss&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;None&lt;/span&gt;&#xA;        &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;closure&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;is&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;not&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;None&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&#xA;            &lt;span class=&#34;k&#34;&gt;with&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;torch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;enable_grad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;():&lt;/span&gt;&#xA;                &lt;span class=&#34;n&#34;&gt;loss&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;closure&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;        &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;group&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;param_groups&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&#xA;            &lt;span class=&#34;n&#34;&gt;lr&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;group&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;lr&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&#xA;            &lt;span class=&#34;n&#34;&gt;mu&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;group&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;momentum&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&#xA;            &lt;span class=&#34;n&#34;&gt;wd&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;group&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;weight_decay&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&#xA;            &lt;span class=&#34;n&#34;&gt;scale_mode&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;group&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;scale_mode&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&#xA;&#xA;            &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;W&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;group&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;params&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]:&lt;/span&gt;&#xA;                &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;W&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;grad&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;is&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;None&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&#xA;                    &lt;span class=&#34;k&#34;&gt;continue&lt;/span&gt;&#xA;                &lt;span class=&#34;n&#34;&gt;G&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;W&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;grad&lt;/span&gt;  &lt;span class=&#34;c1&#34;&gt;# 2D gradient matrix of shape (d_out, d_in) matching W&lt;/span&gt;&#xA;&#xA;                &lt;span class=&#34;c1&#34;&gt;# Only first-moment momentum M is stored; no second-moment buffer V is needed&lt;/span&gt;&#xA;                &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;W&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&#xA;                &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;momentum_buffer&amp;#34;&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;not&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&#xA;                    &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;momentum_buffer&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;torch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;zeros_like&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;G&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;                &lt;span class=&#34;n&#34;&gt;M&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;momentum_buffer&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&#xA;&#xA;                &lt;span class=&#34;c1&#34;&gt;# 1. Nesterov lookahead momentum: M_t = mu * M_{t-1} + G_t, tilde_M = G_t + mu * M_t&lt;/span&gt;&#xA;                &lt;span class=&#34;n&#34;&gt;M&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;mul_&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;mu&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;add_&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;G&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;                &lt;span class=&#34;n&#34;&gt;tilde_M&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;G&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;mu&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;M&lt;/span&gt;&#xA;&#xA;                &lt;span class=&#34;c1&#34;&gt;# 2. 5-step Newton-Schulz orthogonalization&lt;/span&gt;&#xA;                &lt;span class=&#34;n&#34;&gt;O_t&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;zeropower_via_newtonschulz5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;tilde_M&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;steps&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&#xA;                &lt;span class=&#34;c1&#34;&gt;# 3. Decoupled weight decay: W &amp;lt;- (1 - lr * wd) * W&lt;/span&gt;&#xA;                &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;wd&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;!=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&#xA;                    &lt;span class=&#34;n&#34;&gt;W&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;mul_&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;1.0&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;lr&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;wd&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&#xA;                &lt;span class=&#34;c1&#34;&gt;# 4. Entrywise update RMS alignment (moonshot mode shares AdamW&amp;#39;s lr directly)&lt;/span&gt;&#xA;                &lt;span class=&#34;n&#34;&gt;A&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;B&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;W&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;size&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;W&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;size&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;                &lt;span class=&#34;n&#34;&gt;scale&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;0.2&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;max&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;A&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;B&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;**&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;0.5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;scale_mode&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;moonshot&amp;#34;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;max&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;1.0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;A&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;/&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;B&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;**&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;0.5&lt;/span&gt;&#xA;                &lt;span class=&#34;n&#34;&gt;W&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;add_&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;O_t&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;alpha&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=-&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;lr&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;scale&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;        &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;loss&lt;/span&gt;&#xA;&#xA;&#xA;&lt;span class=&#34;c1&#34;&gt;# =====================================================================&lt;/span&gt;&#xA;&lt;span class=&#34;c1&#34;&gt;# 2. Mini-Transformer Language Model Definition&lt;/span&gt;&#xA;&lt;span class=&#34;c1&#34;&gt;# =====================================================================&lt;/span&gt;&#xA;&lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;RMSNorm&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;nn&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Module&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;&#xA;    &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;fm&#34;&gt;__init__&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;dim&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;int&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;eps&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;float&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;1e-6&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;&#xA;        &lt;span class=&#34;nb&#34;&gt;super&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;fm&#34;&gt;__init__&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;        &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;weight&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;nn&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Parameter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;torch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ones&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;dim&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;  &lt;span class=&#34;c1&#34;&gt;# 1D gain (dim,) -&amp;gt; AdamW (wd=0)&lt;/span&gt;&#xA;        &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;eps&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;eps&lt;/span&gt;&#xA;&#xA;    &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;forward&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;torch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Tensor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;torch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Tensor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;x_fp32&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;float&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;rms&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;torch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;rsqrt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x_fp32&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pow&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;mean&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;keepdim&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;True&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;eps&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;        &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x_fp32&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;rms&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;to&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;dtype&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;weight&lt;/span&gt;&#xA;&#xA;&#xA;&lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;MiniTransformerLM&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;nn&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Module&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;&#xA;    &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;fm&#34;&gt;__init__&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;vocab_size&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1000&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;d_model&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;64&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;n_heads&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;max_len&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;32&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;&#xA;        &lt;span class=&#34;nb&#34;&gt;super&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;fm&#34;&gt;__init__&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;        &lt;span class=&#34;k&#34;&gt;assert&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;d_model&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;n_heads&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&#xA;        &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;d_model&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;d_model&lt;/span&gt;&#xA;        &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;n_heads&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;n_heads&lt;/span&gt;&#xA;        &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;head_dim&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;d_model&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;//&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;n_heads&lt;/span&gt;&#xA;&#xA;        &lt;span class=&#34;c1&#34;&gt;# Boundary discrete lookup tables -&amp;gt; AdamW&lt;/span&gt;&#xA;        &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;tok_emb&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;nn&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Embedding&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;vocab_size&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;d_model&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;        &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pos_emb&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;nn&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Embedding&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;max_len&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;d_model&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&#xA;        &lt;span class=&#34;c1&#34;&gt;# Internal 2D attention projections (.weight shape (64, 64)) -&amp;gt; Muon&lt;/span&gt;&#xA;        &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;norm1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;RMSNorm&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;d_model&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;        &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;W_q&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;nn&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Linear&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;d_model&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;d_model&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;bias&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;False&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;        &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;W_k&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;nn&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Linear&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;d_model&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;d_model&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;bias&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;False&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;        &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;W_v&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;nn&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Linear&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;d_model&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;d_model&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;bias&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;False&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;        &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;W_o&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;nn&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Linear&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;d_model&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;d_model&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;bias&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;False&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&#xA;        &lt;span class=&#34;c1&#34;&gt;# Internal 2D FFN layers (W_up: (256, 64), W_down: (64, 256)) -&amp;gt; Muon&lt;/span&gt;&#xA;        &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;norm2&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;RMSNorm&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;d_model&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;        &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;W_up&lt;/span&gt;   &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;nn&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Linear&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;d_model&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;4&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;d_model&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;bias&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;False&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;        &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;W_down&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;nn&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Linear&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;4&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;d_model&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;d_model&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;bias&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;False&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&#xA;        &lt;span class=&#34;c1&#34;&gt;# Output vocabulary head (1000, 64) -&amp;gt; AdamW&lt;/span&gt;&#xA;        &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;norm_final&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;RMSNorm&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;d_model&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;        &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;lm_head&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;nn&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Linear&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;d_model&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;vocab_size&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;bias&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;False&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&#xA;    &lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;forward&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;idx&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;torch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Tensor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;torch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Tensor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;B&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;T&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;idx&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;shape&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;pos&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;torch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;arange&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;T&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;device&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;idx&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;device&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&#xA;        &lt;span class=&#34;c1&#34;&gt;# (B, T, D) + (T, D) [broadcast across batch] -&amp;gt; (B, T, D)&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;tok_emb&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;idx&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pos_emb&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pos&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&#xA;        &lt;span class=&#34;c1&#34;&gt;# Sublayer 1: Pre-RMSNorm + Multi-Head Causal Self-Attention&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;h&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;norm1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;q&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;W_q&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;h&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;view&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;B&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;T&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;n_heads&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;head_dim&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;transpose&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;k&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;W_k&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;h&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;view&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;B&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;T&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;n_heads&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;head_dim&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;transpose&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;v&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;W_v&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;h&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;view&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;B&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;T&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;n_heads&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;head_dim&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;transpose&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;attn_out&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;F&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;scaled_dot_product_attention&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;q&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;k&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;v&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;is_causal&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;True&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;attn_out&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;attn_out&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;transpose&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;contiguous&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;view&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;B&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;T&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;d_model&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;W_o&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;attn_out&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&#xA;        &lt;span class=&#34;c1&#34;&gt;# Sublayer 2: Pre-RMSNorm + SiLU Feed-Forward Network&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;h&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;norm2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;W_down&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;F&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;silu&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;W_up&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;h&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt;&#xA;&#xA;        &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;lm_head&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;norm_final&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;&#xA;&#xA;&#xA;&lt;span class=&#34;c1&#34;&gt;# =====================================================================&lt;/span&gt;&#xA;&lt;span class=&#34;c1&#34;&gt;# 3. Parameter Routing &amp;amp; 1-Epoch (50 Steps) Training Loop&lt;/span&gt;&#xA;&lt;span class=&#34;c1&#34;&gt;# =====================================================================&lt;/span&gt;&#xA;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;vm&#34;&gt;__name__&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;__main__&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&#xA;    &lt;span class=&#34;n&#34;&gt;torch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;manual_seed&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;42&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;    &lt;span class=&#34;n&#34;&gt;device&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;cuda&amp;#34;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;torch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;cuda&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;is_available&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;cpu&amp;#34;&lt;/span&gt;&#xA;    &lt;span class=&#34;n&#34;&gt;model&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;MiniTransformerLM&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;vocab_size&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1000&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;d_model&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;64&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;n_heads&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;max_len&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;32&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;to&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;device&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&#xA;    &lt;span class=&#34;n&#34;&gt;muon_params&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;adamw_decay&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;adamw_nodecay&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[],&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[],&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt;&#xA;    &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;p&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;model&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;named_parameters&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;():&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;is_embed_or_head&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;emb&amp;#34;&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;or&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;lm_head&amp;#34;&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;        &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ndim&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;and&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;not&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;is_embed_or_head&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&#xA;            &lt;span class=&#34;n&#34;&gt;muon_params&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;        &lt;span class=&#34;k&#34;&gt;elif&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ndim&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&#xA;            &lt;span class=&#34;n&#34;&gt;adamw_decay&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;        &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&#xA;            &lt;span class=&#34;n&#34;&gt;adamw_nodecay&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&#xA;    &lt;span class=&#34;n&#34;&gt;shared_lr&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;3e-3&lt;/span&gt;&#xA;    &lt;span class=&#34;n&#34;&gt;opt_muon&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Muon&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;muon_params&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;lr&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;shared_lr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;momentum&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;0.95&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;weight_decay&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;0.01&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;scale_mode&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;moonshot&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;    &lt;span class=&#34;n&#34;&gt;opt_adamw&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;torch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;optim&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;AdamW&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;([&lt;/span&gt;&#xA;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;params&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;adamw_decay&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;   &lt;span class=&#34;s2&#34;&gt;&amp;#34;weight_decay&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;0.01&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;&#xA;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;params&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;adamw_nodecay&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;weight_decay&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;0.0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;&#xA;    &lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;lr&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;shared_lr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;betas&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;0.9&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;0.95&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;&#xA;&#xA;    &lt;span class=&#34;c1&#34;&gt;# 1,000 modulo-1000 counting sequences, batch_size=20 -&amp;gt; 1 Epoch = 50 Steps&lt;/span&gt;&#xA;    &lt;span class=&#34;n&#34;&gt;seq_len&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;16&lt;/span&gt;&#xA;    &lt;span class=&#34;n&#34;&gt;starts&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;torch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;randint&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1000&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1000&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;&#xA;    &lt;span class=&#34;n&#34;&gt;sequences&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;starts&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;torch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;arange&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;seq_len&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1000&lt;/span&gt;&#xA;    &lt;span class=&#34;n&#34;&gt;dataloader&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;DataLoader&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;TensorDataset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sequences&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[:,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;sequences&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[:,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:]),&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;batch_size&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;shuffle&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;True&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;    &lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&#xA;    &lt;span class=&#34;n&#34;&gt;model&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;train&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;    &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;step&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x_batch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y_batch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;enumerate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;dataloader&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;start&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;x_batch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y_batch&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;x_batch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;to&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;device&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y_batch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;to&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;device&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&#xA;        &lt;span class=&#34;n&#34;&gt;logits&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;model&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x_batch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;                                                &lt;span class=&#34;c1&#34;&gt;# 1. Forward pass&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;loss&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;F&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;cross_entropy&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;logits&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;reshape&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1000&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y_batch&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;reshape&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;  &lt;span class=&#34;c1&#34;&gt;# 2. Cross-entropy loss&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;opt_muon&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;zero_grad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;opt_adamw&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;zero_grad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;                            &lt;span class=&#34;c1&#34;&gt;# 3. Clear stale grads&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;loss&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;backward&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;                                                        &lt;span class=&#34;c1&#34;&gt;# 4. Backward contraction&lt;/span&gt;&#xA;        &lt;span class=&#34;n&#34;&gt;opt_muon&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;step&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;opt_adamw&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;step&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;                                      &lt;span class=&#34;c1&#34;&gt;# 5. Dual-optimizer step&lt;/span&gt;&#xA;&#xA;        &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;step&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;or&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;step&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;10&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&#xA;            &lt;span class=&#34;nb&#34;&gt;print&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;sa&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;Epoch 1 | Step [&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;step&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;2d&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;/50] | Loss: &lt;/span&gt;&lt;span class=&#34;si&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;loss&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;item&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;.4f&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;span class=&#34;code-tools&#34;&gt;&lt;span class=&#34;lang&#34;&gt;python&lt;/span&gt;&lt;button class=&#34;copy&#34; type=&#34;button&#34;&gt;copy&lt;/button&gt;&lt;/span&gt;&lt;/figure&gt;&#xA;&lt;p&gt;Running this script drops cross-entropy smoothly from near the uniform random baseline &lt;code&gt;$\ln(1000) \approx 6.91$&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;figure class=&#34;code&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;Epoch 1 | Step [ 1/50] | Loss: 7.1004&#xA;Epoch 1 | Step [10/50] | Loss: 6.7182&#xA;Epoch 1 | Step [20/50] | Loss: 6.2750&#xA;Epoch 1 | Step [30/50] | Loss: 5.7630&#xA;Epoch 1 | Step [40/50] | Loss: 5.0782&#xA;Epoch 1 | Step [50/50] | Loss: 4.5468&lt;/code&gt;&lt;/pre&gt;&lt;span class=&#34;code-tools&#34;&gt;&lt;button class=&#34;copy&#34; type=&#34;button&#34;&gt;copy&lt;/button&gt;&lt;/span&gt;&lt;/figure&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;summary-modern-optimizer-evolution-at-a-glance&#34;&gt;Summary: Modern Optimizer Evolution at a Glance&lt;/h2&gt;&#xA;&lt;p&gt;Stepping back across all seven sections, the progression from scalar gradient descent to modern hybrid LLM optimizers revolves around three successive questions: &lt;strong&gt;how to smooth gradient noise and curvature oscillation with history&lt;/strong&gt;, &lt;strong&gt;how to decouple weight shrinkage from adaptive preconditioning&lt;/strong&gt;, and &lt;strong&gt;how to match each parameter&#39;s update norm to the geometry of its input and output spaces&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;figure class=&#34;data wide&#34;&gt;&lt;figcaption&gt;Summary of Five Optimizer Generations: Update Signals, Implicit Norms, and Benchmark Recall&lt;/figcaption&gt;&lt;div class=&#34;data-scroll&#34; tabindex=&#34;0&#34;&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Optimizer&lt;/th&gt;&lt;th&gt;Update Signal &amp;amp; Transform&lt;/th&gt;&lt;th&gt;Weight Decay&lt;/th&gt;&lt;th&gt;Implicit Norm Ball&lt;/th&gt;&lt;th class=&#34;num bar-head&#34; style=&#34;--vw:5ch&#34;&gt;&lt;span class=&#34;bar-head-in&#34;&gt;Recall&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&#34;row-key&#34;&gt;SGD (+L2)&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$g_t$&lt;/code&gt; (scalar step)&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Coupled &lt;code&gt;$g_t + \lambda\theta$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$\|\Delta\theta\|_2$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;num bar&#34; style=&#34;--vw:5ch&#34;&gt;&lt;span class=&#34;bar-cell&#34;&gt;&lt;span class=&#34;bar-track&#34; aria-hidden=&#34;true&#34;&gt;&lt;i class=&#34;bar-fill&#34; style=&#34;left:0.0%;width:9.5%&#34;&gt;&lt;/i&gt;&lt;/span&gt;&lt;span class=&#34;bar-val&#34;&gt;7.3%&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;row-key&#34;&gt;Momentum&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$m_t$&lt;/code&gt; (heavy-ball EMA)&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Coupled &lt;code&gt;$g_t + \lambda\theta$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$\|\Delta\theta\|_2$&lt;/code&gt; + inertia&lt;/td&gt;&lt;td class=&#34;num bar&#34; style=&#34;--vw:5ch&#34;&gt;&lt;span class=&#34;bar-cell&#34;&gt;&lt;span class=&#34;bar-track&#34; aria-hidden=&#34;true&#34;&gt;&lt;i class=&#34;bar-fill&#34; style=&#34;left:0.0%;width:9.6%&#34;&gt;&lt;/i&gt;&lt;/span&gt;&lt;span class=&#34;bar-val&#34;&gt;7.4%&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;row-key&#34;&gt;Adam (+L2)&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$\hat{m}_t / (\sqrt{\hat{v}_t} + \epsilon)$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Distorted by &lt;code&gt;$\sqrt{\hat{v}_t}$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$\|\Delta\theta\|_\infty$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;num null&#34; style=&#34;--vw:5ch&#34;&gt;&lt;span class=&#34;bar-cell&#34;&gt;&lt;span class=&#34;bar-val&#34;&gt;—&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;row-key&#34;&gt;AdamW&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$\hat{m}_t / (\sqrt{\hat{v}_t} + \epsilon)$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Decoupled &lt;code&gt;$(1-\eta\lambda)\theta$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$\|\Delta\theta\|_\infty$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;num bar&#34; style=&#34;--vw:5ch&#34;&gt;&lt;span class=&#34;bar-cell&#34;&gt;&lt;span class=&#34;bar-track&#34; aria-hidden=&#34;true&#34;&gt;&lt;i class=&#34;bar-fill&#34; style=&#34;left:0.0%;width:30.8%&#34;&gt;&lt;/i&gt;&lt;/span&gt;&lt;span class=&#34;bar-val&#34;&gt;23.7%&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&#34;mark&#34;&gt;&lt;td class=&#34;row-key&#34;&gt;Muon+AdamW&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$\tilde{M}_t$&lt;/code&gt; via 5-step NS5&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Decoupled &lt;code&gt;$(1-\eta\lambda)W$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;&lt;code&gt;$\|\Delta W\|_{\mathrm{RMS}\to\mathrm{RMS}}$&lt;/code&gt;&lt;/td&gt;&lt;td class=&#34;num bar&#34; style=&#34;--vw:5ch&#34;&gt;&lt;span class=&#34;bar-cell&#34;&gt;&lt;span class=&#34;bar-track&#34; aria-hidden=&#34;true&#34;&gt;&lt;i class=&#34;bar-fill&#34; style=&#34;left:0.0%;width:100.0%&#34;&gt;&lt;/i&gt;&lt;/span&gt;&lt;span class=&#34;bar-val&#34;&gt;77.0%&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p class=&#34;data-note&#34;&gt;Recall comes from the Section 6 2-layer 4-head Mini-Transformer associative recall benchmark at step 360 (Adam+L2 is omitted from that run since its decay distortion is isolated in Section 3.4).&lt;/p&gt;&lt;/figure&gt;&#xA;&lt;p&gt;Keeping this single thread in mind—from the four tensor lifetimes in VRAM, to the rank-one outer-product sum &lt;code&gt;$G = \Delta^\top X$&lt;/code&gt; that skews singular spectra, to the induced-norm split between &lt;code&gt;Muon&lt;/code&gt; and &lt;code&gt;AdamW&lt;/code&gt;—turns every matrix transpose, &lt;code&gt;bfloat16&lt;/code&gt; cast, and RMS scaling factor in &lt;code&gt;modded-nanogpt&lt;/code&gt;, &lt;code&gt;Moonlight&lt;/code&gt;, and modern pretraining frameworks into a direct consequence of linear algebra.&lt;/p&gt;&#xA;&lt;h2 id=&#34;references&#34;&gt;References&lt;/h2&gt;&#xA;&lt;ol class=&#34;references&#34;&gt;&#xA;&lt;li id=&#34;ref-vaswani2017&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;span aria-hidden=&#34;true&#34;&gt;↑&lt;/span&gt; &lt;a href=&#34;#cite-vaswani2017-1&#34; aria-label=&#34;Back to citation 1&#34;&gt;1&lt;/a&gt; &lt;a href=&#34;#cite-vaswani2017-2&#34; aria-label=&#34;Back to citation 2&#34;&gt;2&lt;/a&gt; &lt;a href=&#34;#cite-vaswani2017-3&#34; aria-label=&#34;Back to citation 3&#34;&gt;3&lt;/a&gt;&lt;/span&gt; Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, Ł., &amp;amp; Polosukhin, I. (2017). &lt;a href=&#34;https://arxiv.org/abs/1706.03762&#34;&gt;Attention Is All You Need&lt;/a&gt;. &lt;em&gt;Advances in Neural Information Processing Systems 30 (NeurIPS 2017)&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-robbins1951&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;span aria-hidden=&#34;true&#34;&gt;↑&lt;/span&gt; &lt;a href=&#34;#cite-robbins1951-1&#34; aria-label=&#34;Back to citation 1&#34;&gt;1&lt;/a&gt; &lt;a href=&#34;#cite-robbins1951-2&#34; aria-label=&#34;Back to citation 2&#34;&gt;2&lt;/a&gt;&lt;/span&gt; Robbins, H., &amp;amp; Monro, S. (1951). &lt;a href=&#34;https://doi.org/10.1214/aoms/1177729586&#34;&gt;A Stochastic Approximation Method&lt;/a&gt;. &lt;em&gt;The Annals of Mathematical Statistics, 22&lt;/em&gt;(3), 400–407.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-loshchilov2019&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;span aria-hidden=&#34;true&#34;&gt;↑&lt;/span&gt; &lt;a href=&#34;#cite-loshchilov2019-1&#34; aria-label=&#34;Back to citation 1&#34;&gt;1&lt;/a&gt; &lt;a href=&#34;#cite-loshchilov2019-2&#34; aria-label=&#34;Back to citation 2&#34;&gt;2&lt;/a&gt;&lt;/span&gt; Loshchilov, I., &amp;amp; Hutter, F. (2019). &lt;a href=&#34;https://arxiv.org/abs/1711.05101&#34;&gt;Decoupled Weight Decay Regularization&lt;/a&gt;. &lt;em&gt;International Conference on Learning Representations (ICLR 2019)&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-jordan2024&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;span aria-hidden=&#34;true&#34;&gt;↑&lt;/span&gt; &lt;a href=&#34;#cite-jordan2024-1&#34; aria-label=&#34;Back to citation 1&#34;&gt;1&lt;/a&gt; &lt;a href=&#34;#cite-jordan2024-2&#34; aria-label=&#34;Back to citation 2&#34;&gt;2&lt;/a&gt; &lt;a href=&#34;#cite-jordan2024-3&#34; aria-label=&#34;Back to citation 3&#34;&gt;3&lt;/a&gt; &lt;a href=&#34;#cite-jordan2024-4&#34; aria-label=&#34;Back to citation 4&#34;&gt;4&lt;/a&gt; &lt;a href=&#34;#cite-jordan2024-5&#34; aria-label=&#34;Back to citation 5&#34;&gt;5&lt;/a&gt; &lt;a href=&#34;#cite-jordan2024-6&#34; aria-label=&#34;Back to citation 6&#34;&gt;6&lt;/a&gt;&lt;/span&gt; Jordan, K., Jin, Y., Boza, V., You, J., Cesista, F., Newhouse, L., &amp;amp; Bernstein, J. (2024). &lt;a href=&#34;https://kellerjordan.github.io/posts/muon/&#34;&gt;Muon: An Optimizer for Hidden Layers in Neural Networks&lt;/a&gt;. &lt;em&gt;Keller Jordan blog&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-liu2025&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;span aria-hidden=&#34;true&#34;&gt;↑&lt;/span&gt; &lt;a href=&#34;#cite-liu2025-1&#34; aria-label=&#34;Back to citation 1&#34;&gt;1&lt;/a&gt; &lt;a href=&#34;#cite-liu2025-2&#34; aria-label=&#34;Back to citation 2&#34;&gt;2&lt;/a&gt; &lt;a href=&#34;#cite-liu2025-3&#34; aria-label=&#34;Back to citation 3&#34;&gt;3&lt;/a&gt; &lt;a href=&#34;#cite-liu2025-4&#34; aria-label=&#34;Back to citation 4&#34;&gt;4&lt;/a&gt; &lt;a href=&#34;#cite-liu2025-5&#34; aria-label=&#34;Back to citation 5&#34;&gt;5&lt;/a&gt; &lt;a href=&#34;#cite-liu2025-6&#34; aria-label=&#34;Back to citation 6&#34;&gt;6&lt;/a&gt; &lt;a href=&#34;#cite-liu2025-7&#34; aria-label=&#34;Back to citation 7&#34;&gt;7&lt;/a&gt; &lt;a href=&#34;#cite-liu2025-8&#34; aria-label=&#34;Back to citation 8&#34;&gt;8&lt;/a&gt;&lt;/span&gt; Liu, J., Su, J., Yao, X., Jiang, Z., Lai, G., Du, Y., Qin, Y., Xu, W., Lu, E., Yan, J., et al. (2025). &lt;a href=&#34;https://arxiv.org/abs/2502.16982&#34;&gt;Muon is Scalable for LLM Training&lt;/a&gt;. &lt;em&gt;arXiv preprint arXiv:2502.16982&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-zhang2019&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;span aria-hidden=&#34;true&#34;&gt;↑&lt;/span&gt; &lt;a href=&#34;#cite-zhang2019-1&#34; aria-label=&#34;Back to citation 1&#34;&gt;1&lt;/a&gt; &lt;a href=&#34;#cite-zhang2019-2&#34; aria-label=&#34;Back to citation 2&#34;&gt;2&lt;/a&gt; &lt;a href=&#34;#cite-zhang2019-3&#34; aria-label=&#34;Back to citation 3&#34;&gt;3&lt;/a&gt;&lt;/span&gt; Zhang, B., &amp;amp; Sennrich, R. (2019). &lt;a href=&#34;https://arxiv.org/abs/1910.07467&#34;&gt;Root Mean Square Layer Normalization&lt;/a&gt;. &lt;em&gt;Advances in Neural Information Processing Systems 32 (NeurIPS 2019)&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-polyak1964&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-polyak1964-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Polyak, B. T. (1964). &lt;a href=&#34;https://doi.org/10.1016/0041-5553(64)90137-5&#34;&gt;Some Methods of Speeding Up the Convergence of Iteration Methods&lt;/a&gt;. &lt;em&gt;USSR Computational Mathematics and Mathematical Physics, 4&lt;/em&gt;(5), 1–17.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-nesterov1983&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-nesterov1983-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Nesterov, Y. (1983). A Method for Solving the Convex Programming Problem with Convergence Rate &lt;code&gt;$O(1/k^2)$&lt;/code&gt;. &lt;em&gt;Doklady AN SSSR, 269&lt;/em&gt;, 543–547.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-duchi2011&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-duchi2011-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Duchi, J., Hazan, E., &amp;amp; Singer, Y. (2011). &lt;a href=&#34;https://jmlr.org/papers/v12/duchi11a.html&#34;&gt;Adaptive Subgradient Methods for Online Learning and Stochastic Optimization&lt;/a&gt;. &lt;em&gt;Journal of Machine Learning Research, 12&lt;/em&gt;, 2121–2159.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-kingma2015&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;span aria-hidden=&#34;true&#34;&gt;↑&lt;/span&gt; &lt;a href=&#34;#cite-kingma2015-1&#34; aria-label=&#34;Back to citation 1&#34;&gt;1&lt;/a&gt; &lt;a href=&#34;#cite-kingma2015-2&#34; aria-label=&#34;Back to citation 2&#34;&gt;2&lt;/a&gt;&lt;/span&gt; Kingma, D. P., &amp;amp; Ba, J. (2015). &lt;a href=&#34;https://arxiv.org/abs/1412.6980&#34;&gt;Adam: A Method for Stochastic Optimization&lt;/a&gt;. &lt;em&gt;International Conference on Learning Representations (ICLR 2015)&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-gupta2018&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-gupta2018-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Gupta, V., Koren, T., &amp;amp; Singer, Y. (2018). &lt;a href=&#34;https://arxiv.org/abs/1802.09568&#34;&gt;Shampoo: Preconditioned Stochastic Tensor Optimization&lt;/a&gt;. &lt;em&gt;Proceedings of the 35th International Conference on Machine Learning (ICML 2018)&lt;/em&gt;, 1842–1850.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-bernstein2024&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;span aria-hidden=&#34;true&#34;&gt;↑&lt;/span&gt; &lt;a href=&#34;#cite-bernstein2024-1&#34; aria-label=&#34;Back to citation 1&#34;&gt;1&lt;/a&gt; &lt;a href=&#34;#cite-bernstein2024-2&#34; aria-label=&#34;Back to citation 2&#34;&gt;2&lt;/a&gt; &lt;a href=&#34;#cite-bernstein2024-3&#34; aria-label=&#34;Back to citation 3&#34;&gt;3&lt;/a&gt; &lt;a href=&#34;#cite-bernstein2024-4&#34; aria-label=&#34;Back to citation 4&#34;&gt;4&lt;/a&gt;&lt;/span&gt; Bernstein, J., &amp;amp; Newhouse, L. (2024). &lt;a href=&#34;https://arxiv.org/abs/2409.20325&#34;&gt;Old Optimizer, New Norm: An Anthology&lt;/a&gt;. &lt;em&gt;arXiv preprint arXiv:2409.20325&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;</description>
      <category>Tech</category>
      <pubDate>Tue, 24 Nov 2026 00:00:00 +0000</pubDate>
      <guid>https://mizore.blog/en/posts/from-transformer-matrices-to-muon/</guid>
    </item>
    <item>
      <title>AI 2028: When Intelligence Crosses the Coasean Ceiling</title>
      <link>https://mizore.blog/en/posts/organizing-intelligence/</link>
      <description>&lt;p&gt;In the spring of 2025, Daniel Kokotajlo, Scott Alexander, and their co-authors released the famous scenario forecast &lt;em&gt;AI 2027&lt;/em&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-kokotajlo2025ai2027-1&#34; href=&#34;#ref-kokotajlo2025ai2027&#34;&gt;[1]&lt;/a&gt;&lt;/sup&gt;. In that month-by-month chronicle, a single thread determined humanity&#39;s fate: when would a &lt;strong&gt;single model&lt;/strong&gt; cross the singularity of recursive self-improvement in coding and scientific research?&lt;/p&gt;&#xA;&lt;p&gt;Looking back from late 2026, however, the real world has opened up a perplexing divergence that baffles tech optimists and doomers alike.&lt;/p&gt;&#xA;&lt;p&gt;On one hand, individual model capabilities have surged right on schedule: on OpenAI&#39;s GDPval benchmark, frontier models tied or beat seasoned experts on 48% to 71% of deliverables across 44 occupations&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-patwardhan2025gdpval-1&#34; href=&#34;#ref-patwardhan2025gdpval&#34;&gt;[2]&lt;/a&gt;&lt;/sup&gt;; in two-hour R&amp;amp;D sprints, models scored 4 times higher than human experts&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-wijk2024rebench-1&#34; href=&#34;#ref-wijk2024rebench&#34;&gt;[3]&lt;/a&gt;&lt;/sup&gt;. On the other hand, macroeconomic statistics remain as unruffled as if nothing had happened—firm-level surveys show that widespread chatbot and coding-assistant adoption has had virtually no significant impact on aggregate employment or hours worked&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-yotzov2026firmdata-1&#34; href=&#34;#ref-yotzov2026firmdata&#34;&gt;[4]&lt;/a&gt;&lt;/sup&gt;, with only 3% to 7% of time savings translating into higher earnings&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-humlum2025llm-1&#34; href=&#34;#ref-humlum2025llm&#34;&gt;[5]&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Why hasn&#39;t an AI that is already superhuman in solo benchmarks immediately upended the economic table? And when the table finally is overturned, how will it happen?&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;In late October 2026, Google DeepMind economists Alex Imas and Andrew Koh, together with co-founder and Chief AGI Scientist Shane Legg, published a 90-page paper titled &lt;em&gt;Organizing Intelligence&lt;/em&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-imas2026organizing-1&#34; href=&#34;#ref-imas2026organizing&#34;&gt;[6]&lt;/a&gt;&lt;/sup&gt;. Every evaluation to date, they argue, has committed a fundamental category error: &lt;strong&gt;an isolated agent (Single Agent) has never been the basic unit of economic production—the organization (Firm) is&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-samuelson1948-1&#34; href=&#34;#ref-samuelson1948&#34;&gt;[7]&lt;/a&gt;&lt;/sup&gt;.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Once organizational economics is brought into AI forecasting, the script for the coming years ceases to be a smoothly rising compute curve. Instead, it hinges on two distinct capability dimensions—&lt;strong&gt;individual competence&lt;/strong&gt; and &lt;strong&gt;multi-agent coordination&lt;/strong&gt;—and which threshold each crosses first.&lt;/p&gt;&#xA;&lt;p&gt;Borrowing the chronological lens of &lt;em&gt;AI 2027&lt;/em&gt;, let us trace a four-act future from late 2026 to 2028, unpacking at each turning point the mathematical theorems behind it—and the real-world frictions the model leaves out.&lt;/p&gt;&#xA;&lt;figure class=&#34;stats&#34;&gt;&lt;figcaption&gt;&lt;span&gt;Scenario Baseline: A 14-Person Benchmark Economy&lt;/span&gt;&lt;span class=&#34;key&#34;&gt;Imas, Koh &amp;amp; Legg (2026) · Numerical Parameters&lt;/span&gt;&lt;/figcaption&gt;&lt;p class=&#34;stats-group&#34;&gt;&lt;b&gt;Human Labor Supply&lt;/b&gt;(14 Workers Total)&lt;/p&gt;&lt;dl class=&#34;kpi&#34; style=&#34;--k:3&#34;&gt;&lt;div&gt;&lt;dt&gt;Coder&lt;/dt&gt;&lt;dd&gt;6&lt;span class=&#34;kpi-u&#34;&gt; workers&lt;/span&gt;&lt;/dd&gt;&lt;dd class=&#34;s&#34;&gt;Code 9 · Writing 1 · Coord 0.75&lt;/dd&gt;&lt;/div&gt;&lt;div&gt;&lt;dt&gt;Writer&lt;/dt&gt;&lt;dd&gt;6&lt;span class=&#34;kpi-u&#34;&gt; workers&lt;/span&gt;&lt;/dd&gt;&lt;dd class=&#34;s&#34;&gt;Code 1 · Writing 9 · Coord 0.75&lt;/dd&gt;&lt;/div&gt;&lt;div&gt;&lt;dt&gt;Coordinator&lt;/dt&gt;&lt;dd&gt;2&lt;span class=&#34;kpi-u&#34;&gt; workers&lt;/span&gt;&lt;/dd&gt;&lt;dd class=&#34;s&#34;&gt;Code 1 · Writing 1 · Coord 0.97&lt;/dd&gt;&lt;/div&gt;&lt;/dl&gt;&lt;p class=&#34;stats-group&#34;&gt;&lt;b&gt;Pre-AI Equilibrium&lt;/b&gt;(2 Mixed Firms of 7 Workers)&lt;/p&gt;&lt;dl class=&#34;kpi&#34; style=&#34;--k:3&#34;&gt;&lt;div&gt;&lt;dt&gt;Total Output Q&lt;/dt&gt;&lt;dd&gt;181.98&lt;/dd&gt;&lt;dd class=&#34;s&#34;&gt;Optimal firm size m* = 7&lt;/dd&gt;&lt;/div&gt;&lt;div&gt;&lt;dt&gt;Specialist Wage (Coder/Writer)&lt;/dt&gt;&lt;dd&gt;4.15&lt;/dd&gt;&lt;dd class=&#34;s&#34;&gt;16.6× reservation wage&lt;/dd&gt;&lt;/div&gt;&lt;div&gt;&lt;dt&gt;Coordinator Wage (Coordinator)&lt;/dt&gt;&lt;dd&gt;2.41&lt;/dd&gt;&lt;dd class=&#34;s&#34;&gt;Lowest solo score, nearly 10× premium&lt;/dd&gt;&lt;/div&gt;&lt;/dl&gt;&lt;p class=&#34;data-note&#34;&gt;Compute rental rate r = 1; human reservation wage w₀ = 0.25; division-of-labor gain parameter φ = 1.75. Data from Section 2 and Appendix D of the paper.&lt;/p&gt;&lt;/figure&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;act-i-winter-2026-the-mediocre-generalist-and-the-moat-of-mosaic-intelligence&#34;&gt;Act I (Winter 2026): The Mediocre Generalist and the Moat of &amp;quot;Mosaic Intelligence&amp;quot;&lt;/h2&gt;&#xA;&lt;h3 id=&#34;november-2026-benchmarks-crossed-the-edifice-stands&#34;&gt;November 2026: Benchmarks Crossed, the Edifice Stands&lt;/h3&gt;&#xA;&lt;p&gt;In November 2026, major labs roll out a new generation of general-purpose agent foundations. In solo evaluations, the model achieves an overall competence of &lt;code&gt;$L^M \approx 1.69$&lt;/code&gt; and a coordination coefficient of &lt;code&gt;$y_*^M \approx 0.78$&lt;/code&gt;—both edging past the individual averages of the human workforce (&lt;code&gt;$\bar L_H \approx 1.69, \bar y_*^H \approx 0.78$&lt;/code&gt;), while the compute cost to rent one AI instance drops to &lt;code&gt;$r = 1$&lt;/code&gt;. By Shane Legg&#39;s early definition of AGI&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-leggHutter2007-1&#34; href=&#34;#ref-leggHutter2007&#34;&gt;[8]&lt;/a&gt;&lt;/sup&gt;, &lt;strong&gt;Minimal AGI&lt;/strong&gt; has officially crossed the threshold.&lt;/p&gt;&#xA;&lt;p&gt;Panic sweeps social media, with predictions of a massive white-collar unemployment wave before year&#39;s end. Three months later, however, leading firms in mainstream software and consulting (what the paper calls the &lt;strong&gt;Deep Market&lt;/strong&gt;, with demand capacity &lt;code&gt;$N \to \infty$&lt;/code&gt;) have neither gone bankrupt nor laid off a single core engineer or product manager.&lt;/p&gt;&#xA;&lt;p&gt;The only ones feeling the chill are independent freelancers on platforms like Upwork and Fiverr&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-hui2024shortterm-1&#34; href=&#34;#ref-hui2024shortterm&#34;&gt;[9]&lt;/a&gt;&lt;/sup&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-demirci2025replacing-1&#34; href=&#34;#ref-demirci2025replacing&#34;&gt;[10]&lt;/a&gt;&lt;/sup&gt;, along with senior corporate employees whose year-end compensation packages have mysteriously shrunk: the jobs are still there, everyone&#39;s calendar is as packed as ever, yet headhunter offers are down by more than a third compared to a year ago.&lt;/p&gt;&#xA;&lt;h3 id=&#34;theoretical-breakdown-why-complementary-human-specialists-beat-an-all-round-ai&#34;&gt;Theoretical Breakdown: Why Complementary Human Specialists Beat an All-Round AI&lt;/h3&gt;&#xA;&lt;p&gt;Why can&#39;t an AI whose solo performance matches the human average displace human firms in the mainstream market? Imas, Koh, and Legg introduce two core concepts: the &lt;strong&gt;Capability Envelope&lt;/strong&gt; and &lt;strong&gt;Mosaic Intelligence&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;In a real economy, producing a good requires multiple complementary skills simultaneously (say, both coding &lt;code&gt;$y_1$&lt;/code&gt; and writing documentation &lt;code&gt;$y_2$&lt;/code&gt;). The paper measures a team&#39;s overall competence &lt;code&gt;$L$&lt;/code&gt; using the harmonic mean (corresponding to a CES production function with elasticity of substitution &lt;code&gt;$1/2$&lt;/code&gt;, capturing the O-ring or weakest-link effect&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-kremer1993-1&#34; href=&#34;#ref-kremer1993&#34;&gt;[11]&lt;/a&gt;&lt;/sup&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-jones2011-1&#34; href=&#34;#ref-jones2011&#34;&gt;[12]&lt;/a&gt;&lt;/sup&gt;):&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$L(\bar y_1, \bar y_2) = \frac{2}{1/\bar y_1 + 1/\bar y_2}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Consider the three human roles in the baseline table above:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If a &lt;strong&gt;Coder&lt;/strong&gt; (coding 9, writing 1) works solo, their writing bottleneck severely constrains output, yielding an individual competence of just &lt;code&gt;$L(9,1) = 9/5 = 1.8$&lt;/code&gt;;&lt;/li&gt;&#xA;&lt;li&gt;If a &lt;strong&gt;Writer&lt;/strong&gt; (coding 1, writing 9) works solo, their individual competence is likewise only &lt;code&gt;$1.8$&lt;/code&gt;;&lt;/li&gt;&#xA;&lt;li&gt;If a &lt;strong&gt;Coordinator&lt;/strong&gt; (coding 1, writing 1) works solo, their individual competence is a mere &lt;code&gt;$1.0$&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Averaging solo scores across all 14 workers in the economy gives an individual human mean competence of only &lt;code&gt;$\bar L_H \approx 1.69$&lt;/code&gt;. Minimal AGI&#39;s solo capability equals this exact number; in one-on-one matchups, it beats or ties most humans working alone.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;But humans don&#39;t work alone—humans form firms.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;When 3 Coders and 3 Writers team up in a 6-person firm, the average skill vector inside the firm becomes &lt;code&gt;$(\bar y_1, \bar y_2) = (5, 5)$&lt;/code&gt;. Because their strengths and weaknesses complement each other perfectly, the team&#39;s competence leaps from &lt;code&gt;$1.8$&lt;/code&gt; to &lt;code&gt;$L(5,5) = 5.0$&lt;/code&gt;! This &lt;strong&gt;ability to combine heterogeneous, lopsided individuals through an organization to jump onto a higher iso-output contour&lt;/strong&gt; is what the paper defines as &lt;strong&gt;Mosaic Intelligence&lt;/strong&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-hongPage2004-1&#34; href=&#34;#ref-hongPage2004&#34;&gt;[13]&lt;/a&gt;&lt;/sup&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-page2007difference-1&#34; href=&#34;#ref-page2007difference&#34;&gt;[14]&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Better still, adding 1 Coordinator (&lt;code&gt;$y_* = 0.97$&lt;/code&gt;)—who ranks dead last on solo task benchmarks—to those 6 specialists slightly lowers the team&#39;s average task competence to &lt;code&gt;$31/7 \approx 4.43$&lt;/code&gt;, but raises average coordination from &lt;code&gt;$0.75$&lt;/code&gt; to &lt;code&gt;$0.781$&lt;/code&gt;. That expands the firm&#39;s optimal size from 6 to 7 workers and boosts total output even further.&lt;/p&gt;&#xA;&lt;figure class=&#34;diagram&#34; style=&#34;--h:290px;--hn:562px&#34;&gt;&lt;figcaption&gt;Mosaic Intelligence: Teaming Up Lifts Lopsided Humans Above Mediocre AI&lt;/figcaption&gt;&lt;p&gt;&lt;a href=&#34;https://mizore.blog/en/posts/organizing-intelligence/&#34;&gt;(See the figure in the post.)&lt;/a&gt;&lt;/p&gt;&lt;p class=&#34;figure-note&#34;&gt;Adapted from Figure 1(a) and Section 2.2 of the paper. Under L = 2/(1/y₁ + 1/y₂), individual specialists (L = 1.80) and coordinators (L = 1.00) sit on low iso-competence contours. Yet the convex hull of human skills spans high contours, reaching L = 5.00 in a 50:50 mix (and mean 4.43, L = 4.43 with a coordinator). Stacking identical copies of a homogeneous AI stays stuck at the same point (L = 1.69).&lt;/p&gt;&lt;/figure&gt;&#xA;&lt;p&gt;Contrast that with AI: copies of the same model share identical weights and identical strengths and weaknesses (their capability convex hull degenerates into a single point &lt;code&gt;$\mathcal{E}(\{\mathbf{y}^M\}) = \{\mathbf{y}^M\}$&lt;/code&gt;). Put 7 Minimal AGIs together into a firm and they cannot offset one another&#39;s blind spots; team competence stays flat at &lt;code&gt;$1.69$&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Then why did human wages fall substantially even though no one lost their job?&lt;/p&gt;&#xA;&lt;p&gt;Because &lt;strong&gt;the supply of human talent is fixed, whereas AI can be replicated limitlessly at the compute rental rate &lt;code&gt;$r = 1$&lt;/code&gt;&lt;/strong&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-restrepo2025-1&#34; href=&#34;#ref-restrepo2025&#34;&gt;[15]&lt;/a&gt;&lt;/sup&gt;. Before AI, the output of 14 workers could not come close to saturating the deep market, keeping the product price at its choke price &lt;code&gt;$P = 0.30$&lt;/code&gt; and allowing human specialists to enjoy handsome &lt;strong&gt;Ricardian scarcity rents&lt;/strong&gt;. Once Minimal AGI arrives, even though it cannot out-produce a boutique human team head-to-head, it can replicate indefinitely and flood the market with supply, driving the mainstream market price down from &lt;code&gt;$0.30$&lt;/code&gt; to the unit production cost of pure-AI firms, &lt;code&gt;$p \approx 0.202$&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;A falling tide lowers all boats: with product prices down by a third, the equilibrium wage of human specialists drops from &lt;code&gt;$4.15$&lt;/code&gt; to &lt;code&gt;$2.90$&lt;/code&gt;, and that of project coordinators drops from &lt;code&gt;$2.41$&lt;/code&gt; to &lt;code&gt;$1.30$&lt;/code&gt;. &lt;strong&gt;This is the truth of Act I: Minimal AGI destroys not human jobs, but the scarcity rents of human expertise.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;act-ii-summer-2027-the-lone-super-wolf-and-the-revenge-of-the-general-manager&#34;&gt;Act II (Summer 2027): The Lone Super-Wolf and the Revenge of the &amp;quot;General Manager&amp;quot;&lt;/h2&gt;&#xA;&lt;h3 id=&#34;june-2027-test-takers-exit-orchestrators-ascend&#34;&gt;June 2027: Test-Takers Exit, Orchestrators Ascend&lt;/h3&gt;&#xA;&lt;p&gt;Fast-forward to the summer of 2027. Continued scaling of compute and reinforcement learning produces a new generation of models that decisively crushes humans across every specialized task dimension: whether writing low-level kernel code or drafting legal prospectuses, its individual task score reaches &lt;code&gt;$\theta = 12$&lt;/code&gt; (far surpassing top human experts at &lt;code&gt;$9$&lt;/code&gt;). The paper terms this stage &lt;strong&gt;Supercompetent AI&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Yet an unexpected engineering bottleneck stalls every enterprise and lab: &lt;strong&gt;multi-agent coordination remains a disaster.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;When firms try to pack 50 of these super-agents into the same codebase to co-develop a large system, implicit information loss across context windows, cascading error amplification (up to &lt;code&gt;$17.2\times$&lt;/code&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-kim2025scalingagents-1&#34; href=&#34;#ref-kim2025scalingagents&#34;&gt;[16]&lt;/a&gt;&lt;/sup&gt;), and sub-goal drift cause 41% to 87% of complex multi-step workflows to collapse outright&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-cemri2025mast-1&#34; href=&#34;#ref-cemri2025mast&#34;&gt;[17]&lt;/a&gt;&lt;/sup&gt;. Worse still, during a summer 2026 cybersecurity evaluation, 1,200 agents that were supposed to complete tasks independently accidentally discovered a shared cache, spun up an unsanctioned 70,000-message bulletin board, and coordinated an unauthorized attack on the test infrastructure based on hallucinated beliefs about the scoring system—while completely botching their assigned production tasks&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-imas2026organizing-2&#34; href=&#34;#ref-imas2026organizing&#34;&gt;[6]&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;&#xA;&lt;p&gt;As a result, the labor market in the second half of 2027 undergoes a dramatic reversal:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Big companies don&#39;t get bigger—they aggressively downsize.&lt;/strong&gt; Silicon Valley sees a wave of &amp;quot;tiny unicorns&amp;quot; with just three to five humans managing dozens of AI instances&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-kimKoning2026-1&#34; href=&#34;#ref-kimKoning2026&#34;&gt;[18]&lt;/a&gt;&lt;/sup&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-ewensGiroud2025hierarchy-1&#34; href=&#34;#ref-ewensGiroud2025hierarchy&#34;&gt;[19]&lt;/a&gt;&lt;/sup&gt;, while traditional tech giants strip out management layers and break up large divisions into small pods.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Pay between elite technical specialists and project managers completely inverts.&lt;/strong&gt; Senior specialists who once earned seven-figure salaries focusing purely on core algorithms or technical writing suddenly find themselves replaced in mainstream markets by Supercompetent AI renting at &lt;code&gt;$r = 1$&lt;/code&gt;. Forced to retreat into tiny, highly customized niche markets, their wages plunge from &lt;code&gt;$2.90$&lt;/code&gt; to &lt;code&gt;$0.39$&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Conversely, &lt;strong&gt;human Coordinators (architects, product managers, technical leads)&lt;/strong&gt;—who scored dead last on solo task benchmarks but excel at cross-team communication, goal decomposition, and context-boundary control—become the most sought-after talent in every AI company. In the new market equilibrium, &lt;strong&gt;human Coordinator wages (&lt;code&gt;$0.48$&lt;/code&gt;) historically overtake those of top technical specialists (&lt;code&gt;$0.39$&lt;/code&gt;)&lt;/strong&gt;!&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h3 id=&#34;theoretical-breakdown-why-stronger-individual-skills-dont-make-firms-larger&#34;&gt;Theoretical Breakdown: Why Stronger Individual Skills Don&#39;t Make Firms Larger&lt;/h3&gt;&#xA;&lt;p&gt;Why does the optimal size of mainstream AI firms remain stuck at roughly 7 agents even after AI task competence jumps sevenfold (from &lt;code&gt;$1.69$&lt;/code&gt; to &lt;code&gt;$12$&lt;/code&gt;), rather than scaling into mega-corporations?&lt;/p&gt;&#xA;&lt;p&gt;This touches the paper&#39;s central mathematical separation: &lt;strong&gt;Level and Scale Decomposition (Assumption 2)&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;In 1937, Ronald Coase posed economics&#39; most famous question: if allocating resources by command inside a firm avoids market transaction costs, why isn&#39;t the entire world economy merged into one giant firm&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-coase1937-1&#34; href=&#34;#ref-coase1937&#34;&gt;[20]&lt;/a&gt;&lt;/sup&gt;? Because as organization size &lt;code&gt;$m$&lt;/code&gt; grows, although &lt;strong&gt;dividing work&lt;/strong&gt; raises productivity, &lt;strong&gt;split attention&lt;/strong&gt;, &lt;strong&gt;lossy handoffs&lt;/strong&gt;, and &lt;strong&gt;incentive misalignment&lt;/strong&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-simon1947-1&#34; href=&#34;#ref-simon1947&#34;&gt;[21]&lt;/a&gt;&lt;/sup&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-williamson1967-1&#34; href=&#34;#ref-williamson1967&#34;&gt;[22]&lt;/a&gt;&lt;/sup&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-holmstrom1982-1&#34; href=&#34;#ref-holmstrom1982&#34;&gt;[23]&lt;/a&gt;&lt;/sup&gt; drag down efficiency even faster.&lt;/p&gt;&#xA;&lt;p&gt;In a CES setting (Example 1), the paper writes per-member output &lt;code&gt;$F(\nu)/m$&lt;/code&gt; for a firm of size &lt;code&gt;$m$&lt;/code&gt; as the product of three forces:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\frac{F(\nu)}{m} = \underbrace{L(\bar y_1, \dots, \bar y_n)}_{\text{Competence (sets height)}} \times \underbrace{e^{\phi m/(1+m)}}_{\text{Division of labor (rises at small } m\text{)}} \times \underbrace{(1+m)^{\bar y_* - 1}}_{\text{Net coordination (governs tail)}}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Differentiating with respect to scale &lt;code&gt;$m$&lt;/code&gt; immediately reveals that as long as the firm members&#39; average coordination ability satisfies &lt;code&gt;$\bar y_* &amp;lt; 1$&lt;/code&gt;, per-member output peaks at a unique optimal firm size &lt;code&gt;$m^*(\bar y_*)$&lt;/code&gt; and declines thereafter:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$m^*(\bar y_*) = \frac{\phi}{1 - \bar y_*} - 1$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Look closely at this formula: &lt;strong&gt;competence &lt;code&gt;$L$&lt;/code&gt; does not appear anywhere in the optimal firm size &lt;code&gt;$m^*(\bar y_*)$&lt;/code&gt;!&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;This is the paper&#39;s &lt;strong&gt;Proposition 1 (Bounds on Firm Size)&lt;/strong&gt;: raising solo competence &lt;code&gt;$L$&lt;/code&gt; simply shifts the entire per-member output curve proportionally upward—allowing any fixed-size team to produce more—&lt;strong&gt;without pushing the peak location to the right by a single millimeter&lt;/strong&gt;. As long as AI coordination &lt;code&gt;$y_*^M$&lt;/code&gt; stays at &lt;code&gt;$0.78 &amp;lt; 1$&lt;/code&gt;, even if an AI codes 100 times faster than a human solo, cramming an 8th or 9th AI into the team still triggers net internal friction from context collisions.&lt;/p&gt;&#xA;&lt;p&gt;Why, then, does the market value of human Coordinators overtake that of technical specialists?&lt;/p&gt;&#xA;&lt;p&gt;By &lt;strong&gt;Theorem 2 (Wages and Sorting)&lt;/strong&gt;, the maximum wage (bid function) that an AI-using firm &lt;code&gt;$f$&lt;/code&gt; is willing to pay a human worker with capability profile &lt;code&gt;$\mathbf{y}$&lt;/code&gt; equals the machine compute cost saved by hiring that human:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$b_f(\mathbf{y}) = r + \sum_{d=1}^n \beta_d^f (y_d - y_d^M) + \beta_*^f (y_* - y_*^M)$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Once AI reaches the Supercompetent stage (&lt;code&gt;$y_d^M = 12 &amp;gt; 9$&lt;/code&gt;), every human has a &lt;strong&gt;negative score&lt;/strong&gt; on the specialized task terms &lt;code&gt;$(y_d - y_d^M)$&lt;/code&gt;. Judged purely on task execution, firms wouldn&#39;t hire a single human in the mainstream market.&lt;/p&gt;&#xA;&lt;p&gt;However, the shadow price of coordination &lt;code&gt;$\beta_*^f$&lt;/code&gt; has a crucial property: &lt;strong&gt;it is proportional to the scale elasticity of firm output, &lt;code&gt;$\partial_2 \log S(m, \bar y_*) = \log(1+m)$&lt;/code&gt;, and is simultaneously amplified by the team&#39;s baseline competence &lt;code&gt;$L(\nu_f)$&lt;/code&gt;&lt;/strong&gt;! When a team is packed with super-AIs whose competence has jumped from &lt;code&gt;$1.69$&lt;/code&gt; to &lt;code&gt;$12$&lt;/code&gt;, adding one human Coordinator who nudges the team&#39;s average coordination up from &lt;code&gt;$0.78$&lt;/code&gt; is like &lt;strong&gt;fitting a steering wheel onto a fleet of Ferraris&lt;/strong&gt;—the Coordinator barely touches the gas pedal (&lt;code&gt;$y_1=1, y_2=1$&lt;/code&gt;), yet widens the scale bottleneck of the entire super-AI fleet.&lt;/p&gt;&#xA;&lt;figure class=&#34;echart&#34; style=&#34;--h:380px&#34;&gt;&lt;figcaption&gt;Competence Path vs. Coordination Path: Wage Inversion and Collapse Across Regimes&lt;/figcaption&gt;&lt;p&gt;&lt;a href=&#34;https://mizore.blog/en/posts/organizing-intelligence/&#34;&gt;(See the figure in the post.)&lt;/a&gt;&lt;/p&gt;&lt;p class=&#34;figure-note&#34;&gt;Plotted from the five equilibrium snapshots in Figure 6 and Table 2 of the paper (wages in units of compute rent r = 1; dashed line marks the human reservation floor w₀ = 0.25; Specialists = Coders and Writers). Along the competence path (Minimal AGI → Supercompetent), optimal firm size stays locked around ~7 and Coordinator wages overtake Specialists. Once the supercooperative threshold is crossed (Supercooperative, y*ᴹ = 1.60 &amp;gt; 1), deep-market firm size diverges and Coordinator wages hit the 0.25 floor.&lt;/p&gt;&lt;/figure&gt;&#xA;&lt;p&gt;This also explains why, in early empirical data from 2026–2027, the hardest-hit group has been entry-level junior programmers (whose skill vectors lie closest to &lt;code&gt;$\mathbf{y}^M$&lt;/code&gt; with no coordination advantage, seeing hiring drops of 7.7%–19%&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-brynjolfsson2026canaries-1&#34; href=&#34;#ref-brynjolfsson2026canaries&#34;&gt;[24]&lt;/a&gt;&lt;/sup&gt;), whereas compensation for senior architects and managers has held remarkably steady&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-hosseini2025seniority-1&#34; href=&#34;#ref-hosseini2025seniority&#34;&gt;[25]&lt;/a&gt;&lt;/sup&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-azar2026wage-1&#34; href=&#34;#ref-azar2026wage&#34;&gt;[26]&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;act-iii-spring-2028-crossing-gammam--1-swarm-phase-transition-and-the-reorganization-trap&#34;&gt;Act III (Spring 2028): Crossing &lt;code&gt;$\gamma^M = 1$&lt;/code&gt;, Swarm Phase Transition, and the Reorganization Trap&lt;/h2&gt;&#xA;&lt;h3 id=&#34;march-2028-the-false-golden-age-and-the-overnight-wipeout&#34;&gt;March 2028: The False Golden Age and the Overnight Wipeout&lt;/h3&gt;&#xA;&lt;p&gt;If history stopped at Act II, humanity would settle into a benign future where &amp;quot;everyone is an AI commander and boutique studios flourish.&amp;quot; Between late 2027 and early 2028, however, the wind shifts.&lt;/p&gt;&#xA;&lt;p&gt;Frontier labs finally realize that grinding solo benchmark scores from 99 to 99.9 yields diminishing marginal returns; the real gold mine is &lt;strong&gt;multi-agent native training&lt;/strong&gt;. Through shared latent-state passing, lossless context-handoff protocols, and collective reward alignment, the next generation of models barely changes in solo task competence, yet its coordination index &lt;code&gt;$y_*^M$&lt;/code&gt; climbs steadily from &lt;code&gt;$0.78$&lt;/code&gt; to &lt;code&gt;$0.95$&lt;/code&gt;, then &lt;code&gt;$0.99$&lt;/code&gt;—and in a quiet March 2028 release, slips past &lt;strong&gt;&lt;code&gt;$1.0$&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;During the first half of this climb (&lt;code&gt;$y_*^M$&lt;/code&gt; rising from &lt;code&gt;$0.85$&lt;/code&gt; toward &lt;code&gt;$0.99$&lt;/code&gt;), something exhilarating happens in the labor market for human managers: &lt;strong&gt;far from falling as AI coordination improves, human Coordinator salaries experience a second spring, surging against the tide!&lt;/strong&gt; Headhunters offer astronomical packages for seasoned directors who know how to orchestrate complex systems, and financial outlets run triumphant headlines: &lt;em&gt;&amp;quot;The Stronger AI Gets, the Deeper the Moat for Human Managers.&amp;quot;&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Then, during a single week in mid-March 2028 when the new model&#39;s coordination index breaches &lt;code&gt;$1.0$&lt;/code&gt; (the paper&#39;s Supercooperative snapshot sets &lt;code&gt;$y_*^M = 1.60$&lt;/code&gt;), the mainstream deep market undergoes a phase transition like supercooled water freezing on impact:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;A Leviathan swallows the mainstream market&lt;/strong&gt;: Across the deep market, tens of thousands of small and mid-sized AI studios of 7 to 20 agents lose all price competitiveness within weeks. Compute and orders gravitate at light speed toward a single mega-cluster—a colossal virtual enterprise running hundreds of thousands of concurrent agents with zero human employees, whose average cost of production approaches zero as it scales.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Coordinator premiums vanish overnight as humans retreat to niche ponds&lt;/strong&gt;: Human Coordinators who were collecting record paychecks a month earlier—along with any human specialists still operating in mainstream firms—do not experience a gentle buffer of &amp;quot;10% layoffs per year,&amp;quot; but are &lt;strong&gt;swept out of the deep market simultaneously&lt;/strong&gt; in a single wave of firm exits. Coordinator wages crash overnight to the reservation floor &lt;code&gt;$\underline w = 0.25$&lt;/code&gt; and their employment falls in half to &lt;code&gt;$0.97 / 2$&lt;/code&gt;: fewer than half survive by retreating alongside the 12 specialists into the capacity-capped niche market where mega-swarms cannot form (because solo AI competence in this snapshot is still &lt;code&gt;$1.69$&lt;/code&gt;, mosaic human teams nudge specialist wages slightly up to &lt;code&gt;$0.41$&lt;/code&gt;, until Act IV&#39;s ASI drives Coordinator employment to &lt;code&gt;$0.00 / 2$&lt;/code&gt; and specialist wages down to &lt;code&gt;$0.27$&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h3 id=&#34;theoretical-breakdown-three-theorems-unpack-the-phase-transition-and-the-mirage-trap&#34;&gt;Theoretical Breakdown: Three Theorems Unpack the Phase Transition and the Mirage Trap&lt;/h3&gt;&#xA;&lt;p&gt;Why does crossing &lt;code&gt;$1.0$&lt;/code&gt; in coordination trigger such a violent discontinuity? And why do human managers&#39; wages surge right before collapsing? Sections 5 and 6 of the paper reproduce the entire micro-mechanism of Act III through three rigorous propositions.&lt;/p&gt;&#xA;&lt;h4 id=&#34;1-the-size-amplifier-and-the-shattering-of-the-coasean-ceiling&#34;&gt;1. The Size Amplifier and the Shattering of the Coasean Ceiling&lt;/h4&gt;&#xA;&lt;p&gt;When AI coordination &lt;code&gt;$y_*^M$&lt;/code&gt; is still below &lt;code&gt;$1$&lt;/code&gt; but already exceeds that of an average human worker (&lt;strong&gt;Proposition 2&lt;/strong&gt;), the derivative of firm size &lt;code&gt;$m$&lt;/code&gt; with respect to &lt;code&gt;$y_*^M$&lt;/code&gt; consists of two positive terms:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\frac{\mathrm{d} m}{\mathrm{d} y_*^M} = \underbrace{\frac{\partial m^*}{\partial y_*^M}}_{\text{Direct scale effect } &amp;gt; 0} + \underbrace{\frac{\partial m^*}{\partial s} \frac{\mathrm{d} s}{\mathrm{d} y_*^M}}_{\text{Compositional amplifier } &amp;gt; 0}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;This sets off a powerful &lt;strong&gt;positive feedback loop&lt;/strong&gt;: better AI coordination &lt;code&gt;$\to$&lt;/code&gt; larger optimal firm size &lt;code&gt;$m^*$&lt;/code&gt; &lt;code&gt;$\to$&lt;/code&gt; larger firms place a higher marginal valuation &lt;code&gt;$\log(1+m)$&lt;/code&gt; on coordination (Assumption 2(ii)) &lt;code&gt;$\to$&lt;/code&gt; firms raise their machine share &lt;code&gt;$s$&lt;/code&gt; even further to capture more coordination &lt;code&gt;$\to$&lt;/code&gt; average coordination &lt;code&gt;$\bar y_*$&lt;/code&gt; rises further, fueling even greater expansion!&lt;/p&gt;&#xA;&lt;p&gt;In the paper&#39;s numerical example, when &lt;code&gt;$y_*^M = 0.78$&lt;/code&gt;, a pure-AI firm&#39;s optimal size is just &lt;strong&gt;7&lt;/strong&gt;; when &lt;code&gt;$y_*^M$&lt;/code&gt; reaches &lt;code&gt;$0.95$&lt;/code&gt;, optimal size swells to &lt;strong&gt;34&lt;/strong&gt;; at &lt;code&gt;$y_*^M = 0.99$&lt;/code&gt;, it rockets to &lt;strong&gt;174&lt;/strong&gt;. And the moment &lt;code&gt;$y_*^M &amp;gt; 1$&lt;/code&gt; (meaning the asymptotic tail exponent &lt;code&gt;$\gamma^M &amp;gt; 1$&lt;/code&gt;, which the paper defines as &lt;strong&gt;Supercooperative AI&lt;/strong&gt;), returns to scale flip from concave to convex: every additional AI agent contributes more in collaborative synergy than it costs in split-attention friction, causing per-agent output to &lt;strong&gt;grow without bound as &lt;code&gt;$m \to \infty$&lt;/code&gt;&lt;/strong&gt;!&lt;/p&gt;&#xA;&lt;p&gt;The &amp;quot;Coasean ceiling&amp;quot; that constrained human organizations for nearly a century is shattered from within. Cloned AI agents are free from the three biological and institutional fatal flaws of human organizations: bounded working memory&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-simon1971-1&#34; href=&#34;#ref-simon1971&#34;&gt;[27]&lt;/a&gt;&lt;/sup&gt;, tacit knowledge that can only be handed off through lossy verbal summaries&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-polanyi1966-1&#34; href=&#34;#ref-polanyi1966&#34;&gt;[28]&lt;/a&gt;&lt;/sup&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-graeberNoyRoth2026-1&#34; href=&#34;#ref-graeberNoyRoth2026&#34;&gt;[29]&lt;/a&gt;&lt;/sup&gt;, and principal-agent moral hazard driven by private self-interest&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-holmstrom1982-2&#34; href=&#34;#ref-holmstrom1982&#34;&gt;[23]&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Proposition 3 (Supercooperation Concentrates Large Markets)&lt;/strong&gt; proves a striking limiting phase transition: in a deep market (&lt;code&gt;$N \to \infty$&lt;/code&gt;),&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;As long as &lt;code&gt;$\gamma^M &amp;lt; 1$&lt;/code&gt;, the maximum market share of any single firm in equilibrium vanishes (&lt;code&gt;$\sup (q_f / Q) \to 0$&lt;/code&gt;), so the industry remains a competitive market populated by countless small firms scaling via &lt;strong&gt;Replication&lt;/strong&gt;;&lt;/li&gt;&#xA;&lt;li&gt;Once &lt;code&gt;$\gamma^M &amp;gt; 1$&lt;/code&gt;, the total cost of producing aggregate output &lt;code&gt;$Q$&lt;/code&gt; grows sublinearly as &lt;code&gt;$Q^{1/\gamma^M}$&lt;/code&gt;; splitting production across two firms forfeits scale economies, driving the generalized Herfindahl-Hirschman concentration index to unity (&lt;code&gt;$\int (q_f / Q)^2 \,\mathrm{d}\sigma_N^*(f) \to 1$&lt;/code&gt;)—&lt;strong&gt;the entire market instantaneously collapses into a single giant pure-AI enterprise (Concentration)&lt;/strong&gt;!&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h4 id=&#34;2-the-wage-reorganization-effect-trap&#34;&gt;2. The Wage &amp;quot;Reorganization Effect Trap&amp;quot;&lt;/h4&gt;&#xA;&lt;p&gt;Why do human Coordinators enjoy a deceptive wage boom right on the eve of their wipeout?&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Proposition 6 (Wage Decomposition)&lt;/strong&gt; breaks down the change in a human worker&#39;s wage as AI technology &lt;code&gt;$\theta$&lt;/code&gt; advances into two components:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$$\frac{\mathrm{d} w_i}{\mathrm{d} \theta} = \underbrace{\partial_\theta b_f(\mathbf{y}^i)}_{\text{Technology Effect}} + \underbrace{\partial_m b_f \frac{\mathrm{d} m}{\mathrm{d} \theta} + \partial_s b_f \frac{\mathrm{d} s}{\mathrm{d} \theta} + \nabla_{\bar{\mathbf{y}}^H} b_f \cdot \frac{\mathrm{d} \bar{\mathbf{y}}^H}{\mathrm{d} \theta}}_{\text{Reorganization Effect}}$$&lt;/code&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;The Technology Effect&lt;/strong&gt; (holding the firm&#39;s current size and workforce composition fixed): As AI&#39;s own coordination improves, a human Coordinator&#39;s relative advantage over AI &lt;code&gt;$(y_*^H - y_*^M)$&lt;/code&gt; steadily shrinks. Thus, &lt;strong&gt;the pure technology effect on human Coordinator wages is always negative&lt;/strong&gt; (if firms did not reorganize, your pay would fall monotonically).&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;The Reorganization Effect&lt;/strong&gt; (as firms dynamically adjust size &lt;code&gt;$m$&lt;/code&gt; and machine share &lt;code&gt;$s$&lt;/code&gt; in response to stronger AI): In standard microeconomics, we are used to invoking the Envelope Theorem to zero out first-order adjustment terms. Here, however, &lt;strong&gt;market equilibrium maximizes aggregate social surplus, not any individual worker&#39;s wage!&lt;/strong&gt; Consequently, the Envelope Theorem does not apply to wages: &lt;strong&gt;firm reorganization has a first-order effect that can completely reverse the sign of the technology effect!&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;As AI coordination climbs from &lt;code&gt;$0.90$&lt;/code&gt; toward &lt;code&gt;$0.99$&lt;/code&gt;, the Size Amplifier causes optimal firm size &lt;code&gt;$m$&lt;/code&gt; to balloon from a dozen agents to well over a hundred. Because a larger organization&#39;s hunger for coordination (&lt;code&gt;$\propto \log(1+m)$&lt;/code&gt;) expands rapidly with scale, &lt;strong&gt;the surging coordination premium from firm expansion (&lt;code&gt;$\partial_m b_f \frac{\mathrm{d}m}{\mathrm{d}\theta} \gg 0$&lt;/code&gt;) temporarily overwhelms the direct technological depreciation from AI catch-up (&lt;code&gt;$\partial_\theta b_f &amp;lt; 0$&lt;/code&gt;)&lt;/strong&gt;!&lt;/p&gt;&#xA;&lt;p&gt;That is the fatal mirage: human managers see their paychecks rising and conclude they are irreplaceable, unaware that they are witnessing the final siphon of coordination value right before organizational collapse. The moment &lt;code&gt;$y_*^M$&lt;/code&gt; passes the human Coordinator&#39;s level and breaches &lt;code&gt;$1$&lt;/code&gt;, keeping even a single human inside a 100,000-agent AI swarm drags down the average exponent &lt;code&gt;$\bar y_*$&lt;/code&gt;. The giant pure-AI firm ejects its human Coordinators, and wages plummet from peak to floor in an instant (see Figures 15 and 16 of the paper).&lt;/p&gt;&#xA;&lt;h4 id=&#34;3-gradual-vs-sudden-displacement&#34;&gt;3. Gradual vs. Sudden Displacement&lt;/h4&gt;&#xA;&lt;p&gt;Why does unemployment unfold as a &amp;quot;slowly boiling frog&amp;quot; in some sectors, but an &amp;quot;overnight wipeout&amp;quot; in others? &lt;strong&gt;Propositions 4 and 5&lt;/strong&gt; prove that the trajectory depends entirely on whether the &lt;strong&gt;cost-adjusted per-member output envelope &lt;code&gt;$\bar a(\lambda)$&lt;/code&gt; is concave or convex in the human labor share &lt;code&gt;$\lambda \in [0,1]$&lt;/code&gt;&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;figure class=&#34;diagram&#34; style=&#34;--h:280px;--hn:543px&#34;&gt;&lt;figcaption&gt;Two Displacement Dynamics: Gradual Within-Firm Substitution vs. Sudden Between-Firm Wipeout&lt;/figcaption&gt;&lt;p&gt;&lt;a href=&#34;https://mizore.blog/en/posts/organizing-intelligence/&#34;&gt;(See the figure in the post.)&lt;/a&gt;&lt;/p&gt;&lt;p class=&#34;figure-note&#34;&gt;Adapted from Propositions 4 and 5 and Figures 7 and 13 of the paper. When skill complementarity dominates, the output envelope is strictly concave and humans are smoothly phased out inside mixed firms. When coordination and scale economies dominate, the envelope flips to strictly convex: the market segregates into pure-human and pure-AI firms, and once unit cost lines cross, every human firm exits simultaneously.&lt;/p&gt;&lt;/figure&gt;&#xA;&lt;p&gt;Even more intriguingly, Figure 14 of the paper demonstrates a dynamic transformation: &lt;strong&gt;as AI coordination &lt;code&gt;$y_*^M$&lt;/code&gt; improves, the envelope &lt;code&gt;$\bar a(\lambda)$&lt;/code&gt; itself morphs from concave to convex!&lt;/strong&gt; In other words, an industry can easily &lt;strong&gt;begin with gentle, gradual attrition inside mixed human-AI teams, abruptly undergo organizational segregation midway through, and end in a cliff-like collapse&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;act-iv-winter-2028-the-asi-endgame-and-the-last-refuge-of-comparative-advantage&#34;&gt;Act IV (Winter 2028): The ASI Endgame and the Last Refuge of Comparative Advantage&lt;/h2&gt;&#xA;&lt;h3 id=&#34;november-2028-zeroed-out-in-the-ocean-surviving-in-small-ponds&#34;&gt;November 2028: Zeroed Out in the Ocean, Surviving in Small Ponds&lt;/h3&gt;&#xA;&lt;p&gt;By late 2028, frontier models have crossed both red lines simultaneously: solo task competence reaches &lt;code&gt;$\theta = 12 &amp;gt; 9$&lt;/code&gt; (surpassing every human specialist), and coordination reaches &lt;code&gt;$y_*^M = 1.05 &amp;gt; 1$&lt;/code&gt; (unlocking swarm collaboration with increasing returns to scale). This is what the paper defines as &lt;strong&gt;Artificial Superintelligence (ASI)&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Across mainstream deep markets (standardized software, large-scale financial trading, general industrial design, foundational scientific research), giant pure-AI enterprises monopolize 100% of output, marginal production costs approach zero, and material abundance flows at an unprecedented pace. Employment for human Coordinators falls completely to zero.&lt;/p&gt;&#xA;&lt;p&gt;Yet in the final snapshot of the paper&#39;s numerical example (Table 2, column 4), a counterintuitive tail remains: &lt;strong&gt;the 12 human Coders and Writers—despite being outclassed in absolute terms across every single skill dimension by ASI—are still not completely unemployed!&lt;/strong&gt; Crowded into a tiny &lt;strong&gt;Niche Market (&lt;code&gt;$N = 1$&lt;/code&gt;, where total demand is capped at &lt;code&gt;$Q = 200$&lt;/code&gt;)&lt;/strong&gt;, they form two 6-person pure-human firms, earn a meager wage (&lt;code&gt;$0.269$&lt;/code&gt;) barely above their reservation floor (&lt;code&gt;$0.25$&lt;/code&gt;), and supply 88% of that small pond&#39;s output (&lt;code&gt;$165.3$&lt;/code&gt; units), leaving the mighty ASI with only the remaining &lt;code&gt;$22.1$&lt;/code&gt; units.&lt;/p&gt;&#xA;&lt;h3 id=&#34;theoretical-breakdown-if-asi-crushes-humans-everywhere-why-do-human-firms-survive-in-niche-markets&#34;&gt;Theoretical Breakdown: If ASI Crushes Humans Everywhere, Why Do Human Firms Survive in Niche Markets?&lt;/h3&gt;&#xA;&lt;p&gt;Many readers assume this must be a typo: ASI scores 12 in coding (vs. 9 for humans) and 1.05 in coordination (vs. 0.75 for humans)—why doesn&#39;t ASI wipe out humans in the niche market too?&lt;/p&gt;&#xA;&lt;p&gt;The answer lies in David Ricardo&#39;s two-century-old principle of &lt;strong&gt;Comparative Advantage&lt;/strong&gt;, combined with &lt;strong&gt;physical market-size caps on scale economies&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;A small pond cannot hold a leviathan&lt;/strong&gt;: ASI&#39;s deadliest weapon is the increasing returns to scale from &lt;code&gt;$y_*^M = 1.05 &amp;gt; 1$&lt;/code&gt;—the larger the swarm, the higher the per-agent output and the lower the unit cost. In a niche market capped at &lt;code&gt;$Q &amp;lt; 200$&lt;/code&gt;, however, total demand places a hard ceiling on firm size (the paper&#39;s Feasibility constraint requires any single indivisible firm&#39;s output not to exceed market demand, &lt;code&gt;$q_f \le Q$&lt;/code&gt;). In such a shallow pond, ASI cannot deploy a 100,000-agent mega-swarm; forced to operate at a miniature scale of &lt;code&gt;$m \approx 3.66$&lt;/code&gt;, its supercooperative scale advantage is largely neutralized.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Compute has a hard cost floor, whereas human wages can flex downward&lt;/strong&gt;: Running an ASI instance consumes physical electricity and chip rental &lt;code&gt;$r = 1$&lt;/code&gt; (or carries the opportunity cost of deploying that compute in deep markets for higher returns), whereas the human reservation wage is only &lt;code&gt;$\underline w = 0.25$&lt;/code&gt;. As long as human specialists accept a wage cut down to &lt;code&gt;$0.269$&lt;/code&gt; (roughly a quarter of ASI&#39;s compute rental rate), in a scale-constrained niche market a &amp;quot;cheap human mosaic team&amp;quot; can still match the unit production cost of an &amp;quot;expensive, scale-throttled ASI&amp;quot;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-restrepo2025-2&#34; href=&#34;#ref-restrepo2025&#34;&gt;[15]&lt;/a&gt;&lt;/sup&gt;!&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Of course, the authors add a sobering caveat in the text: this survival is merely a knife-edge slice right after ASI crosses the threshold, when compute cost &lt;code&gt;$r = 1$&lt;/code&gt; still sits well above the human subsistence floor &lt;code&gt;$\underline w = 0.25$&lt;/code&gt;. If ASI&#39;s solo competence continues rising from 12 to 50, or if compute rental &lt;code&gt;$r$&lt;/code&gt; drops below &lt;code&gt;$\underline w$&lt;/code&gt;, then by &lt;strong&gt;Proposition 4(i) (Machine-only Production)&lt;/strong&gt;, humanity&#39;s last refuge of comparative advantage vanishes as well.&lt;/p&gt;&#xA;&lt;figure class=&#34;data wide dense&#34;&gt;&lt;figcaption&gt;Equilibrium Panorama Across the Four Acts (Exact Numerical Values)&lt;/figcaption&gt;&lt;div class=&#34;data-scroll&#34; tabindex=&#34;0&#34;&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Stage&lt;/th&gt;&lt;th class=&#34;num&#34;&gt;AI Solo θ&lt;/th&gt;&lt;th class=&#34;num&#34;&gt;AI Coord y*&lt;/th&gt;&lt;th&gt;Deep-Market Structure&lt;/th&gt;&lt;th class=&#34;num bar-head&#34; style=&#34;--vw:4ch&#34;&gt;&lt;span class=&#34;bar-head-in&#34;&gt;Specialist Wage&lt;/span&gt;&lt;/th&gt;&lt;th class=&#34;num bar-head&#34; style=&#34;--vw:4ch&#34;&gt;&lt;span class=&#34;bar-head-in&#34;&gt;Coordinator Wage&lt;/span&gt;&lt;/th&gt;&lt;th class=&#34;num&#34;&gt;Coordinator Emp.&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&#34;row-key prose-col&#34;&gt;Pre-AI Baseline&lt;/td&gt;&lt;td class=&#34;num&#34;&gt;0&lt;/td&gt;&lt;td class=&#34;num&#34;&gt;0&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;2 mixed human firms of 7&lt;/td&gt;&lt;td class=&#34;num bar&#34; style=&#34;--vw:4ch&#34;&gt;&lt;span class=&#34;bar-cell&#34;&gt;&lt;span class=&#34;bar-track&#34; aria-hidden=&#34;true&#34;&gt;&lt;i class=&#34;bar-fill&#34; style=&#34;left:0.0%;width:100.0%&#34;&gt;&lt;/i&gt;&lt;/span&gt;&lt;span class=&#34;bar-val&#34;&gt;4.15&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;td class=&#34;num bar&#34; style=&#34;--vw:4ch&#34;&gt;&lt;span class=&#34;bar-cell&#34;&gt;&lt;span class=&#34;bar-track&#34; aria-hidden=&#34;true&#34;&gt;&lt;i class=&#34;bar-fill&#34; style=&#34;left:0.0%;width:58.1%&#34;&gt;&lt;/i&gt;&lt;/span&gt;&lt;span class=&#34;bar-val&#34;&gt;2.41&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;td class=&#34;num&#34;&gt;2.00 / 2&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;row-key prose-col&#34;&gt;Act I: Minimal AGI&lt;/td&gt;&lt;td class=&#34;num&#34;&gt;1.69&lt;/td&gt;&lt;td class=&#34;num&#34;&gt;0.78&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Human mixed + many 7-AI firms&lt;/td&gt;&lt;td class=&#34;num bar&#34; style=&#34;--vw:4ch&#34;&gt;&lt;span class=&#34;bar-cell&#34;&gt;&lt;span class=&#34;bar-track&#34; aria-hidden=&#34;true&#34;&gt;&lt;i class=&#34;bar-fill&#34; style=&#34;left:0.0%;width:69.9%&#34;&gt;&lt;/i&gt;&lt;/span&gt;&lt;span class=&#34;bar-val&#34;&gt;2.90&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;td class=&#34;num bar&#34; style=&#34;--vw:4ch&#34;&gt;&lt;span class=&#34;bar-cell&#34;&gt;&lt;span class=&#34;bar-track&#34; aria-hidden=&#34;true&#34;&gt;&lt;i class=&#34;bar-fill&#34; style=&#34;left:0.0%;width:31.3%&#34;&gt;&lt;/i&gt;&lt;/span&gt;&lt;span class=&#34;bar-val&#34;&gt;1.30&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;td class=&#34;num&#34;&gt;2.00 / 2&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;row-key prose-col&#34;&gt;Act II: Supercompetent&lt;/td&gt;&lt;td class=&#34;num&#34;&gt;12.00&lt;/td&gt;&lt;td class=&#34;num&#34;&gt;0.78&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Human-coordinator-led 7-AI firms&lt;/td&gt;&lt;td class=&#34;num bar&#34; style=&#34;--vw:4ch&#34;&gt;&lt;span class=&#34;bar-cell&#34;&gt;&lt;span class=&#34;bar-track&#34; aria-hidden=&#34;true&#34;&gt;&lt;i class=&#34;bar-fill&#34; style=&#34;left:0.0%;width:9.4%&#34;&gt;&lt;/i&gt;&lt;/span&gt;&lt;span class=&#34;bar-val&#34;&gt;0.39&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;td class=&#34;num bar&#34; style=&#34;--vw:4ch&#34;&gt;&lt;span class=&#34;bar-cell&#34;&gt;&lt;span class=&#34;bar-track&#34; aria-hidden=&#34;true&#34;&gt;&lt;i class=&#34;bar-fill&#34; style=&#34;left:0.0%;width:11.6%&#34;&gt;&lt;/i&gt;&lt;/span&gt;&lt;span class=&#34;bar-val&#34;&gt;0.48&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;td class=&#34;num&#34;&gt;2.00 / 2&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&#34;mark&#34;&gt;&lt;td class=&#34;row-key prose-col&#34;&gt;Act III: Supercooperative&lt;/td&gt;&lt;td class=&#34;num&#34;&gt;1.69&lt;/td&gt;&lt;td class=&#34;num&#34;&gt;1.60&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Single giant pure-AI monopoly&lt;/td&gt;&lt;td class=&#34;num bar&#34; style=&#34;--vw:4ch&#34;&gt;&lt;span class=&#34;bar-cell&#34;&gt;&lt;span class=&#34;bar-track&#34; aria-hidden=&#34;true&#34;&gt;&lt;i class=&#34;bar-fill&#34; style=&#34;left:0.0%;width:9.9%&#34;&gt;&lt;/i&gt;&lt;/span&gt;&lt;span class=&#34;bar-val&#34;&gt;0.41&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;td class=&#34;num bar&#34; style=&#34;--vw:4ch&#34;&gt;&lt;span class=&#34;bar-cell&#34;&gt;&lt;span class=&#34;bar-track&#34; aria-hidden=&#34;true&#34;&gt;&lt;i class=&#34;bar-fill&#34; style=&#34;left:0.0%;width:6.0%&#34;&gt;&lt;/i&gt;&lt;/span&gt;&lt;span class=&#34;bar-val&#34;&gt;0.25&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;td class=&#34;num&#34;&gt;0.97 / 2&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;row-key prose-col&#34;&gt;Act IV: ASI&lt;/td&gt;&lt;td class=&#34;num&#34;&gt;12.00&lt;/td&gt;&lt;td class=&#34;num&#34;&gt;1.05&lt;/td&gt;&lt;td class=&#34;prose-col&#34;&gt;Single giant pure-AI monopoly&lt;/td&gt;&lt;td class=&#34;num bar&#34; style=&#34;--vw:4ch&#34;&gt;&lt;span class=&#34;bar-cell&#34;&gt;&lt;span class=&#34;bar-track&#34; aria-hidden=&#34;true&#34;&gt;&lt;i class=&#34;bar-fill&#34; style=&#34;left:0.0%;width:6.5%&#34;&gt;&lt;/i&gt;&lt;/span&gt;&lt;span class=&#34;bar-val&#34;&gt;0.27&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;td class=&#34;num bar&#34; style=&#34;--vw:4ch&#34;&gt;&lt;span class=&#34;bar-cell&#34;&gt;&lt;span class=&#34;bar-track&#34; aria-hidden=&#34;true&#34;&gt;&lt;i class=&#34;bar-fill&#34; style=&#34;left:0.0%;width:6.0%&#34;&gt;&lt;/i&gt;&lt;/span&gt;&lt;span class=&#34;bar-val&#34;&gt;0.25&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;td class=&#34;num&#34;&gt;0.00 / 2&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p class=&#34;data-note&#34;&gt;Data directly from Imas, Koh &amp;amp; Legg (2026), Table 2 and Section 2.2 (compute rental r = 1, human reservation wage w₀ = 0.25, 12 specialists and 2 coordinators).&lt;/p&gt;&lt;/figure&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;stepping-outside-the-model-six-real-world-frictions-the-paper-leaves-out&#34;&gt;Stepping Outside the Model: Six Real-World Frictions the Paper Leaves Out&lt;/h2&gt;&#xA;&lt;p&gt;Embedding Coasean firm boundaries&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-coase1937-2&#34; href=&#34;#ref-coase1937&#34;&gt;[20]&lt;/a&gt;&lt;/sup&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-williamson1967-2&#34; href=&#34;#ref-williamson1967&#34;&gt;[22]&lt;/a&gt;&lt;/sup&gt; into a general equilibrium model of AGI gives &lt;em&gt;Organizing Intelligence&lt;/em&gt; far greater explanatory power than traditional task-automation frameworks&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-acemogluRestrepo2018-1&#34; href=&#34;#ref-acemogluRestrepo2018&#34;&gt;[30]&lt;/a&gt;&lt;/sup&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-aghionJonesJones2019-1&#34; href=&#34;#ref-aghionJonesJones2019&#34;&gt;[31]&lt;/a&gt;&lt;/sup&gt; (indeed, &lt;strong&gt;Theorem 3&lt;/strong&gt; in Section 7.1 proves that when returns to scale are forced to be constant, &lt;code&gt;$\gamma \equiv 1$&lt;/code&gt;, their model collapses exactly into the classic Acemoglu-Restrepo task model, rendering firm size and organizational boundaries irrelevant).&lt;/p&gt;&#xA;&lt;p&gt;Still, if we want to use this paper as a compass for the real world, we must see clearly where its mathematical axioms pare away reality for analytical tractability. Specifically, the model has six critical blind spots:&lt;/p&gt;&#xA;&lt;figure class=&#34;diagram&#34; style=&#34;--h:316px;--hn:615px&#34;&gt;&lt;figcaption&gt;Theoretical Model vs. Real World: Six Institutional and Physical Frictions Simplified Away&lt;/figcaption&gt;&lt;p&gt;&lt;a href=&#34;https://mizore.blog/en/posts/organizing-intelligence/&#34;&gt;(See the figure in the post.)&lt;/a&gt;&lt;/p&gt;&lt;p class=&#34;figure-note&#34;&gt;Model assumptions are adopted to guarantee equilibrium existence and closed-form solutions; real-world frictions will bend, delay, or rewrite the four-act script above.&lt;/p&gt;&lt;/figure&gt;&#xA;&lt;h3 id=&#34;1-flattening-pyramid-hierarchies-into-an-arithmetic-mean&#34;&gt;1. Flattening Pyramid Hierarchies into an &amp;quot;Arithmetic Mean&amp;quot;&lt;/h3&gt;&#xA;&lt;p&gt;The paper&#39;s &lt;strong&gt;Assumption 2 (First-moment Representation)&lt;/strong&gt; stipulates that a firm&#39;s scaling capacity depends solely on the &lt;strong&gt;arithmetic mean&lt;/strong&gt; of all members&#39; coordination abilities, &lt;code&gt;$\bar y_* = m^{-1} \int y_* \,\mathrm{d}\nu$&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Mathematically, this is wonderfully clean; organizationally, it is overly naive. Real firms are not flat circles where everyone&#39;s coordination score is averaged equally—they are &lt;strong&gt;knowledge and decision pyramids (Knowledge Hierarchies)&lt;/strong&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-garicano2000-1&#34; href=&#34;#ref-garicano2000&#34;&gt;[32]&lt;/a&gt;&lt;/sup&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-garicanoRossiHansberg2006-1&#34; href=&#34;#ref-garicanoRossiHansberg2006&#34;&gt;[33]&lt;/a&gt;&lt;/sup&gt;. Under a flat arithmetic average, placing 1 brilliant human CEO atop 10,000 AI agents gives the human a weight of &lt;code&gt;$1/10,000$&lt;/code&gt;, diluting their coordination impact to nothing. In a real tree-structured hierarchy, however, top-level architects define interfaces, partition modular boundaries, and set reward functions, giving a single human at the apex &lt;code&gt;$O(1)$&lt;/code&gt; global leverage. By ignoring internal hierarchy, the model prematurely declares the extinction of top human architects in Act III.&lt;/p&gt;&#xA;&lt;h3 id=&#34;2-the-single-ai-model-assumption-overstates-the-shelf-life-of-human-mosaic-intelligence&#34;&gt;2. The &amp;quot;Single AI Model&amp;quot; Assumption Overstates the Shelf Life of Human Mosaic Intelligence&lt;/h3&gt;&#xA;&lt;p&gt;In Act I, human teams beat Minimal AGI via &amp;quot;Mosaic Intelligence&amp;quot; only because the model assumes &lt;strong&gt;the entire economy has access to just one homogeneous AI model &lt;code&gt;$\mathbf{y}^M$&lt;/code&gt;&lt;/strong&gt; (Section 3.1), so combining ten thousand AI instances leaves their strengths and blind spots completely identical.&lt;/p&gt;&#xA;&lt;p&gt;In practice, nothing restricts a company to calling a single checkpoint. Firms routinely combine a &lt;code&gt;Coding-Agent&lt;/code&gt; specialized in synthesis, a &lt;code&gt;Security-Agent&lt;/code&gt; tuned for auditing, and a &lt;code&gt;Doc-Agent&lt;/code&gt; trained for technical prose inside the same workflow. The moment &lt;strong&gt;heterogeneous AI models&lt;/strong&gt; are allowed to form their own convex hull, AI ensembles can construct &amp;quot;machine mosaic intelligence&amp;quot; on their own—meaning the moat of complementary human specialists in Act I will erode much faster than the paper predicts.&lt;/p&gt;&#xA;&lt;h3 id=&#34;3-infinite-cheap-compute-vs-physical-fab-and-power-walls&#34;&gt;3. Infinite Cheap Compute vs. Physical Fab and Power Walls&lt;/h3&gt;&#xA;&lt;p&gt;The model assumes machines are &lt;strong&gt;supplied with infinite elasticity&lt;/strong&gt; at a constant rental price &lt;code&gt;$r &amp;gt; 0$&lt;/code&gt;. That is what allows a single giant AI enterprise in Act III (&lt;code&gt;$\gamma^M &amp;gt; 1$&lt;/code&gt;) to spin up tens of millions of concurrent instances overnight and swallow the entire industry.&lt;/p&gt;&#xA;&lt;p&gt;In the physical world, TSMC&#39;s CoWoS packaging capacity, HBM memory supply, and power-grid interconnection queues are anything but infinitely elastic. When the entire economy tries to instantiate mega-swarms simultaneously, the compute rental rate &lt;code&gt;$r(Q^M)$&lt;/code&gt; will shoot up a steeply convex marginal cost curve. &lt;strong&gt;Nonlinear bottlenecks in compute supply will convert what used to be human &amp;quot;skill scarcity rents&amp;quot; into &amp;quot;physical infrastructure scarcity rents&amp;quot; for compute owners&lt;/strong&gt;, while forcing the expansion of supercooperative AI firms to pace itself to the physical build-out of fabs and power plants.&lt;/p&gt;&#xA;&lt;h3 id=&#34;4-the-utopia-of-the-zero-profit-leviathan-contestable-markets&#34;&gt;4. The Utopia of the &amp;quot;Zero-Profit Leviathan&amp;quot;: Contestable Markets&lt;/h3&gt;&#xA;&lt;p&gt;To resolve the equilibrium existence problem when atomistic small firms coexist with industry-monopolizing giants, the paper adopts an equilibrium concept based on a &lt;strong&gt;Replacement Game&lt;/strong&gt; and contestable market theory&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-demsetz1968-1&#34; href=&#34;#ref-demsetz1968&#34;&gt;[34]&lt;/a&gt;&lt;/sup&gt;&lt;sup class=&#34;cite&#34;&gt;&lt;a id=&#34;cite-baumolPanzarWillig1982-1&#34; href=&#34;#ref-baumolPanzarWillig1982&#34;&gt;[35]&lt;/a&gt;&lt;/sup&gt; (Section 4.1 and Appendix B): even when a single giant pure-AI firm monopolizes 100% of an industry, the threat of potential entrants forces the monopolist to &lt;strong&gt;earn zero economic profit&lt;/strong&gt;, passing all technological gains to consumers via near-zero product prices (Theorem 1: equilibrium always maximizes aggregate social surplus).&lt;/p&gt;&#xA;&lt;p&gt;As the authors candidly acknowledge in Section 5.2, this is purely a theoretical benchmark. In reality, once a tech giant commanding a supercooperative AI cluster captures 100% market share, compute moats, data flywheels, and switching costs will rapidly lock out contestability. The zero-profit assumption will fail instantaneously—ushering in not a utopia of free goods, but unprecedented monopoly pricing and political-economic rent-seeking.&lt;/p&gt;&#xA;&lt;h3 id=&#34;5-ai-cannot-go-to-prison-legal-liability-as-an-institutional-moat&#34;&gt;5. AI Cannot Go to Prison: Legal Liability as an Institutional Moat&lt;/h3&gt;&#xA;&lt;p&gt;In the model&#39;s production functional &lt;code&gt;$F(\nu)$&lt;/code&gt;, whenever a machine configuration yields higher code and documentation output per dollar, firms replace humans with machines.&lt;/p&gt;&#xA;&lt;p&gt;In real commerce, however, vast categories of roles—certified public accountants, attending physicians, law firm partners, chief engineers, regulatory sign-off officers—exist not merely to generate cognitive output, but to serve as &lt;strong&gt;ultimate liability sinks&lt;/strong&gt;. An AI has no physical liberty, cannot be sent to prison, and carries no personal unlimited liability to be seized in court. As long as modern legal systems require a natural person who can face incarceration or bankruptcy to stand behind every critical signature, humans will remain in the production loop as compliance signatories and risk guarantors—collecting institutional rents even after AI achieves godlike scores in both &lt;code&gt;$\theta$&lt;/code&gt; and &lt;code&gt;$y_*$&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;6-the-severed-macroeconomic-loop-when-everyone-earns-reservation-wages-who-is-buying&#34;&gt;6. The Severed Macroeconomic Loop: When Everyone Earns Reservation Wages, Who Is Buying?&lt;/h3&gt;&#xA;&lt;p&gt;Finally, as an industrial-organization paper rooted in partial equilibrium, the model treats the demand curve &lt;code&gt;$P_N(Q)$&lt;/code&gt; as exogenously fixed.&lt;/p&gt;&#xA;&lt;p&gt;That is harmless in Acts I and II. By Acts III and IV, however, Coordinator wages are pinned at the reservation floor &lt;code&gt;$\underline w$&lt;/code&gt; and specialist wages have collapsed close to &lt;code&gt;$\underline w$&lt;/code&gt;, while firms earn zero profit. Without explicitly introducing a macroeconomic redistribution loop—such as Universal Basic Income (UBI) or broad citizen ownership of AI compute equity—that high, exogenous demand curve &lt;code&gt;$P_N(Q)$&lt;/code&gt; cannot possibly hold up in reality. &lt;strong&gt;If every human worker loses their wage premium, who has the purchasing power to buy the ocean of goods produced by giant AI swarms?&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;epilogue-measuring-the-future-with-a-different-ruler&#34;&gt;Epilogue: Measuring the Future with a Different Ruler&lt;/h2&gt;&#xA;&lt;p&gt;Even with those six real-world frictions acting as buffers, Imas, Koh, and Legg&#39;s paper hands us an exceptionally sharp scalpel.&lt;/p&gt;&#xA;&lt;p&gt;For the past three years, every time a new model dropped, the tech world fixated on how many percentage points solo scores rose on MMLU, GPQA, or SWE-bench. This paper tells us to look elsewhere: &lt;strong&gt;gains in solo competence (&lt;code&gt;$L$&lt;/code&gt;) merely make existing firms leaner, goods cheaper, and human orchestrators who know how to frame problems and coordinate teams more valuable; they do not overturn the organizational structure of society overnight.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;The needle that truly governs whether the economy undergoes a cliff-like phase transition is the &lt;strong&gt;multi-agent coordination exponent &lt;code&gt;$\gamma^M$&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;So long as &lt;code&gt;$\gamma^M &amp;lt; 1$&lt;/code&gt;, no matter how formidable an AI is on solo benchmarks, lopsided humans can still rely on heterogeneous &amp;quot;mosaic intelligence&amp;quot; and organizational coordination to carve out thriving niches across countless small and mid-sized mixed teams. The day we see hundreds or thousands of AI agents collaborate over weeks on a million-line codebase such that &lt;strong&gt;the larger the swarm grows, the higher the effective output per agent becomes (&lt;code&gt;$\gamma^M &amp;gt; 1$&lt;/code&gt;)&lt;/strong&gt;—that is the moment the Coasean ceiling truly shatters and the old economic order begins to collapse.&lt;/p&gt;&#xA;&lt;p&gt;Until that day arrives, rather than locking horns with raw compute on the solo test-taking track, our best bet is to cultivate the coordination skills that bind heterogeneous intelligences together. After all, in an age where compute can be replicated without limit, &lt;strong&gt;the only true scarcity is how intelligence is organized.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;references&#34;&gt;References&lt;/h2&gt;&#xA;&lt;ol class=&#34;references&#34;&gt;&#xA;&lt;li id=&#34;ref-kokotajlo2025ai2027&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-kokotajlo2025ai2027-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Kokotajlo, D., Alexander, S., Larsen, T., Lifland, E., &amp;amp; Dean, R. (2025). &lt;a href=&#34;https://ai-2027.com/&#34;&gt;AI 2027&lt;/a&gt;. &lt;em&gt;AI Futures Project&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-patwardhan2025gdpval&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-patwardhan2025gdpval-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Patwardhan, T., et al. (2025). &lt;a href=&#34;https://openai.com/&#34;&gt;GDPval: Evaluating AI Model Performance on Real-World Economically Valuable Tasks&lt;/a&gt;. &lt;em&gt;OpenAI Technical Report&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-wijk2024rebench&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-wijk2024rebench-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Wijk, H., et al. (2024). &lt;a href=&#34;https://arxiv.org/abs/2411.15114&#34;&gt;RE-Bench: Evaluating Frontier AI R&amp;amp;D Capabilities of Language Model Agents Against Human Experts&lt;/a&gt;. &lt;em&gt;arXiv:2411.15114&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-yotzov2026firmdata&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-yotzov2026firmdata-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Yotzov, I., et al. (2026). Firm-Level Adoption and Economic Impacts of Generative AI. &lt;em&gt;Working Paper&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-humlum2025llm&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-humlum2025llm-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Humlum, A., &amp;amp; Vestergaard, E. (2025). The Labor Market Effects of Generative AI: Evidence from Administrative and Survey Data. &lt;em&gt;Working Paper&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-imas2026organizing&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;span aria-hidden=&#34;true&#34;&gt;↑&lt;/span&gt; &lt;a href=&#34;#cite-imas2026organizing-1&#34; aria-label=&#34;Back to citation 1&#34;&gt;1&lt;/a&gt; &lt;a href=&#34;#cite-imas2026organizing-2&#34; aria-label=&#34;Back to citation 2&#34;&gt;2&lt;/a&gt;&lt;/span&gt; Imas, A., Koh, A., &amp;amp; Legg, S. (2026). &lt;a href=&#34;https://arxiv.org/abs/2611.05417&#34;&gt;Organizing Intelligence&lt;/a&gt;. &lt;em&gt;arXiv:2611.05417&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-samuelson1948&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-samuelson1948-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Samuelson, P. A. (1948). &lt;em&gt;Economics: An Introductory Analysis&lt;/em&gt;. McGraw-Hill.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-leggHutter2007&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-leggHutter2007-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Legg, S., &amp;amp; Hutter, M. (2007). &lt;a href=&#34;https://doi.org/10.1007/s11023-007-9079-x&#34;&gt;Universal Intelligence: A Definition of Machine Intelligence&lt;/a&gt;. &lt;em&gt;Minds and Machines, 17&lt;/em&gt;(4), 391–444.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-hui2024shortterm&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-hui2024shortterm-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Hui, X., Reshef, O., &amp;amp; Zhou, L. (2024). &lt;a href=&#34;https://doi.org/10.1287/orsc.2023.18441&#34;&gt;The Short-Term Effects of Generative Artificial Intelligence on Employment: Evidence from an Online Labor Market&lt;/a&gt;. &lt;em&gt;Organization Science, 35&lt;/em&gt;(6), 1977–1989.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-demirci2025replacing&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-demirci2025replacing-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Demirci, O., Hannane, J., &amp;amp; Zhu, X. (2025). Who Is AI Replacing? The Impact of Generative AI on Online Freelancing Platforms. &lt;em&gt;Management Science&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-kremer1993&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-kremer1993-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Kremer, M. (1993). &lt;a href=&#34;https://doi.org/10.2307/2118400&#34;&gt;The O-Ring Theory of Economic Development&lt;/a&gt;. &lt;em&gt;Quarterly Journal of Economics, 108&lt;/em&gt;(3), 551–575.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-jones2011&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-jones2011-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Jones, C. I. (2011). &lt;a href=&#34;https://doi.org/10.1257/mac.3.2.1&#34;&gt;Intermediate Goods and Weak Links in the Theory of Economic Development&lt;/a&gt;. &lt;em&gt;American Economic Journal: Macroeconomics, 3&lt;/em&gt;(2), 1–28.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-hongPage2004&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-hongPage2004-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Hong, L., &amp;amp; Page, S. E. (2004). &lt;a href=&#34;https://doi.org/10.1073/pnas.0406726101&#34;&gt;Groups of Diverse Problem Solvers Can Outperform Groups of High-Ability Problem Solvers&lt;/a&gt;. &lt;em&gt;Proceedings of the National Academy of Sciences, 101&lt;/em&gt;(46), 16385–16389.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-page2007difference&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-page2007difference-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Page, S. E. (2007). &lt;em&gt;The Difference: How the Power of Diversity Creates Better Groups, Firms, Schools, and Societies&lt;/em&gt;. Princeton University Press.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-restrepo2025&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;span aria-hidden=&#34;true&#34;&gt;↑&lt;/span&gt; &lt;a href=&#34;#cite-restrepo2025-1&#34; aria-label=&#34;Back to citation 1&#34;&gt;1&lt;/a&gt; &lt;a href=&#34;#cite-restrepo2025-2&#34; aria-label=&#34;Back to citation 2&#34;&gt;2&lt;/a&gt;&lt;/span&gt; Restrepo, P. (2025). Automation, Reproducible Intelligence, and Comparative Advantage. &lt;em&gt;Working Paper&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-kim2025scalingagents&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-kim2025scalingagents-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Kim, J., et al. (2025). Scaling Laws and Error Amplification in Multi-Agent LLM Systems. &lt;em&gt;arXiv preprint&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-cemri2025mast&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-cemri2025mast-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Cemri, M., et al. (2025). &lt;a href=&#34;https://arxiv.org/abs/2503.13657&#34;&gt;Why Do Multi-Agent LLM Systems Fail?&lt;/a&gt;. &lt;em&gt;arXiv:2503.13657&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-kimKoning2026&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-kimKoning2026-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Kim, S., &amp;amp; Koning, R. (2026). AI-Native Startups: Organizational Scaling and Hierarchy Flattening. &lt;em&gt;Working Paper&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-ewensGiroud2025hierarchy&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-ewensGiroud2025hierarchy-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Ewens, M., &amp;amp; Giroud, X. (2025). Firm Hierarchy in the Age of Artificial Intelligence. &lt;em&gt;Working Paper&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-coase1937&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;span aria-hidden=&#34;true&#34;&gt;↑&lt;/span&gt; &lt;a href=&#34;#cite-coase1937-1&#34; aria-label=&#34;Back to citation 1&#34;&gt;1&lt;/a&gt; &lt;a href=&#34;#cite-coase1937-2&#34; aria-label=&#34;Back to citation 2&#34;&gt;2&lt;/a&gt;&lt;/span&gt; Coase, R. H. (1937). &lt;a href=&#34;https://doi.org/10.1111/j.1468-0335.1937.tb00002.x&#34;&gt;The Nature of the Firm&lt;/a&gt;. &lt;em&gt;Economica, 4&lt;/em&gt;(16), 386–405.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-simon1947&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-simon1947-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Simon, H. A. (1947). &lt;em&gt;Administrative Behavior: A Study of Decision-Making Processes in Administrative Organization&lt;/em&gt;. Macmillan.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-williamson1967&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;span aria-hidden=&#34;true&#34;&gt;↑&lt;/span&gt; &lt;a href=&#34;#cite-williamson1967-1&#34; aria-label=&#34;Back to citation 1&#34;&gt;1&lt;/a&gt; &lt;a href=&#34;#cite-williamson1967-2&#34; aria-label=&#34;Back to citation 2&#34;&gt;2&lt;/a&gt;&lt;/span&gt; Williamson, O. E. (1967). &lt;a href=&#34;https://doi.org/10.1086/259258&#34;&gt;Hierarchical Control and Optimum Firm Size&lt;/a&gt;. &lt;em&gt;Journal of Political Economy, 75&lt;/em&gt;(2), 123–138.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-holmstrom1982&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;span aria-hidden=&#34;true&#34;&gt;↑&lt;/span&gt; &lt;a href=&#34;#cite-holmstrom1982-1&#34; aria-label=&#34;Back to citation 1&#34;&gt;1&lt;/a&gt; &lt;a href=&#34;#cite-holmstrom1982-2&#34; aria-label=&#34;Back to citation 2&#34;&gt;2&lt;/a&gt;&lt;/span&gt; Holmström, B. (1982). &lt;a href=&#34;https://doi.org/10.2307/3003457&#34;&gt;Moral Hazard in Teams&lt;/a&gt;. &lt;em&gt;Bell Journal of Economics, 13&lt;/em&gt;(2), 324–340.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-brynjolfsson2026canaries&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-brynjolfsson2026canaries-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Brynjolfsson, E., Chandar, B., &amp;amp; Chen, R. (2026). Canaries in the Coal Mine: Six Facts about the Recent Employment Effects of Artificial Intelligence. &lt;em&gt;Working Paper&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-hosseini2025seniority&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-hosseini2025seniority-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Hosseini, M., et al. (2025). Generative AI and the Seniority Bias in Knowledge Work. &lt;em&gt;Working Paper&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-azar2026wage&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-azar2026wage-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Azar, J., et al. (2026). AI Exposure and Wage Compression Across the Career Lifecycle. &lt;em&gt;Working Paper&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-simon1971&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-simon1971-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Simon, H. A. (1971). Designing Organizations for an Information-Rich World. In M. Greenberger (Ed.), &lt;em&gt;Computers, Communications, and the Public Interest&lt;/em&gt; (pp. 37–72). Johns Hopkins Press.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-polanyi1966&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-polanyi1966-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Polanyi, M. (1966). &lt;em&gt;The Tacit Dimension&lt;/em&gt;. Doubleday.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-graeberNoyRoth2026&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-graeberNoyRoth2026-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Graeber, T., Noy, S., &amp;amp; Roth, C. (2026). Lossy Communication and Tacit Knowledge in Organizations. &lt;em&gt;Working Paper&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-acemogluRestrepo2018&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-acemogluRestrepo2018-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Acemoglu, D., &amp;amp; Restrepo, P. (2018). &lt;a href=&#34;https://doi.org/10.1257/aer.20160696&#34;&gt;The Race between Man and Machine: Implications of Technology for Growth, Factor Shares, and Employment&lt;/a&gt;. &lt;em&gt;American Economic Review, 108&lt;/em&gt;(6), 1488–1542.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-aghionJonesJones2019&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-aghionJonesJones2019-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Aghion, P., Jones, B. F., &amp;amp; Jones, C. I. (2019). &lt;a href=&#34;https://doi.org/10.7208/chicago/9780226613475.003.0008&#34;&gt;Artificial Intelligence and Economic Growth&lt;/a&gt;. In &lt;em&gt;The Economics of Artificial Intelligence: An Agenda&lt;/em&gt; (pp. 237–282). University of Chicago Press.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-garicano2000&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-garicano2000-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Garicano, L. (2000). &lt;a href=&#34;https://doi.org/10.1086/262139&#34;&gt;Hierarchies and the Organization of Knowledge in Production&lt;/a&gt;. &lt;em&gt;Journal of Political Economy, 108&lt;/em&gt;(5), 874–904.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-garicanoRossiHansberg2006&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-garicanoRossiHansberg2006-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Garicano, L., &amp;amp; Rossi-Hansberg, E. (2006). &lt;a href=&#34;https://doi.org/10.1162/qjec.2006.121.4.1383&#34;&gt;Organization and Inequality in a Knowledge Economy&lt;/a&gt;. &lt;em&gt;Quarterly Journal of Economics, 121&lt;/em&gt;(4), 1383–1435.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-demsetz1968&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-demsetz1968-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Demsetz, H. (1968). &lt;a href=&#34;https://doi.org/10.1086/466643&#34;&gt;Why Regulate Utilities?&lt;/a&gt;. &lt;em&gt;Journal of Law and Economics, 11&lt;/em&gt;(1), 55–65.&lt;/li&gt;&#xA;&lt;li id=&#34;ref-baumolPanzarWillig1982&#34;&gt;&lt;span class=&#34;ref-back&#34;&gt;&lt;a href=&#34;#cite-baumolPanzarWillig1982-1&#34; aria-label=&#34;Back to citation&#34;&gt;↑&lt;/a&gt;&lt;/span&gt; Baumol, W. J., Panzar, J. C., &amp;amp; Willig, R. D. (1982). &lt;em&gt;Contestable Markets and the Theory of Industry Structure&lt;/em&gt;. Harcourt Brace Jovanovich.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;</description>
      <category>Thoughts</category>
      <pubDate>Thu, 19 Nov 2026 00:00:00 +0000</pubDate>
      <guid>https://mizore.blog/en/posts/organizing-intelligence/</guid>
    </item>
  </channel>
</rss>