<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Tonon Journey</title>
    <link>https://lucastononro.github.io/</link>
    <atom:link href="https://lucastononro.github.io/feed.xml" rel="self" type="application/rss+xml"/>
    <description>Lucas Tonon builds tools for coding agents and writes down what happened. Skills, experiments, and the occasional evening lost to a shell script.</description>
    <language>en</language>
    <managingEditor>tonon@vetto.ai (Lucas Tonon)</managingEditor>
    <lastBuildDate>Wed, 28 Oct 2026 13:23:59 GMT</lastBuildDate>
    <item>
      <title>how you could have invented muon from memory</title>
      <link>https://lucastononro.github.io/how-you-could-have-invented-muon-from-memory/</link>
      <guid isPermaLink="true">https://lucastononro.github.io/how-you-could-have-invented-muon-from-memory/</guid>
      <pubDate>Sun, 25 Oct 2026 12:00:00 GMT</pubDate>
      <description>The matrix trick hiding in plain sight that made AdamW look less inevitable.</description>
      <category>research</category>
      <content:encoded><![CDATA[<p>AdamW is a comfortable default. Then someone remembers that a matrix is a transformation, and suddenly there is a suspiciously simple optimizer to explain.</p>
<p>Let&#39;s try to invent it. We have a model, some data, and enough calculus and linear algebra to be dangerous. How should we change the weights?</p>
<p>We&#39;ll start with the obvious answer, gradient descent. Then we&#39;ll notice that a matrix does more than store a list of numbers. Taking that seriously will lead us to Muon&#39;s update. The aim is to make each choice follow from the previous one, so the formula becomes something we can reconstruct.</p>
<p>The optional explanations are folded away. Open whichever bits you need; there is no entrance exam.</p>
<h2 id="a-function-some-data-and-a-loss"><a class="anchor" href="#a-function-some-data-and-a-loss" aria-label="Permalink">§</a>A function, some data, and a loss</h2>
<p>A model is a mathematical function <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>f</mi><mi>θ</mi></msub><mo>:</mo><mi mathvariant="script">X</mi><mo>→</mo><mi mathvariant="script">Y</mi></mrow><annotation encoding="application/x-tex">f_\theta:\mathcal X\to\mathcal Y</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1076em;">f</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.1076em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">θ</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">:</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathcal" style="margin-right:0.1464em;">X</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">→</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7805em;vertical-align:-0.0972em;"></span><span class="mord mathcal" style="margin-right:0.0822em;">Y</span></span></span></span>,</span> with adjustable parameters <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">θ</span></span></span></span>.</span> We choose those parameters to approximate a relationship we do not know. In regression, call that relationship <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>f</mi><mo>∗</mo></msub></mrow><annotation encoding="application/x-tex">f_*</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1076em;">f</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1757em;"><span style="top:-2.55em;margin-left:-0.1076em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mbin mtight">∗</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>;</span> after fitting, our estimate is <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mover accent="true"><mi>f</mi><mo>^</mo></mover><mo>=</mo><msub><mi>f</mi><mover accent="true"><mi>θ</mi><mo>^</mo></mover></msub><mo>≈</mo><msub><mi>f</mi><mo>∗</mo></msub></mrow><annotation encoding="application/x-tex">\hat f=f_{\hat\theta}\approx f_*</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.1523em;vertical-align:-0.1944em;"></span><span class="mord accent"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.9579em;"><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord mathnormal" style="margin-right:0.1076em;">f</span></span><span style="top:-3.2634em;"><span class="pstrut" style="height:3em;"></span><span class="accent-body" style="left:-0.0833em;"><span class="mord">^</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.1944em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.0202em;vertical-align:-0.3257em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1076em;">f</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3448em;"><span style="top:-2.3743em;margin-left:-0.1076em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord accent mtight"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.9579em;"><span style="top:-2.7em;"><span class="pstrut" style="height:2.7em;"></span><span class="mord mathnormal mtight" style="margin-right:0.0278em;">θ</span></span><span style="top:-2.9634em;"><span class="pstrut" style="height:2.7em;"></span><span class="accent-body" style="left:-0.1667em;"><span class="mord mtight">^</span></span></span></span></span></span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.3257em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">≈</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1076em;">f</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1757em;"><span style="top:-2.55em;margin-left:-0.1076em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mbin mtight">∗</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>.</span> The hat means &quot;estimated from data&quot;.</p>
<p>This covers a line <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>f</mi><mi>θ</mi></msub><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><mo>=</mo><mi>a</mi><mi>x</mi><mo>+</mo><mi>b</mi></mrow><annotation encoding="application/x-tex">f_\theta(x)=ax+b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1076em;">f</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.1076em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">θ</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6667em;vertical-align:-0.0833em;"></span><span class="mord mathnormal">a</span><span class="mord mathnormal">x</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">b</span></span></span></span>,</span> a vision network, or an LLM. For an LLM, the output is a probability distribution over possible next tokens. We are estimating a conditional distribution, rather than assuming every input has one inevitable answer.</p>
<p>A <strong>loss</strong> turns &quot;how well are we doing?&quot; into a number to minimize. It doesn&#39;t have to be a <a href="https://en.wikipedia.org/wiki/Metric_space#Definition" target="_blank" rel="noopener noreferrer" class="external">distance in the formal mathematical sense</a>. Here, it measures what we intuitively call distance or difference: how far the model&#39;s predictions are from what we want.</p>
<p>For regression, our training data consists of pairs <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><msub><mi>x</mi><mi>i</mi></msub><mo separator="true">,</mo><msub><mi>y</mi><mi>i</mi></msub><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(x_i,y_i)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">y</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span></span></span></span>.</span> The input is <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>x</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">x_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>,</span> the desired output is <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>y</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">y_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">y</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>,</span> and the model predicts <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>f</mi><mi>θ</mi></msub><mo stretchy="false">(</mo><msub><mi>x</mi><mi>i</mi></msub><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">f_\theta(x_i)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1076em;">f</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.1076em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">θ</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span></span></span></span>.</span> For a language model, <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>x</mi><mi>t</mi></msub></mrow><annotation encoding="application/x-tex">x_t</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> is the observed token at position <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>t</mi></mrow><annotation encoding="application/x-tex">t</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6151em;"></span><span class="mord mathnormal">t</span></span></span></span>,</span> and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>x</mi><mrow><mo>&lt;</mo><mi>t</mi></mrow></msub></mrow><annotation encoding="application/x-tex">x_{&lt;t}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6079em;vertical-align:-0.1774em;"></span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mrel mtight">&lt;</span><span class="mord mathnormal mtight">t</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.1774em;"><span></span></span></span></span></span></span></span></span></span></span> is the preceding context. Two common losses are</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><msub><mi>L</mi><mrow><mi mathvariant="normal">r</mi><mi mathvariant="normal">e</mi><mi mathvariant="normal">g</mi></mrow></msub><mo stretchy="false">(</mo><mi>θ</mi><mo stretchy="false">)</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mfrac><mn>1</mn><mi>N</mi></mfrac><munderover><mo>∑</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>N</mi></munderover><mo fence="true" stretchy="true" minsize="1.2em" maxsize="1.2em">(</mo><msub><mi>f</mi><mi>θ</mi></msub><mo stretchy="false">(</mo><msub><mi>x</mi><mi>i</mi></msub><mo stretchy="false">)</mo><mo>−</mo><msub><mi>y</mi><mi>i</mi></msub><msup><mo fence="true" stretchy="true" minsize="1.2em" maxsize="1.2em">)</mo><mn>2</mn></msup><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><msub><mi>L</mi><mrow><mi mathvariant="normal">L</mi><mi mathvariant="normal">M</mi></mrow></msub><mo stretchy="false">(</mo><mi>θ</mi><mo stretchy="false">)</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mo>−</mo><mfrac><mn>1</mn><mi>T</mi></mfrac><munderover><mo>∑</mo><mrow><mi>t</mi><mo>=</mo><mn>1</mn></mrow><mi>T</mi></munderover><mi>log</mi><mo>⁡</mo><msub><mi>p</mi><mi>θ</mi></msub><mo stretchy="false">(</mo><msub><mi>x</mi><mi>t</mi></msub><mo>∣</mo><msub><mi>x</mi><mrow><mo>&lt;</mo><mi>t</mi></mrow></msub><mo stretchy="false">)</mo><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
L_{\mathrm{reg}}(\theta)
&amp;=\frac1N\sum_{i=1}^N\bigl(f_\theta(x_i)-y_i\bigr)^2,\\[10pt]
L_{\mathrm{LM}}(\theta)
&amp;=-\frac1T\sum_{t=1}^T\log p_\theta(x_t\mid x_{&lt;t}).
\end{aligned}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:6.5838em;vertical-align:-3.0419em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:3.5419em;"><span style="top:-5.5419em;"><span class="pstrut" style="height:3.8283em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal">L</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathrm mtight" style="margin-right:0.0139em;">reg</span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.0278em;">θ</span><span class="mclose">)</span></span></span><span style="top:-2.0536em;"><span class="pstrut" style="height:3.8283em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal">L</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathrm mtight">LM</span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.0278em;">θ</span><span class="mclose">)</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:3.0419em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:3.5419em;"><span style="top:-5.5419em;"><span class="pstrut" style="height:3.8283em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.3214em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">N</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.686em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.8283em;"><span style="top:-1.8723em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">i</span><span class="mrel mtight">=</span><span class="mord mtight">1</span></span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span><span style="top:-4.3em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.109em;">N</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.2777em;"><span></span></span></span></span></span><span class="mopen"><span class="delimsizing size1">(</span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1076em;">f</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.1076em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">θ</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">y</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose"><span class="mclose"><span class="delimsizing size1">)</span></span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:1.054em;"><span style="top:-3.3029em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mpunct">,</span></span></span><span style="top:-2.0536em;"><span class="pstrut" style="height:3.8283em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord">−</span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.3214em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1389em;">T</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.686em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.8283em;"><span style="top:-1.8829em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">t</span><span class="mrel mtight">=</span><span class="mord mtight">1</span></span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span><span style="top:-4.3em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">T</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.2671em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop">lo<span style="margin-right:0.0139em;">g</span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">p</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">θ</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∣</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mrel mtight">&lt;</span><span class="mord mathnormal mtight">t</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.1774em;"><span></span></span></span></span></span></span><span class="mclose">)</span><span class="mord">.</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:3.0419em;"><span></span></span></span></span></span></span></span></span></span></span></span></div>
<p>The first is mean squared error over <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.109em;">N</span></span></span></span></span> input/output pairs. The second is token cross-entropy over <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi></mrow><annotation encoding="application/x-tex">T</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.1389em;">T</span></span></span></span></span> predicted tokens: it penalizes assigning low probability to the token that actually occurred. A lower loss means improvement on this objective; choosing a useful objective is our responsibility.</p>
<details class="muon-aside" id="cross-entropy-refresher">
<summary>Why does low token probability give a large loss?</summary>

<p>For a target distribution <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">y</span></span></span></span></span> and predicted probabilities <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi></mrow><annotation encoding="application/x-tex">p</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">p</span></span></span></span>,</span> <a href="https://d2l.ai/chapter_linear-classification/softmax-regression.html" target="_blank" rel="noopener noreferrer" class="external">cross-entropy</a> is <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><msub><mo>∑</mo><mi>j</mi></msub><msub><mi>y</mi><mi>j</mi></msub><mi>log</mi><mo>⁡</mo><msub><mi>p</mi><mi>j</mi></msub></mrow><annotation encoding="application/x-tex">-\sum_j y_j\log p_j</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.1858em;vertical-align:-0.4358em;"></span><span class="mord">−</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop"><span class="mop op-symbol small-op" style="position:relative;top:0em;">∑</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.162em;"><span style="top:-2.4003em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">j</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.4358em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">y</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">j</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop">lo<span style="margin-right:0.0139em;">g</span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">p</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">j</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span></span></span></span>.</span> A <a href="https://en.wikipedia.org/wiki/One-hot" target="_blank" rel="noopener noreferrer" class="external">one-hot</a> target puts all its mass on the observed token, so only <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><mi>log</mi><mo>⁡</mo><mi>p</mi><mo stretchy="false">(</mo><mtext>observed token</mtext><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">-\log p(\text{observed token})</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">−</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop">lo<span style="margin-right:0.0139em;">g</span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal">p</span><span class="mopen">(</span><span class="mord text"><span class="mord">observed token</span></span><span class="mclose">)</span></span></span></span></span> remains.</p>
<p>Giving the correct token probability <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0.8</mn></mrow><annotation encoding="application/x-tex">0.8</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.8</span></span></span></span></span> costs about <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0.223</mn></mrow><annotation encoding="application/x-tex">0.223</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.223</span></span></span></span></span> nats. Giving it <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0.2</mn></mrow><annotation encoding="application/x-tex">0.2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.2</span></span></span></span></span> costs about <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1.609</mn></mrow><annotation encoding="application/x-tex">1.609</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1.609</span></span></span></span>.</span> The negative logarithm makes confident mistakes expensive. Averaging this quantity over tokens gives the loss above.</p>
</details>

<p>Training moves <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">θ</span></span></span></span></span> through a space with one dimension per parameter. We want a useful direction and a sensible distance. We get local information about the loss, not a map showing the best route to the bottom.</p>
<h2 id="first-take-a-step-downhill"><a class="anchor" href="#first-take-a-step-downhill" aria-label="Permalink">§</a>First, take a step downhill</h2>
<p>So far, <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">θ</span></span></span></span></span> has meant all the model&#39;s adjustable parameters. To work out one update, focus on the weight matrix of a single layer, <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>W</mi><mo>∈</mo><msup><mi mathvariant="double-struck">R</mi><mrow><mi>m</mi><mo>×</mo><mi>n</mi></mrow></msup></mrow><annotation encoding="application/x-tex">W\in\mathbb R^{m\times n}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7224em;vertical-align:-0.0391em;"></span><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7713em;"></span><span class="mord"><span class="mord mathbb">R</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7713em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">m</span><span class="mbin mtight">×</span><span class="mord mathnormal mtight">n</span></span></span></span></span></span></span></span></span></span></span></span>,</span> and hold the other parameters fixed. We will write the loss as <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>L</mi><mo stretchy="false">(</mo><mi>W</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">L(W)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">L</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="mclose">)</span></span></span></span></span> to show which parameters we are changing. It is the same training objective, viewed as a smaller optimization problem.</p>
<p>Once we have a rule for this matrix, we can apply it to other weight matrices too. Biases and other parameter shapes may use a different update rule. For now, assume <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>L</mi><mo stretchy="false">(</mo><mi>W</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">L(W)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">L</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="mclose">)</span></span></span></span></span> is differentiable: small weight changes have a first-order effect that we can predict from the local slopes.</p>
<p>An optimizer adds a <strong>step</strong> <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span></span></span></span>,</span> with the same shape as <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>W</mi></mrow><annotation encoding="application/x-tex">W</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.1389em;">W</span></span></span></span>:</span></p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>W</mi><mrow><mi mathvariant="normal">n</mi><mi mathvariant="normal">e</mi><mi mathvariant="normal">w</mi></mrow></msub><mo>=</mo><mi>W</mi><mo>+</mo><mi>D</mi><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">W_{\mathrm{new}}=W+D.</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathrm mtight" style="margin-right:0.0139em;">new</span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7667em;vertical-align:-0.0833em;"></span><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord">.</span></span></span></span></span></div>
<p>Each <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>D</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub></mrow><annotation encoding="application/x-tex">D_{ij}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.9694em;vertical-align:-0.2861em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0278em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span></span></span></span></span> says how much to change the corresponding weight <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>W</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub></mrow><annotation encoding="application/x-tex">W_{ij}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.9694em;vertical-align:-0.2861em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span></span></span></span>.</span> We keep uppercase <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>W</mi></mrow><annotation encoding="application/x-tex">W</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.1389em;">W</span></span></span></span></span> and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span></span></span></span></span> for the whole matrices throughout this derivation. In the small examples below, lowercase <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>w</mi><mn>1</mn></msub><mo separator="true">,</mo><msub><mi>w</mi><mn>2</mn></msub></mrow><annotation encoding="application/x-tex">w_1,w_2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0269em;">w</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0269em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0269em;">w</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0269em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> denote individual weights.</p>
<p>The gradient matrix <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi></mrow><annotation encoding="application/x-tex">G</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal">G</span></span></span></span></span> collects the partial derivatives, <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>G</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub><mo>=</mo><mi mathvariant="normal">∂</mi><mi>L</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">∂</mi><msub><mi>W</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub></mrow><annotation encoding="application/x-tex">G_{ij}=\partial L/\partial W_{ij}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.9694em;vertical-align:-0.2861em;"></span><span class="mord"><span class="mord mathnormal">G</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.0361em;vertical-align:-0.2861em;"></span><span class="mord" style="margin-right:0.0556em;">∂</span><span class="mord mathnormal">L</span><span class="mord">/</span><span class="mord" style="margin-right:0.0556em;">∂</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span></span></span></span>.</span> Each entry measures the local change in loss per tiny change in that weight, with the others held fixed. A positive slope says increasing the weight raises the loss locally; a negative slope says the opposite.</p>
<p>The gradient gives us slopes. To turn them into an actual step, choose a positive scale <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi></mrow><annotation encoding="application/x-tex">\alpha</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal" style="margin-right:0.0037em;">α</span></span></span></span>,</span> called the <strong>learning rate</strong>, and define</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>D</mi><mo>=</mo><mo>−</mo><mi>α</mi><mi>G</mi><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">D=-\alpha G.</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7667em;vertical-align:-0.0833em;"></span><span class="mord">−</span><span class="mord mathnormal" style="margin-right:0.0037em;">α</span><span class="mord mathnormal">G</span><span class="mord">.</span></span></span></span></span></div>
<p>The minus sign reverses the slopes; <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi></mrow><annotation encoding="application/x-tex">\alpha</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal" style="margin-right:0.0037em;">α</span></span></span></span></span> controls how far we move along them. This is gradient descent. Whether it lowers the actual loss still depends on how large a step we take.</p>
<link rel="stylesheet" href="/muon-animations.css">

<details class="muon-aside" id="derivative-refresher">
<summary>Derivatives and partial derivatives, without the ceremony</summary>

<p>For <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mo stretchy="false">(</mo><mi>w</mi><mo stretchy="false">)</mo><mo>=</mo><msup><mi>w</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">f(w)=w^2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.1076em;">f</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.0269em;">w</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8141em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0269em;">w</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span></span></span>,</span> changing <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>w</mi><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">w=1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal" style="margin-right:0.0269em;">w</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span></span> by <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>h</mi></mrow><annotation encoding="application/x-tex">h</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">h</span></span></span></span></span> changes the output by <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>2</mn><mi>h</mi><mo>+</mo><msup><mi>h</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">2h+h^2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7778em;vertical-align:-0.0833em;"></span><span class="mord">2</span><span class="mord mathnormal">h</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.8141em;"></span><span class="mord"><span class="mord mathnormal">h</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span></span></span>.</span> Divide by <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>h</mi></mrow><annotation encoding="application/x-tex">h</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">h</span></span></span></span></span> to get the average slope <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>2</mn><mo>+</mo><mi>h</mi></mrow><annotation encoding="application/x-tex">2+h</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">2</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">h</span></span></span></span>.</span> As <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>h</mi></mrow><annotation encoding="application/x-tex">h</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">h</span></span></span></span></span> approaches zero, this approaches the derivative <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>f</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo stretchy="false">(</mo><mn>1</mn><mo stretchy="false">)</mo><mo>=</mo><mn>2</mn></mrow><annotation encoding="application/x-tex">f&#x27;(1)=2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0019em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1076em;">f</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7519em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">′</span></span></span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord">1</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">2</span></span></span></span>.</span></p>
<figure class="diagram"><svg xmlns="http://www.w3.org/2000/svg" class="muon-film" id="muon-derivatives" viewBox="0 0 720 480" role="img" aria-labelledby="muon-derivatives-title"><title id="muon-derivatives-title">A shrinking secant interval reveals the derivative</title><desc>Secant slope 2.020 for h=0.020 approaches the tangent slope 2.</desc><text x="24" y="28" class="mf-strong" text-anchor="start">A derivative is a limiting slope</text><text x="24" y="54" class="mf-small" text-anchor="start">Shrink the interval; keep the starting point fixed.</text><line x1="56.7" y1="338" x2="369.25" y2="338" class="mf-axis" /><line x1="70" y1="355.4" x2="70" y2="82.79999999999998" class="mf-axis" /><polyline fill="none" points="70.00,338.00 74.66,337.93 79.31,337.72 83.97,337.36 88.62,336.86 93.28,336.22 97.93,335.44 102.59,334.52 107.24,333.45 111.90,332.24 116.55,330.89 121.20,329.40 125.86,327.77 130.51,325.99 135.17,324.07 139.82,322.01 144.48,319.81 149.13,317.47 153.79,314.98 158.44,312.35 163.10,309.58 167.75,306.67 172.41,303.61 177.06,300.41 181.72,297.08 186.38,293.59 191.03,289.97 195.69,286.20 200.34,282.30 205.00,278.25 209.65,274.06 214.31,269.72 218.96,265.24 223.62,260.63 228.27,255.87 232.93,250.96 237.58,245.92 242.24,240.73 246.89,235.40 251.54,229.93 256.20,224.32 260.86,218.56 265.51,212.67 270.16,206.63 274.82,200.45 279.48,194.12 284.13,187.66 288.78,181.05 293.44,174.30 298.10,167.41 302.75,160.38 307.41,153.20 312.06,145.88 316.72,138.42 321.37,130.82 326.03,123.07 330.68,115.19 335.34,107.16 339.99,98.99 344.64,90.67 349.30,82.22" class="mf-curve"/><line x1="136.5" y1="338" x2="336" y2="164" class="mf-ink mf-dashed" /><line x1="156.45" y1="321.006" x2="342.65" y2="156.98200000000003" class="mf-memory-arrow" /><line x1="203" y1="280" x2="205.66" y2="280" class="mf-objective" /><line x1="205.66" y1="280" x2="205.66" y2="277.6568" class="mf-objective" /><circle cx="203" cy="280" r="5" class="mf-open"/><circle cx="205.66" cy="277.6568" r="6" class="mf-blue-dot"/><text x="203" y="366" class="mf-small" text-anchor="middle">1</text><text x="205.66" y="392" class="mf-small" text-anchor="middle">1 + h</text><text x="374" y="358" class="mf-small" text-anchor="start">w</text><foreignObject x="385" y="124" width="311" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="mf-memory-math" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mfrac><mrow><mi>f</mi><mo stretchy="false">(</mo><mn>1</mn><mo>+</mo><mi>h</mi><mo stretchy="false">)</mo><mo>−</mo><mi>f</mi><mo stretchy="false">(</mo><mn>1</mn><mo stretchy="false">)</mo></mrow><mi>h</mi></mfrac><mo>=</mo><mn>2</mn><mo>+</mo><mi>h</mi></mrow><annotation encoding="application/x-tex">\frac{f(1+h)-f(1)}h=2+h</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.355em;vertical-align:-0.345em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.01em;"><span style="top:-2.655em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">h</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.485em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.1076em;">f</span><span class="mopen mtight">(</span><span class="mord mtight">1</span><span class="mbin mtight">+</span><span class="mord mathnormal mtight">h</span><span class="mclose mtight">)</span><span class="mbin mtight">−</span><span class="mord mathnormal mtight" style="margin-right:0.1076em;">f</span><span class="mopen mtight">(</span><span class="mord mtight">1</span><span class="mclose mtight">)</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.345em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">2</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">h</span></span></span></span></span></div></foreignObject><text x="540.5" y="222" class="mf-small" text-anchor="middle">h = 0.020</text><text x="540.5" y="260" class="mf-blue-text" text-anchor="middle">secant slope = 2.020</text><foreignObject x="385" y="282" width="311" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>f</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo stretchy="false">(</mo><mn>1</mn><mo stretchy="false">)</mo><mo>=</mo><msub><mrow><mi>lim</mi><mo>⁡</mo></mrow><mrow><mi>h</mi><mo>→</mo><mn>0</mn></mrow></msub><mo stretchy="false">(</mo><mn>2</mn><mo>+</mo><mi>h</mi><mo stretchy="false">)</mo><mo>=</mo><mn>2</mn></mrow><annotation encoding="application/x-tex">f&#x27;(1)=\lim_{h\to0}(2+h)=2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0019em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1076em;">f</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7519em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">′</span></span></span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord">1</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mop"><span class="mop">lim</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">h</span><span class="mrel mtight">→</span><span class="mord mtight">0</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord">2</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">h</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">2</span></span></span></span></span></div></foreignObject><text x="24" y="453" class="mf-small" text-anchor="start">Blue: secant · dashed: tangent · curve: f(w) = w²</text></svg>
<figcaption>The moving point approaches w = 1. The blue secant measures the slope over a finite interval; the dashed tangent shows its limit. A partial derivative does the same experiment while holding the other weights fixed.</figcaption></figure>
<div class="muon-controls" data-animation="derivatives"><button data-action="play" disabled>Play animation</button><button data-action="restart" disabled>Restart</button><button data-action="previous-step" disabled>← Back</button><button data-action="next-step" disabled>Next →</button><span data-status>Shrink the interval and watch the slope settle.</span></div>

<p>A derivative measures slope. A second derivative measures how that slope changes, which is curvature. If every partial derivative is zero, we have a stationary point. It could be a minimum, a maximum, or a saddle. Zero does not come with a &quot;best possible answer&quot; certificate.</p>
</details>

<details class="muon-aside" id="gradient-worked-example">
<summary>Work out a two-weight loss and its gradient</summary>

<p>Let two predictions be <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mover accent="true"><mi>y</mi><mo>^</mo></mover><mn>1</mn></msub><mo>=</mo><msub><mi>w</mi><mn>1</mn></msub></mrow><annotation encoding="application/x-tex">\hat y_1=w_1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord"><span class="mord accent"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.6944em;"><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">y</span></span><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="accent-body" style="left:-0.1944em;"><span class="mord">^</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.1944em;"><span></span></span></span></span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0269em;">w</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0269em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mover accent="true"><mi>y</mi><mo>^</mo></mover><mn>2</mn></msub><mo>=</mo><mn>2</mn><msub><mi>w</mi><mn>2</mn></msub></mrow><annotation encoding="application/x-tex">\hat y_2=2w_2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord"><span class="mord accent"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.6944em;"><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">y</span></span><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="accent-body" style="left:-0.1944em;"><span class="mord">^</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.1944em;"><span></span></span></span></span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7944em;vertical-align:-0.15em;"></span><span class="mord">2</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0269em;">w</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0269em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>,</span> both with target zero. Half the sum of squared errors gives</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>L</mi><mo stretchy="false">(</mo><msub><mi>w</mi><mn>1</mn></msub><mo separator="true">,</mo><msub><mi>w</mi><mn>2</mn></msub><mo stretchy="false">)</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mstyle scriptlevel="0" displaystyle="false"><mfrac><mn>1</mn><mn>2</mn></mfrac></mstyle><mo fence="true" stretchy="true" minsize="1.2em" maxsize="1.2em">[</mo><mo stretchy="false">(</mo><msub><mover accent="true"><mi>y</mi><mo>^</mo></mover><mn>1</mn></msub><mo>−</mo><mn>0</mn><msup><mo stretchy="false">)</mo><mn>2</mn></msup><mo>+</mo><mo stretchy="false">(</mo><msub><mover accent="true"><mi>y</mi><mo>^</mo></mover><mn>2</mn></msub><mo>−</mo><mn>0</mn><msup><mo stretchy="false">)</mo><mn>2</mn></msup><mo fence="true" stretchy="true" minsize="1.2em" maxsize="1.2em">]</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mstyle scriptlevel="0" displaystyle="false"><mfrac><mn>1</mn><mn>2</mn></mfrac></mstyle><mo fence="true" stretchy="true" minsize="1.2em" maxsize="1.2em">[</mo><msubsup><mi>w</mi><mn>1</mn><mn>2</mn></msubsup><mo>+</mo><mo stretchy="false">(</mo><mn>2</mn><msub><mi>w</mi><mn>2</mn></msub><msup><mo stretchy="false">)</mo><mn>2</mn></msup><mo fence="true" stretchy="true" minsize="1.2em" maxsize="1.2em">]</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mstyle scriptlevel="0" displaystyle="false"><mfrac><mn>1</mn><mn>2</mn></mfrac></mstyle><mo stretchy="false">(</mo><msubsup><mi>w</mi><mn>1</mn><mn>2</mn></msubsup><mo>+</mo><mn>4</mn><msubsup><mi>w</mi><mn>2</mn><mn>2</mn></msubsup><mo stretchy="false">)</mo><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
L(w_1,w_2)
&amp;=\tfrac12\bigl[(\hat y_1-0)^2+(\hat y_2-0)^2\bigr]\\[10pt]
&amp;=\tfrac12\bigl[w_1^2+(2w_2)^2\bigr]\\[10pt]
&amp;=\tfrac12(w_1^2+4w_2^2).
\end{aligned}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:6.2723em;vertical-align:-2.8862em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:3.3862em;"><span style="top:-5.5221em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">L</span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0269em;">w</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0269em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0269em;">w</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0269em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span></span></span><span style="top:-2.9979em;"><span class="pstrut" style="height:3em;"></span><span class="mord"></span></span><span style="top:-0.4738em;"><span class="pstrut" style="height:3em;"></span><span class="mord"></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:2.8862em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:3.3862em;"><span style="top:-5.5221em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8451em;"><span style="top:-2.655em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">2</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.345em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mopen"><span class="delimsizing size1">[</span></span><span class="mopen">(</span><span class="mord"><span class="mord accent"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.6944em;"><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">y</span></span><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="accent-body" style="left:-0.1944em;"><span class="mord">^</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.1944em;"><span></span></span></span></span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord">0</span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mopen">(</span><span class="mord"><span class="mord accent"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.6944em;"><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">y</span></span><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="accent-body" style="left:-0.1944em;"><span class="mord">^</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.1944em;"><span></span></span></span></span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord">0</span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mclose"><span class="delimsizing size1">]</span></span></span></span><span style="top:-2.9979em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8451em;"><span style="top:-2.655em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">2</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.345em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mopen"><span class="delimsizing size1">[</span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0269em;">w</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-2.453em;margin-left:-0.0269em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mopen">(</span><span class="mord">2</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0269em;">w</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0269em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mclose"><span class="delimsizing size1">]</span></span></span></span><span style="top:-0.4738em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8451em;"><span style="top:-2.655em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">2</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.345em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0269em;">w</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-2.453em;margin-left:-0.0269em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord">4</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0269em;">w</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-2.453em;margin-left:-0.0269em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mclose">)</span><span class="mord">.</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:2.8862em;"><span></span></span></span></span></span></span></span></span></span></span></span></div>
<p>The <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow><annotation encoding="application/x-tex">1/2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">1/2</span></span></span></span></span> tidies the derivatives. The <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>4</mn></mrow><annotation encoding="application/x-tex">4</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">4</span></span></span></span></span> comes from squaring the second prediction&#39;s factor of <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>2</mn></mrow><annotation encoding="application/x-tex">2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">2</span></span></span></span>.</span> In this two-weight example, collect the derivatives in a vector <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi></mrow><annotation encoding="application/x-tex">g</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">g</span></span></span></span>:</span></p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mi>g</mi></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mrow><mo fence="true">(</mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>L</mi></mrow><mrow><mi mathvariant="normal">∂</mi><msub><mi>w</mi><mn>1</mn></msub></mrow></mfrac><mo separator="true">,</mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>L</mi></mrow><mrow><mi mathvariant="normal">∂</mi><msub><mi>w</mi><mn>2</mn></msub></mrow></mfrac><mo fence="true">)</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mrow><mo fence="true">(</mo><mstyle scriptlevel="0" displaystyle="false"><mfrac><mn>1</mn><mn>2</mn></mfrac></mstyle><mo>⋅</mo><mn>2</mn><msub><mi>w</mi><mn>1</mn></msub><mo separator="true">,</mo><mstyle scriptlevel="0" displaystyle="false"><mfrac><mn>1</mn><mn>2</mn></mfrac></mstyle><mo>⋅</mo><mn>8</mn><msub><mi>w</mi><mn>2</mn></msub><mo fence="true">)</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mo stretchy="false">(</mo><msub><mi>w</mi><mn>1</mn></msub><mo separator="true">,</mo><mn>4</mn><msub><mi>w</mi><mn>2</mn></msub><mo stretchy="false">)</mo><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
g&amp;=\left(\frac{\partial L}{\partial w_1},\frac{\partial L}{\partial w_2}\right)\\[12pt]
&amp;=\left(\tfrac12\cdot2w_1,\tfrac12\cdot8w_2\right)\\[10pt]
&amp;=(w_1,4w_2).
\end{aligned}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:7.02em;vertical-align:-3.26em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:3.76em;"><span style="top:-5.76em;"><span class="pstrut" style="height:3.45em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">g</span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.45em;"></span><span class="mord"></span></span><span style="top:-0.55em;"><span class="pstrut" style="height:3.45em;"></span><span class="mord"></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:3.26em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:3.76em;"><span style="top:-5.76em;"><span class="pstrut" style="height:3.45em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">(</span></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.3714em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord" style="margin-right:0.0556em;">∂</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0269em;">w</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0269em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord" style="margin-right:0.0556em;">∂</span><span class="mord mathnormal">L</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.836em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.3714em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord" style="margin-right:0.0556em;">∂</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0269em;">w</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0269em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord" style="margin-right:0.0556em;">∂</span><span class="mord mathnormal">L</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.836em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">)</span></span></span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.45em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size1">(</span></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8451em;"><span style="top:-2.655em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">2</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.345em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">⋅</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord">2</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0269em;">w</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0269em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8451em;"><span style="top:-2.655em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">2</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.345em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">⋅</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord">8</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0269em;">w</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0269em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size1">)</span></span></span></span></span><span style="top:-0.55em;"><span class="pstrut" style="height:3.45em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0269em;">w</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0269em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">4</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0269em;">w</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0269em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span><span class="mord">.</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:3.26em;"><span></span></span></span></span></span></span></span></span></span></span></span></div>
<p>A real network chains layers together. An early weight affects later activations, then the prediction, then the loss. <a href="https://d2l.ai/chapter_multilayer-perceptrons/backprop.html" target="_blank" rel="noopener noreferrer" class="external">Backpropagation</a> applies the chain rule through those layers to compute the same kind of partial derivatives.</p>
</details>

<p>Choosing <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span></span></span></span></span> gets harder when the loss has curved valleys, flat regions, saddles, or several minima. A downhill step can settle in a shallow basin even when a deeper one exists elsewhere.</p>
<p>The surface below has two minima. The first run settles in the higher one. Try the other basin to see a different result. You can also drag the graph to look around and zoom with the buttons.</p>
<figure class="diagram"><svg xmlns="http://www.w3.org/2000/svg" class="muon-film" id="muon-gd" viewBox="0 0 640 490" role="img" aria-labelledby="muon-gd-title"><title id="muon-gd-title">Rotate a loss surface with two basins and follow computed gradient descent</title><desc>Step 15. Weights −0.816, 0.000. Loss 1.1010. A computed gradient path descends a three-dimensional surface with two basins. The floor trail shows parameter positions.</desc><g clip-path="url(#muon-surface-clip)"><g class="mf-floor"><line x1="222.3437368019196" y1="249.79643906615422" x2="136.48284898252186" y2="331.97764513528625" class="mf-axis" /><line x1="250.46107822347545" y1="258.6190306460102" x2="164.60019040407772" y2="340.8002367151422" class="mf-axis" /><line x1="278.5784196450313" y1="267.4416222258661" x2="192.71753182563356" y2="349.62282829499816" class="mf-axis" /><line x1="306.6957610665872" y1="276.2642138057221" x2="220.83487324718945" y2="358.4454198748541" class="mf-axis" /><line x1="334.81310248814304" y1="285.08680538557803" x2="248.95221466874528" y2="367.26801145471006" class="mf-axis" /><line x1="362.93044390969885" y1="293.909396965434" x2="277.06955609030115" y2="376.090603034566" class="mf-axis" /><line x1="391.0477853312547" y1="302.73198854528994" x2="305.186897511857" y2="384.91319461442197" class="mf-axis" /><line x1="419.1651267528106" y1="311.5545801251459" x2="333.3042389334129" y2="393.7357861942779" class="mf-axis" /><line x1="447.28246817436644" y1="320.37717170500184" x2="361.42158035496874" y2="402.5583777741339" class="mf-axis" /><line x1="475.3998095959223" y1="329.1997632848578" x2="389.5389217765246" y2="411.3809693539898" class="mf-axis" /><line x1="208.28506609114166" y1="245.38514327622624" x2="517.5758217282561" y2="342.4336506546417" class="mf-axis" /><line x1="197.55245511371692" y1="255.65779403486775" x2="506.8432107508313" y2="352.70630141328326" class="mf-axis" /><line x1="186.81984413629223" y1="265.93044479350925" x2="496.11059977340665" y2="362.97895217192473" class="mf-axis" /><line x1="176.08723315886752" y1="276.2030955521507" x2="485.37798879598193" y2="373.25160293056626" class="mf-axis" /><line x1="165.3546221814428" y1="286.47574631079226" x2="474.6453778185572" y2="383.52425368920774" class="mf-axis" /><line x1="154.62201120401807" y1="296.74839706943374" x2="463.91276684113245" y2="393.7969044478493" class="mf-axis" /><line x1="143.88940022659338" y1="307.02104782807527" x2="453.1801558637078" y2="404.06955520649075" class="mf-axis" /><line x1="133.15678924916867" y1="317.29369858671674" x2="442.4475448862831" y2="414.3422059651323" class="mf-axis" /><line x1="122.42417827174393" y1="327.5663493453583" x2="431.71493390885837" y2="424.61485672377376" class="mf-axis" /></g><polygon points="229.78,218.82 238.37,226.75 234.79,238.35 226.20,230.42" class="mf-surface-face" fill-opacity="0.189"/><polygon points="221.19,208.49 229.78,218.82 226.20,230.42 217.61,220.09" class="mf-surface-face" fill-opacity="0.189"/><polygon points="226.20,230.42 234.79,238.35 231.21,248.47 222.62,240.54" class="mf-surface-face" fill-opacity="0.194"/><polygon points="217.61,220.09 226.20,230.42 222.62,240.54 214.03,230.21" class="mf-surface-face" fill-opacity="0.191"/><polygon points="233.35,205.73 241.95,213.66 238.37,226.75 229.78,218.82" class="mf-surface-face" fill-opacity="0.185"/><polygon points="224.76,195.40 233.35,205.73 229.78,218.82 221.19,208.49" class="mf-surface-face" fill-opacity="0.186"/><polygon points="238.37,226.75 246.96,232.72 243.38,244.33 234.79,238.35" class="mf-surface-face" fill-opacity="0.187"/><polygon points="222.62,240.54 231.21,248.47 227.64,257.10 219.04,249.17" class="mf-surface-face" fill-opacity="0.199"/><polygon points="234.79,238.35 243.38,244.33 239.80,254.44 231.21,248.47" class="mf-surface-face" fill-opacity="0.193"/><polygon points="214.03,230.21 222.62,240.54 219.04,249.17 210.45,238.83" class="mf-surface-face" fill-opacity="0.193"/><polygon points="212.59,195.28 221.19,208.49 217.61,220.09 209.02,206.88" class="mf-surface-face" fill-opacity="0.186"/><polygon points="241.95,213.66 250.54,219.63 246.96,232.72 238.37,226.75" class="mf-surface-face" fill-opacity="0.182"/><polygon points="209.02,206.88 217.61,220.09 214.03,230.21 205.44,217.00" class="mf-surface-face" fill-opacity="0.186"/><polygon points="236.93,191.15 245.52,199.08 241.95,213.66 233.35,205.73" class="mf-surface-face" fill-opacity="0.182"/><polygon points="228.34,180.82 236.93,191.15 233.35,205.73 224.76,195.40" class="mf-surface-face" fill-opacity="0.184"/><polygon points="216.17,182.19 224.76,195.40 221.19,208.49 212.59,195.28" class="mf-surface-face" fill-opacity="0.185"/><polygon points="231.21,248.47 239.80,254.44 236.23,263.07 227.64,257.10" class="mf-surface-face" fill-opacity="0.201"/><polygon points="205.44,217.00 214.03,230.21 210.45,238.83 201.86,225.63" class="mf-surface-face" fill-opacity="0.184"/><polygon points="245.52,199.08 254.11,205.06 250.54,219.63 241.95,213.66" class="mf-surface-face" fill-opacity="0.179"/><polygon points="246.96,232.72 255.55,237.15 251.97,248.75 243.38,244.33" class="mf-surface-face" fill-opacity="0.183"/><polygon points="219.04,249.17 227.64,257.10 224.06,264.24 215.47,256.31" class="mf-surface-face" fill-opacity="0.203"/><polygon points="210.45,238.83 219.04,249.17 215.47,256.31 206.88,245.98" class="mf-surface-face" fill-opacity="0.192"/><polygon points="219.75,167.61 228.34,180.82 224.76,195.40 216.17,182.19" class="mf-surface-face" fill-opacity="0.184"/><polygon points="243.38,244.33 251.97,248.75 248.40,258.87 239.80,254.44" class="mf-surface-face" fill-opacity="0.189"/><polygon points="250.54,219.63 259.13,224.06 255.55,237.15 246.96,232.72" class="mf-surface-face" fill-opacity="0.178"/><polygon points="240.51,175.09 249.10,183.02 245.52,199.08 236.93,191.15" class="mf-surface-face" fill-opacity="0.179"/><polygon points="231.92,164.76 240.51,175.09 236.93,191.15 228.34,180.82" class="mf-surface-face" fill-opacity="0.181"/><polygon points="227.64,257.10 236.23,263.07 232.65,270.21 224.06,264.24" class="mf-surface-face" fill-opacity="0.211"/><polygon points="239.80,254.44 248.40,258.87 244.82,267.50 236.23,263.07" class="mf-surface-face" fill-opacity="0.198"/><polygon points="204.00,178.68 212.59,195.28 209.02,206.88 200.43,190.28" class="mf-surface-face" fill-opacity="0.180"/><polygon points="201.86,225.63 210.45,238.83 206.88,245.98 198.28,232.77" class="mf-surface-face" fill-opacity="0.180"/><polygon points="200.43,190.28 209.02,206.88 205.44,217.00 196.85,200.39" class="mf-surface-face" fill-opacity="0.179"/><polygon points="254.11,205.06 262.71,209.48 259.13,224.06 250.54,219.63" class="mf-surface-face" fill-opacity="0.175"/><polygon points="249.10,183.02 257.69,188.99 254.11,205.06 245.52,199.08" class="mf-surface-face" fill-opacity="0.176"/><polygon points="207.58,165.59 216.17,182.19 212.59,195.28 204.00,178.68" class="mf-surface-face" fill-opacity="0.181"/><polygon points="223.33,151.55 231.92,164.76 228.34,180.82 219.75,167.61" class="mf-surface-face" fill-opacity="0.182"/><polygon points="255.55,237.15 264.14,240.40 260.56,252.00 251.97,248.75" class="mf-surface-face" fill-opacity="0.178"/><polygon points="215.47,256.31 224.06,264.24 220.48,269.89 211.89,261.96" class="mf-surface-face" fill-opacity="0.203"/><polygon points="206.88,245.98 215.47,256.31 211.89,261.96 203.30,251.63" class="mf-surface-face" fill-opacity="0.186"/><polygon points="196.85,200.39 205.44,217.00 201.86,225.63 193.27,209.02" class="mf-surface-face" fill-opacity="0.175"/><polygon points="251.97,248.75 260.56,252.00 256.99,262.12 248.40,258.87" class="mf-surface-face" fill-opacity="0.184"/><polygon points="236.23,263.07 244.82,267.50 241.24,274.64 232.65,270.21" class="mf-surface-face" fill-opacity="0.212"/><polygon points="259.13,224.06 267.72,227.31 264.14,240.40 255.55,237.15" class="mf-surface-face" fill-opacity="0.174"/><polygon points="211.16,151.01 219.75,167.61 216.17,182.19 207.58,165.59" class="mf-surface-face" fill-opacity="0.181"/><polygon points="244.09,157.54 252.68,165.47 249.10,183.02 240.51,175.09" class="mf-surface-face" fill-opacity="0.177"/><polygon points="235.50,147.20 244.09,157.54 240.51,175.09 231.92,164.76" class="mf-surface-face" fill-opacity="0.179"/><polygon points="224.06,264.24 232.65,270.21 229.07,275.87 220.48,269.89" class="mf-surface-face" fill-opacity="0.221"/><polygon points="257.69,188.99 266.28,193.42 262.71,209.48 254.11,205.06" class="mf-surface-face" fill-opacity="0.172"/><polygon points="248.40,258.87 256.99,262.12 253.41,270.75 244.82,267.50" class="mf-surface-face" fill-opacity="0.192"/><polygon points="198.28,232.77 206.88,245.98 203.30,251.63 194.71,238.42" class="mf-surface-face" fill-opacity="0.173"/><polygon points="262.71,209.48 271.30,212.73 267.72,227.31 259.13,224.06" class="mf-surface-face" fill-opacity="0.171"/><polygon points="252.68,165.47 261.27,171.44 257.69,188.99 249.10,183.02" class="mf-surface-face" fill-opacity="0.173"/><polygon points="193.27,209.02 201.86,225.63 198.28,232.77 189.69,216.17" class="mf-surface-face" fill-opacity="0.170"/><polygon points="226.90,134.00 235.50,147.20 231.92,164.76 223.33,151.55" class="mf-surface-face" fill-opacity="0.180"/><polygon points="214.74,134.94 223.33,151.55 219.75,167.61 211.16,151.01" class="mf-surface-face" fill-opacity="0.181"/><polygon points="232.65,270.21 241.24,274.64 237.66,280.29 229.07,275.87" class="mf-surface-face" fill-opacity="0.230"/><polygon points="244.82,267.50 253.41,270.75 249.83,277.89 241.24,274.64" class="mf-surface-face" fill-opacity="0.206"/><polygon points="264.14,240.40 272.73,242.81 269.16,254.41 260.56,252.00" class="mf-surface-face" fill-opacity="0.174"/><polygon points="211.89,261.96 220.48,269.89 216.90,274.06 208.31,266.13" class="mf-surface-face" fill-opacity="0.190"/><polygon points="203.30,251.63 211.89,261.96 208.31,266.13 199.72,255.80" class="mf-surface-face" fill-opacity="0.173"/><polygon points="260.56,252.00 269.16,254.41 265.58,264.52 256.99,262.12" class="mf-surface-face" fill-opacity="0.179"/><polygon points="267.72,227.31 276.31,229.72 272.73,242.81 264.14,240.40" class="mf-surface-face" fill-opacity="0.171"/><polygon points="195.41,158.13 204.00,178.68 200.43,190.28 191.83,169.74" class="mf-surface-face" fill-opacity="0.174"/><polygon points="266.28,193.42 274.88,196.67 271.30,212.73 262.71,209.48" class="mf-surface-face" fill-opacity="0.169"/><polygon points="261.27,171.44 269.86,175.87 266.28,193.42 257.69,188.99" class="mf-surface-face" fill-opacity="0.170"/><polygon points="191.83,169.74 200.43,190.28 196.85,200.39 188.26,179.85" class="mf-surface-face" fill-opacity="0.171"/><polygon points="198.99,145.04 207.58,165.59 204.00,178.68 195.41,158.13" class="mf-surface-face" fill-opacity="0.176"/><polygon points="247.66,138.50 256.26,146.43 252.68,165.47 244.09,157.54" class="mf-surface-face" fill-opacity="0.174"/><polygon points="220.48,269.89 229.07,275.87 225.49,280.04 216.90,274.06" class="mf-surface-face" fill-opacity="0.216"/><polygon points="239.07,128.17 247.66,138.50 244.09,157.54 235.50,147.20" class="mf-surface-face" fill-opacity="0.177"/><polygon points="189.69,216.17 198.28,232.77 194.71,238.42 186.11,221.82" class="mf-surface-face" fill-opacity="0.163"/><polygon points="256.99,262.12 265.58,264.52 262.00,273.15 253.41,270.75" class="mf-surface-face" fill-opacity="0.186"/><polygon points="194.71,238.42 203.30,251.63 199.72,255.80 191.13,242.59" class="mf-surface-face" fill-opacity="0.161"/><polygon points="271.30,212.73 279.89,215.14 276.31,229.72 267.72,227.31" class="mf-surface-face" fill-opacity="0.168"/><polygon points="188.26,179.85 196.85,200.39 193.27,209.02 184.68,188.48" class="mf-surface-face" fill-opacity="0.167"/><polygon points="218.31,117.39 226.90,134.00 223.33,151.55 214.74,134.94" class="mf-surface-face" fill-opacity="0.180"/><polygon points="202.57,130.47 211.16,151.01 207.58,165.59 198.99,145.04" class="mf-surface-face" fill-opacity="0.177"/><polygon points="256.26,146.43 264.85,152.40 261.27,171.44 252.68,165.47" class="mf-surface-face" fill-opacity="0.171"/><polygon points="241.24,274.64 249.83,277.89 246.25,283.54 237.66,280.29" class="mf-surface-face" fill-opacity="0.229"/><polygon points="230.48,114.96 239.07,128.17 235.50,147.20 226.90,134.00" class="mf-surface-face" fill-opacity="0.179"/><polygon points="253.41,270.75 262.00,273.15 258.42,280.30 249.83,277.89" class="mf-surface-face" fill-opacity="0.198"/><polygon points="229.07,275.87 237.66,280.29 234.09,284.46 225.49,280.04" class="mf-surface-face" fill-opacity="0.230"/><polygon points="269.86,175.87 278.45,179.12 274.88,196.67 266.28,193.42" class="mf-surface-face" fill-opacity="0.167"/><polygon points="272.73,242.81 281.33,244.67 277.75,256.28 269.16,254.41" class="mf-surface-face" fill-opacity="0.171"/><polygon points="184.68,188.48 193.27,209.02 189.69,216.17 181.10,195.62" class="mf-surface-face" fill-opacity="0.162"/><polygon points="274.88,196.67 283.47,199.07 279.89,215.14 271.30,212.73" class="mf-surface-face" fill-opacity="0.166"/><polygon points="269.16,254.41 277.75,256.28 274.17,266.39 265.58,264.52" class="mf-surface-face" fill-opacity="0.176"/><polygon points="276.31,229.72 284.90,231.58 281.33,244.67 272.73,242.81" class="mf-surface-face" fill-opacity="0.168"/><polygon points="264.85,152.40 273.44,156.83 269.86,175.87 261.27,171.44" class="mf-surface-face" fill-opacity="0.168"/><polygon points="206.14,114.40 214.74,134.94 211.16,151.01 202.57,130.47" class="mf-surface-face" fill-opacity="0.178"/><polygon points="208.31,266.13 216.90,274.06 213.33,276.74 204.73,268.81" class="mf-surface-face" fill-opacity="0.161"/><polygon points="199.72,255.80 208.31,266.13 204.73,268.81 196.14,258.48" class="mf-surface-face" fill-opacity="0.152"/><polygon points="186.11,221.82 194.71,238.42 191.13,242.59 182.54,225.99" class="mf-surface-face" fill-opacity="0.153"/><polygon points="265.58,264.52 274.17,266.39 270.59,275.02 262.00,273.15" class="mf-surface-face" fill-opacity="0.182"/><polygon points="279.89,215.14 288.48,217.01 284.90,231.58 276.31,229.72" class="mf-surface-face" fill-opacity="0.166"/><polygon points="216.90,274.06 225.49,280.04 221.92,282.72 213.33,276.74" class="mf-surface-face" fill-opacity="0.174"/><polygon points="251.24,117.97 259.83,125.90 256.26,146.43 247.66,138.50" class="mf-surface-face" fill-opacity="0.173"/><polygon points="242.65,107.64 251.24,117.97 247.66,138.50 239.07,128.17" class="mf-surface-face" fill-opacity="0.175"/><polygon points="221.89,98.36 230.48,114.96 226.90,134.00 218.31,117.39" class="mf-surface-face" fill-opacity="0.179"/><polygon points="249.83,277.89 258.42,280.30 254.85,285.95 246.25,283.54" class="mf-surface-face" fill-opacity="0.217"/><polygon points="191.13,242.59 199.72,255.80 196.14,258.48 187.55,245.27" class="mf-surface-face" fill-opacity="0.146"/><polygon points="237.66,280.29 246.25,283.54 242.68,287.71 234.09,284.46" class="mf-surface-face" fill-opacity="0.230"/><polygon points="181.10,195.62 189.69,216.17 186.11,221.82 177.52,201.28" class="mf-surface-face" fill-opacity="0.155"/><polygon points="278.45,179.12 287.04,181.52 283.47,199.07 274.88,196.67" class="mf-surface-face" fill-opacity="0.164"/><polygon points="259.83,125.90 268.42,131.88 264.85,152.40 256.26,146.43" class="mf-surface-face" fill-opacity="0.170"/><polygon points="262.00,273.15 270.59,275.02 267.02,282.16 258.42,280.30" class="mf-surface-face" fill-opacity="0.191"/><polygon points="273.44,156.83 282.03,160.08 278.45,179.12 269.86,175.87" class="mf-surface-face" fill-opacity="0.165"/><polygon points="234.06,94.43 242.65,107.64 239.07,128.17 230.48,114.96" class="mf-surface-face" fill-opacity="0.177"/><polygon points="209.72,96.85 218.31,117.39 214.74,134.94 206.14,114.40" class="mf-surface-face" fill-opacity="0.178"/><polygon points="281.33,244.67 289.92,246.27 286.34,257.87 277.75,256.28" class="mf-surface-face" fill-opacity="0.170"/><polygon points="283.47,199.07 292.06,200.94 288.48,217.01 279.89,215.14" class="mf-surface-face" fill-opacity="0.164"/><polygon points="225.49,280.04 234.09,284.46 230.51,287.14 221.92,282.72" class="mf-surface-face" fill-opacity="0.186"/><polygon points="277.75,256.28 286.34,257.87 282.76,267.99 274.17,266.39" class="mf-surface-face" fill-opacity="0.174"/><polygon points="186.82,133.06 195.41,158.13 191.83,169.74 183.24,144.67" class="mf-surface-face" fill-opacity="0.168"/><polygon points="284.90,231.58 293.49,233.18 289.92,246.27 281.33,244.67" class="mf-surface-face" fill-opacity="0.167"/><polygon points="183.24,144.67 191.83,169.74 188.26,179.85 179.66,154.78" class="mf-surface-face" fill-opacity="0.165"/><polygon points="190.40,119.97 198.99,145.04 195.41,158.13 186.82,133.06" class="mf-surface-face" fill-opacity="0.171"/><polygon points="268.42,131.88 277.02,136.30 273.44,156.83 264.85,152.40" class="mf-surface-face" fill-opacity="0.167"/><polygon points="274.17,266.39 282.76,267.99 279.18,276.62 270.59,275.02" class="mf-surface-face" fill-opacity="0.179"/><polygon points="182.54,225.99 191.13,242.59 187.55,245.27 178.96,228.67" class="mf-surface-face" fill-opacity="0.141"/><polygon points="179.66,154.78 188.26,179.85 184.68,188.48 176.09,163.41" class="mf-surface-face" fill-opacity="0.160"/><polygon points="288.48,217.01 297.07,218.60 293.49,233.18 284.90,231.58" class="mf-surface-face" fill-opacity="0.165"/><polygon points="246.25,283.54 254.85,285.95 251.27,290.12 242.68,287.71" class="mf-surface-face" fill-opacity="0.230"/><polygon points="204.73,268.81 213.33,276.74 209.75,277.94 201.16,270.01" class="mf-surface-face" fill-opacity="0.126"/><polygon points="196.14,258.48 204.73,268.81 201.16,270.01 192.57,259.67" class="mf-surface-face" fill-opacity="0.128"/><polygon points="258.42,280.30 267.02,282.16 263.44,287.82 254.85,285.95" class="mf-surface-face" fill-opacity="0.206"/><polygon points="193.97,105.40 202.57,130.47 198.99,145.04 190.40,119.97" class="mf-surface-face" fill-opacity="0.172"/><polygon points="177.52,201.28 186.11,221.82 182.54,225.99 173.95,205.44" class="mf-surface-face" fill-opacity="0.147"/><polygon points="234.09,284.46 242.68,287.71 239.10,290.39 230.51,287.14" class="mf-surface-face" fill-opacity="0.184"/><polygon points="225.47,77.83 234.06,94.43 230.48,114.96 221.89,98.36" class="mf-surface-face" fill-opacity="0.178"/><polygon points="287.04,181.52 295.64,183.39 292.06,200.94 283.47,199.07" class="mf-surface-face" fill-opacity="0.163"/><polygon points="282.03,160.08 290.62,162.49 287.04,181.52 278.45,179.12" class="mf-surface-face" fill-opacity="0.163"/><polygon points="213.33,276.74 221.92,282.72 218.34,283.91 209.75,277.94" class="mf-surface-face" fill-opacity="0.120"/><polygon points="270.59,275.02 279.18,276.62 275.61,283.76 267.02,282.16" class="mf-surface-face" fill-opacity="0.187"/><polygon points="213.30,77.81 221.89,98.36 218.31,117.39 209.72,96.85" class="mf-surface-face" fill-opacity="0.178"/><polygon points="187.55,245.27 196.14,258.48 192.57,259.67 183.97,246.46" class="mf-surface-face" fill-opacity="0.128"/><polygon points="176.09,163.41 184.68,188.48 181.10,195.62 172.51,170.55" class="mf-surface-face" fill-opacity="0.156"/><polygon points="292.06,200.94 300.65,202.54 297.07,218.60 288.48,217.01" class="mf-surface-face" fill-opacity="0.163"/><polygon points="289.92,246.27 298.51,247.82 294.93,259.42 286.34,257.87" class="mf-surface-face" fill-opacity="0.170"/><polygon points="277.02,136.30 285.61,139.55 282.03,160.08 273.44,156.83" class="mf-surface-face" fill-opacity="0.164"/><polygon points="197.55,89.33 206.14,114.40 202.57,130.47 193.97,105.40" class="mf-surface-face" fill-opacity="0.174"/><polygon points="286.34,257.87 294.93,259.42 291.35,269.54 282.76,267.99" class="mf-surface-face" fill-opacity="0.173"/><polygon points="293.49,233.18 302.09,234.73 298.51,247.82 289.92,246.27" class="mf-surface-face" fill-opacity="0.167"/><polygon points="221.92,282.72 230.51,287.14 226.93,288.34 218.34,283.91" class="mf-surface-face" fill-opacity="0.109"/><polygon points="282.76,267.99 291.35,269.54 287.78,278.17 279.18,276.62" class="mf-surface-face" fill-opacity="0.179"/><polygon points="254.85,285.95 263.44,287.82 259.86,291.99 251.27,290.12" class="mf-surface-face" fill-opacity="0.217"/><polygon points="297.07,218.60 305.66,220.15 302.09,234.73 293.49,233.18" class="mf-surface-face" fill-opacity="0.165"/><polygon points="267.02,282.16 275.61,283.76 272.03,289.41 263.44,287.82" class="mf-surface-face" fill-opacity="0.199"/><polygon points="242.68,287.71 251.27,290.12 247.69,292.80 239.10,290.39" class="mf-surface-face" fill-opacity="0.165"/><polygon points="172.51,170.55 181.10,195.62 177.52,201.28 168.93,176.21" class="mf-surface-face" fill-opacity="0.150"/><polygon points="178.96,228.67 187.55,245.27 183.97,246.46 175.38,229.86" class="mf-surface-face" fill-opacity="0.128"/><polygon points="290.62,162.49 299.21,164.35 295.64,183.39 287.04,181.52" class="mf-surface-face" fill-opacity="0.162"/><polygon points="173.95,205.44 182.54,225.99 178.96,228.67 170.37,208.13" class="mf-surface-face" fill-opacity="0.138"/><polygon points="295.64,183.39 304.23,184.99 300.65,202.54 292.06,200.94" class="mf-surface-face" fill-opacity="0.162"/><polygon points="201.13,71.78 209.72,96.85 206.14,114.40 197.55,89.33" class="mf-surface-face" fill-opacity="0.175"/><polygon points="279.18,276.62 287.78,278.17 284.20,285.31 275.61,283.76" class="mf-surface-face" fill-opacity="0.187"/><polygon points="285.61,139.55 294.20,141.96 290.62,162.49 282.03,160.08" class="mf-surface-face" fill-opacity="0.162"/><polygon points="201.16,270.01 209.75,277.94 206.17,277.64 197.58,269.71" class="mf-surface-face" fill-opacity="0.095"/><polygon points="192.57,259.67 201.16,270.01 197.58,269.71 188.99,259.38" class="mf-surface-face" fill-opacity="0.105"/><polygon points="230.51,287.14 239.10,290.39 235.52,291.58 226.93,288.34" class="mf-surface-face" fill-opacity="0.095"/><polygon points="300.65,202.54 309.24,204.09 305.66,220.15 297.07,218.60" class="mf-surface-face" fill-opacity="0.163"/><polygon points="216.88,57.29 225.47,77.83 221.89,98.36 213.30,77.81" class="mf-surface-face" fill-opacity="0.178"/><polygon points="298.51,247.82 307.10,249.52 303.52,261.12 294.93,259.42" class="mf-surface-face" fill-opacity="0.170"/><polygon points="294.93,259.42 303.52,261.12 299.94,271.24 291.35,269.54" class="mf-surface-face" fill-opacity="0.174"/><polygon points="302.09,234.73 310.68,236.43 307.10,249.52 298.51,247.82" class="mf-surface-face" fill-opacity="0.168"/><polygon points="209.75,277.94 218.34,283.91 214.76,283.62 206.17,277.64" class="mf-surface-face" fill-opacity="0.083"/><polygon points="291.35,269.54 299.94,271.24 296.37,279.87 287.78,278.17" class="mf-surface-face" fill-opacity="0.180"/><polygon points="183.97,246.46 192.57,259.67 188.99,259.38 180.40,246.17" class="mf-surface-face" fill-opacity="0.111"/><polygon points="263.44,287.82 272.03,289.41 268.45,293.58 259.86,291.99" class="mf-surface-face" fill-opacity="0.204"/><polygon points="168.93,176.21 177.52,201.28 173.95,205.44 165.35,180.38" class="mf-surface-face" fill-opacity="0.143"/><polygon points="305.66,220.15 314.25,221.85 310.68,236.43 302.09,234.73" class="mf-surface-face" fill-opacity="0.165"/><polygon points="251.27,290.12 259.86,291.99 256.28,294.67 247.69,292.80" class="mf-surface-face" fill-opacity="0.146"/><polygon points="275.61,283.76 284.20,285.31 280.62,290.96 272.03,289.41" class="mf-surface-face" fill-opacity="0.198"/><polygon points="299.21,164.35 307.80,165.95 304.23,184.99 295.64,183.39" class="mf-surface-face" fill-opacity="0.161"/><polygon points="304.23,184.99 312.82,186.54 309.24,204.09 300.65,202.54" class="mf-surface-face" fill-opacity="0.162"/><polygon points="204.71,52.74 213.30,77.81 209.72,96.85 201.13,71.78" class="mf-surface-face" fill-opacity="0.176"/><polygon points="218.34,283.91 226.93,288.34 223.35,288.04 214.76,283.62" class="mf-surface-face" fill-opacity="0.070"/><polygon points="294.20,141.96 302.79,143.83 299.21,164.35 290.62,162.49" class="mf-surface-face" fill-opacity="0.161"/><polygon points="239.10,290.39 247.69,292.80 244.11,293.99 235.52,291.58" class="mf-surface-face" fill-opacity="0.082"/><polygon points="287.78,278.17 296.37,279.87 292.79,287.01 284.20,285.31" class="mf-surface-face" fill-opacity="0.189"/><polygon points="170.37,208.13 178.96,228.67 175.38,229.86 166.79,209.32" class="mf-surface-face" fill-opacity="0.128"/><polygon points="307.10,249.52 315.69,251.53 312.11,263.14 303.52,261.12" class="mf-surface-face" fill-opacity="0.172"/><polygon points="309.24,204.09 317.83,205.79 314.25,221.85 305.66,220.15" class="mf-surface-face" fill-opacity="0.164"/><polygon points="303.52,261.12 312.11,263.14 308.54,273.25 299.94,271.24" class="mf-surface-face" fill-opacity="0.177"/><polygon points="310.68,236.43 319.27,238.44 315.69,251.53 307.10,249.52" class="mf-surface-face" fill-opacity="0.169"/><polygon points="175.38,229.86 183.97,246.46 180.40,246.17 171.80,229.57" class="mf-surface-face" fill-opacity="0.115"/><polygon points="299.94,271.24 308.54,273.25 304.96,281.88 296.37,279.87" class="mf-surface-face" fill-opacity="0.183"/><polygon points="272.03,289.41 280.62,290.96 277.04,295.13 268.45,293.58" class="mf-surface-face" fill-opacity="0.202"/><polygon points="314.25,221.85 322.85,223.87 319.27,238.44 310.68,236.43" class="mf-surface-face" fill-opacity="0.167"/><polygon points="259.86,291.99 268.45,293.58 264.87,296.26 256.28,294.67" class="mf-surface-face" fill-opacity="0.137"/><polygon points="226.93,288.34 235.52,291.58 231.94,291.29 223.35,288.04" class="mf-surface-face" fill-opacity="0.070"/><polygon points="284.20,285.31 292.79,287.01 289.21,292.66 280.62,290.96" class="mf-surface-face" fill-opacity="0.202"/><polygon points="165.35,180.38 173.95,205.44 170.37,208.13 161.78,183.06" class="mf-surface-face" fill-opacity="0.136"/><polygon points="197.58,269.71 206.17,277.64 202.59,275.86 194.00,267.93" class="mf-surface-face" fill-opacity="0.073"/><polygon points="307.80,165.95 316.40,167.50 312.82,186.54 304.23,184.99" class="mf-surface-face" fill-opacity="0.161"/><polygon points="188.99,259.38 197.58,269.71 194.00,267.93 185.41,257.60" class="mf-surface-face" fill-opacity="0.085"/><polygon points="312.82,186.54 321.41,188.24 317.83,205.79 309.24,204.09" class="mf-surface-face" fill-opacity="0.162"/><polygon points="247.69,292.80 256.28,294.67 252.71,295.86 244.11,293.99" class="mf-surface-face" fill-opacity="0.074"/><polygon points="302.79,143.83 311.38,145.42 307.80,165.95 299.21,164.35" class="mf-surface-face" fill-opacity="0.160"/><polygon points="296.37,279.87 304.96,281.88 301.38,289.02 292.79,287.01" class="mf-surface-face" fill-opacity="0.193"/><polygon points="208.29,32.22 216.88,57.29 213.30,77.81 204.71,52.74" class="mf-surface-face" fill-opacity="0.176"/><polygon points="315.69,251.53 324.28,253.98 320.70,265.59 312.11,263.14" class="mf-surface-face" fill-opacity="0.174"/><polygon points="206.17,277.64 214.76,283.62 211.18,281.84 202.59,275.86" class="mf-surface-face" fill-opacity="0.070"/><polygon points="317.83,205.79 326.42,207.80 322.85,223.87 314.25,221.85" class="mf-surface-face" fill-opacity="0.165"/><polygon points="312.11,263.14 320.70,265.59 317.13,275.70 308.54,273.25" class="mf-surface-face" fill-opacity="0.179"/><polygon points="319.27,238.44 327.86,240.89 324.28,253.98 315.69,251.53" class="mf-surface-face" fill-opacity="0.171"/><polygon points="180.40,246.17 188.99,259.38 185.41,257.60 176.82,244.39" class="mf-surface-face" fill-opacity="0.095"/><polygon points="308.54,273.25 317.13,275.70 313.55,284.33 304.96,281.88" class="mf-surface-face" fill-opacity="0.187"/><polygon points="235.52,291.58 244.11,293.99 240.54,293.70 231.94,291.29" class="mf-surface-face" fill-opacity="0.070"/><polygon points="322.85,223.87 331.44,226.32 327.86,240.89 319.27,238.44" class="mf-surface-face" fill-opacity="0.168"/><polygon points="280.62,290.96 289.21,292.66 285.63,296.83 277.04,295.13" class="mf-surface-face" fill-opacity="0.209"/><polygon points="166.79,209.32 175.38,229.86 171.80,229.57 163.21,209.03" class="mf-surface-face" fill-opacity="0.118"/><polygon points="214.76,283.62 223.35,288.04 219.78,286.26 211.18,281.84" class="mf-surface-face" fill-opacity="0.070"/><polygon points="268.45,293.58 277.04,295.13 273.47,297.81 264.87,296.26" class="mf-surface-face" fill-opacity="0.135"/><polygon points="292.79,287.01 301.38,289.02 297.80,294.68 289.21,292.66" class="mf-surface-face" fill-opacity="0.209"/><polygon points="316.40,167.50 324.99,169.20 321.41,188.24 312.82,186.54" class="mf-surface-face" fill-opacity="0.161"/><polygon points="321.41,188.24 330.00,190.25 326.42,207.80 317.83,205.79" class="mf-surface-face" fill-opacity="0.163"/><polygon points="304.96,281.88 313.55,284.33 309.97,291.47 301.38,289.02" class="mf-surface-face" fill-opacity="0.198"/><polygon points="324.28,253.98 332.87,256.95 329.30,268.56 320.70,265.59" class="mf-surface-face" fill-opacity="0.177"/><polygon points="256.28,294.67 264.87,296.26 261.30,297.45 252.71,295.86" class="mf-surface-face" fill-opacity="0.070"/><polygon points="311.38,145.42 319.97,146.97 316.40,167.50 307.80,165.95" class="mf-surface-face" fill-opacity="0.160"/><polygon points="320.70,265.59 329.30,268.56 325.72,278.67 317.13,275.70" class="mf-surface-face" fill-opacity="0.183"/><polygon points="161.78,183.06 170.37,208.13 166.79,209.32 158.20,184.25" class="mf-surface-face" fill-opacity="0.128"/><polygon points="171.80,229.57 180.40,246.17 176.82,244.39 168.23,227.79" class="mf-surface-face" fill-opacity="0.103"/><polygon points="327.86,240.89 336.45,243.86 332.87,256.95 324.28,253.98" class="mf-surface-face" fill-opacity="0.173"/><polygon points="326.42,207.80 335.02,210.25 331.44,226.32 322.85,223.87" class="mf-surface-face" fill-opacity="0.166"/><polygon points="317.13,275.70 325.72,278.67 322.14,287.30 313.55,284.33" class="mf-surface-face" fill-opacity="0.191"/><polygon points="223.35,288.04 231.94,291.29 228.37,289.51 219.78,286.26" class="mf-surface-face" fill-opacity="0.070"/><polygon points="331.44,226.32 340.03,229.29 336.45,243.86 327.86,240.89" class="mf-surface-face" fill-opacity="0.170"/><polygon points="244.11,293.99 252.71,295.86 249.13,295.57 240.54,293.70" class="mf-surface-face" fill-opacity="0.070"/><polygon points="289.21,292.66 297.80,294.68 294.23,298.85 285.63,296.83" class="mf-surface-face" fill-opacity="0.224"/><polygon points="301.38,289.02 309.97,291.47 306.39,297.13 297.80,294.68" class="mf-surface-face" fill-opacity="0.218"/><polygon points="277.04,295.13 285.63,296.83 282.06,299.51 273.47,297.81" class="mf-surface-face" fill-opacity="0.141"/><polygon points="332.87,256.95 341.47,260.50 337.89,272.11 329.30,268.56" class="mf-surface-face" fill-opacity="0.180"/><polygon points="194.00,267.93 202.59,275.86 199.02,272.60 190.42,264.66" class="mf-surface-face" fill-opacity="0.070"/><polygon points="185.41,257.60 194.00,267.93 190.42,264.66 181.83,254.33" class="mf-surface-face" fill-opacity="0.070"/><polygon points="313.55,284.33 322.14,287.30 318.56,294.44 309.97,291.47" class="mf-surface-face" fill-opacity="0.204"/><polygon points="329.30,268.56 337.89,272.11 334.31,282.22 325.72,278.67" class="mf-surface-face" fill-opacity="0.186"/><polygon points="330.00,190.25 338.59,192.70 335.02,210.25 326.42,207.80" class="mf-surface-face" fill-opacity="0.165"/><polygon points="324.99,169.20 333.58,171.21 330.00,190.25 321.41,188.24" class="mf-surface-face" fill-opacity="0.162"/><polygon points="336.45,243.86 345.04,247.41 341.47,260.50 332.87,256.95" class="mf-surface-face" fill-opacity="0.175"/><polygon points="335.02,210.25 343.61,213.22 340.03,229.29 331.44,226.32" class="mf-surface-face" fill-opacity="0.168"/><polygon points="264.87,296.26 273.47,297.81 269.89,299.00 261.30,297.45" class="mf-surface-face" fill-opacity="0.070"/><polygon points="319.97,146.97 328.56,148.67 324.99,169.20 316.40,167.50" class="mf-surface-face" fill-opacity="0.160"/><polygon points="202.59,275.86 211.18,281.84 207.61,278.57 199.02,272.60" class="mf-surface-face" fill-opacity="0.070"/><polygon points="325.72,278.67 334.31,282.22 330.73,290.85 322.14,287.30" class="mf-surface-face" fill-opacity="0.194"/><polygon points="176.82,244.39 185.41,257.60 181.83,254.33 173.24,241.12" class="mf-surface-face" fill-opacity="0.081"/><polygon points="340.03,229.29 348.62,232.84 345.04,247.41 336.45,243.86" class="mf-surface-face" fill-opacity="0.172"/><polygon points="231.94,291.29 240.54,293.70 236.96,291.92 228.37,289.51" class="mf-surface-face" fill-opacity="0.070"/><polygon points="163.21,209.03 171.80,229.57 168.23,227.79 159.64,207.25" class="mf-surface-face" fill-opacity="0.108"/><polygon points="341.47,260.50 350.06,264.65 346.48,276.25 337.89,272.11" class="mf-surface-face" fill-opacity="0.182"/><polygon points="252.71,295.86 261.30,297.45 257.72,297.16 249.13,295.57" class="mf-surface-face" fill-opacity="0.070"/><polygon points="309.97,291.47 318.56,294.44 314.99,300.10 306.39,297.13" class="mf-surface-face" fill-opacity="0.226"/><polygon points="297.80,294.68 306.39,297.13 302.82,301.29 294.23,298.85" class="mf-surface-face" fill-opacity="0.230"/><polygon points="337.89,272.11 346.48,276.25 342.90,286.36 334.31,282.22" class="mf-surface-face" fill-opacity="0.188"/><polygon points="158.20,184.25 166.79,209.32 163.21,209.03 154.62,183.96" class="mf-surface-face" fill-opacity="0.120"/><polygon points="345.04,247.41 353.63,251.56 350.06,264.65 341.47,260.50" class="mf-surface-face" fill-opacity="0.177"/><polygon points="322.14,287.30 330.73,290.85 327.16,297.99 318.56,294.44" class="mf-surface-face" fill-opacity="0.208"/><polygon points="211.18,281.84 219.78,286.26 216.20,283.00 207.61,278.57" class="mf-surface-face" fill-opacity="0.070"/><polygon points="285.63,296.83 294.23,298.85 290.65,301.53 282.06,299.51" class="mf-surface-face" fill-opacity="0.152"/><polygon points="338.59,192.70 347.18,195.67 343.61,213.22 335.02,210.25" class="mf-surface-face" fill-opacity="0.166"/><polygon points="343.61,213.22 352.20,216.77 348.62,232.84 340.03,229.29" class="mf-surface-face" fill-opacity="0.170"/><polygon points="333.58,171.21 342.17,173.66 338.59,192.70 330.00,190.25" class="mf-surface-face" fill-opacity="0.163"/><polygon points="334.31,282.22 342.90,286.36 339.32,294.99 330.73,290.85" class="mf-surface-face" fill-opacity="0.197"/><polygon points="348.62,232.84 357.21,236.98 353.63,251.56 345.04,247.41" class="mf-surface-face" fill-opacity="0.174"/><polygon points="168.23,227.79 176.82,244.39 173.24,241.12 164.65,224.52" class="mf-surface-face" fill-opacity="0.091"/><polygon points="273.47,297.81 282.06,299.51 278.48,300.71 269.89,299.00" class="mf-surface-face" fill-opacity="0.071"/><polygon points="328.56,148.67 337.16,150.69 333.58,171.21 324.99,169.20" class="mf-surface-face" fill-opacity="0.161"/><polygon points="350.06,264.65 358.65,269.37 355.07,280.97 346.48,276.25" class="mf-surface-face" fill-opacity="0.184"/><polygon points="346.48,276.25 355.07,280.97 351.49,291.08 342.90,286.36" class="mf-surface-face" fill-opacity="0.190"/><polygon points="240.54,293.70 249.13,295.57 245.55,293.79 236.96,291.92" class="mf-surface-face" fill-opacity="0.070"/><polygon points="353.63,251.56 362.23,256.28 358.65,269.37 350.06,264.65" class="mf-surface-face" fill-opacity="0.179"/><polygon points="318.56,294.44 327.16,297.99 323.58,303.65 314.99,300.10" class="mf-surface-face" fill-opacity="0.230"/><polygon points="330.73,290.85 339.32,294.99 335.75,302.14 327.16,297.99" class="mf-surface-face" fill-opacity="0.211"/><polygon points="219.78,286.26 228.37,289.51 224.79,286.24 216.20,283.00" class="mf-surface-face" fill-opacity="0.070"/><polygon points="306.39,297.13 314.99,300.10 311.41,304.27 302.82,301.29" class="mf-surface-face" fill-opacity="0.230"/><polygon points="342.90,286.36 351.49,291.08 347.92,299.71 339.32,294.99" class="mf-surface-face" fill-opacity="0.199"/><polygon points="352.20,216.77 360.79,220.91 357.21,236.98 348.62,232.84" class="mf-surface-face" fill-opacity="0.171"/><polygon points="347.18,195.67 355.78,199.22 352.20,216.77 343.61,213.22" class="mf-surface-face" fill-opacity="0.168"/><polygon points="261.30,297.45 269.89,299.00 266.31,298.71 257.72,297.16" class="mf-surface-face" fill-opacity="0.070"/><polygon points="357.21,236.98 365.80,241.70 362.23,256.28 353.63,251.56" class="mf-surface-face" fill-opacity="0.176"/><polygon points="294.23,298.85 302.82,301.29 299.24,303.98 290.65,301.53" class="mf-surface-face" fill-opacity="0.166"/><polygon points="358.65,269.37 367.24,274.61 363.66,286.21 355.07,280.97" class="mf-surface-face" fill-opacity="0.185"/><polygon points="342.17,173.66 350.76,176.63 347.18,195.67 338.59,192.70" class="mf-surface-face" fill-opacity="0.165"/><polygon points="355.07,280.97 363.66,286.21 360.08,296.33 351.49,291.08" class="mf-surface-face" fill-opacity="0.192"/><polygon points="362.23,256.28 370.82,261.52 367.24,274.61 358.65,269.37" class="mf-surface-face" fill-opacity="0.181"/><polygon points="190.42,264.66 199.02,272.60 195.44,267.84 186.85,259.91" class="mf-surface-face" fill-opacity="0.070"/><polygon points="181.83,254.33 190.42,264.66 186.85,259.91 178.26,249.58" class="mf-surface-face" fill-opacity="0.070"/><polygon points="339.32,294.99 347.92,299.71 344.34,306.86 335.75,302.14" class="mf-surface-face" fill-opacity="0.212"/><polygon points="337.16,150.69 345.75,153.14 342.17,173.66 333.58,171.21" class="mf-surface-face" fill-opacity="0.162"/><polygon points="327.16,297.99 335.75,302.14 332.17,307.79 323.58,303.65" class="mf-surface-face" fill-opacity="0.230"/><polygon points="351.49,291.08 360.08,296.33 356.51,304.96 347.92,299.71" class="mf-surface-face" fill-opacity="0.200"/><polygon points="282.06,299.51 290.65,301.53 287.07,302.72 278.48,300.71" class="mf-surface-face" fill-opacity="0.076"/><polygon points="360.79,220.91 369.38,225.63 365.80,241.70 357.21,236.98" class="mf-surface-face" fill-opacity="0.173"/><polygon points="365.80,241.70 374.39,246.94 370.82,261.52 362.23,256.28" class="mf-surface-face" fill-opacity="0.177"/><polygon points="367.24,274.61 375.83,280.29 372.25,291.89 363.66,286.21" class="mf-surface-face" fill-opacity="0.186"/><polygon points="228.37,289.51 236.96,291.92 233.38,288.65 224.79,286.24" class="mf-surface-face" fill-opacity="0.070"/><polygon points="314.99,300.10 323.58,303.65 320.00,307.81 311.41,304.27" class="mf-surface-face" fill-opacity="0.230"/><polygon points="363.66,286.21 372.25,291.89 368.68,302.01 360.08,296.33" class="mf-surface-face" fill-opacity="0.193"/><polygon points="199.02,272.60 207.61,278.57 204.03,273.82 195.44,267.84" class="mf-surface-face" fill-opacity="0.070"/><polygon points="249.13,295.57 257.72,297.16 254.14,295.38 245.55,293.79" class="mf-surface-face" fill-opacity="0.070"/><polygon points="355.78,199.22 364.37,203.36 360.79,220.91 352.20,216.77" class="mf-surface-face" fill-opacity="0.169"/><polygon points="370.82,261.52 379.41,267.20 375.83,280.29 367.24,274.61" class="mf-surface-face" fill-opacity="0.182"/><polygon points="154.62,183.96 163.21,209.03 159.64,207.25 151.04,182.18" class="mf-surface-face" fill-opacity="0.112"/><polygon points="159.64,207.25 168.23,227.79 164.65,224.52 156.06,203.98" class="mf-surface-face" fill-opacity="0.098"/><polygon points="173.24,241.12 181.83,254.33 178.26,249.58 169.66,236.37" class="mf-surface-face" fill-opacity="0.070"/><polygon points="350.76,176.63 359.35,180.18 355.78,199.22 347.18,195.67" class="mf-surface-face" fill-opacity="0.166"/><polygon points="360.08,296.33 368.68,302.01 365.10,310.64 356.51,304.96" class="mf-surface-face" fill-opacity="0.201"/><polygon points="347.92,299.71 356.51,304.96 352.93,312.10 344.34,306.86" class="mf-surface-face" fill-opacity="0.212"/><polygon points="302.82,301.29 311.41,304.27 307.83,306.95 299.24,303.98" class="mf-surface-face" fill-opacity="0.180"/><polygon points="269.89,299.00 278.48,300.71 274.90,300.41 266.31,298.71" class="mf-surface-face" fill-opacity="0.070"/><polygon points="375.83,280.29 384.42,286.28 380.84,297.88 372.25,291.89" class="mf-surface-face" fill-opacity="0.187"/><polygon points="374.39,246.94 382.99,252.62 379.41,267.20 370.82,261.52" class="mf-surface-face" fill-opacity="0.178"/><polygon points="335.75,302.14 344.34,306.86 340.76,312.51 332.17,307.79" class="mf-surface-face" fill-opacity="0.230"/><polygon points="372.25,291.89 380.84,297.88 377.27,308.00 368.68,302.01" class="mf-surface-face" fill-opacity="0.193"/><polygon points="369.38,225.63 377.97,230.88 374.39,246.94 365.80,241.70" class="mf-surface-face" fill-opacity="0.174"/><polygon points="379.41,267.20 388.00,273.19 384.42,286.28 375.83,280.29" class="mf-surface-face" fill-opacity="0.182"/><polygon points="207.61,278.57 216.20,283.00 212.62,278.24 204.03,273.82" class="mf-surface-face" fill-opacity="0.070"/><polygon points="345.75,153.14 354.34,156.11 350.76,176.63 342.17,173.66" class="mf-surface-face" fill-opacity="0.163"/><polygon points="364.37,203.36 372.96,208.08 369.38,225.63 360.79,220.91" class="mf-surface-face" fill-opacity="0.171"/><polygon points="323.58,303.65 332.17,307.79 328.59,311.96 320.00,307.81" class="mf-surface-face" fill-opacity="0.230"/><polygon points="368.68,302.01 377.27,308.00 373.69,316.63 365.10,310.64" class="mf-surface-face" fill-opacity="0.201"/><polygon points="290.65,301.53 299.24,303.98 295.66,305.17 287.07,302.72" class="mf-surface-face" fill-opacity="0.083"/><polygon points="384.42,286.28 393.01,292.42 389.44,304.02 380.84,297.88" class="mf-surface-face" fill-opacity="0.187"/><polygon points="356.51,304.96 365.10,310.64 361.52,317.78 352.93,312.10" class="mf-surface-face" fill-opacity="0.212"/><polygon points="382.99,252.62 391.58,258.61 388.00,273.19 379.41,267.20" class="mf-surface-face" fill-opacity="0.179"/><polygon points="380.84,297.88 389.44,304.02 385.86,314.14 377.27,308.00" class="mf-surface-face" fill-opacity="0.193"/><polygon points="388.00,273.19 396.59,279.33 393.01,292.42 384.42,286.28" class="mf-surface-face" fill-opacity="0.183"/><polygon points="164.65,224.52 173.24,241.12 169.66,236.37 161.07,219.77" class="mf-surface-face" fill-opacity="0.080"/><polygon points="236.96,291.92 245.55,293.79 241.97,290.52 233.38,288.65" class="mf-surface-face" fill-opacity="0.070"/><polygon points="377.97,230.88 386.56,236.56 382.99,252.62 374.39,246.94" class="mf-surface-face" fill-opacity="0.175"/><polygon points="359.35,180.18 367.94,184.33 364.37,203.36 355.78,199.22" class="mf-surface-face" fill-opacity="0.167"/><polygon points="344.34,306.86 352.93,312.10 349.35,317.75 340.76,312.51" class="mf-surface-face" fill-opacity="0.227"/><polygon points="257.72,297.16 266.31,298.71 262.73,296.93 254.14,295.38" class="mf-surface-face" fill-opacity="0.070"/><polygon points="311.41,304.27 320.00,307.81 316.42,310.50 307.83,306.95" class="mf-surface-face" fill-opacity="0.187"/><polygon points="377.27,308.00 385.86,314.14 382.28,322.77 373.69,316.63" class="mf-surface-face" fill-opacity="0.201"/><polygon points="393.01,292.42 401.61,298.52 398.03,310.12 389.44,304.02" class="mf-surface-face" fill-opacity="0.187"/><polygon points="372.96,208.08 381.55,213.33 377.97,230.88 369.38,225.63" class="mf-surface-face" fill-opacity="0.172"/><polygon points="365.10,310.64 373.69,316.63 370.11,323.77 361.52,317.78" class="mf-surface-face" fill-opacity="0.211"/><polygon points="389.44,304.02 398.03,310.12 394.45,320.24 385.86,314.14" class="mf-surface-face" fill-opacity="0.193"/><polygon points="391.58,258.61 400.17,264.75 396.59,279.33 388.00,273.19" class="mf-surface-face" fill-opacity="0.179"/><polygon points="216.20,283.00 224.79,286.24 221.21,281.49 212.62,278.24" class="mf-surface-face" fill-opacity="0.070"/><polygon points="396.59,279.33 405.18,285.43 401.61,298.52 393.01,292.42" class="mf-surface-face" fill-opacity="0.183"/><polygon points="278.48,300.71 287.07,302.72 283.49,302.43 274.90,300.41" class="mf-surface-face" fill-opacity="0.070"/><polygon points="332.17,307.79 340.76,312.51 337.18,316.68 328.59,311.96" class="mf-surface-face" fill-opacity="0.230"/><polygon points="386.56,236.56 395.15,242.55 391.58,258.61 382.99,252.62" class="mf-surface-face" fill-opacity="0.176"/><polygon points="354.34,156.11 362.93,159.66 359.35,180.18 350.76,176.63" class="mf-surface-face" fill-opacity="0.165"/><polygon points="352.93,312.10 361.52,317.78 357.94,323.43 349.35,317.75" class="mf-surface-face" fill-opacity="0.223"/><polygon points="385.86,314.14 394.45,320.24 390.87,328.86 382.28,322.77" class="mf-surface-face" fill-opacity="0.201"/><polygon points="401.61,298.52 410.20,304.34 406.62,315.94 398.03,310.12" class="mf-surface-face" fill-opacity="0.187"/><polygon points="373.69,316.63 382.28,322.77 378.70,329.91 370.11,323.77" class="mf-surface-face" fill-opacity="0.211"/><polygon points="367.94,184.33 376.54,189.05 372.96,208.08 364.37,203.36" class="mf-surface-face" fill-opacity="0.169"/><polygon points="299.24,303.98 307.83,306.95 304.25,308.14 295.66,305.17" class="mf-surface-face" fill-opacity="0.091"/><polygon points="400.17,264.75 408.76,270.85 405.18,285.43 396.59,279.33" class="mf-surface-face" fill-opacity="0.179"/><polygon points="398.03,310.12 406.62,315.94 403.04,326.06 394.45,320.24" class="mf-surface-face" fill-opacity="0.193"/><polygon points="381.55,213.33 390.14,219.01 386.56,236.56 377.97,230.88" class="mf-surface-face" fill-opacity="0.173"/><polygon points="405.18,285.43 413.77,291.25 410.20,304.34 401.61,298.52" class="mf-surface-face" fill-opacity="0.182"/><polygon points="395.15,242.55 403.75,248.69 400.17,264.75 391.58,258.61" class="mf-surface-face" fill-opacity="0.176"/><polygon points="320.00,307.81 328.59,311.96 325.01,314.64 316.42,310.50" class="mf-surface-face" fill-opacity="0.187"/><polygon points="340.76,312.51 349.35,317.75 345.77,321.92 337.18,316.68" class="mf-surface-face" fill-opacity="0.229"/><polygon points="361.52,317.78 370.11,323.77 366.53,329.42 357.94,323.43" class="mf-surface-face" fill-opacity="0.220"/><polygon points="394.45,320.24 403.04,326.06 399.46,334.69 390.87,328.86" class="mf-surface-face" fill-opacity="0.201"/><polygon points="245.55,293.79 254.14,295.38 250.56,292.11 241.97,290.52" class="mf-surface-face" fill-opacity="0.070"/><polygon points="382.28,322.77 390.87,328.86 387.29,336.01 378.70,329.91" class="mf-surface-face" fill-opacity="0.211"/><polygon points="151.04,182.18 159.64,207.25 156.06,203.98 147.47,178.91" class="mf-surface-face" fill-opacity="0.104"/><polygon points="408.76,270.85 417.35,276.67 413.77,291.25 405.18,285.43" class="mf-surface-face" fill-opacity="0.178"/><polygon points="410.20,304.34 418.79,309.62 415.21,321.23 406.62,315.94" class="mf-surface-face" fill-opacity="0.186"/><polygon points="266.31,298.71 274.90,300.41 271.32,298.63 262.73,296.93" class="mf-surface-face" fill-opacity="0.070"/><polygon points="186.85,259.91 195.44,267.84 191.86,261.60 183.27,253.67" class="mf-surface-face" fill-opacity="0.070"/><polygon points="178.26,249.58 186.85,259.91 183.27,253.67 174.68,243.34" class="mf-surface-face" fill-opacity="0.070"/><polygon points="224.79,286.24 233.38,288.65 229.80,283.90 221.21,281.49" class="mf-surface-face" fill-opacity="0.070"/><polygon points="406.62,315.94 415.21,321.23 411.63,331.34 403.04,326.06" class="mf-surface-face" fill-opacity="0.192"/><polygon points="390.14,219.01 398.73,225.00 395.15,242.55 386.56,236.56" class="mf-surface-face" fill-opacity="0.173"/><polygon points="362.93,159.66 371.52,163.80 367.94,184.33 359.35,180.18" class="mf-surface-face" fill-opacity="0.166"/><polygon points="376.54,189.05 385.13,194.29 381.55,213.33 372.96,208.08" class="mf-surface-face" fill-opacity="0.170"/><polygon points="403.75,248.69 412.34,254.79 408.76,270.85 400.17,264.75" class="mf-surface-face" fill-opacity="0.176"/><polygon points="413.77,291.25 422.37,296.53 418.79,309.62 410.20,304.34" class="mf-surface-face" fill-opacity="0.181"/><polygon points="156.06,203.98 164.65,224.52 161.07,219.77 152.48,199.22" class="mf-surface-face" fill-opacity="0.089"/><polygon points="287.07,302.72 295.66,305.17 292.08,304.88 283.49,302.43" class="mf-surface-face" fill-opacity="0.070"/><polygon points="370.11,323.77 378.70,329.91 375.13,335.56 366.53,329.42" class="mf-surface-face" fill-opacity="0.219"/><polygon points="195.44,267.84 204.03,273.82 200.45,267.57 191.86,261.60" class="mf-surface-face" fill-opacity="0.070"/><polygon points="349.35,317.75 357.94,323.43 354.37,327.60 345.77,321.92" class="mf-surface-face" fill-opacity="0.220"/><polygon points="403.04,326.06 411.63,331.34 408.06,339.97 399.46,334.69" class="mf-surface-face" fill-opacity="0.201"/><polygon points="307.83,306.95 316.42,310.50 312.84,311.69 304.25,308.14" class="mf-surface-face" fill-opacity="0.099"/><polygon points="390.87,328.86 399.46,334.69 395.89,341.83 387.29,336.01" class="mf-surface-face" fill-opacity="0.212"/><polygon points="328.59,311.96 337.18,316.68 333.61,319.36 325.01,314.64" class="mf-surface-face" fill-opacity="0.184"/><polygon points="169.66,236.37 178.26,249.58 174.68,243.34 166.09,230.13" class="mf-surface-face" fill-opacity="0.070"/><polygon points="417.35,276.67 425.94,281.96 422.37,296.53 413.77,291.25" class="mf-surface-face" fill-opacity="0.177"/><polygon points="398.73,225.00 407.32,231.14 403.75,248.69 395.15,242.55" class="mf-surface-face" fill-opacity="0.174"/><polygon points="412.34,254.79 420.93,260.61 417.35,276.67 408.76,270.85" class="mf-surface-face" fill-opacity="0.175"/><polygon points="418.79,309.62 427.38,314.07 423.80,325.67 415.21,321.23" class="mf-surface-face" fill-opacity="0.183"/><polygon points="385.13,194.29 393.72,199.97 390.14,219.01 381.55,213.33" class="mf-surface-face" fill-opacity="0.171"/><polygon points="415.21,321.23 423.80,325.67 420.22,335.79 411.63,331.34" class="mf-surface-face" fill-opacity="0.189"/><polygon points="378.70,329.91 387.29,336.01 383.72,341.66 375.13,335.56" class="mf-surface-face" fill-opacity="0.219"/><polygon points="422.37,296.53 430.96,300.98 427.38,314.07 418.79,309.62" class="mf-surface-face" fill-opacity="0.178"/><polygon points="371.52,163.80 380.11,168.52 376.54,189.05 367.94,184.33" class="mf-surface-face" fill-opacity="0.167"/><polygon points="357.94,323.43 366.53,329.42 362.96,333.59 354.37,327.60" class="mf-surface-face" fill-opacity="0.215"/><polygon points="204.03,273.82 212.62,278.24 209.04,272.00 200.45,267.57" class="mf-surface-face" fill-opacity="0.070"/><polygon points="399.46,334.69 408.06,339.97 404.48,347.11 395.89,341.83" class="mf-surface-face" fill-opacity="0.212"/><polygon points="407.32,231.14 415.92,237.23 412.34,254.79 403.75,248.69" class="mf-surface-face" fill-opacity="0.174"/><polygon points="411.63,331.34 420.22,335.79 416.65,344.42 408.06,339.97" class="mf-surface-face" fill-opacity="0.198"/><polygon points="254.14,295.38 262.73,296.93 259.16,293.66 250.56,292.11" class="mf-surface-face" fill-opacity="0.070"/><polygon points="337.18,316.68 345.77,321.92 342.20,324.60 333.61,319.36" class="mf-surface-face" fill-opacity="0.180"/><polygon points="274.90,300.41 283.49,302.43 279.92,300.65 271.32,298.63" class="mf-surface-face" fill-opacity="0.070"/><polygon points="420.93,260.61 429.52,265.89 425.94,281.96 417.35,276.67" class="mf-surface-face" fill-opacity="0.174"/><polygon points="233.38,288.65 241.97,290.52 238.39,285.76 229.80,283.90" class="mf-surface-face" fill-opacity="0.070"/><polygon points="425.94,281.96 434.53,286.40 430.96,300.98 422.37,296.53" class="mf-surface-face" fill-opacity="0.175"/><polygon points="393.72,199.97 402.31,205.96 398.73,225.00 390.14,219.01" class="mf-surface-face" fill-opacity="0.171"/><polygon points="387.29,336.01 395.89,341.83 392.31,347.48 383.72,341.66" class="mf-surface-face" fill-opacity="0.222"/><polygon points="316.42,310.50 325.01,314.64 321.44,315.83 312.84,311.69" class="mf-surface-face" fill-opacity="0.107"/><polygon points="295.66,305.17 304.25,308.14 300.68,307.85 292.08,304.88" class="mf-surface-face" fill-opacity="0.070"/><polygon points="366.53,329.42 375.13,335.56 371.55,339.73 362.96,333.59" class="mf-surface-face" fill-opacity="0.213"/><polygon points="161.07,219.77 169.66,236.37 166.09,230.13 157.49,213.52" class="mf-surface-face" fill-opacity="0.071"/><polygon points="427.38,314.07 435.97,317.34 432.39,328.94 423.80,325.67" class="mf-surface-face" fill-opacity="0.178"/><polygon points="380.11,168.52 388.70,173.76 385.13,194.29 376.54,189.05" class="mf-surface-face" fill-opacity="0.168"/><polygon points="415.92,237.23 424.51,243.06 420.93,260.61 412.34,254.79" class="mf-surface-face" fill-opacity="0.173"/><polygon points="423.80,325.67 432.39,328.94 428.82,339.05 420.22,335.79" class="mf-surface-face" fill-opacity="0.184"/><polygon points="430.96,300.98 439.55,304.25 435.97,317.34 427.38,314.07" class="mf-surface-face" fill-opacity="0.174"/><polygon points="408.06,339.97 416.65,344.42 413.07,351.56 404.48,347.11" class="mf-surface-face" fill-opacity="0.212"/><polygon points="345.77,321.92 354.37,327.60 350.79,330.28 342.20,324.60" class="mf-surface-face" fill-opacity="0.176"/><polygon points="402.31,205.96 410.90,212.10 407.32,231.14 398.73,225.00" class="mf-surface-face" fill-opacity="0.172"/><polygon points="395.89,341.83 404.48,347.11 400.90,352.77 392.31,347.48" class="mf-surface-face" fill-opacity="0.227"/><polygon points="375.13,335.56 383.72,341.66 380.14,345.83 371.55,339.73" class="mf-surface-face" fill-opacity="0.213"/><polygon points="212.62,278.24 221.21,281.49 217.63,275.25 209.04,272.00" class="mf-surface-face" fill-opacity="0.070"/><polygon points="429.52,265.89 438.11,270.34 434.53,286.40 425.94,281.96" class="mf-surface-face" fill-opacity="0.172"/><polygon points="420.22,335.79 428.82,339.05 425.24,347.68 416.65,344.42" class="mf-surface-face" fill-opacity="0.193"/><polygon points="325.01,314.64 333.61,319.36 330.03,320.55 321.44,315.83" class="mf-surface-face" fill-opacity="0.112"/><polygon points="434.53,286.40 443.13,289.67 439.55,304.25 430.96,300.98" class="mf-surface-face" fill-opacity="0.171"/><polygon points="424.51,243.06 433.10,248.34 429.52,265.89 420.93,260.61" class="mf-surface-face" fill-opacity="0.172"/><polygon points="388.70,173.76 397.30,179.44 393.72,199.97 385.13,194.29" class="mf-surface-face" fill-opacity="0.169"/><polygon points="410.90,212.10 419.49,218.20 415.92,237.23 407.32,231.14" class="mf-surface-face" fill-opacity="0.172"/><polygon points="354.37,327.60 362.96,333.59 359.38,336.27 350.79,330.28" class="mf-surface-face" fill-opacity="0.174"/><polygon points="304.25,308.14 312.84,311.69 309.27,311.40 300.68,307.85" class="mf-surface-face" fill-opacity="0.070"/><polygon points="283.49,302.43 292.08,304.88 288.51,303.09 279.92,300.65" class="mf-surface-face" fill-opacity="0.070"/><polygon points="262.73,296.93 271.32,298.63 267.75,295.37 259.16,293.66" class="mf-surface-face" fill-opacity="0.070"/><polygon points="383.72,341.66 392.31,347.48 388.73,351.65 380.14,345.83" class="mf-surface-face" fill-opacity="0.218"/><polygon points="241.97,290.52 250.56,292.11 246.99,287.36 238.39,285.76" class="mf-surface-face" fill-opacity="0.070"/><polygon points="404.48,347.11 413.07,351.56 409.49,357.21 400.90,352.77" class="mf-surface-face" fill-opacity="0.230"/><polygon points="416.65,344.42 425.24,347.68 421.66,354.82 413.07,351.56" class="mf-surface-face" fill-opacity="0.206"/><polygon points="147.47,178.91 156.06,203.98 152.48,199.22 143.89,174.15" class="mf-surface-face" fill-opacity="0.096"/><polygon points="435.97,317.34 444.56,319.05 440.98,330.66 432.39,328.94" class="mf-surface-face" fill-opacity="0.171"/><polygon points="397.30,179.44 405.89,185.43 402.31,205.96 393.72,199.97" class="mf-surface-face" fill-opacity="0.170"/><polygon points="432.39,328.94 440.98,330.66 437.41,340.77 428.82,339.05" class="mf-surface-face" fill-opacity="0.175"/><polygon points="419.49,218.20 428.08,224.02 424.51,243.06 415.92,237.23" class="mf-surface-face" fill-opacity="0.171"/><polygon points="333.61,319.36 342.20,324.60 338.62,325.80 330.03,320.55" class="mf-surface-face" fill-opacity="0.116"/><polygon points="362.96,333.59 371.55,339.73 367.97,342.41 359.38,336.27" class="mf-surface-face" fill-opacity="0.173"/><polygon points="438.11,270.34 446.70,273.60 443.13,289.67 434.53,286.40" class="mf-surface-face" fill-opacity="0.169"/><polygon points="439.55,304.25 448.14,305.96 444.56,319.05 435.97,317.34" class="mf-surface-face" fill-opacity="0.168"/><polygon points="433.10,248.34 441.69,252.79 438.11,270.34 429.52,265.89" class="mf-surface-face" fill-opacity="0.170"/><polygon points="221.21,281.49 229.80,283.90 226.23,277.65 217.63,275.25" class="mf-surface-face" fill-opacity="0.070"/><polygon points="392.31,347.48 400.90,352.77 397.32,356.94 388.73,351.65" class="mf-surface-face" fill-opacity="0.228"/><polygon points="428.82,339.05 437.41,340.77 433.83,349.40 425.24,347.68" class="mf-surface-face" fill-opacity="0.180"/><polygon points="152.48,199.22 161.07,219.77 157.49,213.52 148.90,192.98" class="mf-surface-face" fill-opacity="0.081"/><polygon points="183.27,253.67 191.86,261.60 188.28,253.87 179.69,245.94" class="mf-surface-face" fill-opacity="0.070"/><polygon points="174.68,243.34 183.27,253.67 179.69,245.94 171.10,235.61" class="mf-surface-face" fill-opacity="0.070"/><polygon points="312.84,311.69 321.44,315.83 317.86,315.54 309.27,311.40" class="mf-surface-face" fill-opacity="0.070"/><polygon points="405.89,185.43 414.48,191.57 410.90,212.10 402.31,205.96" class="mf-surface-face" fill-opacity="0.170"/><polygon points="443.13,289.67 451.72,291.39 448.14,305.96 439.55,304.25" class="mf-surface-face" fill-opacity="0.166"/><polygon points="371.55,339.73 380.14,345.83 376.56,348.51 367.97,342.41" class="mf-surface-face" fill-opacity="0.173"/><polygon points="428.08,224.02 436.68,229.30 433.10,248.34 424.51,243.06" class="mf-surface-face" fill-opacity="0.170"/><polygon points="342.20,324.60 350.79,330.28 347.21,331.47 338.62,325.80" class="mf-surface-face" fill-opacity="0.119"/><polygon points="413.07,351.56 421.66,354.82 418.08,360.48 409.49,357.21" class="mf-surface-face" fill-opacity="0.230"/><polygon points="292.08,304.88 300.68,307.85 297.10,306.07 288.51,303.09" class="mf-surface-face" fill-opacity="0.070"/><polygon points="191.86,261.60 200.45,267.57 196.87,259.85 188.28,253.87" class="mf-surface-face" fill-opacity="0.070"/><polygon points="271.32,298.63 279.92,300.65 276.34,297.38 267.75,295.37" class="mf-surface-face" fill-opacity="0.070"/><polygon points="166.09,230.13 174.68,243.34 171.10,235.61 162.51,222.40" class="mf-surface-face" fill-opacity="0.070"/><polygon points="414.48,191.57 423.07,197.67 419.49,218.20 410.90,212.10" class="mf-surface-face" fill-opacity="0.170"/><polygon points="400.90,352.77 409.49,357.21 405.91,361.38 397.32,356.94" class="mf-surface-face" fill-opacity="0.230"/><polygon points="425.24,347.68 433.83,349.40 430.25,356.54 421.66,354.82" class="mf-surface-face" fill-opacity="0.189"/><polygon points="441.69,252.79 450.28,256.05 446.70,273.60 438.11,270.34" class="mf-surface-face" fill-opacity="0.167"/><polygon points="250.56,292.11 259.16,293.66 255.58,288.91 246.99,287.36" class="mf-surface-face" fill-opacity="0.070"/><polygon points="380.14,345.83 388.73,351.65 385.15,354.33 376.56,348.51" class="mf-surface-face" fill-opacity="0.175"/><polygon points="446.70,273.60 455.29,275.32 451.72,291.39 443.13,289.67" class="mf-surface-face" fill-opacity="0.164"/><polygon points="350.79,330.28 359.38,336.27 355.80,337.46 347.21,331.47" class="mf-surface-face" fill-opacity="0.120"/><polygon points="321.44,315.83 330.03,320.55 326.45,320.26 317.86,315.54" class="mf-surface-face" fill-opacity="0.072"/><polygon points="436.68,229.30 445.27,233.75 441.69,252.79 433.10,248.34" class="mf-surface-face" fill-opacity="0.168"/><polygon points="444.56,319.05 453.15,318.81 449.58,330.42 440.98,330.66" class="mf-surface-face" fill-opacity="0.159"/><polygon points="440.98,330.66 449.58,330.42 446.00,340.53 437.41,340.77" class="mf-surface-face" fill-opacity="0.159"/><polygon points="229.80,283.90 238.39,285.76 234.82,279.52 226.23,277.65" class="mf-surface-face" fill-opacity="0.070"/><polygon points="200.45,267.57 209.04,272.00 205.47,264.27 196.87,259.85" class="mf-surface-face" fill-opacity="0.070"/><polygon points="423.07,197.67 431.66,203.49 428.08,224.02 419.49,218.20" class="mf-surface-face" fill-opacity="0.169"/><polygon points="448.14,305.96 456.73,305.72 453.15,318.81 444.56,319.05" class="mf-surface-face" fill-opacity="0.158"/><polygon points="388.73,351.65 397.32,356.94 393.75,359.62 385.15,354.33" class="mf-surface-face" fill-opacity="0.179"/><polygon points="359.38,336.27 367.97,342.41 364.39,343.61 355.80,337.46" class="mf-surface-face" fill-opacity="0.121"/><polygon points="300.68,307.85 309.27,311.40 305.69,309.62 297.10,306.07" class="mf-surface-face" fill-opacity="0.070"/><polygon points="437.41,340.77 446.00,340.53 442.42,349.16 433.83,349.40" class="mf-surface-face" fill-opacity="0.160"/><polygon points="421.66,354.82 430.25,356.54 426.67,362.20 418.08,360.48" class="mf-surface-face" fill-opacity="0.203"/><polygon points="409.49,357.21 418.08,360.48 414.51,364.65 405.91,361.38" class="mf-surface-face" fill-opacity="0.230"/><polygon points="451.72,291.39 460.31,291.15 456.73,305.72 448.14,305.96" class="mf-surface-face" fill-opacity="0.157"/><polygon points="157.49,213.52 166.09,230.13 162.51,222.40 153.92,205.80" class="mf-surface-face" fill-opacity="0.070"/><polygon points="330.03,320.55 338.62,325.80 335.04,325.50 326.45,320.26" class="mf-surface-face" fill-opacity="0.077"/><polygon points="279.92,300.65 288.51,303.09 284.93,299.83 276.34,297.38" class="mf-surface-face" fill-opacity="0.070"/><polygon points="431.66,203.49 440.25,208.78 436.68,229.30 428.08,224.02" class="mf-surface-face" fill-opacity="0.168"/><polygon points="450.28,256.05 458.87,257.77 455.29,275.32 446.70,273.60" class="mf-surface-face" fill-opacity="0.162"/><polygon points="367.97,342.41 376.56,348.51 372.98,349.70 364.39,343.61" class="mf-surface-face" fill-opacity="0.121"/><polygon points="445.27,233.75 453.86,237.01 450.28,256.05 441.69,252.79" class="mf-surface-face" fill-opacity="0.165"/><polygon points="259.16,293.66 267.75,295.37 264.17,290.61 255.58,288.91" class="mf-surface-face" fill-opacity="0.070"/><polygon points="397.32,356.94 405.91,361.38 402.34,364.06 393.75,359.62" class="mf-surface-face" fill-opacity="0.186"/><polygon points="209.04,272.00 217.63,275.25 214.06,267.52 205.47,264.27" class="mf-surface-face" fill-opacity="0.070"/><polygon points="433.83,349.40 442.42,349.16 438.84,356.30 430.25,356.54" class="mf-surface-face" fill-opacity="0.159"/><polygon points="338.62,325.80 347.21,331.47 343.63,331.18 335.04,325.50" class="mf-surface-face" fill-opacity="0.080"/><polygon points="455.29,275.32 463.89,275.08 460.31,291.15 451.72,291.39" class="mf-surface-face" fill-opacity="0.157"/><polygon points="309.27,311.40 317.86,315.54 314.28,313.76 305.69,309.62" class="mf-surface-face" fill-opacity="0.070"/><polygon points="238.39,285.76 246.99,287.36 243.41,281.12 234.82,279.52" class="mf-surface-face" fill-opacity="0.070"/><polygon points="376.56,348.51 385.15,354.33 381.58,355.53 372.98,349.70" class="mf-surface-face" fill-opacity="0.120"/><polygon points="440.25,208.78 448.84,213.22 445.27,233.75 436.68,229.30" class="mf-surface-face" fill-opacity="0.167"/><polygon points="143.89,174.15 152.48,199.22 148.90,192.98 140.31,167.91" class="mf-surface-face" fill-opacity="0.089"/><polygon points="418.08,360.48 426.67,362.20 423.10,366.36 414.51,364.65" class="mf-surface-face" fill-opacity="0.211"/><polygon points="347.21,331.47 355.80,337.46 352.22,337.17 343.63,331.18" class="mf-surface-face" fill-opacity="0.083"/><polygon points="453.15,318.81 461.74,316.17 458.17,327.78 449.58,330.42" class="mf-surface-face" fill-opacity="0.142"/><polygon points="288.51,303.09 297.10,306.07 293.52,302.80 284.93,299.83" class="mf-surface-face" fill-opacity="0.070"/><polygon points="449.58,330.42 458.17,327.78 454.59,337.89 446.00,340.53" class="mf-surface-face" fill-opacity="0.139"/><polygon points="405.91,361.38 414.51,364.65 410.93,367.33 402.34,364.06" class="mf-surface-face" fill-opacity="0.185"/><polygon points="430.25,356.54 438.84,356.30 435.27,361.96 426.67,362.20" class="mf-surface-face" fill-opacity="0.154"/><polygon points="385.15,354.33 393.75,359.62 390.17,360.81 381.58,355.53" class="mf-surface-face" fill-opacity="0.116"/><polygon points="456.73,305.72 465.32,303.08 461.74,316.17 453.15,318.81" class="mf-surface-face" fill-opacity="0.144"/><polygon points="453.86,237.01 462.45,238.73 458.87,257.77 450.28,256.05" class="mf-surface-face" fill-opacity="0.161"/><polygon points="317.86,315.54 326.45,320.26 322.87,318.48 314.28,313.76" class="mf-surface-face" fill-opacity="0.070"/><polygon points="217.63,275.25 226.23,277.65 222.65,269.93 214.06,267.52" class="mf-surface-face" fill-opacity="0.070"/><polygon points="458.87,257.77 467.46,257.53 463.89,275.08 455.29,275.32" class="mf-surface-face" fill-opacity="0.156"/><polygon points="267.75,295.37 276.34,297.38 272.76,292.62 264.17,290.61" class="mf-surface-face" fill-opacity="0.070"/><polygon points="446.00,340.53 454.59,337.89 451.01,346.52 442.42,349.16" class="mf-surface-face" fill-opacity="0.134"/><polygon points="148.90,192.98 157.49,213.52 153.92,205.80 145.33,185.25" class="mf-surface-face" fill-opacity="0.073"/><polygon points="355.80,337.46 364.39,343.61 360.82,343.31 352.22,337.17" class="mf-surface-face" fill-opacity="0.084"/><polygon points="448.84,213.22 457.44,216.49 453.86,237.01 445.27,233.75" class="mf-surface-face" fill-opacity="0.164"/><polygon points="460.31,291.15 468.90,288.51 465.32,303.08 456.73,305.72" class="mf-surface-face" fill-opacity="0.146"/><polygon points="179.69,245.94 188.28,253.87 184.71,244.65 176.11,236.72" class="mf-surface-face" fill-opacity="0.070"/><polygon points="171.10,235.61 179.69,245.94 176.11,236.72 167.52,226.39" class="mf-surface-face" fill-opacity="0.070"/><polygon points="246.99,287.36 255.58,288.91 252.00,282.67 243.41,281.12" class="mf-surface-face" fill-opacity="0.070"/><polygon points="393.75,359.62 402.34,364.06 398.76,365.26 390.17,360.81" class="mf-surface-face" fill-opacity="0.110"/><polygon points="364.39,343.61 372.98,349.70 369.41,349.41 360.82,343.31" class="mf-surface-face" fill-opacity="0.084"/><polygon points="326.45,320.26 335.04,325.50 331.46,323.72 322.87,318.48" class="mf-surface-face" fill-opacity="0.070"/><polygon points="297.10,306.07 305.69,309.62 302.11,306.35 293.52,302.80" class="mf-surface-face" fill-opacity="0.070"/><polygon points="442.42,349.16 451.01,346.52 447.43,353.66 438.84,356.30" class="mf-surface-face" fill-opacity="0.125"/><polygon points="188.28,253.87 196.87,259.85 193.30,250.63 184.71,244.65" class="mf-surface-face" fill-opacity="0.070"/><polygon points="414.51,364.65 423.10,366.36 419.52,369.05 410.93,367.33" class="mf-surface-face" fill-opacity="0.142"/><polygon points="162.51,222.40 171.10,235.61 167.52,226.39 158.93,213.18" class="mf-surface-face" fill-opacity="0.070"/><polygon points="426.67,362.20 435.27,361.96 431.69,366.12 423.10,366.36" class="mf-surface-face" fill-opacity="0.132"/><polygon points="463.89,275.08 472.48,272.44 468.90,288.51 460.31,291.15" class="mf-surface-face" fill-opacity="0.147"/><polygon points="372.98,349.70 381.58,355.53 378.00,355.23 369.41,349.41" class="mf-surface-face" fill-opacity="0.082"/><polygon points="226.23,277.65 234.82,279.52 231.24,271.79 222.65,269.93" class="mf-surface-face" fill-opacity="0.070"/><polygon points="335.04,325.50 343.63,331.18 340.06,329.40 331.46,323.72" class="mf-surface-face" fill-opacity="0.070"/><polygon points="462.45,238.73 471.04,238.49 467.46,257.53 458.87,257.77" class="mf-surface-face" fill-opacity="0.156"/><polygon points="276.34,297.38 284.93,299.83 281.35,295.07 272.76,292.62" class="mf-surface-face" fill-opacity="0.070"/><polygon points="457.44,216.49 466.03,218.21 462.45,238.73 453.86,237.01" class="mf-surface-face" fill-opacity="0.160"/><polygon points="402.34,364.06 410.93,367.33 407.35,368.52 398.76,365.26" class="mf-surface-face" fill-opacity="0.096"/><polygon points="196.87,259.85 205.47,264.27 201.89,255.05 193.30,250.63" class="mf-surface-face" fill-opacity="0.070"/><polygon points="305.69,309.62 314.28,313.76 310.70,310.49 302.11,306.35" class="mf-surface-face" fill-opacity="0.070"/><polygon points="438.84,356.30 447.43,353.66 443.86,359.32 435.27,361.96" class="mf-surface-face" fill-opacity="0.110"/><polygon points="381.58,355.53 390.17,360.81 386.59,360.52 378.00,355.23" class="mf-surface-face" fill-opacity="0.077"/><polygon points="343.63,331.18 352.22,337.17 348.65,335.39 340.06,329.40" class="mf-surface-face" fill-opacity="0.070"/><polygon points="255.58,288.91 264.17,290.61 260.59,284.37 252.00,282.67" class="mf-surface-face" fill-opacity="0.070"/><polygon points="467.46,257.53 476.06,254.89 472.48,272.44 463.89,275.08" class="mf-surface-face" fill-opacity="0.147"/><polygon points="153.92,205.80 162.51,222.40 158.93,213.18 150.34,196.58" class="mf-surface-face" fill-opacity="0.070"/><polygon points="461.74,316.17 470.34,310.66 466.76,322.26 458.17,327.78" class="mf-surface-face" fill-opacity="0.123"/><polygon points="458.17,327.78 466.76,322.26 463.18,332.37 454.59,337.89" class="mf-surface-face" fill-opacity="0.117"/><polygon points="465.32,303.08 473.91,297.57 470.34,310.66 461.74,316.17" class="mf-surface-face" fill-opacity="0.128"/><polygon points="352.22,337.17 360.82,343.31 357.24,341.53 348.65,335.39" class="mf-surface-face" fill-opacity="0.070"/><polygon points="423.10,366.36 431.69,366.12 428.11,368.81 419.52,369.05" class="mf-surface-face" fill-opacity="0.087"/><polygon points="205.47,264.27 214.06,267.52 210.48,258.30 201.89,255.05" class="mf-surface-face" fill-opacity="0.070"/><polygon points="314.28,313.76 322.87,318.48 319.30,315.21 310.70,310.49" class="mf-surface-face" fill-opacity="0.070"/><polygon points="284.93,299.83 293.52,302.80 289.94,298.04 281.35,295.07" class="mf-surface-face" fill-opacity="0.070"/><polygon points="454.59,337.89 463.18,332.37 459.60,341.00 451.01,346.52" class="mf-surface-face" fill-opacity="0.108"/><polygon points="234.82,279.52 243.41,281.12 239.83,273.39 231.24,271.79" class="mf-surface-face" fill-opacity="0.070"/><polygon points="390.17,360.81 398.76,365.26 395.18,364.96 386.59,360.52" class="mf-surface-face" fill-opacity="0.070"/><polygon points="468.90,288.51 477.49,282.99 473.91,297.57 465.32,303.08" class="mf-surface-face" fill-opacity="0.131"/><polygon points="140.31,167.91 148.90,192.98 145.33,185.25 136.73,160.18" class="mf-surface-face" fill-opacity="0.082"/><polygon points="410.93,367.33 419.52,369.05 415.94,370.24 407.35,368.52" class="mf-surface-face" fill-opacity="0.072"/><polygon points="435.27,361.96 443.86,359.32 440.28,363.49 431.69,366.12" class="mf-surface-face" fill-opacity="0.086"/><polygon points="466.03,218.21 474.62,217.97 471.04,238.49 462.45,238.73" class="mf-surface-face" fill-opacity="0.155"/><polygon points="360.82,343.31 369.41,349.41 365.83,347.63 357.24,341.53" class="mf-surface-face" fill-opacity="0.070"/><polygon points="451.01,346.52 459.60,341.00 456.03,348.14 447.43,353.66" class="mf-surface-face" fill-opacity="0.096"/><polygon points="264.17,290.61 272.76,292.62 269.18,286.38 260.59,284.37" class="mf-surface-face" fill-opacity="0.070"/><polygon points="322.87,318.48 331.46,323.72 327.89,320.45 319.30,315.21" class="mf-surface-face" fill-opacity="0.070"/><polygon points="471.04,238.49 479.63,235.85 476.06,254.89 467.46,257.53" class="mf-surface-face" fill-opacity="0.148"/><polygon points="472.48,272.44 481.07,266.92 477.49,282.99 468.90,288.51" class="mf-surface-face" fill-opacity="0.134"/><polygon points="369.41,349.41 378.00,355.23 374.42,353.45 365.83,347.63" class="mf-surface-face" fill-opacity="0.070"/><polygon points="398.76,365.26 407.35,368.52 403.77,368.23 395.18,364.96" class="mf-surface-face" fill-opacity="0.070"/><polygon points="293.52,302.80 302.11,306.35 298.53,301.59 289.94,298.04" class="mf-surface-face" fill-opacity="0.070"/><polygon points="214.06,267.52 222.65,269.93 219.07,260.71 210.48,258.30" class="mf-surface-face" fill-opacity="0.070"/><polygon points="145.33,185.25 153.92,205.80 150.34,196.58 141.75,176.04" class="mf-surface-face" fill-opacity="0.070"/><polygon points="331.46,323.72 340.06,329.40 336.48,326.13 327.89,320.45" class="mf-surface-face" fill-opacity="0.070"/><polygon points="243.41,281.12 252.00,282.67 248.42,274.94 239.83,273.39" class="mf-surface-face" fill-opacity="0.070"/><polygon points="447.43,353.66 456.03,348.14 452.45,353.80 443.86,359.32" class="mf-surface-face" fill-opacity="0.080"/><polygon points="378.00,355.23 386.59,360.52 383.01,358.74 374.42,353.45" class="mf-surface-face" fill-opacity="0.070"/><polygon points="419.52,369.05 428.11,368.81 424.53,370.00 415.94,370.24" class="mf-surface-face" fill-opacity="0.070"/><polygon points="431.69,366.12 440.28,363.49 436.70,366.17 428.11,368.81" class="mf-surface-face" fill-opacity="0.070"/><polygon points="176.11,236.72 184.71,244.65 181.13,233.95 172.54,226.02" class="mf-surface-face" fill-opacity="0.070"/><polygon points="476.06,254.89 484.65,249.37 481.07,266.92 472.48,272.44" class="mf-surface-face" fill-opacity="0.136"/><polygon points="167.52,226.39 176.11,236.72 172.54,226.02 163.94,215.69" class="mf-surface-face" fill-opacity="0.070"/><polygon points="340.06,329.40 348.65,335.39 345.07,332.12 336.48,326.13" class="mf-surface-face" fill-opacity="0.070"/><polygon points="272.76,292.62 281.35,295.07 277.77,288.83 269.18,286.38" class="mf-surface-face" fill-opacity="0.070"/><polygon points="302.11,306.35 310.70,310.49 307.13,305.74 298.53,301.59" class="mf-surface-face" fill-opacity="0.070"/><polygon points="407.35,368.52 415.94,370.24 412.36,369.95 403.77,368.23" class="mf-surface-face" fill-opacity="0.070"/><polygon points="184.71,244.65 193.30,250.63 189.72,239.93 181.13,233.95" class="mf-surface-face" fill-opacity="0.070"/><polygon points="474.62,217.97 483.21,215.33 479.63,235.85 471.04,238.49" class="mf-surface-face" fill-opacity="0.148"/><polygon points="386.59,360.52 395.18,364.96 391.60,363.18 383.01,358.74" class="mf-surface-face" fill-opacity="0.070"/><polygon points="222.65,269.93 231.24,271.79 227.66,262.58 219.07,260.71" class="mf-surface-face" fill-opacity="0.070"/><polygon points="158.93,213.18 167.52,226.39 163.94,215.69 155.35,202.48" class="mf-surface-face" fill-opacity="0.070"/><polygon points="348.65,335.39 357.24,341.53 353.66,338.26 345.07,332.12" class="mf-surface-face" fill-opacity="0.070"/><polygon points="470.34,310.66 478.93,301.75 475.35,313.35 466.76,322.26" class="mf-surface-face" fill-opacity="0.104"/><polygon points="466.76,322.26 475.35,313.35 471.77,323.46 463.18,332.37" class="mf-surface-face" fill-opacity="0.096"/><polygon points="473.91,297.57 482.51,288.66 478.93,301.75 470.34,310.66" class="mf-surface-face" fill-opacity="0.111"/><polygon points="443.86,359.32 452.45,353.80 448.87,357.97 440.28,363.49" class="mf-surface-face" fill-opacity="0.070"/><polygon points="252.00,282.67 260.59,284.37 257.01,276.64 248.42,274.94" class="mf-surface-face" fill-opacity="0.070"/><polygon points="310.70,310.49 319.30,315.21 315.72,310.46 307.13,305.74" class="mf-surface-face" fill-opacity="0.070"/><polygon points="193.30,250.63 201.89,255.05 198.31,244.35 189.72,239.93" class="mf-surface-face" fill-opacity="0.070"/><polygon points="463.18,332.37 471.77,323.46 468.20,332.09 459.60,341.00" class="mf-surface-face" fill-opacity="0.087"/><polygon points="357.24,341.53 365.83,347.63 362.25,344.36 353.66,338.26" class="mf-surface-face" fill-opacity="0.070"/><polygon points="281.35,295.07 289.94,298.04 286.37,291.80 277.77,288.83" class="mf-surface-face" fill-opacity="0.070"/><polygon points="477.49,282.99 486.08,274.08 482.51,288.66 473.91,297.57" class="mf-surface-face" fill-opacity="0.116"/><polygon points="479.63,235.85 488.22,230.33 484.65,249.37 476.06,254.89" class="mf-surface-face" fill-opacity="0.138"/><polygon points="395.18,364.96 403.77,368.23 400.20,366.45 391.60,363.18" class="mf-surface-face" fill-opacity="0.070"/><polygon points="150.34,196.58 158.93,213.18 155.35,202.48 146.76,185.88" class="mf-surface-face" fill-opacity="0.070"/><polygon points="365.83,347.63 374.42,353.45 370.84,350.19 362.25,344.36" class="mf-surface-face" fill-opacity="0.070"/><polygon points="319.30,315.21 327.89,320.45 324.31,315.70 315.72,310.46" class="mf-surface-face" fill-opacity="0.070"/><polygon points="428.11,368.81 436.70,366.17 433.12,367.36 424.53,370.00" class="mf-surface-face" fill-opacity="0.070"/><polygon points="459.60,341.00 468.20,332.09 464.62,339.23 456.03,348.14" class="mf-surface-face" fill-opacity="0.075"/><polygon points="415.94,370.24 424.53,370.00 420.96,369.71 412.36,369.95" class="mf-surface-face" fill-opacity="0.070"/><polygon points="231.24,271.79 239.83,273.39 236.25,264.17 227.66,262.58" class="mf-surface-face" fill-opacity="0.070"/><polygon points="136.73,160.18 145.33,185.25 141.75,176.04 133.16,150.97" class="mf-surface-face" fill-opacity="0.076"/><polygon points="481.07,266.92 489.66,258.01 486.08,274.08 477.49,282.99" class="mf-surface-face" fill-opacity="0.120"/><polygon points="201.89,255.05 210.48,258.30 206.90,247.60 198.31,244.35" class="mf-surface-face" fill-opacity="0.070"/><polygon points="260.59,284.37 269.18,286.38 265.61,278.65 257.01,276.64" class="mf-surface-face" fill-opacity="0.070"/><polygon points="289.94,298.04 298.53,301.59 294.96,295.35 286.37,291.80" class="mf-surface-face" fill-opacity="0.070"/><polygon points="374.42,353.45 383.01,358.74 379.44,355.47 370.84,350.19" class="mf-surface-face" fill-opacity="0.070"/><polygon points="327.89,320.45 336.48,326.13 332.90,321.38 324.31,315.70" class="mf-surface-face" fill-opacity="0.070"/><polygon points="440.28,363.49 448.87,357.97 445.29,360.65 436.70,366.17" class="mf-surface-face" fill-opacity="0.070"/><polygon points="403.77,368.23 412.36,369.95 408.79,368.17 400.20,366.45" class="mf-surface-face" fill-opacity="0.070"/><polygon points="456.03,348.14 464.62,339.23 461.04,344.89 452.45,353.80" class="mf-surface-face" fill-opacity="0.070"/><polygon points="483.21,215.33 491.80,209.81 488.22,230.33 479.63,235.85" class="mf-surface-face" fill-opacity="0.139"/><polygon points="336.48,326.13 345.07,332.12 341.49,327.37 332.90,321.38" class="mf-surface-face" fill-opacity="0.070"/><polygon points="484.65,249.37 493.24,240.46 489.66,258.01 481.07,266.92" class="mf-surface-face" fill-opacity="0.123"/><polygon points="383.01,358.74 391.60,363.18 388.03,359.91 379.44,355.47" class="mf-surface-face" fill-opacity="0.070"/><polygon points="210.48,258.30 219.07,260.71 215.49,250.01 206.90,247.60" class="mf-surface-face" fill-opacity="0.070"/><polygon points="239.83,273.39 248.42,274.94 244.85,265.72 236.25,264.17" class="mf-surface-face" fill-opacity="0.070"/><polygon points="298.53,301.59 307.13,305.74 303.55,299.50 294.96,295.35" class="mf-surface-face" fill-opacity="0.070"/><polygon points="141.75,176.04 150.34,196.58 146.76,185.88 138.17,165.33" class="mf-surface-face" fill-opacity="0.070"/><polygon points="345.07,332.12 353.66,338.26 350.08,333.51 341.49,327.37" class="mf-surface-face" fill-opacity="0.070"/><polygon points="269.18,286.38 277.77,288.83 274.20,281.10 265.61,278.65" class="mf-surface-face" fill-opacity="0.070"/><polygon points="424.53,370.00 433.12,367.36 429.55,367.07 420.96,369.71" class="mf-surface-face" fill-opacity="0.070"/><polygon points="452.45,353.80 461.04,344.89 457.46,349.06 448.87,357.97" class="mf-surface-face" fill-opacity="0.070"/><polygon points="353.66,338.26 362.25,344.36 358.67,339.61 350.08,333.51" class="mf-surface-face" fill-opacity="0.070"/><polygon points="391.60,363.18 400.20,366.45 396.62,363.18 388.03,359.91" class="mf-surface-face" fill-opacity="0.070"/><polygon points="307.13,305.74 315.72,310.46 312.14,304.21 303.55,299.50" class="mf-surface-face" fill-opacity="0.070"/><polygon points="436.70,366.17 445.29,360.65 441.72,361.84 433.12,367.36" class="mf-surface-face" fill-opacity="0.070"/><polygon points="412.36,369.95 420.96,369.71 417.38,367.93 408.79,368.17" class="mf-surface-face" fill-opacity="0.070"/><polygon points="172.54,226.02 181.13,233.95 177.55,221.76 168.96,213.83" class="mf-surface-face" fill-opacity="0.070"/><polygon points="163.94,215.69 172.54,226.02 168.96,213.83 160.37,203.50" class="mf-surface-face" fill-opacity="0.070"/><polygon points="488.22,230.33 496.82,221.42 493.24,240.46 484.65,249.37" class="mf-surface-face" fill-opacity="0.126"/><polygon points="478.93,301.75 487.52,288.89 483.94,300.50 475.35,313.35" class="mf-surface-face" fill-opacity="0.087"/><polygon points="475.35,313.35 483.94,300.50 480.36,310.61 471.77,323.46" class="mf-surface-face" fill-opacity="0.080"/><polygon points="219.07,260.71 227.66,262.58 224.08,251.88 215.49,250.01" class="mf-surface-face" fill-opacity="0.070"/><polygon points="482.51,288.66 491.10,275.80 487.52,288.89 478.93,301.75" class="mf-surface-face" fill-opacity="0.094"/><polygon points="362.25,344.36 370.84,350.19 367.27,345.43 358.67,339.61" class="mf-surface-face" fill-opacity="0.070"/><polygon points="248.42,274.94 257.01,276.64 253.44,267.43 244.85,265.72" class="mf-surface-face" fill-opacity="0.070"/><polygon points="181.13,233.95 189.72,239.93 186.14,227.74 177.55,221.76" class="mf-surface-face" fill-opacity="0.070"/><polygon points="277.77,288.83 286.37,291.80 282.79,284.07 274.20,281.10" class="mf-surface-face" fill-opacity="0.070"/><polygon points="155.35,202.48 163.94,215.69 160.37,203.50 151.78,190.29" class="mf-surface-face" fill-opacity="0.070"/><polygon points="471.77,323.46 480.36,310.61 476.79,319.24 468.20,332.09" class="mf-surface-face" fill-opacity="0.071"/><polygon points="315.72,310.46 324.31,315.70 320.73,309.46 312.14,304.21" class="mf-surface-face" fill-opacity="0.070"/><polygon points="486.08,274.08 494.67,261.23 491.10,275.80 482.51,288.66" class="mf-surface-face" fill-opacity="0.100"/><polygon points="370.84,350.19 379.44,355.47 375.86,350.72 367.27,345.43" class="mf-surface-face" fill-opacity="0.070"/><polygon points="400.20,366.45 408.79,368.17 405.21,364.90 396.62,363.18" class="mf-surface-face" fill-opacity="0.070"/><polygon points="189.72,239.93 198.31,244.35 194.73,232.16 186.14,227.74" class="mf-surface-face" fill-opacity="0.070"/><polygon points="448.87,357.97 457.46,349.06 453.89,351.74 445.29,360.65" class="mf-surface-face" fill-opacity="0.070"/><polygon points="468.20,332.09 476.79,319.24 473.21,326.38 464.62,339.23" class="mf-surface-face" fill-opacity="0.070"/><polygon points="324.31,315.70 332.90,321.38 329.32,315.14 320.73,309.46" class="mf-surface-face" fill-opacity="0.070"/><polygon points="489.66,258.01 498.25,245.16 494.67,261.23 486.08,274.08" class="mf-surface-face" fill-opacity="0.105"/><polygon points="286.37,291.80 294.96,295.35 291.38,287.62 282.79,284.07" class="mf-surface-face" fill-opacity="0.070"/><polygon points="227.66,262.58 236.25,264.17 232.68,253.47 224.08,251.88" class="mf-surface-face" fill-opacity="0.070"/><polygon points="491.80,209.81 500.39,200.90 496.82,221.42 488.22,230.33" class="mf-surface-face" fill-opacity="0.129"/><polygon points="146.76,185.88 155.35,202.48 151.78,190.29 143.18,173.69" class="mf-surface-face" fill-opacity="0.070"/><polygon points="133.16,150.97 141.75,176.04 138.17,165.33 129.58,140.27" class="mf-surface-face" fill-opacity="0.070"/><polygon points="257.01,276.64 265.61,278.65 262.03,269.44 253.44,267.43" class="mf-surface-face" fill-opacity="0.070"/><polygon points="379.44,355.47 388.03,359.91 384.45,355.16 375.86,350.72" class="mf-surface-face" fill-opacity="0.070"/><polygon points="420.96,369.71 429.55,367.07 425.97,365.29 417.38,367.93" class="mf-surface-face" fill-opacity="0.070"/><polygon points="332.90,321.38 341.49,327.37 337.91,321.13 329.32,315.14" class="mf-surface-face" fill-opacity="0.070"/><polygon points="433.12,367.36 441.72,361.84 438.14,361.55 429.55,367.07" class="mf-surface-face" fill-opacity="0.070"/><polygon points="198.31,244.35 206.90,247.60 203.32,235.41 194.73,232.16" class="mf-surface-face" fill-opacity="0.070"/><polygon points="464.62,339.23 473.21,326.38 469.63,332.04 461.04,344.89" class="mf-surface-face" fill-opacity="0.070"/><polygon points="341.49,327.37 350.08,333.51 346.51,327.27 337.91,321.13" class="mf-surface-face" fill-opacity="0.070"/><polygon points="493.24,240.46 501.83,227.61 498.25,245.16 489.66,258.01" class="mf-surface-face" fill-opacity="0.110"/><polygon points="294.96,295.35 303.55,299.50 299.97,291.77 291.38,287.62" class="mf-surface-face" fill-opacity="0.070"/><polygon points="408.79,368.17 417.38,367.93 413.80,364.66 405.21,364.90" class="mf-surface-face" fill-opacity="0.070"/><polygon points="388.03,359.91 396.62,363.18 393.04,358.43 384.45,355.16" class="mf-surface-face" fill-opacity="0.070"/><polygon points="445.29,360.65 453.89,351.74 450.31,352.93 441.72,361.84" class="mf-surface-face" fill-opacity="0.070"/><polygon points="350.08,333.51 358.67,339.61 355.10,333.37 346.51,327.27" class="mf-surface-face" fill-opacity="0.070"/><polygon points="265.61,278.65 274.20,281.10 270.62,271.89 262.03,269.44" class="mf-surface-face" fill-opacity="0.070"/><polygon points="236.25,264.17 244.85,265.72 241.27,255.02 232.68,253.47" class="mf-surface-face" fill-opacity="0.070"/><polygon points="206.90,247.60 215.49,250.01 211.92,237.82 203.32,235.41" class="mf-surface-face" fill-opacity="0.070"/><polygon points="303.55,299.50 312.14,304.21 308.56,296.49 299.97,291.77" class="mf-surface-face" fill-opacity="0.070"/><polygon points="461.04,344.89 469.63,332.04 466.05,336.21 457.46,349.06" class="mf-surface-face" fill-opacity="0.070"/><polygon points="138.17,165.33 146.76,185.88 143.18,173.69 134.59,153.14" class="mf-surface-face" fill-opacity="0.070"/><polygon points="358.67,339.61 367.27,345.43 363.69,339.19 355.10,333.37" class="mf-surface-face" fill-opacity="0.070"/><polygon points="496.82,221.42 505.41,208.57 501.83,227.61 493.24,240.46" class="mf-surface-face" fill-opacity="0.113"/><polygon points="396.62,363.18 405.21,364.90 401.63,360.14 393.04,358.43" class="mf-surface-face" fill-opacity="0.070"/><polygon points="312.14,304.21 320.73,309.46 317.15,301.73 308.56,296.49" class="mf-surface-face" fill-opacity="0.070"/><polygon points="367.27,345.43 375.86,350.72 372.28,344.47 363.69,339.19" class="mf-surface-face" fill-opacity="0.070"/><polygon points="274.20,281.10 282.79,284.07 279.21,274.86 270.62,271.89" class="mf-surface-face" fill-opacity="0.070"/><polygon points="429.55,367.07 438.14,361.55 434.56,359.77 425.97,365.29" class="mf-surface-face" fill-opacity="0.070"/><polygon points="244.85,265.72 253.44,267.43 249.86,256.72 241.27,255.02" class="mf-surface-face" fill-opacity="0.070"/><polygon points="417.38,367.93 425.97,365.29 422.39,362.02 413.80,364.66" class="mf-surface-face" fill-opacity="0.070"/><polygon points="215.49,250.01 224.08,251.88 220.51,239.69 211.92,237.82" class="mf-surface-face" fill-opacity="0.070"/><polygon points="168.96,213.83 177.55,221.76 173.97,208.09 165.38,200.15" class="mf-surface-face" fill-opacity="0.070"/><polygon points="487.52,288.89 496.11,271.52 492.53,283.12 483.94,300.50" class="mf-surface-face" fill-opacity="0.074"/><polygon points="160.37,203.50 168.96,213.83 165.38,200.15 156.79,189.82" class="mf-surface-face" fill-opacity="0.070"/><polygon points="483.94,300.50 492.53,283.12 488.96,293.24 480.36,310.61" class="mf-surface-face" fill-opacity="0.070"/><polygon points="320.73,309.46 329.32,315.14 325.75,307.41 317.15,301.73" class="mf-surface-face" fill-opacity="0.070"/><polygon points="491.10,275.80 499.69,258.43 496.11,271.52 487.52,288.89" class="mf-surface-face" fill-opacity="0.080"/><polygon points="457.46,349.06 466.05,336.21 462.48,338.89 453.89,351.74" class="mf-surface-face" fill-opacity="0.070"/><polygon points="375.86,350.72 384.45,355.16 380.87,348.92 372.28,344.47" class="mf-surface-face" fill-opacity="0.070"/><polygon points="177.55,221.76 186.14,227.74 182.56,214.06 173.97,208.09" class="mf-surface-face" fill-opacity="0.070"/><polygon points="441.72,361.84 450.31,352.93 446.73,352.64 438.14,361.55" class="mf-surface-face" fill-opacity="0.070"/><polygon points="480.36,310.61 488.96,293.24 485.38,301.86 476.79,319.24" class="mf-surface-face" fill-opacity="0.070"/><polygon points="151.78,190.29 160.37,203.50 156.79,189.82 148.20,176.61" class="mf-surface-face" fill-opacity="0.070"/><polygon points="494.67,261.23 503.27,243.85 499.69,258.43 491.10,275.80" class="mf-surface-face" fill-opacity="0.086"/><polygon points="282.79,284.07 291.38,287.62 287.80,278.41 279.21,274.86" class="mf-surface-face" fill-opacity="0.070"/><polygon points="329.32,315.14 337.91,321.13 334.34,313.40 325.75,307.41" class="mf-surface-face" fill-opacity="0.070"/><polygon points="500.39,200.90 508.98,188.05 505.41,208.57 496.82,221.42" class="mf-surface-face" fill-opacity="0.117"/><polygon points="405.21,364.90 413.80,364.66 410.22,359.90 401.63,360.14" class="mf-surface-face" fill-opacity="0.070"/><polygon points="186.14,227.74 194.73,232.16 191.16,218.49 182.56,214.06" class="mf-surface-face" fill-opacity="0.070"/><polygon points="476.79,319.24 485.38,301.86 481.80,309.01 473.21,326.38" class="mf-surface-face" fill-opacity="0.070"/><polygon points="253.44,267.43 262.03,269.44 258.45,258.74 249.86,256.72" class="mf-surface-face" fill-opacity="0.070"/><polygon points="384.45,355.16 393.04,358.43 389.46,352.18 380.87,348.92" class="mf-surface-face" fill-opacity="0.070"/><polygon points="337.91,321.13 346.51,327.27 342.93,319.54 334.34,313.40" class="mf-surface-face" fill-opacity="0.070"/><polygon points="224.08,251.88 232.68,253.47 229.10,241.28 220.51,239.69" class="mf-surface-face" fill-opacity="0.070"/><polygon points="498.25,245.16 506.84,227.79 503.27,243.85 494.67,261.23" class="mf-surface-face" fill-opacity="0.092"/><polygon points="129.58,140.27 138.17,165.33 134.59,153.14 126.00,128.08" class="mf-surface-face" fill-opacity="0.070"/><polygon points="143.18,173.69 151.78,190.29 148.20,176.61 139.61,160.01" class="mf-surface-face" fill-opacity="0.070"/><polygon points="291.38,287.62 299.97,291.77 296.39,282.55 287.80,278.41" class="mf-surface-face" fill-opacity="0.070"/><polygon points="346.51,327.27 355.10,333.37 351.52,325.64 342.93,319.54" class="mf-surface-face" fill-opacity="0.070"/><polygon points="453.89,351.74 462.48,338.89 458.90,340.08 450.31,352.93" class="mf-surface-face" fill-opacity="0.070"/><polygon points="194.73,232.16 203.32,235.41 199.75,221.73 191.16,218.49" class="mf-surface-face" fill-opacity="0.070"/><polygon points="473.21,326.38 481.80,309.01 478.22,314.66 469.63,332.04" class="mf-surface-face" fill-opacity="0.070"/><polygon points="425.97,365.29 434.56,359.77 430.98,356.50 422.39,362.02" class="mf-surface-face" fill-opacity="0.070"/><polygon points="355.10,333.37 363.69,339.19 360.11,331.46 351.52,325.64" class="mf-surface-face" fill-opacity="0.070"/><polygon points="501.83,227.61 510.42,210.23 506.84,227.79 498.25,245.16" class="mf-surface-face" fill-opacity="0.096"/><polygon points="262.03,269.44 270.62,271.89 267.04,261.18 258.45,258.74" class="mf-surface-face" fill-opacity="0.070"/><polygon points="299.97,291.77 308.56,296.49 304.98,287.27 296.39,282.55" class="mf-surface-face" fill-opacity="0.070"/><polygon points="393.04,358.43 401.63,360.14 398.05,353.90 389.46,352.18" class="mf-surface-face" fill-opacity="0.070"/><polygon points="232.68,253.47 241.27,255.02 237.69,242.83 229.10,241.28" class="mf-surface-face" fill-opacity="0.070"/><polygon points="438.14,361.55 446.73,352.64 443.15,350.86 434.56,359.77" class="mf-surface-face" fill-opacity="0.070"/><polygon points="413.80,364.66 422.39,362.02 418.81,357.26 410.22,359.90" class="mf-surface-face" fill-opacity="0.070"/><polygon points="363.69,339.19 372.28,344.47 368.70,336.75 360.11,331.46" class="mf-surface-face" fill-opacity="0.070"/><polygon points="308.56,296.49 317.15,301.73 313.58,292.51 304.98,287.27" class="mf-surface-face" fill-opacity="0.070"/><polygon points="203.32,235.41 211.92,237.82 208.34,224.14 199.75,221.73" class="mf-surface-face" fill-opacity="0.070"/><polygon points="469.63,332.04 478.22,314.66 474.65,318.83 466.05,336.21" class="mf-surface-face" fill-opacity="0.070"/><polygon points="134.59,153.14 143.18,173.69 139.61,160.01 131.02,139.47" class="mf-surface-face" fill-opacity="0.070"/><polygon points="270.62,271.89 279.21,274.86 275.63,264.16 267.04,261.18" class="mf-surface-face" fill-opacity="0.070"/><polygon points="505.41,208.57 514.00,191.20 510.42,210.23 501.83,227.61" class="mf-surface-face" fill-opacity="0.101"/><polygon points="372.28,344.47 380.87,348.92 377.29,341.19 368.70,336.75" class="mf-surface-face" fill-opacity="0.070"/><polygon points="317.15,301.73 325.75,307.41 322.17,298.19 313.58,292.51" class="mf-surface-face" fill-opacity="0.070"/><polygon points="401.63,360.14 410.22,359.90 406.65,353.66 398.05,353.90" class="mf-surface-face" fill-opacity="0.070"/><polygon points="241.27,255.02 249.86,256.72 246.28,244.53 237.69,242.83" class="mf-surface-face" fill-opacity="0.070"/><polygon points="450.31,352.93 458.90,340.08 455.32,339.79 446.73,352.64" class="mf-surface-face" fill-opacity="0.070"/><polygon points="325.75,307.41 334.34,313.40 330.76,304.18 322.17,298.19" class="mf-surface-face" fill-opacity="0.070"/><polygon points="211.92,237.82 220.51,239.69 216.93,226.01 208.34,224.14" class="mf-surface-face" fill-opacity="0.070"/><polygon points="279.21,274.86 287.80,278.41 284.22,267.70 275.63,264.16" class="mf-surface-face" fill-opacity="0.070"/><polygon points="380.87,348.92 389.46,352.18 385.89,344.46 377.29,341.19" class="mf-surface-face" fill-opacity="0.070"/><polygon points="466.05,336.21 474.65,318.83 471.07,321.51 462.48,338.89" class="mf-surface-face" fill-opacity="0.070"/><polygon points="334.34,313.40 342.93,319.54 339.35,310.32 330.76,304.18" class="mf-surface-face" fill-opacity="0.070"/><polygon points="422.39,362.02 430.98,356.50 427.41,351.75 418.81,357.26" class="mf-surface-face" fill-opacity="0.070"/><polygon points="508.98,188.05 517.58,170.67 514.00,191.20 505.41,208.57" class="mf-surface-face" fill-opacity="0.104"/><polygon points="434.56,359.77 443.15,350.86 439.57,347.59 430.98,356.50" class="mf-surface-face" fill-opacity="0.070"/><polygon points="249.86,256.72 258.45,258.74 254.87,246.55 246.28,244.53" class="mf-surface-face" fill-opacity="0.070"/><polygon points="342.93,319.54 351.52,325.64 347.94,316.42 339.35,310.32" class="mf-surface-face" fill-opacity="0.070"/><polygon points="287.80,278.41 296.39,282.55 292.82,271.85 284.22,267.70" class="mf-surface-face" fill-opacity="0.070"/><polygon points="220.51,239.69 229.10,241.28 225.52,227.60 216.93,226.01" class="mf-surface-face" fill-opacity="0.070"/><polygon points="389.46,352.18 398.05,353.90 394.48,346.17 385.89,344.46" class="mf-surface-face" fill-opacity="0.070"/><polygon points="410.22,359.90 418.81,357.26 415.24,351.02 406.65,353.66" class="mf-surface-face" fill-opacity="0.070"/><polygon points="126.00,128.08 134.59,153.14 131.02,139.47 122.42,114.40" class="mf-surface-face" fill-opacity="0.070"/><polygon points="351.52,325.64 360.11,331.46 356.53,322.25 347.94,316.42" class="mf-surface-face" fill-opacity="0.070"/><polygon points="446.73,352.64 455.32,339.79 451.74,338.01 443.15,350.86" class="mf-surface-face" fill-opacity="0.070"/><polygon points="296.39,282.55 304.98,287.27 301.41,276.57 292.82,271.85" class="mf-surface-face" fill-opacity="0.070"/><polygon points="462.48,338.89 471.07,321.51 467.49,322.70 458.90,340.08" class="mf-surface-face" fill-opacity="0.070"/><polygon points="258.45,258.74 267.04,261.18 263.46,248.99 254.87,246.55" class="mf-surface-face" fill-opacity="0.070"/><polygon points="360.11,331.46 368.70,336.75 365.12,327.53 356.53,322.25" class="mf-surface-face" fill-opacity="0.070"/><polygon points="304.98,287.27 313.58,292.51 310.00,281.81 301.41,276.57" class="mf-surface-face" fill-opacity="0.070"/><polygon points="229.10,241.28 237.69,242.83 234.11,229.15 225.52,227.60" class="mf-surface-face" fill-opacity="0.070"/><polygon points="398.05,353.90 406.65,353.66 403.07,345.93 394.48,346.17" class="mf-surface-face" fill-opacity="0.070"/><polygon points="368.70,336.75 377.29,341.19 373.72,331.97 365.12,327.53" class="mf-surface-face" fill-opacity="0.070"/><polygon points="267.04,261.18 275.63,264.16 272.06,251.97 263.46,248.99" class="mf-surface-face" fill-opacity="0.070"/><polygon points="313.58,292.51 322.17,298.19 318.59,287.49 310.00,281.81" class="mf-surface-face" fill-opacity="0.070"/><polygon points="430.98,356.50 439.57,347.59 436.00,342.84 427.41,351.75" class="mf-surface-face" fill-opacity="0.070"/><polygon points="418.81,357.26 427.41,351.75 423.83,345.50 415.24,351.02" class="mf-surface-face" fill-opacity="0.070"/><polygon points="377.29,341.19 385.89,344.46 382.31,335.24 373.72,331.97" class="mf-surface-face" fill-opacity="0.070"/><polygon points="322.17,298.19 330.76,304.18 327.18,293.48 318.59,287.49" class="mf-surface-face" fill-opacity="0.070"/><polygon points="458.90,340.08 467.49,322.70 463.91,322.41 455.32,339.79" class="mf-surface-face" fill-opacity="0.070"/><polygon points="237.69,242.83 246.28,244.53 242.70,230.86 234.11,229.15" class="mf-surface-face" fill-opacity="0.070"/><polygon points="275.63,264.16 284.22,267.70 280.65,255.52 272.06,251.97" class="mf-surface-face" fill-opacity="0.070"/><polygon points="330.76,304.18 339.35,310.32 335.77,299.62 327.18,293.48" class="mf-surface-face" fill-opacity="0.070"/><polygon points="443.15,350.86 451.74,338.01 448.17,334.74 439.57,347.59" class="mf-surface-face" fill-opacity="0.070"/><polygon points="406.65,353.66 415.24,351.02 411.66,343.29 403.07,345.93" class="mf-surface-face" fill-opacity="0.070"/><polygon points="339.35,310.32 347.94,316.42 344.36,305.72 335.77,299.62" class="mf-surface-face" fill-opacity="0.070"/><polygon points="385.89,344.46 394.48,346.17 390.90,336.96 382.31,335.24" class="mf-surface-face" fill-opacity="0.070"/><polygon points="284.22,267.70 292.82,271.85 289.24,259.66 280.65,255.52" class="mf-surface-face" fill-opacity="0.070"/><polygon points="246.28,244.53 254.87,246.55 251.30,232.87 242.70,230.86" class="mf-surface-face" fill-opacity="0.070"/><polygon points="347.94,316.42 356.53,322.25 352.96,311.54 344.36,305.72" class="mf-surface-face" fill-opacity="0.070"/><polygon points="356.53,322.25 365.12,327.53 361.55,316.83 352.96,311.54" class="mf-surface-face" fill-opacity="0.070"/><polygon points="292.82,271.85 301.41,276.57 297.83,264.38 289.24,259.66" class="mf-surface-face" fill-opacity="0.070"/><polygon points="455.32,339.79 463.91,322.41 460.34,320.63 451.74,338.01" class="mf-surface-face" fill-opacity="0.070"/><polygon points="394.48,346.17 403.07,345.93 399.49,336.72 390.90,336.96" class="mf-surface-face" fill-opacity="0.070"/><polygon points="254.87,246.55 263.46,248.99 259.89,235.32 251.30,232.87" class="mf-surface-face" fill-opacity="0.070"/><polygon points="427.41,351.75 436.00,342.84 432.42,336.59 423.83,345.50" class="mf-surface-face" fill-opacity="0.070"/><polygon points="365.12,327.53 373.72,331.97 370.14,321.27 361.55,316.83" class="mf-surface-face" fill-opacity="0.070"/><polygon points="301.41,276.57 310.00,281.81 306.42,269.62 297.83,264.38" class="mf-surface-face" fill-opacity="0.070"/><polygon points="415.24,351.02 423.83,345.50 420.25,337.78 411.66,343.29" class="mf-surface-face" fill-opacity="0.070"/><polygon points="439.57,347.59 448.17,334.74 444.59,329.98 436.00,342.84" class="mf-surface-face" fill-opacity="0.070"/><polygon points="310.00,281.81 318.59,287.49 315.01,275.30 306.42,269.62" class="mf-surface-face" fill-opacity="0.070"/><polygon points="263.46,248.99 272.06,251.97 268.48,238.29 259.89,235.32" class="mf-surface-face" fill-opacity="0.070"/><polygon points="373.72,331.97 382.31,335.24 378.73,324.54 370.14,321.27" class="mf-surface-face" fill-opacity="0.070"/><polygon points="318.59,287.49 327.18,293.48 323.60,281.29 315.01,275.30" class="mf-surface-face" fill-opacity="0.070"/><polygon points="403.07,345.93 411.66,343.29 408.08,334.08 399.49,336.72" class="mf-surface-face" fill-opacity="0.070"/><polygon points="327.18,293.48 335.77,299.62 332.20,287.43 323.60,281.29" class="mf-surface-face" fill-opacity="0.070"/><polygon points="272.06,251.97 280.65,255.52 277.07,241.84 268.48,238.29" class="mf-surface-face" fill-opacity="0.070"/><polygon points="451.74,338.01 460.34,320.63 456.76,317.36 448.17,334.74" class="mf-surface-face" fill-opacity="0.070"/><polygon points="382.31,335.24 390.90,336.96 387.32,326.25 378.73,324.54" class="mf-surface-face" fill-opacity="0.070"/><polygon points="335.77,299.62 344.36,305.72 340.79,293.53 332.20,287.43" class="mf-surface-face" fill-opacity="0.070"/><polygon points="344.36,305.72 352.96,311.54 349.38,299.35 340.79,293.53" class="mf-surface-face" fill-opacity="0.070"/><polygon points="280.65,255.52 289.24,259.66 285.66,245.98 277.07,241.84" class="mf-surface-face" fill-opacity="0.070"/><polygon points="423.83,345.50 432.42,336.59 428.84,328.87 420.25,337.78" class="mf-surface-face" fill-opacity="0.070"/><polygon points="352.96,311.54 361.55,316.83 357.97,304.64 349.38,299.35" class="mf-surface-face" fill-opacity="0.070"/><polygon points="436.00,342.84 444.59,329.98 441.01,323.74 432.42,336.59" class="mf-surface-face" fill-opacity="0.070"/><polygon points="390.90,336.96 399.49,336.72 395.91,326.01 387.32,326.25" class="mf-surface-face" fill-opacity="0.070"/><polygon points="289.24,259.66 297.83,264.38 294.25,250.70 285.66,245.98" class="mf-surface-face" fill-opacity="0.070"/><polygon points="411.66,343.29 420.25,337.78 416.67,328.56 408.08,334.08" class="mf-surface-face" fill-opacity="0.070"/><polygon points="361.55,316.83 370.14,321.27 366.56,309.08 357.97,304.64" class="mf-surface-face" fill-opacity="0.070"/><polygon points="297.83,264.38 306.42,269.62 302.84,255.94 294.25,250.70" class="mf-surface-face" fill-opacity="0.070"/><polygon points="448.17,334.74 456.76,317.36 453.18,312.61 444.59,329.98" class="mf-surface-face" fill-opacity="0.070"/><polygon points="306.42,269.62 315.01,275.30 311.44,261.62 302.84,255.94" class="mf-surface-face" fill-opacity="0.070"/><polygon points="370.14,321.27 378.73,324.54 375.15,312.35 366.56,309.08" class="mf-surface-face" fill-opacity="0.070"/><polygon points="399.49,336.72 408.08,334.08 404.50,323.38 395.91,326.01" class="mf-surface-face" fill-opacity="0.070"/><polygon points="315.01,275.30 323.60,281.29 320.03,267.61 311.44,261.62" class="mf-surface-face" fill-opacity="0.070"/><polygon points="323.60,281.29 332.20,287.43 328.62,273.75 320.03,267.61" class="mf-surface-face" fill-opacity="0.070"/><polygon points="378.73,324.54 387.32,326.25 383.74,314.06 375.15,312.35" class="mf-surface-face" fill-opacity="0.070"/><polygon points="332.20,287.43 340.79,293.53 337.21,279.85 328.62,273.75" class="mf-surface-face" fill-opacity="0.070"/><polygon points="432.42,336.59 441.01,323.74 437.43,316.01 428.84,328.87" class="mf-surface-face" fill-opacity="0.070"/><polygon points="420.25,337.78 428.84,328.87 425.26,319.65 416.67,328.56" class="mf-surface-face" fill-opacity="0.070"/><polygon points="340.79,293.53 349.38,299.35 345.80,285.68 337.21,279.85" class="mf-surface-face" fill-opacity="0.070"/><polygon points="387.32,326.25 395.91,326.01 392.34,313.82 383.74,314.06" class="mf-surface-face" fill-opacity="0.070"/><polygon points="408.08,334.08 416.67,328.56 413.10,317.86 404.50,323.38" class="mf-surface-face" fill-opacity="0.070"/><polygon points="349.38,299.35 357.97,304.64 354.39,290.96 345.80,285.68" class="mf-surface-face" fill-opacity="0.070"/><polygon points="444.59,329.98 453.18,312.61 449.60,306.37 441.01,323.74" class="mf-surface-face" fill-opacity="0.070"/><polygon points="357.97,304.64 366.56,309.08 362.98,295.40 354.39,290.96" class="mf-surface-face" fill-opacity="0.070"/><polygon points="366.56,309.08 375.15,312.35 371.58,298.67 362.98,295.40" class="mf-surface-face" fill-opacity="0.070"/><polygon points="395.91,326.01 404.50,323.38 400.93,311.19 392.34,313.82" class="mf-surface-face" fill-opacity="0.070"/><polygon points="428.84,328.87 437.43,316.01 433.86,306.80 425.26,319.65" class="mf-surface-face" fill-opacity="0.070"/><polygon points="375.15,312.35 383.74,314.06 380.17,300.39 371.58,298.67" class="mf-surface-face" fill-opacity="0.070"/><polygon points="416.67,328.56 425.26,319.65 421.69,308.95 413.10,317.86" class="mf-surface-face" fill-opacity="0.070"/><polygon points="441.01,323.74 449.60,306.37 446.03,298.64 437.43,316.01" class="mf-surface-face" fill-opacity="0.070"/><polygon points="404.50,323.38 413.10,317.86 409.52,305.67 400.93,311.19" class="mf-surface-face" fill-opacity="0.070"/><polygon points="383.74,314.06 392.34,313.82 388.76,300.15 380.17,300.39" class="mf-surface-face" fill-opacity="0.070"/><polygon points="392.34,313.82 400.93,311.19 397.35,297.51 388.76,300.15" class="mf-surface-face" fill-opacity="0.070"/><polygon points="425.26,319.65 433.86,306.80 430.28,296.10 421.69,308.95" class="mf-surface-face" fill-opacity="0.070"/><polygon points="437.43,316.01 446.03,298.64 442.45,289.42 433.86,306.80" class="mf-surface-face" fill-opacity="0.070"/><polygon points="413.10,317.86 421.69,308.95 418.11,296.76 409.52,305.67" class="mf-surface-face" fill-opacity="0.070"/><polygon points="400.93,311.19 409.52,305.67 405.94,291.99 397.35,297.51" class="mf-surface-face" fill-opacity="0.070"/><polygon points="421.69,308.95 430.28,296.10 426.70,283.91 418.11,296.76" class="mf-surface-face" fill-opacity="0.070"/><polygon points="433.86,306.80 442.45,289.42 438.87,278.72 430.28,296.10" class="mf-surface-face" fill-opacity="0.070"/><polygon points="409.52,305.67 418.11,296.76 414.53,283.08 405.94,291.99" class="mf-surface-face" fill-opacity="0.070"/><polygon points="430.28,296.10 438.87,278.72 435.29,266.53 426.70,283.91" class="mf-surface-face" fill-opacity="0.070"/><polygon points="418.11,296.76 426.70,283.91 423.12,270.23 414.53,283.08" class="mf-surface-face" fill-opacity="0.070"/><polygon points="426.70,283.91 435.29,266.53 431.71,252.85 423.12,270.23" class="mf-surface-face" fill-opacity="0.070"/><line x1="320" y1="335" x2="488.7040485293351" y2="387.9355494791357" class="mf-ink" /><path d="M479.87,389.36 L488.70,387.94 L482.27,381.72" class="mf-ink"/><line x1="320" y1="335" x2="266.33694511287644" y2="386.3632537932075" class="mf-ink" /><path d="M269.35,377.94 L266.34,386.36 L274.88,383.72" class="mf-ink"/><text x="500.7040485293351" y="395.9355494791357" class="mf-small" text-anchor="start">w₁</text><text x="254.33694511287644" y="404.3632537932075" class="mf-small" text-anchor="start">w₂</text><circle cx="243.49948408383585" cy="287.9720321964371" r="5" class="mf-open"/><text x="243.49948408383585" y="312.9720321964371" class="mf-small" text-anchor="middle">local</text><circle cx="413.7244714051862" cy="364.40863859951986" r="5" class="mf-open"/><text x="413.7244714051862" y="389.40863859951986" class="mf-small" text-anchor="middle">global</text><defs><radialGradient id="muon-gd-sphere" cx="30%" cy="25%" r="75%"><stop offset="0" stop-color="var(--paper-lift)"/><stop offset=".4" stop-color="var(--accent)"/><stop offset="1" stop-color="var(--ink)"/></radialGradient><clipPath id="muon-surface-clip"><rect x="8" y="65" width="624" height="365"/></clipPath></defs></g><g data-muon-moving><g clip-path="url(#muon-surface-clip)"><polyline fill="none" points="153.90,327.21 167.37,323.46 180.84,319.71 194.30,315.95 207.77,312.20 221.23,308.44 234.70,304.69 248.16,300.93 261.63,297.18 261.63,297.18 258.73,299.78 255.83,302.38 252.94,304.98 250.04,307.59 247.14,310.19 244.24,312.79 241.35,315.39 238.45,317.99 238.45,317.99 239.58,316.80 240.71,315.61 241.84,314.42 242.97,313.23 244.10,312.04 245.23,310.85 246.37,309.66 247.50,308.47 247.50,308.47 246.91,308.97 246.32,309.47 245.74,309.96 245.15,310.46 244.56,310.95 243.98,311.45 243.39,311.94 242.80,312.44 242.80,312.44 243.01,312.20 243.21,311.97 243.42,311.73 243.62,311.50 243.82,311.26 244.03,311.03 244.23,310.79 244.44,310.56 244.44,310.56 244.31,310.65 244.19,310.75 244.07,310.84 243.95,310.93 243.83,311.03 243.70,311.12 243.58,311.21 243.46,311.31 243.46,311.31 243.49,311.26 243.53,311.21 243.56,311.16 243.60,311.12 243.63,311.07 243.67,311.02 243.70,310.98 243.74,310.93 243.74,310.93 243.71,310.95 243.68,310.96 243.66,310.98 243.63,311.00 243.60,311.01 243.58,311.03 243.55,311.05 243.52,311.07 243.52,311.07 243.53,311.06 243.53,311.05 243.54,311.04 243.54,311.03 243.55,311.02 243.55,311.01 243.56,311.00 243.56,310.99 243.56,310.99 243.56,310.99 243.55,310.99 243.55,311.00 243.54,311.00 243.53,311.00 243.53,311.01 243.52,311.01 243.52,311.01 243.52,311.01 243.52,311.01 243.52,311.01 243.52,311.01 243.52,311.00 243.52,311.00 243.52,311.00 243.52,311.00 243.52,311.00 243.52,311.00 243.52,311.00 243.52,311.00 243.51,311.00 243.51,311.00 243.51,311.00 243.51,311.00 243.51,311.00 243.51,311.00 243.51,311.00 243.51,311.00 243.51,311.00 243.51,311.00 243.51,311.00 243.51,311.00 243.51,311.00 243.51,311.00 243.51,311.00 243.51,311.00 243.51,311.00 243.50,311.00 243.50,311.00 243.50,311.00 243.50,311.00 243.50,311.00 243.50,311.00 243.50,311.00 243.50,311.00 243.50,311.00 243.50,311.00 243.50,311.00 243.50,311.00 243.50,311.00 243.50,311.00 243.50,311.00 243.50,311.00" class="mf-floor-trail"/><line x1="243.50140787054312" y1="310.9962574183144" x2="243.50140787054312" y2="287.9724369819303" class="mf-objective" opacity=".4"/><ellipse cx="243.50140787054312" cy="310.9962574183144" rx="8" ry="3" class="mf-shadow"/><polyline fill="none" points="153.90,201.13 167.37,230.27 180.84,252.67 194.30,268.61 207.77,278.37 221.23,282.20 234.70,280.34 248.16,273.02 261.63,260.43 261.63,260.43 258.73,267.52 255.83,273.72 252.94,279.04 250.04,283.46 247.14,287.00 244.24,289.66 241.35,291.42 238.45,292.31 238.45,292.31 239.58,291.98 240.71,291.49 241.84,290.83 242.97,289.99 244.10,288.98 245.23,287.81 246.37,286.45 247.50,284.93 247.50,284.93 246.91,285.60 246.32,286.23 245.74,286.82 245.15,287.39 244.56,287.92 243.98,288.42 243.39,288.88 242.80,289.31 242.80,289.31 243.01,289.11 243.21,288.90 243.42,288.69 243.62,288.47 243.82,288.24 244.03,288.00 244.23,287.76 244.44,287.52 244.44,287.52 244.31,287.61 244.19,287.71 244.07,287.81 243.95,287.91 243.83,288.00 243.70,288.09 243.58,288.19 243.46,288.28 243.46,288.28 243.49,288.23 243.53,288.19 243.56,288.14 243.60,288.09 243.63,288.05 243.67,288.00 243.70,287.95 243.74,287.90 243.74,287.90 243.71,287.92 243.68,287.94 243.66,287.96 243.63,287.97 243.60,287.99 243.58,288.01 243.55,288.02 243.52,288.04 243.52,288.04 243.53,288.03 243.53,288.02 243.54,288.01 243.54,288.00 243.55,287.99 243.55,287.98 243.56,287.97 243.56,287.96 243.56,287.96 243.56,287.97 243.55,287.97 243.55,287.97 243.54,287.98 243.53,287.98 243.53,287.98 243.52,287.99 243.52,287.99 243.52,287.99 243.52,287.99 243.52,287.98 243.52,287.98 243.52,287.98 243.52,287.98 243.52,287.98 243.52,287.97 243.52,287.97 243.52,287.97 243.52,287.97 243.52,287.97 243.51,287.97 243.51,287.97 243.51,287.98 243.51,287.98 243.51,287.98 243.51,287.98 243.51,287.98 243.51,287.98 243.51,287.98 243.51,287.98 243.51,287.97 243.51,287.97 243.51,287.97 243.51,287.97 243.51,287.97 243.51,287.97 243.51,287.97 243.50,287.97 243.50,287.97 243.50,287.97 243.50,287.97 243.50,287.97 243.50,287.97 243.50,287.97 243.50,287.97 243.50,287.97 243.50,287.97 243.50,287.97 243.50,287.97 243.50,287.97 243.50,287.97 243.50,287.97 243.50,287.97" class="mf-trail-halo"/><polyline fill="none" points="153.90,201.13 167.37,230.27 180.84,252.67 194.30,268.61 207.77,278.37 221.23,282.20 234.70,280.34 248.16,273.02 261.63,260.43 261.63,260.43 258.73,267.52 255.83,273.72 252.94,279.04 250.04,283.46 247.14,287.00 244.24,289.66 241.35,291.42 238.45,292.31 238.45,292.31 239.58,291.98 240.71,291.49 241.84,290.83 242.97,289.99 244.10,288.98 245.23,287.81 246.37,286.45 247.50,284.93 247.50,284.93 246.91,285.60 246.32,286.23 245.74,286.82 245.15,287.39 244.56,287.92 243.98,288.42 243.39,288.88 242.80,289.31 242.80,289.31 243.01,289.11 243.21,288.90 243.42,288.69 243.62,288.47 243.82,288.24 244.03,288.00 244.23,287.76 244.44,287.52 244.44,287.52 244.31,287.61 244.19,287.71 244.07,287.81 243.95,287.91 243.83,288.00 243.70,288.09 243.58,288.19 243.46,288.28 243.46,288.28 243.49,288.23 243.53,288.19 243.56,288.14 243.60,288.09 243.63,288.05 243.67,288.00 243.70,287.95 243.74,287.90 243.74,287.90 243.71,287.92 243.68,287.94 243.66,287.96 243.63,287.97 243.60,287.99 243.58,288.01 243.55,288.02 243.52,288.04 243.52,288.04 243.53,288.03 243.53,288.02 243.54,288.01 243.54,288.00 243.55,287.99 243.55,287.98 243.56,287.97 243.56,287.96 243.56,287.96 243.56,287.97 243.55,287.97 243.55,287.97 243.54,287.98 243.53,287.98 243.53,287.98 243.52,287.99 243.52,287.99 243.52,287.99 243.52,287.99 243.52,287.98 243.52,287.98 243.52,287.98 243.52,287.98 243.52,287.98 243.52,287.97 243.52,287.97 243.52,287.97 243.52,287.97 243.52,287.97 243.51,287.97 243.51,287.97 243.51,287.98 243.51,287.98 243.51,287.98 243.51,287.98 243.51,287.98 243.51,287.98 243.51,287.98 243.51,287.98 243.51,287.97 243.51,287.97 243.51,287.97 243.51,287.97 243.51,287.97 243.51,287.97 243.51,287.97 243.50,287.97 243.50,287.97 243.50,287.97 243.50,287.97 243.50,287.97 243.50,287.97 243.50,287.97 243.50,287.97 243.50,287.97 243.50,287.97 243.50,287.97 243.50,287.97 243.50,287.97 243.50,287.97 243.50,287.97 243.50,287.97" class="mf-trail"/><circle cx="243.50140787054312" cy="287.9724369819303" r="7" fill="url(#muon-gd-sphere)" stroke="var(--paper)" stroke-width="1.3"/></g><text x="24" y="28" class="mf-strong" text-anchor="start">Step 15 / 15   ·   loss 1.1010</text><text x="24" y="466" class="" text-anchor="start">w = (−0.816, 0.000)</text><text x="616" y="466" class="mf-small" text-anchor="end">D = −0.09 G</text></g></svg>
<figcaption>Height is loss; the floor axes are two weights. Orange follows computed gradient steps. The left basin contains a local minimum with positive loss; the right basin reaches the global minimum, zero. This small example shows why local slope information cannot promise the best solution.</figcaption></figure>
<div class="muon-controls" data-animation="gd"><button data-action="play" disabled>Play animation</button><button data-action="restart" disabled>Restart</button><button data-action="previous-step" disabled>← Back</button><button data-action="next-step" disabled>Next →</button><button data-action="new-start" disabled>Try the other basin</button><button data-action="zoom-in" aria-label="Zoom in on the loss surface" disabled>Zoom +</button><button data-action="zoom-out" aria-label="Zoom out of the loss surface" disabled>Zoom −</button><button data-action="reset-view" disabled>Reset view</button><span data-status>Drag to rotate. Arrow keys also rotate; + and − zoom.</span></div>

<details class="muon-aside" id="surface-formula">
<summary>The exact loss behind the picture</summary>

<p>The surface uses</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><msub><mi>L</mi><mrow><mi mathvariant="normal">d</mi><mi mathvariant="normal">r</mi><mi mathvariant="normal">a</mi><mi mathvariant="normal">w</mi></mrow></msub><mo stretchy="false">(</mo><mi>x</mi><mo separator="true">,</mo><mi>y</mi><mo stretchy="false">)</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mo stretchy="false">(</mo><msup><mi>x</mi><mn>2</mn></msup><mo>−</mo><mn>1</mn><msup><mo stretchy="false">)</mo><mn>2</mn></msup></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mspace width="1em"/><mo>+</mo><mn>0.3</mn><mo stretchy="false">(</mo><mi>x</mi><mo>−</mo><mn>1</mn><msup><mo stretchy="false">)</mo><mn>2</mn></msup><mo>+</mo><mn>8</mn><msup><mi>y</mi><mn>2</mn></msup><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
L_{\mathrm{draw}}(x,y)&amp;=(x^2-1)^2\\[6pt]
&amp;\quad+0.3(x-1)^2+8y^2.
\end{aligned}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:3.3482em;vertical-align:-1.4241em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.9241em;"><span style="top:-4.06em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal">L</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathrm mtight" style="margin-right:0.0139em;">draw</span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">y</span><span class="mclose">)</span></span></span><span style="top:-1.9359em;"><span class="pstrut" style="height:3em;"></span><span class="mord"></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.4241em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.9241em;"><span style="top:-4.06em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord">1</span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span></span><span style="top:-1.9359em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:1em;"></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord">0.3</span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord">1</span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord">8</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">y</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mord">.</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.4241em;"><span></span></span></span></span></span></span></span></span></span></span></span></div>
<p>Its gradient is <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mn>4</mn><mi>x</mi><mo stretchy="false">(</mo><msup><mi>x</mi><mn>2</mn></msup><mo>−</mo><mn>1</mn><mo stretchy="false">)</mo><mo>+</mo><mn>0.6</mn><mo stretchy="false">(</mo><mi>x</mi><mo>−</mo><mn>1</mn><mo stretchy="false">)</mo><mo separator="true">,</mo><mtext> </mtext><mn>16</mn><mi>y</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(4x(x^2-1)+0.6(x-1),\,16y)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0641em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord">4</span><span class="mord mathnormal">x</span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">1</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">0.6</span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">1</span><span class="mclose">)</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">16</span><span class="mord mathnormal" style="margin-right:0.0359em;">y</span><span class="mclose">)</span></span></span></span>.</span> The global minimum is <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mn>1</mn><mo separator="true">,</mo><mn>0</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(1,0)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord">1</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">0</span><span class="mclose">)</span></span></span></span>:</span> all three nonnegative terms vanish there. There is also a strict local minimum at <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi><mo>=</mo><mo stretchy="false">(</mo><mo>−</mo><mn>1</mn><mo>−</mo><msqrt><mn>0.4</mn></msqrt><mo stretchy="false">)</mo><mi mathvariant="normal">/</mi><mn>2</mn><mo>≈</mo><mo>−</mo><mn>0.816</mn></mrow><annotation encoding="application/x-tex">x=(-1-\sqrt{0.4})/2\approx-0.816</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">x</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord">−</span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.1572em;vertical-align:-0.25em;"></span><span class="mord sqrt"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.9072em;"><span class="svg-align" style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord" style="padding-left:0.833em;"><span class="mord">0.4</span></span></span><span style="top:-2.8672em;"><span class="pstrut" style="height:3em;"></span><span class="hide-tail" style="min-width:0.853em;height:1.08em;"><svg xmlns="http://www.w3.org/2000/svg" width="400em" height="1.08em" viewBox="0 0 400000 1080" preserveAspectRatio="xMinYMin slice"><path d="M95,702
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l0 -0
c5.3,-9.3,12,-14,20,-14
H400000v40H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M834 80h400000v40h-400000z"/></svg></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.1328em;"><span></span></span></span></span></span><span class="mclose">)</span><span class="mord">/2</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">≈</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">−</span><span class="mord">0.816</span></span></span></span>,</span> <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">y=0</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">y</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0</span></span></span></span>,</span> separated from the deeper basin by a saddle.</p>
<p>The animation recomputes the gradient at each step, using <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mo>=</mo><mn>0.09</mn></mrow><annotation encoding="application/x-tex">\alpha=0.09</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal" style="margin-right:0.0037em;">α</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.09</span></span></span></span>.</span> The same function drives the surface and the path. Moving between iterates is only a visual aid; the optimization steps are discrete. This is a two-weight illustration, not a claim that shallow local minima are the main difficulty in every large network.</p>
</details>

<div id="frobenius-is-the-dot-product-of-the-entries" class="section-alias" aria-hidden="true"></div>

<h2 id="turn-many-slopes-into-one-score"><a class="anchor" href="#turn-many-slopes-into-one-score" aria-label="Permalink">§</a>Turn many slopes into one score</h2>
<p>We have a candidate step <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span></span></span></span>,</span> but its entries only tell us how much to change the weights. They do not tell us whether those changes help. For that, we need to know how the loss responds. That is the information in <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi></mrow><annotation encoding="application/x-tex">G</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal">G</span></span></span></span>.</span></p>
<p>Hold every weight except <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>W</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub></mrow><annotation encoding="application/x-tex">W_{ij}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.9694em;vertical-align:-0.2861em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span></span></span></span></span> fixed. Recall that <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>G</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub><mo>=</mo><mi mathvariant="normal">∂</mi><mi>L</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">∂</mi><msub><mi>W</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub></mrow><annotation encoding="application/x-tex">G_{ij}=\partial L/\partial W_{ij}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.9694em;vertical-align:-0.2861em;"></span><span class="mord"><span class="mord mathnormal">G</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.0361em;vertical-align:-0.2861em;"></span><span class="mord" style="margin-right:0.0556em;">∂</span><span class="mord mathnormal">L</span><span class="mord">/</span><span class="mord" style="margin-right:0.0556em;">∂</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span></span></span></span></span> is the local slope: loss change per unit change in this weight, in the limit of a tiny move. Near our current weights, we approximate the curve by a straight line. On a straight line, change in height is slope times horizontal movement. Here that becomes</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mtext>predicted loss change</mtext><mo>≈</mo><msub><mi>G</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub><msub><mi>D</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\text{predicted loss change}\approx G_{ij}D_{ij}.</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord text"><span class="mord">predicted loss change</span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">≈</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.9694em;vertical-align:-0.2861em;"></span><span class="mord"><span class="mord mathnormal">G</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0278em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span></span></div>
<p>For example, if <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>G</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub><mo>=</mo><mn>3</mn></mrow><annotation encoding="application/x-tex">G_{ij}=3</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.9694em;vertical-align:-0.2861em;"></span><span class="mord"><span class="mord mathnormal">G</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">3</span></span></span></span></span> and we increase that weight by <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>D</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub><mo>=</mo><mn>0.01</mn></mrow><annotation encoding="application/x-tex">D_{ij}=0.01</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.9694em;vertical-align:-0.2861em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0278em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.01</span></span></span></span>,</span> the predicted loss change is <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>3</mn><mo>×</mo><mn>0.01</mn><mo>=</mo><mn>0.03</mn></mrow><annotation encoding="application/x-tex">3\times0.01=0.03</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">3</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">×</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.01</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.03</span></span></span></span>.</span> Moving it by <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><mn>0.01</mn></mrow><annotation encoding="application/x-tex">-0.01</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">−</span><span class="mord">0.01</span></span></span></span></span> instead predicts <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><mn>0.03</mn></mrow><annotation encoding="application/x-tex">-0.03</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">−</span><span class="mord">0.03</span></span></span></span>,</span> a decrease. A negative gradient entry reverses which direction helps. The same weight change can help or hurt depending on its slope.</p>
<p>When several weights change together, differentiability tells us that their first-order effects add. This does not assume the weights act independently: the slopes depend on the whole current matrix, and the linear approximation leaves a remainder. We will make that approximation explicit in the next section. For now, our combined score is</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><munder><mo>∑</mo><mrow><mi>i</mi><mo separator="true">,</mo><mi>j</mi></mrow></munder><msub><mi>G</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub><msub><mi>D</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub><mo>=</mo><mo stretchy="false">⟨</mo><mi>G</mi><mo separator="true">,</mo><mi>D</mi><msub><mo stretchy="false">⟩</mo><mi>F</mi></msub><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\sum_{i,j}G_{ij}D_{ij}=\langle G,D\rangle_F.</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:2.4638em;vertical-align:-1.4138em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.05em;"><span style="top:-1.8723em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">i</span><span class="mpunct mtight">,</span><span class="mord mathnormal mtight" style="margin-right:0.0572em;">j</span></span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.4138em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">G</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0278em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">⟨</span><span class="mord mathnormal">G</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mclose"><span class="mclose">⟩</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span></span></div>
<p>This is the ordinary dot product of the entries, keeping them arranged as matrices. Its name is the <strong>Frobenius inner product</strong>. For any two matrices <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi></mrow><annotation encoding="application/x-tex">A</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal">A</span></span></span></span></span> and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi></mrow><annotation encoding="application/x-tex">B</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span></span></span></span></span> of the same shape, we write</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">⟨</mo><mi>A</mi><mo separator="true">,</mo><mi>B</mi><msub><mo stretchy="false">⟩</mo><mi>F</mi></msub><mo>=</mo><munder><mo>∑</mo><mrow><mi>i</mi><mo separator="true">,</mo><mi>j</mi></mrow></munder><msub><mi>A</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub><msub><mi>B</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub><mo>=</mo><mi mathvariant="normal">tr</mi><mo>⁡</mo><mo stretchy="false">(</mo><msup><mi>A</mi><mi mathvariant="normal">⊤</mi></msup><mi>B</mi><mo stretchy="false">)</mo><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\langle A,B\rangle_F=\sum_{i,j}A_{ij}B_{ij}
=\operatorname{tr}(A^\top B).</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">⟨</span><span class="mord mathnormal">A</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="mclose"><span class="mclose">⟩</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:2.4638em;vertical-align:-1.4138em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.05em;"><span style="top:-1.8723em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">i</span><span class="mpunct mtight">,</span><span class="mord mathnormal mtight" style="margin-right:0.0572em;">j</span></span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.4138em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">A</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0502em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.1491em;vertical-align:-0.25em;"></span><span class="mop"><span class="mord mathrm">tr</span></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">A</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="mclose">)</span><span class="mord">.</span></span></span></span></span></div>
<p>Here <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>A</mi><mi mathvariant="normal">⊤</mi></msup></mrow><annotation encoding="application/x-tex">A^\top</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8491em;"></span><span class="mord"><span class="mord mathnormal">A</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span></span></span></span></span></span></span></span></span> is the transpose, which swaps rows and columns. <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">tr</mi><mo>⁡</mo></mrow><annotation encoding="application/x-tex">\operatorname{tr}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6151em;"></span><span class="mop"><span class="mord mathrm">tr</span></span></span></span></span></span> denotes the <strong>trace</strong>, the sum of a square matrix&#39;s diagonal entries. The whole expression returns one number.</p>
<details class="muon-aside" id="trace-refresher">
<summary>What does the trace notation mean?</summary>

<p>For a square matrix <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>C</mi></mrow><annotation encoding="application/x-tex">C</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0715em;">C</span></span></span></span>,</span> the trace is the sum of its diagonal entries:</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="normal">tr</mi><mo>⁡</mo><mo stretchy="false">(</mo><mi>C</mi><mo stretchy="false">)</mo><mo>=</mo><munder><mo>∑</mo><mi>j</mi></munder><msub><mi>C</mi><mrow><mi>j</mi><mi>j</mi></mrow></msub><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\operatorname{tr}(C)=\sum_j C_{jj}.</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mop"><span class="mord mathrm">tr</span></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.0715em;">C</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:2.4638em;vertical-align:-1.4138em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.05em;"><span style="top:-1.8723em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">j</span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.4138em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0715em;">C</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0715em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">j</span><span class="mord mathnormal mtight" style="margin-right:0.0572em;">j</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span></span></div>
<p>For example,</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mi>C</mi></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mrow><mo fence="true">[</mo><mtable rowspacing="0.16em" columnalign="center center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>3</mn></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0</mn></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>2</mn></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mo>−</mo><mn>2</mn></mrow></mstyle></mtd></mtr></mtable><mo fence="true">]</mo></mrow><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi mathvariant="normal">tr</mi><mo>⁡</mo><mo stretchy="false">(</mo><mi>C</mi><mo stretchy="false">)</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mn>3</mn><mo>+</mo><mo stretchy="false">(</mo><mo>−</mo><mn>2</mn><mo stretchy="false">)</mo><mo>=</mo><mn>1.</mn></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
C&amp;=\begin{bmatrix}3&amp;0\\2&amp;-2\end{bmatrix},\\[10pt]
\operatorname{tr}(C)&amp;=3+(-2)=1.
\end{aligned}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:4.31em;vertical-align:-1.905em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:2.405em;"><span style="top:-4.405em;"><span class="pstrut" style="height:3.45em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0715em;">C</span></span></span><span style="top:-1.905em;"><span class="pstrut" style="height:3.45em;"></span><span class="mord"><span class="mop"><span class="mord mathrm">tr</span></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.0715em;">C</span><span class="mclose">)</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.905em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:2.405em;"><span style="top:-4.405em;"><span class="pstrut" style="height:3.45em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">[</span></span><span class="mord"><span class="mtable"><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">3</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span><span class="arraycolsep" style="width:0.5em;"></span><span class="arraycolsep" style="width:0.5em;"></span><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">−</span><span class="mord">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">]</span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mpunct">,</span></span></span><span style="top:-1.905em;"><span class="pstrut" style="height:3.45em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord">3</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mopen">(</span><span class="mord">−</span><span class="mord">2</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord">1.</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.905em;"><span></span></span></span></span></span></span></span></span></span></span></span></div>
<p>The entry <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>2</mn></mrow><annotation encoding="application/x-tex">2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">2</span></span></span></span></span> below the diagonal contributes nothing. Trace takes a square matrix and returns one scalar.</p>
<p>Why does it appear in our score? The <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>j</mi></mrow><annotation encoding="application/x-tex">j</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.854em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.0572em;">j</span></span></span></span></span>th diagonal entry of <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>A</mi><mi mathvariant="normal">⊤</mi></msup><mi>B</mi></mrow><annotation encoding="application/x-tex">A^\top B</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8491em;"></span><span class="mord"><span class="mord mathnormal">A</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span></span></span></span></span> is the dot product of column <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>j</mi></mrow><annotation encoding="application/x-tex">j</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.854em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.0572em;">j</span></span></span></span></span> of <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi></mrow><annotation encoding="application/x-tex">A</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal">A</span></span></span></span></span> with column <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>j</mi></mrow><annotation encoding="application/x-tex">j</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.854em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.0572em;">j</span></span></span></span></span> of <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi></mrow><annotation encoding="application/x-tex">B</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span></span></span></span>:</span></p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mo stretchy="false">(</mo><msup><mi>A</mi><mi mathvariant="normal">⊤</mi></msup><mi>B</mi><msub><mo stretchy="false">)</mo><mrow><mi>j</mi><mi>j</mi></mrow></msub></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><munder><mo>∑</mo><mi>i</mi></munder><msub><mi>A</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub><msub><mi>B</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi mathvariant="normal">tr</mi><mo>⁡</mo><mo stretchy="false">(</mo><msup><mi>A</mi><mi mathvariant="normal">⊤</mi></msup><mi>B</mi><mo stretchy="false">)</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><munder><mo>∑</mo><mi>j</mi></munder><munder><mo>∑</mo><mi>i</mi></munder><msub><mi>A</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub><msub><mi>B</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
(A^\top B)_{jj}&amp;=\sum_i A_{ij}B_{ij},\\[10pt]
\operatorname{tr}(A^\top B)&amp;=\sum_j\sum_i A_{ij}B_{ij}.
\end{aligned}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:5.1738em;vertical-align:-2.3369em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:2.8369em;"><span style="top:-4.8369em;"><span class="pstrut" style="height:3.05em;"></span><span class="mord"><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">A</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">j</span><span class="mord mathnormal mtight" style="margin-right:0.0572em;">j</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span></span></span><span style="top:-2.1269em;"><span class="pstrut" style="height:3.05em;"></span><span class="mord"><span class="mop"><span class="mord mathrm">tr</span></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">A</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="mclose">)</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:2.3369em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:2.8369em;"><span style="top:-4.8369em;"><span class="pstrut" style="height:3.05em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.05em;"><span style="top:-1.8723em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.2777em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">A</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0502em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mpunct">,</span></span></span><span style="top:-2.1269em;"><span class="pstrut" style="height:3.05em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.05em;"><span style="top:-1.8723em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">j</span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.4138em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.05em;"><span style="top:-1.8723em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.2777em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">A</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0502em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:2.3369em;"><span></span></span></span></span></span></span></span></span></span></span></span></div>
<p>Adding those diagonal entries counts every matching pair once. That gives the same inner product we started with.</p>
</details>

<p>We will also need a way to measure the size of a step. Using the same entries, define the <strong>Frobenius norm</strong>:</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="normal">∥</mi><mi>A</mi><msub><mi mathvariant="normal">∥</mi><mi>F</mi></msub><mo>=</mo><msqrt><mrow><munder><mo>∑</mo><mrow><mi>i</mi><mo separator="true">,</mo><mi>j</mi></mrow></munder><msubsup><mi>A</mi><mrow><mi>i</mi><mi>j</mi></mrow><mn>2</mn></msubsup></mrow></msqrt><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\|A\|_F=\sqrt{\sum_{i,j}A_{ij}^2}.</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">∥</span><span class="mord mathnormal">A</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:3.04em;vertical-align:-1.588em;"></span><span class="mord sqrt"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.452em;"><span class="svg-align" style="top:-5em;"><span class="pstrut" style="height:5em;"></span><span class="mord" style="padding-left:1em;"><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.05em;"><span style="top:-1.8723em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">i</span><span class="mpunct mtight">,</span><span class="mord mathnormal mtight" style="margin-right:0.0572em;">j</span></span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.4138em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">A</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.7959em;"><span style="top:-2.4231em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span><span style="top:-3.0448em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.413em;"><span></span></span></span></span></span></span></span></span><span style="top:-3.412em;"><span class="pstrut" style="height:5em;"></span><span class="hide-tail" style="min-width:1.02em;height:3.08em;"><svg xmlns="http://www.w3.org/2000/svg" width="400em" height="3.08em" viewBox="0 0 400000 3240" preserveAspectRatio="xMinYMin slice"><path d="M473,2793
c339.3,-1799.3,509.3,-2700,510,-2702 l0 -0
c3.3,-7.3,9.3,-11,18,-11 H400000v40H1017.7
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
606zM1001 80h400000v40H1017.7z"/></svg></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.588em;"><span></span></span></span></span></span><span class="mord">.</span></span></span></span></span></div>
<p>It is the Euclidean length we would get by listing all the entries in a vector. This length and our score are related: the difference between the squared lengths of <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi><mo>+</mo><mi>B</mi></mrow><annotation encoding="application/x-tex">A+B</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7667em;vertical-align:-0.0833em;"></span><span class="mord mathnormal">A</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span></span></span></span></span> and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi><mo>−</mo><mi>B</mi></mrow><annotation encoding="application/x-tex">A-B</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7667em;vertical-align:-0.0833em;"></span><span class="mord mathnormal">A</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span></span></span></span></span> isolates their inner product.</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><menclose notation="box"><mstyle scriptlevel="0" displaystyle="false"><mstyle scriptlevel="0" displaystyle="false"><mstyle scriptlevel="0" displaystyle="true"><mrow><mo stretchy="false">⟨</mo><mi>A</mi><mo separator="true">,</mo><mi>B</mi><msub><mo stretchy="false">⟩</mo><mi>F</mi></msub><mo>=</mo><mfrac><mrow><mi mathvariant="normal">∥</mi><mi>A</mi><mo>+</mo><mi>B</mi><msubsup><mi mathvariant="normal">∥</mi><mi>F</mi><mn>2</mn></msubsup><mo>−</mo><mi mathvariant="normal">∥</mi><mi>A</mi><mo>−</mo><mi>B</mi><msubsup><mi mathvariant="normal">∥</mi><mi>F</mi><mn>2</mn></msubsup></mrow><mn>4</mn></mfrac><mi mathvariant="normal">.</mi></mrow></mstyle></mstyle></mstyle></menclose></mrow><annotation encoding="application/x-tex">\boxed{\langle A,B\rangle_F
=\frac{\|A+B\|_F^2-\|A-B\|_F^2}{4}.}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:2.8571em;vertical-align:-1.026em;"></span><span class="mord"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.8311em;"><span style="top:-4.8571em;"><span class="pstrut" style="height:4.8571em;"></span><span class="boxpad"><span class="mord"><span class="mord"><span class="mopen">⟨</span><span class="mord mathnormal">A</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="mclose"><span class="mclose">⟩</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.4911em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">4</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">∥</span><span class="mord mathnormal">A</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-2.4247em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2753em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord">∥</span><span class="mord mathnormal">A</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-2.4247em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2753em;"><span></span></span></span></span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.686em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mord">.</span></span></span></span></span><span style="top:-3.8311em;"><span class="pstrut" style="height:4.8571em;"></span><span class="stretchy fbox" style="height:2.8571em;border-style:solid;border-width:0.04em;"></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.026em;"><span></span></span></span></span></span></span></span></span></span></div>
<p>This is the real polarization identity.</p>
<details class="muon-aside" id="polarization-proof">
<summary>Where does the polarization formula come from?</summary>

<p>Start with the norm&#39;s definition. Squaring it removes the square root, and each entry of <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi><mo>+</mo><mi>B</mi></mrow><annotation encoding="application/x-tex">A+B</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7667em;vertical-align:-0.0833em;"></span><span class="mord mathnormal">A</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span></span></span></span></span> is <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>A</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub><mo>+</mo><msub><mi>B</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub></mrow><annotation encoding="application/x-tex">A_{ij}+B_{ij}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.9694em;vertical-align:-0.2861em;"></span><span class="mord"><span class="mord mathnormal">A</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.9694em;vertical-align:-0.2861em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0502em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span></span></span></span>.</span> Apply the ordinary identity <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mi>a</mi><mo>+</mo><mi>b</mi><msup><mo stretchy="false">)</mo><mn>2</mn></msup><mo>=</mo><msup><mi>a</mi><mn>2</mn></msup><mo>+</mo><mn>2</mn><mi>a</mi><mi>b</mi><mo>+</mo><msup><mi>b</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">(a+b)^2=a^2+2ab+b^2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal">a</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.0641em;vertical-align:-0.25em;"></span><span class="mord mathnormal">b</span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8974em;vertical-align:-0.0833em;"></span><span class="mord"><span class="mord mathnormal">a</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.7778em;vertical-align:-0.0833em;"></span><span class="mord">2</span><span class="mord mathnormal">ab</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.8141em;"></span><span class="mord"><span class="mord mathnormal">b</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span></span></span></span> to each entry:</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi mathvariant="normal">∥</mi><mi>A</mi><mo>+</mo><mi>B</mi><msubsup><mi mathvariant="normal">∥</mi><mi>F</mi><mn>2</mn></msubsup></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><munder><mo>∑</mo><mrow><mi>i</mi><mo separator="true">,</mo><mi>j</mi></mrow></munder><mo stretchy="false">(</mo><msub><mi>A</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub><mo>+</mo><msub><mi>B</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub><msup><mo stretchy="false">)</mo><mn>2</mn></msup></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><munder><mo>∑</mo><mrow><mi>i</mi><mo separator="true">,</mo><mi>j</mi></mrow></munder><msubsup><mi>A</mi><mrow><mi>i</mi><mi>j</mi></mrow><mn>2</mn></msubsup><mo>+</mo><munder><mo>∑</mo><mrow><mi>i</mi><mo separator="true">,</mo><mi>j</mi></mrow></munder><msubsup><mi>B</mi><mrow><mi>i</mi><mi>j</mi></mrow><mn>2</mn></msubsup></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mspace width="1em"/><mo>+</mo><mn>2</mn><munder><mo>∑</mo><mrow><mi>i</mi><mo separator="true">,</mo><mi>j</mi></mrow></munder><msub><mi>A</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub><msub><mi>B</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mi mathvariant="normal">∥</mi><mi>A</mi><msubsup><mi mathvariant="normal">∥</mi><mi>F</mi><mn>2</mn></msubsup><mo>+</mo><mi mathvariant="normal">∥</mi><mi>B</mi><msubsup><mi mathvariant="normal">∥</mi><mi>F</mi><mn>2</mn></msubsup></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mspace width="1em"/><mo>+</mo><mn>2</mn><mo stretchy="false">⟨</mo><mi>A</mi><mo separator="true">,</mo><mi>B</mi><msub><mo stretchy="false">⟩</mo><mi>F</mi></msub><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
\|A+B\|_F^2&amp;=\sum_{i,j}(A_{ij}+B_{ij})^2\\[10pt]
&amp;=\sum_{i,j}A_{ij}^2+\sum_{i,j}B_{ij}^2\\[6pt]
&amp;\quad+2\sum_{i,j}A_{ij}B_{ij}\\[10pt]
&amp;=\|A\|_F^2+\|B\|_F^2\\[6pt]
&amp;\quad+2\langle A,B\rangle_F.
\end{aligned}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:11.6155em;vertical-align:-5.5577em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:6.0577em;"><span style="top:-8.0577em;"><span class="pstrut" style="height:3.05em;"></span><span class="mord"><span class="mord">∥</span><span class="mord mathnormal">A</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span></span></span><span style="top:-5.2939em;"><span class="pstrut" style="height:3.05em;"></span><span class="mord"></span></span><span style="top:-2.5302em;"><span class="pstrut" style="height:3.05em;"></span><span class="mord"></span></span><span style="top:0.0477em;"><span class="pstrut" style="height:3.05em;"></span><span class="mord"></span></span><span style="top:2.1477em;"><span class="pstrut" style="height:3.05em;"></span><span class="mord"></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:5.5577em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:6.0577em;"><span style="top:-8.0577em;"><span class="pstrut" style="height:3.05em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.05em;"><span style="top:-1.8723em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">i</span><span class="mpunct mtight">,</span><span class="mord mathnormal mtight" style="margin-right:0.0572em;">j</span></span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.4138em;"><span></span></span></span></span></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">A</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0502em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span></span><span style="top:-5.2939em;"><span class="pstrut" style="height:3.05em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.05em;"><span style="top:-1.8723em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">i</span><span class="mpunct mtight">,</span><span class="mord mathnormal mtight" style="margin-right:0.0572em;">j</span></span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.4138em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">A</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.3831em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.05em;"><span style="top:-1.8723em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">i</span><span class="mpunct mtight">,</span><span class="mord mathnormal mtight" style="margin-right:0.0572em;">j</span></span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.4138em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-2.453em;margin-left:-0.0502em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.3831em;"><span></span></span></span></span></span></span></span></span><span style="top:-2.5302em;"><span class="pstrut" style="height:3.05em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:1em;"></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord">2</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.05em;"><span style="top:-1.8723em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">i</span><span class="mpunct mtight">,</span><span class="mord mathnormal mtight" style="margin-right:0.0572em;">j</span></span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.4138em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">A</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0502em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span></span></span><span style="top:0.0477em;"><span class="pstrut" style="height:3.05em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord">∥</span><span class="mord mathnormal">A</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord">∥</span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span></span></span><span style="top:2.1477em;"><span class="pstrut" style="height:3.05em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:1em;"></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord">2</span><span class="mopen">⟨</span><span class="mord mathnormal">A</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="mclose"><span class="mclose">⟩</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:5.5577em;"><span></span></span></span></span></span></span></span></span></span></span></span></div>
<p>The last line simply recognizes the two squared norms and the inner product from their definitions. Replacing <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi></mrow><annotation encoding="application/x-tex">B</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span></span></span></span></span> by <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><mi>B</mi></mrow><annotation encoding="application/x-tex">-B</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7667em;vertical-align:-0.0833em;"></span><span class="mord">−</span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span></span></span></span></span> changes the sign of the cross term:</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi mathvariant="normal">∥</mi><mi>A</mi><mo>−</mo><mi>B</mi><msubsup><mi mathvariant="normal">∥</mi><mi>F</mi><mn>2</mn></msubsup></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mi mathvariant="normal">∥</mi><mi>A</mi><msubsup><mi mathvariant="normal">∥</mi><mi>F</mi><mn>2</mn></msubsup><mo>+</mo><mi mathvariant="normal">∥</mi><mi>B</mi><msubsup><mi mathvariant="normal">∥</mi><mi>F</mi><mn>2</mn></msubsup></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mspace width="1em"/><mo>−</mo><mn>2</mn><mo stretchy="false">⟨</mo><mi>A</mi><mo separator="true">,</mo><mi>B</mi><msub><mo stretchy="false">⟩</mo><mi>F</mi></msub><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
\|A-B\|_F^2&amp;=\|A\|_F^2+\|B\|_F^2\\[6pt]
&amp;\quad-2\langle A,B\rangle_F.
\end{aligned}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:3.3241em;vertical-align:-1.4121em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.9121em;"><span style="top:-4.0479em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">∥</span><span class="mord mathnormal">A</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span></span></span><span style="top:-1.9479em;"><span class="pstrut" style="height:3em;"></span><span class="mord"></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.4121em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.9121em;"><span style="top:-4.0479em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord">∥</span><span class="mord mathnormal">A</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord">∥</span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span></span></span><span style="top:-1.9479em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:1em;"></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord">2</span><span class="mopen">⟨</span><span class="mord mathnormal">A</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="mclose"><span class="mclose">⟩</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.4121em;"><span></span></span></span></span></span></span></span></span></span></span></span></div>
<p>Subtract the second expansion from the first. The squared norms cancel, and the cross terms leave <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>4</mn><mo stretchy="false">⟨</mo><mi>A</mi><mo separator="true">,</mo><mi>B</mi><msub><mo stretchy="false">⟩</mo><mi>F</mi></msub></mrow><annotation encoding="application/x-tex">4\langle A,B\rangle_F</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">4</span><span class="mopen">⟨</span><span class="mord mathnormal">A</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="mclose"><span class="mclose">⟩</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>.</span> Dividing by four gives the formula above.</p>
</details>

<div id="taylor-turns-the-step-into-a-loss-prediction" class="section-alias" aria-hidden="true"></div>

<h2 id="predict-whether-a-step-will-lower-the-loss"><a class="anchor" href="#predict-whether-a-step-will-lower-the-loss" aria-label="Permalink">§</a>Predict whether a step will lower the loss</h2>
<p>Our sum of slopes times changes looks like a useful score. Now we need to connect it to the quantity we actually care about, the loss after taking the step.</p>
<p>A differentiable function is locally approximated by its value plus a linear change. Applied to the weights, that linear change is exactly <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">⟨</mo><mi>G</mi><mo separator="true">,</mo><mi>D</mi><msub><mo stretchy="false">⟩</mo><mi>F</mi></msub></mrow><annotation encoding="application/x-tex">\langle G,D\rangle_F</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">⟨</span><span class="mord mathnormal">G</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mclose"><span class="mclose">⟩</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>.</span> This is the first-order <a href="https://mathworld.wolfram.com/TaylorsTheorem.html" target="_blank" rel="noopener noreferrer" class="external">Taylor expansion</a>:</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><menclose notation="box"><mstyle scriptlevel="0" displaystyle="false"><mstyle scriptlevel="0" displaystyle="false"><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>L</mi><mo stretchy="false">(</mo><mi>W</mi><mo>+</mo><mi>D</mi><mo stretchy="false">)</mo><mo>≈</mo><mi>L</mi><mo stretchy="false">(</mo><mi>W</mi><mo stretchy="false">)</mo><mo>+</mo><mo stretchy="false">⟨</mo><mi>G</mi><mo separator="true">,</mo><mi>D</mi><msub><mo stretchy="false">⟩</mo><mi>F</mi></msub><mi mathvariant="normal">.</mi></mrow></mstyle></mstyle></mstyle></menclose></mrow><annotation encoding="application/x-tex">\boxed{L(W+D)\approx L(W)+\langle G,D\rangle_F.}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.68em;vertical-align:-0.59em;"></span><span class="mord"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.09em;"><span style="top:-3.68em;"><span class="pstrut" style="height:3.68em;"></span><span class="boxpad"><span class="mord"><span class="mord"><span class="mord mathnormal">L</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">≈</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord mathnormal">L</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mopen">⟨</span><span class="mord mathnormal">G</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mclose"><span class="mclose">⟩</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span></span><span style="top:-3.09em;"><span class="pstrut" style="height:3.68em;"></span><span class="stretchy fbox" style="height:1.68em;border-style:solid;border-width:0.04em;"></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.59em;"><span></span></span></span></span></span></span></span></span></span></div>
<p>The first term is our current loss. The second is the predicted change. A more negative inner product means a larger predicted decrease. The approximation is local, so the step size still matters.</p>
<details class="muon-aside" id="taylor-refresher">
<summary>Why does the local slope predict a change in loss?</summary>

<p>Taylor approximates a function near a point using derivatives there. For a sufficiently smooth scalar function,</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>f</mi><mo stretchy="false">(</mo><mi>x</mi><mo>+</mo><mi>h</mi><mo stretchy="false">)</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mi>f</mi><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><mo>+</mo><msup><mi>f</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><mi>h</mi></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mspace width="1em"/><mo>+</mo><mfrac><mrow><msup><mi>f</mi><mrow><mo mathvariant="normal">′</mo><mo mathvariant="normal">′</mo></mrow></msup><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo></mrow><mrow><mn>2</mn><mo stretchy="false">!</mo></mrow></mfrac><msup><mi>h</mi><mn>2</mn></msup><mo>+</mo><mo>⋯</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mspace width="1em"/><mo>+</mo><mfrac><mrow><msup><mi>f</mi><mrow><mo stretchy="false">(</mo><mi>N</mi><mo stretchy="false">)</mo></mrow></msup><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo></mrow><mrow><mi>N</mi><mo stretchy="false">!</mo></mrow></mfrac><msup><mi>h</mi><mi>N</mi></msup><mo>+</mo><msub><mi>R</mi><mi>N</mi></msub><mo stretchy="false">(</mo><mi>h</mi><mo stretchy="false">)</mo><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
f(x+h)&amp;=f(x)+f&#x27;(x)h\\[8pt]
&amp;\quad+\frac{f&#x27;&#x27;(x)}{2!}h^2+\cdots\\[8pt]
&amp;\quad+\frac{f^{(N)}(x)}{N!}h^N+R_N(h).
\end{aligned}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:7.4399em;vertical-align:-3.4699em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:3.9699em;"><span style="top:-6.6949em;"><span class="pstrut" style="height:3.565em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1076em;">f</span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal">h</span><span class="mclose">)</span></span></span><span style="top:-3.8061em;"><span class="pstrut" style="height:3.565em;"></span><span class="mord"></span></span><span style="top:-0.7811em;"><span class="pstrut" style="height:3.565em;"></span><span class="mord"></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:3.4699em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:3.9699em;"><span style="top:-6.6949em;"><span class="pstrut" style="height:3.565em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord mathnormal" style="margin-right:0.1076em;">f</span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1076em;">f</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8019em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">′</span></span></span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mclose">)</span><span class="mord mathnormal">h</span></span></span><span style="top:-3.8061em;"><span class="pstrut" style="height:3.565em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:1em;"></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.4289em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">2</span><span class="mclose">!</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right:0.1076em;">f</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7519em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">′′</span></span></span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mclose">)</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.686em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mord"><span class="mord mathnormal">h</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="minner">⋯</span></span></span><span style="top:-0.7811em;"><span class="pstrut" style="height:3.565em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:1em;"></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.565em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">N</span><span class="mclose">!</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right:0.1076em;">f</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.888em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathnormal mtight" style="margin-right:0.109em;">N</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mclose">)</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.686em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mord"><span class="mord mathnormal">h</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8913em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.109em;">N</span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0077em;">R</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.0077em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.109em;">N</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal">h</span><span class="mclose">)</span><span class="mord">.</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:3.4699em;"><span></span></span></span></span></span></span></span></span></span></span></span></div>
<p>The remainder <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>R</mi><mi>N</mi></msub></mrow><annotation encoding="application/x-tex">R_N</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0077em;">R</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.0077em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.109em;">N</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> records the error. If the next derivative is continuous and bounded in magnitude by <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi></mrow><annotation encoding="application/x-tex">B</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span></span></span></span></span> along the interval, <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">∣</mi><msub><mi>R</mi><mi>N</mi></msub><mo stretchy="false">(</mo><mi>h</mi><mo stretchy="false">)</mo><mi mathvariant="normal">∣</mi><mo>≤</mo><mi>B</mi><mi mathvariant="normal">∣</mi><mi>h</mi><msup><mi mathvariant="normal">∣</mi><mrow><mi>N</mi><mo>+</mo><mn>1</mn></mrow></msup><mi mathvariant="normal">/</mi><mo stretchy="false">(</mo><mi>N</mi><mo>+</mo><mn>1</mn><mo stretchy="false">)</mo><mo stretchy="false">!</mo></mrow><annotation encoding="application/x-tex">|R_N(h)|\leq B|h|^{N+1}/(N+1)!</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">∣</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0077em;">R</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.0077em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.109em;">N</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal">h</span><span class="mclose">)</span><span class="mord">∣</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">≤</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.0913em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="mord">∣</span><span class="mord mathnormal">h</span><span class="mord"><span class="mord">∣</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8413em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.109em;">N</span><span class="mbin mtight">+</span><span class="mord mtight">1</span></span></span></span></span></span></span></span></span><span class="mord">/</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.109em;">N</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">1</span><span class="mclose">)!</span></span></span></span>.</span> Keeping only the value and slope gives the first-order approximation.</p>
<p>For <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><mo>=</mo><msup><mi>x</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">f(x)=x^2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.1076em;">f</span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8141em;"></span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span></span></span></span> at <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">x=1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">x</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span>,</span> the tangent predicts <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mo>+</mo><mn>2</mn><mi>h</mi></mrow><annotation encoding="application/x-tex">1+2h</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord">2</span><span class="mord mathnormal">h</span></span></span></span></span> and the exact value is <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mo>+</mo><mn>2</mn><mi>h</mi><mo>+</mo><msup><mi>h</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">1+2h+h^2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.7778em;vertical-align:-0.0833em;"></span><span class="mord">2</span><span class="mord mathnormal">h</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.8141em;"></span><span class="mord"><span class="mord mathnormal">h</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span></span></span>.</span> Watch the terms appear with their geometric meaning.</p>
<figure class="diagram"><svg xmlns="http://www.w3.org/2000/svg" class="muon-film" id="muon-taylor" viewBox="0 0 720 480" role="img" aria-labelledby="muon-taylor-title"><title id="muon-taylor-title">A parabola, its tangent line and the Taylor approximation error</title><desc>At x=1.15, the actual value is 1.322, the tangent predicts 1.300, and their gap is 0.0225. Halving h quarters the gap.</desc><text x="24" y="28" class="mf-strong" text-anchor="start">Value, slope, then the missing piece</text><text x="24" y="54" class="mf-small" text-anchor="start">Halve h. The error drops to one quarter.</text><line x1="32.5" y1="345" x2="370" y2="345" class="mf-axis" /><line x1="70" y1="366.5" x2="70" y2="87" class="mf-axis" /><polyline fill="none" points="32.50,341.13 37.32,342.06 42.14,342.86 46.96,343.54 51.79,344.09 56.61,344.51 61.43,344.80 66.25,344.96 71.07,345.00 75.89,344.90 80.71,344.68 85.54,344.34 90.36,343.86 95.18,343.26 100.00,342.52 104.82,341.66 109.64,340.68 114.46,339.56 119.29,338.32 124.11,336.94 128.93,335.44 133.75,333.82 138.57,332.06 143.39,330.18 148.21,328.16 153.04,326.03 157.86,323.76 162.68,321.36 167.50,318.84 172.32,316.19 177.14,313.41 181.96,310.50 186.79,307.47 191.61,304.30 196.43,301.01 201.25,297.59 206.07,294.05 210.89,290.37 215.71,286.57 220.54,282.64 225.36,278.58 230.18,274.39 235.00,270.08 239.82,265.63 244.64,261.06 249.46,256.37 254.29,251.54 259.11,246.58 263.93,241.50 268.75,236.29 273.57,230.95 278.39,225.49 283.21,219.89 288.04,214.17 292.86,208.32 297.68,202.34 302.50,196.24 307.32,190.00 312.14,183.64 316.96,177.15 321.79,170.53 326.61,163.79 331.43,156.91 336.25,149.91 341.07,142.78 345.89,135.53 350.71,128.14 355.54,120.63 360.36,112.99 365.18,105.22 370.00,97.32" class="mf-curve"/><g opacity="1"><line x1="45" y1="405.2" x2="370" y2="181.6" class="mf-memory-arrow mf-dashed" /></g><circle cx="195" cy="302" r="5" class="mf-muted-dot"/><text x="195" y="370" class="mf-small" text-anchor="middle">1</text><line x1="213.75" y1="345" x2="213.75" y2="288.1325" class="mf-objective" opacity=".35"/><circle cx="213.75" cy="289.1" r="5" class="mf-blue-dot"/><g opacity="1"><line x1="213.75" y1="289.1" x2="213.75" y2="288.1325" class="mf-orange" /><circle cx="213.75" cy="288.1325" r="5" class="mf-dot"/></g><line x1="195" y1="389" x2="213.75" y2="389" class="mf-orange" /><text x="204.375" y="415" class="mf-small" text-anchor="middle">h</text><text x="371" y="365" class="mf-small" text-anchor="start">x</text><foreignObject x="382" y="115" width="314" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mo stretchy="false">(</mo><mn>1</mn><mo>+</mo><mi>h</mi><mo stretchy="false">)</mo><mo>=</mo></mrow><annotation encoding="application/x-tex">f(1+h)=</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.1076em;">f</span><span class="mopen">(</span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">h</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span></span></span></span></span><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn></mrow><annotation encoding="application/x-tex">1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span></span><span class="mf-memory-math" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>+</mo><mn>2</mn><mi>h</mi></mrow><annotation encoding="application/x-tex">+2h</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7778em;vertical-align:-0.0833em;"></span><span class="mord">+</span><span class="mord">2</span><span class="mord mathnormal">h</span></span></span></span></span><span class="mf-result-math" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>+</mo><msup><mi>h</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">+h^2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8974em;vertical-align:-0.0833em;"></span><span class="mord">+</span><span class="mord"><span class="mord mathnormal">h</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span></span></span></span></div></foreignObject><text x="539" y="206" class="mf-small" text-anchor="middle">h = 0.150</text><text x="539" y="245" class="mf-blue-text" text-anchor="middle">tangent = 1.300</text><g opacity="1"><text x="539" y="284" class="" text-anchor="middle">actual = 1.322</text><text x="539" y="323" class="mf-accent-text" text-anchor="middle">gap h² = 0.0225</text></g><line x1="28" y1="453" x2="52" y2="453" class="mf-curve" /><text x="62" y="459" class="mf-small" text-anchor="start">curve</text><line x1="164" y1="453" x2="188" y2="453" class="mf-memory-arrow mf-dashed" /><text x="198" y="459" class="mf-small" text-anchor="start">tangent</text><line x1="314" y1="453" x2="338" y2="453" class="mf-orange" /><text x="348" y="459" class="mf-small" text-anchor="start">error</text></svg>
<figcaption>First locate the value, then build the tangent prediction, then reveal the gap to the curve. Halving h halves the linear change but quarters the error h².</figcaption></figure>
<div class="muon-controls" data-animation="taylor"><button data-action="play" disabled>Play animation</button><button data-action="restart" disabled>Restart</button><button data-action="previous-step" disabled>← Back</button><button data-action="next-step" disabled>Next →</button><span data-status>Value, slope, and the part the tangent misses.</span></div>

<p>For matrices, restrict the loss to a line, <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ϕ</mi><mo stretchy="false">(</mo><mi>t</mi><mo stretchy="false">)</mo><mo>=</mo><mi>L</mi><mo stretchy="false">(</mo><mi>W</mi><mo>+</mo><mi>t</mi><mi>D</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\phi(t)=L(W+tD)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">ϕ</span><span class="mopen">(</span><span class="mord mathnormal">t</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">L</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">t</span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mclose">)</span></span></span></span>.</span> The <a href="https://d2l.ai/chapter_preliminaries/calculus.html#chain-rule" target="_blank" rel="noopener noreferrer" class="external">chain rule</a> gives</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msup><mi>ϕ</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo stretchy="false">(</mo><mn>0</mn><mo stretchy="false">)</mo><mo>=</mo><munder><mo>∑</mo><mrow><mi>i</mi><mo separator="true">,</mo><mi>j</mi></mrow></munder><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>L</mi></mrow><mrow><mi mathvariant="normal">∂</mi><msub><mi>W</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub></mrow></mfrac><msub><mi>D</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub><mo>=</mo><mo stretchy="false">⟨</mo><mi>G</mi><mo separator="true">,</mo><mi>D</mi><msub><mo stretchy="false">⟩</mo><mi>F</mi></msub><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\phi&#x27;(0)=\sum_{i,j}\frac{\partial L}{\partial W_{ij}}D_{ij}
=\langle G,D\rangle_F.</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0519em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathnormal">ϕ</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8019em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">′</span></span></span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord">0</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:2.7852em;vertical-align:-1.4138em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.05em;"><span style="top:-1.8723em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">i</span><span class="mpunct mtight">,</span><span class="mord mathnormal mtight" style="margin-right:0.0572em;">j</span></span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.4138em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.3714em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord" style="margin-right:0.0556em;">∂</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord" style="margin-right:0.0556em;">∂</span><span class="mord mathnormal">L</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.9721em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0278em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">ij</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">⟨</span><span class="mord mathnormal">G</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mclose"><span class="mclose">⟩</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span></span></div>
<p>That is where Frobenius enters: it packages the sum of slopes times changes. Differentiability gives the precise statement</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>L</mi><mo stretchy="false">(</mo><mi>W</mi><mo>+</mo><mi>D</mi><mo stretchy="false">)</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mi>L</mi><mo stretchy="false">(</mo><mi>W</mi><mo stretchy="false">)</mo><mo>+</mo><mo stretchy="false">⟨</mo><mi>G</mi><mo separator="true">,</mo><mi>D</mi><msub><mo stretchy="false">⟩</mo><mi>F</mi></msub></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mspace width="1em"/><mo>+</mo><mi>R</mi><mo stretchy="false">(</mo><mi>D</mi><mo stretchy="false">)</mo><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
L(W+D)&amp;=L(W)+\langle G,D\rangle_F\\[6pt]
&amp;\quad+R(D).
\end{aligned}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:3.3em;vertical-align:-1.4em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.9em;"><span style="top:-4.06em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">L</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mclose">)</span></span></span><span style="top:-1.96em;"><span class="pstrut" style="height:3em;"></span><span class="mord"></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.4em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.9em;"><span style="top:-4.06em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord mathnormal">L</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mopen">⟨</span><span class="mord mathnormal">G</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mclose"><span class="mclose">⟩</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span><span style="top:-1.96em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:1em;"></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal" style="margin-right:0.0077em;">R</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mclose">)</span><span class="mord">.</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.4em;"><span></span></span></span></span></span></span></span></span></span></span></span></div>
<p>The remainder becomes small relative to the step:</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mfrac><mrow><mi>R</mi><mo stretchy="false">(</mo><mi>D</mi><mo stretchy="false">)</mo></mrow><mrow><mi mathvariant="normal">∥</mi><mi>D</mi><msub><mi mathvariant="normal">∥</mi><mi>F</mi></msub></mrow></mfrac><mo>⟶</mo><mn>0</mn><mspace width="1em"/><mtext>as </mtext><mi>D</mi><mo>→</mo><mn>0.</mn></mrow><annotation encoding="application/x-tex">\frac{R(D)}{\|D\|_F}\longrightarrow0\quad\text{as }D\to0.</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:2.363em;vertical-align:-0.936em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.427em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">∥</span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0077em;">R</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mclose">)</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.936em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">⟶</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord">0</span><span class="mspace" style="margin-right:1em;"></span><span class="mord text"><span class="mord">as </span></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">→</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.</span></span></span></span></span></div>
<p>A quadratic error bound needs extra smoothness, such as a continuous <a href="https://mathworld.wolfram.com/Hessian.html" target="_blank" rel="noopener noreferrer" class="external">Hessian</a> nearby. For our earlier quadratic, the remainder is exactly <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mstyle scriptlevel="0" displaystyle="false"><mfrac><mn>1</mn><mn>2</mn></mfrac></mstyle><mo stretchy="false">(</mo><msubsup><mi>d</mi><mn>1</mn><mn>2</mn></msubsup><mo>+</mo><mn>4</mn><msubsup><mi>d</mi><mn>2</mn><mn>2</mn></msubsup><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\tfrac12(d_1^2+4d_2^2)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.1901em;vertical-align:-0.345em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8451em;"><span style="top:-2.655em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">2</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.345em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-2.4519em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2481em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.0641em;vertical-align:-0.25em;"></span><span class="mord">4</span><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-2.4519em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2481em;"><span></span></span></span></span></span></span><span class="mclose">)</span></span></span></span>.</span> An oversized step can let this positive remainder overwhelm the predicted decrease.</p>
</details>

<div id="steepest-needs-a-budget" class="section-alias" aria-hidden="true"></div>

<h2 id="decide-how-far-we-are-willing-to-move"><a class="anchor" href="#decide-how-far-we-are-willing-to-move" aria-label="Permalink">§</a>Decide how far we are willing to move</h2>
<p>We can now compare steps by their predicted change in loss. But the prediction only uses local slopes. We choose a size limit so we stay close enough for it to be useful. A huge downhill step can overshoot, raise the actual loss, and send training bouncing around. The tangent line will happily recommend it anyway.</p>
<p>Call the limit <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi><mo>&gt;</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\eta&gt;0</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7335em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">&gt;</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0</span></span></span></span>,</span> our step <strong>budget</strong>. We choose both its size and how to measure it; a limit alone does not guarantee convergence. Measuring size with the Frobenius norm gives</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><munder><mrow><mi>min</mi><mo>⁡</mo></mrow><mrow><mi mathvariant="normal">∥</mi><mi>D</mi><msub><mi mathvariant="normal">∥</mi><mi>F</mi></msub><mo>≤</mo><mi>η</mi></mrow></munder><mo stretchy="false">⟨</mo><mi>G</mi><mo separator="true">,</mo><mi>D</mi><msub><mo stretchy="false">⟩</mo><mi>F</mi></msub><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\min_{\|D\|_F\leq\eta}\langle G,D\rangle_F.</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.716em;vertical-align:-0.966em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.6679em;"><span style="top:-2.309em;margin-left:0em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">∥</span><span class="mord mathnormal mtight" style="margin-right:0.0278em;">D</span><span class="mord mtight"><span class="mord mtight">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3448em;"><span style="top:-2.3567em;margin-left:0em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.1433em;"><span></span></span></span></span></span></span><span class="mrel mtight">≤</span><span class="mord mathnormal mtight" style="margin-right:0.0359em;">η</span></span></span></span><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span><span class="mop">min</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.966em;"><span></span></span></span></span></span><span class="mopen">⟨</span><span class="mord mathnormal">G</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mclose"><span class="mclose">⟩</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span></span></div>
<p>Read this as: <strong>among all steps within the budget, choose the one with the most negative predicted loss change</strong>. The gradient <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi></mrow><annotation encoding="application/x-tex">G</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal">G</span></span></span></span></span> is fixed at our current weights; the step <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span></span></span></span></span> is what we get to choose.</p>
<p>To see the geometry, imagine listing the matrix entries in vectors. For nonzero <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi></mrow><annotation encoding="application/x-tex">G</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal">G</span></span></span></span></span> and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span></span></span></span>,</span> call the angle between those vectors <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>φ</mi></mrow><annotation encoding="application/x-tex">\varphi</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">φ</span></span></span></span>:</span></p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">⟨</mo><mi>G</mi><mo separator="true">,</mo><mi>D</mi><msub><mo stretchy="false">⟩</mo><mi>F</mi></msub><mo>=</mo><mi mathvariant="normal">∥</mi><mi>G</mi><msub><mi mathvariant="normal">∥</mi><mi>F</mi></msub><mi mathvariant="normal">∥</mi><mi>D</mi><msub><mi mathvariant="normal">∥</mi><mi>F</mi></msub><mi>cos</mi><mo>⁡</mo><mi>φ</mi><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\langle G,D\rangle_F=\|G\|_F\|D\|_F\cos\varphi.</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">⟨</span><span class="mord mathnormal">G</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mclose"><span class="mclose">⟩</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">∥</span><span class="mord mathnormal">G</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">∥</span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop">cos</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal">φ</span><span class="mord">.</span></span></span></span></span></div>
<p>The quantity <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">∥</mi><mi>D</mi><msub><mi mathvariant="normal">∥</mi><mi>F</mi></msub><mi>cos</mi><mo>⁡</mo><mi>φ</mi></mrow><annotation encoding="application/x-tex">\|D\|_F\cos\varphi</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">∥</span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop">cos</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal">φ</span></span></span></span></span> is the signed projection of the step onto the gradient direction. Multiplying by <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">∥</mi><mi>G</mi><msub><mi mathvariant="normal">∥</mi><mi>F</mi></msub></mrow><annotation encoding="application/x-tex">\|G\|_F</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">∥</span><span class="mord mathnormal">G</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> turns that displacement into a predicted loss change. Moving with the gradient gives a positive score; moving against it gives a negative one. A perpendicular step scores zero, which predicts no first-order improvement. We want the most negative score our budget allows.</p>
<p><a href="https://mathworld.wolfram.com/CauchysInequality.html" target="_blank" rel="noopener noreferrer" class="external">Cauchy–Schwarz</a> says <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">∣</mi><mo stretchy="false">⟨</mo><mi>G</mi><mo separator="true">,</mo><mi>D</mi><msub><mo stretchy="false">⟩</mo><mi>F</mi></msub><mi mathvariant="normal">∣</mi><mo>≤</mo><mi mathvariant="normal">∥</mi><mi>G</mi><msub><mi mathvariant="normal">∥</mi><mi>F</mi></msub><mi mathvariant="normal">∥</mi><mi>D</mi><msub><mi mathvariant="normal">∥</mi><mi>F</mi></msub></mrow><annotation encoding="application/x-tex">|\langle G,D\rangle_F|\leq\|G\|_F\|D\|_F</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">∣</span><span class="mopen">⟨</span><span class="mord mathnormal">G</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mclose"><span class="mclose">⟩</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">∣</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">≤</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">∥</span><span class="mord mathnormal">G</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">∥</span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>.</span> Taking the negative side of that bound and applying our budget,</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">⟨</mo><mi>G</mi><mo separator="true">,</mo><mi>D</mi><msub><mo stretchy="false">⟩</mo><mi>F</mi></msub><mo>≥</mo><mo>−</mo><mi mathvariant="normal">∥</mi><mi>G</mi><msub><mi mathvariant="normal">∥</mi><mi>F</mi></msub><mi mathvariant="normal">∥</mi><mi>D</mi><msub><mi mathvariant="normal">∥</mi><mi>F</mi></msub><mo>≥</mo><mo>−</mo><mi>η</mi><mi mathvariant="normal">∥</mi><mi>G</mi><msub><mi mathvariant="normal">∥</mi><mi>F</mi></msub><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\langle G,D\rangle_F
\geq-\|G\|_F\|D\|_F
\geq-\eta\|G\|_F.</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">⟨</span><span class="mord mathnormal">G</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mclose"><span class="mclose">⟩</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">≥</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">−</span><span class="mord">∥</span><span class="mord mathnormal">G</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">∥</span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">≥</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">−</span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span><span class="mord">∥</span><span class="mord mathnormal">G</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span></span></div>
<p>For <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi><mo mathvariant="normal">≠</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">G\neq0</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">G</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel"><span class="mrel"><span class="mord vbox"><span class="thinbox"><span class="rlap"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="inner"><span class="mord"><span class="mrel"></span></span></span><span class="fix"></span></span></span></span></span><span class="mspace nobreak"></span><span class="mrel">=</span></span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0</span></span></span></span>,</span> choose <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>D</mi><mi>F</mi></msub><mo>=</mo><mo>−</mo><mi>η</mi><mi>G</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">∥</mi><mi>G</mi><msub><mi mathvariant="normal">∥</mi><mi>F</mi></msub></mrow><annotation encoding="application/x-tex">D_F=-\eta G/\|G\|_F</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.0278em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">−</span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span><span class="mord mathnormal">G</span><span class="mord">/∥</span><span class="mord mathnormal">G</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>.</span> Substitution gives <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">⟨</mo><mi>G</mi><mo separator="true">,</mo><msub><mi>D</mi><mi>F</mi></msub><msub><mo stretchy="false">⟩</mo><mi>F</mi></msub><mo>=</mo><mo>−</mo><mi>η</mi><mi mathvariant="normal">∥</mi><mi>G</mi><msub><mi mathvariant="normal">∥</mi><mi>F</mi></msub></mrow><annotation encoding="application/x-tex">\langle G,D_F\rangle_F=-\eta\|G\|_F</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">⟨</span><span class="mord mathnormal">G</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.0278em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose"><span class="mclose">⟩</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">−</span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span><span class="mord">∥</span><span class="mord mathnormal">G</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>,</span> exactly the lower bound. There is our minus sign and our best direction.</p>
<p>Ordinary SGD uses <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><mi>α</mi><mi>G</mi></mrow><annotation encoding="application/x-tex">-\alpha G</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7667em;vertical-align:-0.0833em;"></span><span class="mord">−</span><span class="mord mathnormal" style="margin-right:0.0037em;">α</span><span class="mord mathnormal">G</span></span></span></span>:</span> the same direction, with step length <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mi mathvariant="normal">∥</mi><mi>G</mi><msub><mi mathvariant="normal">∥</mi><mi>F</mi></msub></mrow><annotation encoding="application/x-tex">\alpha\|G\|_F</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.0037em;">α</span><span class="mord">∥</span><span class="mord mathnormal">G</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> instead of a fixed <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span></span></span></span>.</span></p>
<p>Our budget so far measures the combined size of the changes to the matrix entries. There is another useful question: how much will this update change what the layer outputs?</p>
<p>To see the difference, feed the <strong>same input vector</strong> <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi></mrow><annotation encoding="application/x-tex">x</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">x</span></span></span></span></span> into the layer before and after the update. Here <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi></mrow><annotation encoding="application/x-tex">x</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">x</span></span></span></span></span> means the activations entering this layer. For the linear part of the layer, call the output <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal" style="margin-right:0.044em;">z</span></span></span></span>:</span></p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><msub><mi>z</mi><mrow><mi mathvariant="normal">b</mi><mi mathvariant="normal">e</mi><mi mathvariant="normal">f</mi><mi mathvariant="normal">o</mi><mi mathvariant="normal">r</mi><mi mathvariant="normal">e</mi></mrow></msub></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mi>W</mi><mi>x</mi><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><msub><mi>z</mi><mrow><mi mathvariant="normal">a</mi><mi mathvariant="normal">f</mi><mi mathvariant="normal">t</mi><mi mathvariant="normal">e</mi><mi mathvariant="normal">r</mi></mrow></msub></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mo stretchy="false">(</mo><mi>W</mi><mo>+</mo><mi>D</mi><mo stretchy="false">)</mo><mi>x</mi><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mi>W</mi><mi>x</mi><mo>+</mo><mi>D</mi><mi>x</mi><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><msub><mi>z</mi><mrow><mi mathvariant="normal">a</mi><mi mathvariant="normal">f</mi><mi mathvariant="normal">t</mi><mi mathvariant="normal">e</mi><mi mathvariant="normal">r</mi></mrow></msub><mo>−</mo><msub><mi>z</mi><mrow><mi mathvariant="normal">b</mi><mi mathvariant="normal">e</mi><mi mathvariant="normal">f</mi><mi mathvariant="normal">o</mi><mi mathvariant="normal">r</mi><mi mathvariant="normal">e</mi></mrow></msub></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mi>D</mi><mi>x</mi><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
z_{\mathrm{before}}&amp;=Wx,\\[8pt]
z_{\mathrm{after}}&amp;=(W+D)x,\\[8pt]
&amp;=Wx+Dx,\\[8pt]
z_{\mathrm{after}}-z_{\mathrm{before}}&amp;=Dx.
\end{aligned}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:8.1em;vertical-align:-3.8em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:4.3em;"><span style="top:-6.46em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right:0.044em;">z</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.044em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathrm mtight">before</span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span><span style="top:-4.16em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right:0.044em;">z</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.044em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathrm mtight">after</span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span><span style="top:-1.86em;"><span class="pstrut" style="height:3em;"></span><span class="mord"></span></span><span style="top:0.44em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right:0.044em;">z</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.044em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathrm mtight">after</span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.044em;">z</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.044em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathrm mtight">before</span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:3.8em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:4.3em;"><span style="top:-6.46em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="mord mathnormal">x</span><span class="mpunct">,</span></span></span><span style="top:-4.16em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mclose">)</span><span class="mord mathnormal">x</span><span class="mpunct">,</span></span></span><span style="top:-1.86em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="mord mathnormal">x</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord mathnormal">x</span><span class="mpunct">,</span></span></span><span style="top:0.44em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord mathnormal">x</span><span class="mord">.</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:3.8em;"><span></span></span></span></span></span></span></span></span></span></span></span></div>
<p>The old output <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>W</mi><mi>x</mi></mrow><annotation encoding="application/x-tex">Wx</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="mord mathnormal">x</span></span></span></span></span> cancels. An unchanged bias would cancel too. What remains, <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi><mi>x</mi></mrow><annotation encoding="application/x-tex">Dx</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord mathnormal">x</span></span></span></span>,</span> is exactly the change caused by updating the weights. Even in one dimension, this distinction matters: changing a weight from 2 to 2.1 changes the output for input 3 from 6 to 6.3. The weight changed by 0.1; the output changed by <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0.1</mn><mo>×</mo><mn>3</mn><mo>=</mo><mn>0.3</mn></mrow><annotation encoding="application/x-tex">0.1\times3=0.3</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">0.1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">×</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">3</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.3</span></span></span></span>.</span></p>
<p>So we can choose a budget based on the update&#39;s effect on the layer&#39;s outputs. We need it to cover different inputs, not just one example. That leads to the next question: which input direction does <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span></span></span></span></span> change the most?</p>
<h2 id="measure-the-largest-output-change"><a class="anchor" href="#measure-the-largest-output-change" aria-label="Permalink">§</a>Measure the largest output change</h2>
<p>Keep the same loss prediction, but measure the update by its largest output change per unit of input length.</p>
<p>We must fix the input length before comparing directions. Otherwise, simply doubling <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi></mrow><annotation encoding="application/x-tex">x</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">x</span></span></span></span></span> doubles <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi><mi>x</mi></mrow><annotation encoding="application/x-tex">Dx</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord mathnormal">x</span></span></span></span>,</span> even though the update <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span></span></span></span></span> has not changed. Try every input with length 1 and measure the resulting change <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi><mi>x</mi></mrow><annotation encoding="application/x-tex">Dx</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord mathnormal">x</span></span></span></span>.</span> The largest length we find is the <strong>spectral norm</strong>, also called the Euclidean operator norm:</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="normal">∥</mi><mi>D</mi><msub><mi mathvariant="normal">∥</mi><mrow><mi mathvariant="normal">o</mi><mi mathvariant="normal">p</mi></mrow></msub><mo>=</mo><munder><mrow><mi>max</mi><mo>⁡</mo></mrow><mrow><mi mathvariant="normal">∥</mi><mi>x</mi><msub><mi mathvariant="normal">∥</mi><mn>2</mn></msub><mo>=</mo><mn>1</mn></mrow></munder><mi mathvariant="normal">∥</mi><mi>D</mi><mi>x</mi><msub><mi mathvariant="normal">∥</mi><mn>2</mn></msub><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\|D\|_{\mathrm{op}}=\max_{\|x\|_2=1}\|Dx\|_2.</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0361em;vertical-align:-0.2861em;"></span><span class="mord">∥</span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathrm mtight">op</span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.716em;vertical-align:-0.966em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.4306em;"><span style="top:-2.309em;margin-left:0em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">∥</span><span class="mord mathnormal mtight">x</span><span class="mord mtight"><span class="mord mtight">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3173em;"><span style="top:-2.357em;margin-left:0em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.143em;"><span></span></span></span></span></span></span><span class="mrel mtight">=</span><span class="mord mtight">1</span></span></span></span><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span><span class="mop">max</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.966em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">∥</span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord mathnormal">x</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span></span></div>
<p>Here <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">∥</mi><mi>x</mi><msub><mi mathvariant="normal">∥</mi><mn>2</mn></msub></mrow><annotation encoding="application/x-tex">\|x\|_2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">∥</span><span class="mord mathnormal">x</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> is Euclidean vector length (the size of the vector, <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msqrt><mrow><msubsup><mi>x</mi><mn>1</mn><mn>2</mn></msubsup><mo>+</mo><mo>⋯</mo><mo>+</mo><msubsup><mi>x</mi><mi>n</mi><mn>2</mn></msubsup></mrow></msqrt></mrow><annotation encoding="application/x-tex">\sqrt{x_1^2+\cdots+x_n^2}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.24em;vertical-align:-0.2902em;"></span><span class="mord sqrt"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.9498em;"><span class="svg-align" style="top:-3.2em;"><span class="pstrut" style="height:3.2em;"></span><span class="mord" style="padding-left:1em;"><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.7959em;"><span style="top:-2.4337em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span><span style="top:-3.0448em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2663em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="minner">⋯</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.7401em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">n</span></span></span><span style="top:-2.989em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span></span></span><span style="top:-2.9098em;"><span class="pstrut" style="height:3.2em;"></span><span class="hide-tail" style="min-width:1.02em;height:1.28em;"><svg xmlns="http://www.w3.org/2000/svg" width="400em" height="1.28em" viewBox="0 0 400000 1296" preserveAspectRatio="xMinYMin slice"><path d="M263,681c0.7,0,18,39.7,52,119
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
c340,-704.7,510.7,-1060.3,512,-1067
l0 -0
c4.7,-7.3,11,-11,19,-11
H40000v40H1012.3
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
M1001 80h400000v40h-400000z"/></svg></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2902em;"><span></span></span></span></span></span></span></span></span></span>). Fixing it at 1 lets us compare directions fairly.</p>
<figure class="diagram"><svg xmlns="http://www.w3.org/2000/svg" class="muon-film" id="muon-spectral" viewBox="0 0 720 480" role="img" aria-labelledby="muon-spectral-title"><title id="muon-spectral-title">Sweep unit inputs to find the spectral norm</title><desc>Unit input (0.707,0.707) maps to (1.414,1.414), with output length 2.000. The maximum is 2.</desc><text x="24" y="28" class="mf-strong" text-anchor="start">Which unit input gets stretched the most?</text><text x="24" y="54" class="mf-small" text-anchor="start">The longest output has length 2.</text><line x1="18.599999999999994" y1="232" x2="245.4" y2="232" class="mf-axis" /><line x1="132" y1="345.4" x2="132" y2="118.6" class="mf-axis" /><polyline fill="none" points="186.00,232.00 185.88,228.47 185.54,224.95 184.96,221.47 184.16,218.02 183.13,214.64 181.89,211.34 180.43,208.12 178.77,205.00 176.90,202.00 174.84,199.13 172.60,196.40 170.18,193.82 167.60,191.40 164.87,189.16 162.00,187.10 159.00,185.23 155.88,183.57 152.66,182.11 149.36,180.87 145.98,179.84 142.53,179.04 139.05,178.46 135.53,178.12 132.00,178.00 128.47,178.12 124.95,178.46 121.47,179.04 118.02,179.84 114.64,180.87 111.34,182.11 108.12,183.57 105.00,185.23 102.00,187.10 99.13,189.16 96.40,191.40 93.82,193.82 91.40,196.40 89.16,199.13 87.10,202.00 85.23,205.00 83.57,208.12 82.11,211.34 80.87,214.64 79.84,218.02 79.04,221.47 78.46,224.95 78.12,228.47 78.00,232.00 78.12,235.53 78.46,239.05 79.04,242.53 79.84,245.98 80.87,249.36 82.11,252.66 83.57,255.88 85.23,259.00 87.10,262.00 89.16,264.87 91.40,267.60 93.82,270.18 96.40,272.60 99.13,274.84 102.00,276.90 105.00,278.77 108.12,280.43 111.34,281.89 114.64,283.13 118.02,284.16 121.47,284.96 124.95,285.54 128.47,285.88 132.00,286.00 135.53,285.88 139.05,285.54 142.53,284.96 145.98,284.16 149.36,283.13 152.66,281.89 155.88,280.43 159.00,278.77 162.00,276.90 164.87,274.84 167.60,272.60 170.18,270.18 172.60,267.60 174.84,264.87 176.90,262.00 178.77,259.00 180.43,255.88 181.89,252.66 183.13,249.36 184.16,245.98 184.96,242.53 185.54,239.05 185.88,235.53 186.00,232.00" class="mf-ink mf-dashed"/><line x1="132" y1="232" x2="170.1837661840736" y2="193.81623381592644" class="mf-memory-arrow" /><path d="M167.36,202.30 L170.18,193.82 L161.70,196.64" class="mf-memory-arrow"/><circle cx="170.1837661840736" cy="193.81623381592644" r="5" class="mf-blue-dot"/><text x="132" y="374" class="mf-small" text-anchor="middle">input x · length 1</text><line x1="287.6" y1="232" x2="514.4" y2="232" class="mf-axis" /><line x1="401" y1="345.4" x2="401" y2="118.6" class="mf-axis" /><polyline fill="none" points="482.00,205.00 483.59,199.76 484.83,194.66 485.71,189.72 486.23,184.96 486.38,180.40 486.17,176.06 485.59,171.96 484.65,168.12 483.35,164.55 481.70,161.27 479.70,158.29 477.37,155.63 474.71,153.30 471.73,151.30 468.45,149.65 464.88,148.35 461.04,147.41 456.94,146.83 452.60,146.62 448.04,146.77 443.28,147.29 438.34,148.17 433.24,149.41 428.00,151.00 422.64,152.94 417.20,155.22 411.68,157.82 406.12,160.75 400.53,163.98 394.95,167.50 389.39,171.30 383.88,175.35 378.45,179.65 373.11,184.17 367.89,188.90 362.82,193.82 357.90,198.89 353.17,204.11 348.65,209.45 344.35,214.88 340.30,220.39 336.50,225.95 332.98,231.53 329.75,237.12 326.82,242.68 324.22,248.20 321.94,253.64 320.00,259.00 318.41,264.24 317.17,269.34 316.29,274.28 315.77,279.04 315.62,283.60 315.83,287.94 316.41,292.04 317.35,295.88 318.65,299.45 320.30,302.73 322.30,305.71 324.63,308.37 327.29,310.70 330.27,312.70 333.55,314.35 337.12,315.65 340.96,316.59 345.06,317.17 349.40,317.38 353.96,317.23 358.72,316.71 363.66,315.83 368.76,314.59 374.00,313.00 379.36,311.06 384.80,308.78 390.32,306.18 395.88,303.25 401.47,300.02 407.05,296.50 412.61,292.70 418.12,288.65 423.55,284.35 428.89,279.83 434.11,275.10 439.18,270.18 444.10,265.11 448.83,259.89 453.35,254.55 457.65,249.12 461.70,243.61 465.50,238.05 469.02,232.47 472.25,226.88 475.18,221.32 477.78,215.80 480.06,210.36 482.00,205.00" class="mf-shape"/><line x1="401" y1="232" x2="477.3675323681471" y2="155.63246763185288" class="mf-orange" /><path d="M474.54,164.12 L477.37,155.63 L468.88,158.46" class="mf-orange"/><circle cx="477.3675323681471" cy="155.63246763185288" r="5" class="mf-dot"/><text x="401" y="374" class="mf-small" text-anchor="middle">output Dx</text><line x1="221" y1="232" x2="290" y2="232" class="mf-ink" /><path d="M282.00,236.00 L290.00,232.00 L282.00,228.00" class="mf-ink"/><text x="256" y="216" class="mf-small" text-anchor="middle">D</text><foreignObject x="532" y="118" width="164" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi><mo>=</mo><mrow><mo fence="true">[</mo><mtable rowspacing="0.16em" columnalign="center center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>1.5</mn></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0.5</mn></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0.5</mn></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>1.5</mn></mstyle></mtd></mtr></mtable><mo fence="true">]</mo></mrow></mrow><annotation encoding="application/x-tex">D=\begin{bmatrix}1.5&amp;0.5\\0.5&amp;1.5\end{bmatrix}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:2.4em;vertical-align:-0.95em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">[</span></span><span class="mord"><span class="mtable"><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">1.5</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0.5</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span><span class="arraycolsep" style="width:0.5em;"></span><span class="arraycolsep" style="width:0.5em;"></span><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0.5</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">1.5</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">]</span></span></span></span></span></span></span></div></foreignObject><text x="614" y="222" class="mf-accent-text" text-anchor="middle">‖Dx‖₂ = 2.000</text><line x1="544" y1="255" x2="684" y2="255" class="mf-axis" /><line x1="544" y1="255" x2="684" y2="255" class="mf-orange" /><text x="684" y="279" class="mf-small" text-anchor="end">2</text><foreignObject x="128" y="406" width="464" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="mf-result-math" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>x</mi><mo>∗</mo></msub><mo>=</mo><mfrac><mn>1</mn><msqrt><mn>2</mn></msqrt></mfrac><mrow><mo fence="true">[</mo><mtable rowspacing="0.16em" columnalign="center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>1</mn></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>1</mn></mstyle></mtd></mtr></mtable><mo fence="true">]</mo></mrow><mo separator="true">,</mo><mspace width="1em"/><mi mathvariant="normal">∥</mi><mi>D</mi><msub><mi mathvariant="normal">∥</mi><mrow><mi mathvariant="normal">o</mi><mi mathvariant="normal">p</mi></mrow></msub><mo>=</mo><mn>2</mn></mrow><annotation encoding="application/x-tex">x_*={1\over\sqrt2}\begin{bmatrix}1\\1\end{bmatrix},\quad\|D\|_{\rm op}=2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1757em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mbin mtight">∗</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:2.4em;vertical-align:-0.95em;"></span><span class="mord"><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8451em;"><span style="top:-2.551em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord sqrt mtight"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.9128em;"><span class="svg-align" style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord mtight" style="padding-left:0.833em;">2</span></span><span style="top:-2.8728em;"><span class="pstrut" style="height:3em;"></span><span class="hide-tail mtight" style="min-width:0.853em;height:1.08em;"><svg xmlns="http://www.w3.org/2000/svg" width="400em" height="1.08em" viewBox="0 0 400000 1080" preserveAspectRatio="xMinYMin slice"><path d="M95,702
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l0 -0
c5.3,-9.3,12,-14,20,-14
H400000v40H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M834 80h400000v40h-400000z"/></svg></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.1272em;"><span></span></span></span></span></span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.538em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">[</span></span><span class="mord"><span class="mtable"><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">1</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">]</span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mpunct">,</span><span class="mspace" style="margin-right:1em;"></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">∥</span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathrm mtight">op</span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">2</span></span></span></span></span></div></foreignObject></svg>
<figcaption>A unit input sweeps around the circle while its image sweeps an ellipse. For this D, the longest image has length 2, attained at x = (1, 1)/√2 and its negative. The animation then settles on one maximizing direction.</figcaption></figure>
<div class="muon-controls" data-animation="spectral"><button data-action="play" disabled>Play animation</button><button data-action="restart" disabled>Restart</button><button data-action="previous-step" disabled>← Back</button><button data-action="next-step" disabled>Next →</button><span data-status>Keep the input length fixed. Search over its direction.</span></div>

<p>A spectral budget <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">∥</mi><mi>D</mi><msub><mi mathvariant="normal">∥</mi><mrow><mi mathvariant="normal">o</mi><mi mathvariant="normal">p</mi></mrow></msub><mo>≤</mo><mi>η</mi></mrow><annotation encoding="application/x-tex">\|D\|_{\mathrm{op}}\leq\eta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0361em;vertical-align:-0.2861em;"></span><span class="mord">∥</span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathrm mtight">op</span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">≤</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span></span></span></span></span> guarantees <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">∥</mi><mi>D</mi><mi>x</mi><msub><mi mathvariant="normal">∥</mi><mn>2</mn></msub><mo>≤</mo><mi>η</mi><mi mathvariant="normal">∥</mi><mi>x</mi><msub><mi mathvariant="normal">∥</mi><mn>2</mn></msub></mrow><annotation encoding="application/x-tex">\|Dx\|_2\leq\eta\|x\|_2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">∥</span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord mathnormal">x</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">≤</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span><span class="mord">∥</span><span class="mord mathnormal">x</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> for every input. It controls this layer&#39;s worst output change per unit input. It does not, by itself, control the whole network&#39;s loss curvature.</p>
<p>For a diagonal update, the two budgets are easy to see:</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>D</mi><mo>=</mo><mi mathvariant="normal">diag</mi><mo>⁡</mo><mo stretchy="false">(</mo><msub><mi>d</mi><mn>1</mn></msub><mo separator="true">,</mo><msub><mi>d</mi><mn>2</mn></msub><mo stretchy="false">)</mo><mo>=</mo><mrow><mo fence="true">[</mo><mtable rowspacing="0.16em" columnalign="center center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><msub><mi>d</mi><mn>1</mn></msub></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0</mn></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0</mn></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><msub><mi>d</mi><mn>2</mn></msub></mstyle></mtd></mtr></mtable><mo fence="true">]</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">D=\operatorname{diag}(d_1,d_2)
=\begin{bmatrix}d_1&amp;0\\0&amp;d_2\end{bmatrix},</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mop"><span class="mord mathrm" style="margin-right:0.0139em;">diag</span></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:2.4em;vertical-align:-0.95em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">[</span></span><span class="mord"><span class="mtable"><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span><span class="arraycolsep" style="width:0.5em;"></span><span class="arraycolsep" style="width:0.5em;"></span><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">]</span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mpunct">,</span></span></span></span></span></div>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi mathvariant="normal">∥</mi><mi>D</mi><msub><mi mathvariant="normal">∥</mi><mi>F</mi></msub></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><msqrt><mrow><msubsup><mi>d</mi><mn>1</mn><mn>2</mn></msubsup><mo>+</mo><msubsup><mi>d</mi><mn>2</mn><mn>2</mn></msubsup></mrow></msqrt><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi mathvariant="normal">∥</mi><mi>D</mi><msub><mi mathvariant="normal">∥</mi><mrow><mi mathvariant="normal">o</mi><mi mathvariant="normal">p</mi></mrow></msub></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mi>max</mi><mo>⁡</mo><mo stretchy="false">(</mo><mi mathvariant="normal">∣</mi><msub><mi>d</mi><mn>1</mn></msub><mi mathvariant="normal">∣</mi><mo separator="true">,</mo><mi mathvariant="normal">∣</mi><msub><mi>d</mi><mn>2</mn></msub><mi mathvariant="normal">∣</mi><mo stretchy="false">)</mo><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
\|D\|_F&amp;=\sqrt{d_1^2+d_2^2},\\[10pt]
\|D\|_{\mathrm{op}}&amp;=\max(|d_1|,|d_2|).
\end{aligned}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:4.1587em;vertical-align:-1.8293em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:2.3293em;"><span style="top:-4.3293em;"><span class="pstrut" style="height:3.2987em;"></span><span class="mord"><span class="mord">∥</span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span><span style="top:-1.8293em;"><span class="pstrut" style="height:3.2987em;"></span><span class="mord"><span class="mord">∥</span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathrm mtight">op</span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.8293em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:2.3293em;"><span style="top:-4.3293em;"><span class="pstrut" style="height:3.2987em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord sqrt"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.2987em;"><span class="svg-align" style="top:-3.8em;"><span class="pstrut" style="height:3.8em;"></span><span class="mord" style="padding-left:1em;"><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.7959em;"><span style="top:-2.4337em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span><span style="top:-3.0448em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2663em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.7959em;"><span style="top:-2.4337em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span><span style="top:-3.0448em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2663em;"><span></span></span></span></span></span></span></span></span><span style="top:-3.2587em;"><span class="pstrut" style="height:3.8em;"></span><span class="hide-tail" style="min-width:1.02em;height:1.88em;"><svg xmlns="http://www.w3.org/2000/svg" width="400em" height="1.88em" viewBox="0 0 400000 1944" preserveAspectRatio="xMinYMin slice"><path d="M983 90
l0 -0
c4,-6.7,10,-10,18,-10 H400000v40
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
M1001 80h400000v40h-400000z"/></svg></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.5413em;"><span></span></span></span></span></span><span class="mpunct">,</span></span></span><span style="top:-1.8293em;"><span class="pstrut" style="height:3.2987em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mop">max</span><span class="mopen">(</span><span class="mord">∣</span><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">∣</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">∣</span><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">∣</span><span class="mclose">)</span><span class="mord">.</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.8293em;"><span></span></span></span></span></span></span></span></span></span></span></span></div>
<p>Set <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">\eta=1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span>.</span> Each point in the animation is a candidate update <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><msub><mi>d</mi><mn>1</mn></msub><mo separator="true">,</mo><msub><mi>d</mi><mn>2</mn></msub><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(d_1,d_2)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span></span></span></span>.</span> Shading marks allowed steps; the outline is the budget limit. Frobenius gives a disk, and the spectral norm gives a square.</p>
<figure class="diagram"><svg xmlns="http://www.w3.org/2000/svg" class="muon-film" id="muon-budgets" viewBox="0 0 720 680" role="img" aria-labelledby="muon-budgets-title"><title id="muon-budgets-title">Find the best allowed step by sliding an equal-score line to the budget boundary</title><desc>Example 3. 4. Last contact: this is the best allowed update. The blue arrow is minus the gradient: a direction of decreasing predicted loss, with arbitrary drawn length. The orange dot is the candidate update; its matrix and score change as it moves. The dashed line joins equal scores.</desc><text x="360" y="27" class="mf-strong" text-anchor="middle">Example 3 · budget η = 1</text><foreignObject x="0" y="34" width="720" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi><mo>=</mo><mrow><mo fence="true">[</mo><mtable rowspacing="0.16em" columnalign="center center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>2</mn></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0</mn></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0</mn></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mo>−</mo><mn>1</mn></mrow></mstyle></mtd></mtr></mtable><mo fence="true">]</mo></mrow></mrow><annotation encoding="application/x-tex">G=\begin{bmatrix}2&amp;0\\0&amp;-1\end{bmatrix}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal">G</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:2.4em;vertical-align:-0.95em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">[</span></span><span class="mord"><span class="mtable"><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">2</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span><span class="arraycolsep" style="width:0.5em;"></span><span class="arraycolsep" style="width:0.5em;"></span><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">−</span><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">]</span></span></span></span></span></span></span></div></foreignObject><text x="360" y="112" class="mf-small" text-anchor="middle">4. Last contact: this is the best allowed update</text><g transform="translate(0,132)"><text x="180" y="22" class="mf-strong" text-anchor="middle">Frobenius</text><foreignObject x="0" y="29" width="360" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msqrt><mrow><msubsup><mi>d</mi><mn>1</mn><mn>2</mn></msubsup><mo>+</mo><msubsup><mi>d</mi><mn>2</mn><mn>2</mn></msubsup></mrow></msqrt><mo>≤</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">\sqrt{d_1^2+d_2^2}\leq1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.24em;vertical-align:-0.2902em;"></span><span class="mord sqrt"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.9498em;"><span class="svg-align" style="top:-3.2em;"><span class="pstrut" style="height:3.2em;"></span><span class="mord" style="padding-left:1em;"><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.7959em;"><span style="top:-2.4337em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span><span style="top:-3.0448em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2663em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.7959em;"><span style="top:-2.4337em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span><span style="top:-3.0448em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2663em;"><span></span></span></span></span></span></span></span></span><span style="top:-2.9098em;"><span class="pstrut" style="height:3.2em;"></span><span class="hide-tail" style="min-width:1.02em;height:1.28em;"><svg xmlns="http://www.w3.org/2000/svg" width="400em" height="1.28em" viewBox="0 0 400000 1296" preserveAspectRatio="xMinYMin slice"><path d="M263,681c0.7,0,18,39.7,52,119
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
c340,-704.7,510.7,-1060.3,512,-1067
l0 -0
c4.7,-7.3,11,-11,19,-11
H40000v40H1012.3
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
M1001 80h400000v40h-400000z"/></svg></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2902em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">≤</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span></span></div></foreignObject><circle cx="180" cy="188" r="85" class="mf-budget"/><line x1="50" y1="188" x2="310" y2="188" class="mf-axis" /><line x1="180" y1="92" x2="180" y2="285" class="mf-axis" /><text x="310" y="209" class="mf-small" text-anchor="start">d₁</text><text x="191" y="100" class="mf-small" text-anchor="start">d₂</text><defs><clipPath id="muon-budget-clip-0"><rect x="45" y="88" width="270" height="195"/></clipPath></defs><g opacity="1" clip-path="url(#muon-budget-clip-0)"><line x1="35.5500086535136" y1="286.8342046054907" x2="172.3973688765007" y2="13.139484159516428" class="mf-objective" /></g><g opacity="1"><line x1="180" y1="188" x2="138.18552882075392" y2="167.09276441037696" class="mf-memory-arrow" /><path d="M147.13,167.09 L138.19,167.09 L143.55,174.25" class="mf-memory-arrow"/><text x="142.18552882075392" y="154.09276441037696" class="mf-small mf-blue-text" text-anchor="start">−g</text></g><circle cx="103.97368876500715" cy="149.9868443825036" r="5" class="mf-dot"/><text x="180" y="314" class="mf-small" text-anchor="middle">Best update D*</text><g transform="translate(180 352) scale(0.66)"><polyline fill="none" points="-77.00,-35.00 -84.00,-35.00 -84.00,35.00 -77.00,35.00" class="mf-ink"/><polyline fill="none" points="77.00,-35.00 84.00,-35.00 84.00,35.00 77.00,35.00" class="mf-ink"/><text x="-43" y="-8" class="mf-matrix-number mf-accent-text" text-anchor="middle">−0.894</text><text x="43" y="-8" class="mf-matrix-number mf-accent-text" text-anchor="middle">0.000</text><text x="-43" y="27" class="mf-matrix-number mf-accent-text" text-anchor="middle">0.000</text><text x="43" y="27" class="mf-matrix-number mf-accent-text" text-anchor="middle">0.447</text></g><text x="180" y="401" class="mf-small" text-anchor="middle">score = −2.24</text></g><g transform="translate(360,132)"><text x="180" y="22" class="mf-strong" text-anchor="middle">Spectral</text><foreignObject x="0" y="29" width="360" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>max</mi><mo>⁡</mo><mo stretchy="false">(</mo><mi mathvariant="normal">∣</mi><msub><mi>d</mi><mn>1</mn></msub><mi mathvariant="normal">∣</mi><mo separator="true">,</mo><mi mathvariant="normal">∣</mi><msub><mi>d</mi><mn>2</mn></msub><mi mathvariant="normal">∣</mi><mo stretchy="false">)</mo><mo>≤</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">\max(|d_1|,|d_2|)\leq1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mop">max</span><span class="mopen">(</span><span class="mord">∣</span><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">∣</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">∣</span><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">∣</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">≤</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span></span></div></foreignObject><rect x="95" y="103" width="170" height="170" class="mf-budget"/><line x1="50" y1="188" x2="310" y2="188" class="mf-axis" /><line x1="180" y1="92" x2="180" y2="285" class="mf-axis" /><text x="310" y="209" class="mf-small" text-anchor="start">d₁</text><text x="191" y="100" class="mf-small" text-anchor="start">d₂</text><defs><clipPath id="muon-budget-clip-1"><rect x="45" y="88" width="270" height="195"/></clipPath></defs><g opacity="1" clip-path="url(#muon-budget-clip-1)"><line x1="26.576319888506447" y1="239.84736022298713" x2="163.42368011149355" y2="-33.847360222987106" class="mf-objective" /></g><g opacity="1"><line x1="180" y1="188" x2="138.18552882075392" y2="167.09276441037696" class="mf-memory-arrow" /><path d="M147.13,167.09 L138.19,167.09 L143.55,174.25" class="mf-memory-arrow"/><text x="142.18552882075392" y="154.09276441037696" class="mf-small mf-blue-text" text-anchor="start">−g</text></g><circle cx="95" cy="103" r="5" class="mf-dot"/><text x="180" y="314" class="mf-small" text-anchor="middle">Best update D*</text><g transform="translate(180 352) scale(0.66)"><polyline fill="none" points="-77.00,-35.00 -84.00,-35.00 -84.00,35.00 -77.00,35.00" class="mf-ink"/><polyline fill="none" points="77.00,-35.00 84.00,-35.00 84.00,35.00 77.00,35.00" class="mf-ink"/><text x="-43" y="-8" class="mf-matrix-number mf-accent-text" text-anchor="middle">−1.000</text><text x="43" y="-8" class="mf-matrix-number mf-accent-text" text-anchor="middle">0.000</text><text x="-43" y="27" class="mf-matrix-number mf-accent-text" text-anchor="middle">0.000</text><text x="43" y="27" class="mf-matrix-number mf-accent-text" text-anchor="middle">1.000</text></g><text x="180" y="401" class="mf-small" text-anchor="middle">score = −3.00</text></g><line x1="24" y1="574" x2="46" y2="574" class="mf-memory-arrow" /><path d="M38.00,578.00 L46.00,574.00 L38.00,570.00" class="mf-memory-arrow"/><text x="58" y="580" class="mf-small" text-anchor="start">−g: direction, not step length</text><circle cx="35" cy="608" r="5" class="mf-dot"/><text x="58" y="614" class="mf-small" text-anchor="start">D: the update being considered</text><line x1="24" y1="643" x2="46" y2="643" class="mf-objective" /><text x="58" y="649" class="mf-small" text-anchor="start">dashed: same predicted change</text></svg>
<figcaption>Read the stages in order: allowed steps, the −g direction, decreasing score, then the last contact. The blue arrow is a direction guide. The orange point is the candidate update; its matrix and score change together. Both panels use the same gradient and budget η = 1.</figcaption></figure>
<div class="muon-controls" data-animation="budgets"><button data-action="play" disabled>Play animation</button><button data-action="restart" disabled>Restart</button><button data-action="previous-step" disabled>← Back</button><button data-action="next-step" disabled>Next →</button><span data-status>Start at score zero. Follow the blue arrow toward lower scores.</span></div>


<p>Write the score as <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>c</mi><mo stretchy="false">(</mo><msub><mi>d</mi><mn>1</mn></msub><mo separator="true">,</mo><msub><mi>d</mi><mn>2</mn></msub><mo stretchy="false">)</mo><mo>=</mo><msub><mi>g</mi><mn>1</mn></msub><msub><mi>d</mi><mn>1</mn></msub><mo>+</mo><msub><mi>g</mi><mn>2</mn></msub><msub><mi>d</mi><mn>2</mn></msub></mrow><annotation encoding="application/x-tex">c(d_1,d_2)=g_1d_1+g_2d_2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">c</span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">g</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">g</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>.</span> The blue arrow points along <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><mi>g</mi><mo>=</mo><mo stretchy="false">(</mo><mo>−</mo><msub><mi>g</mi><mn>1</mn></msub><mo separator="true">,</mo><mo>−</mo><msub><mi>g</mi><mn>2</mn></msub><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">-g=(-g_1,-g_2)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7778em;vertical-align:-0.1944em;"></span><span class="mord">−</span><span class="mord mathnormal" style="margin-right:0.0359em;">g</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord">−</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">g</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">−</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">g</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span></span></span></span>,</span> where this score decreases. Its drawn length is just for readability. The orange dot is a candidate update <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span></span></span></span>,</span> and the dashed line passes through all updates with the same score as that dot.</p>
<p>Start at the origin: no weight change, score zero. Now slide the dashed line in the arrow&#39;s direction. More negative scores mean larger predicted decreases. Stop when the line is about to lose contact with the allowed region. The final orange dot is the best allowed update. The arrow tells us which way is better; the boundary decides how far we can go.</p>
<p>Keep our loss prediction in view:</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>L</mi><mo stretchy="false">(</mo><mi>W</mi><mo>+</mo><mi>D</mi><mo stretchy="false">)</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>≈</mo><mi>L</mi><mo stretchy="false">(</mo><mi>W</mi><mo stretchy="false">)</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mspace width="1em"/><mo>+</mo><munder><munder><mstyle mathcolor="#b54328"><mrow><mo stretchy="false">⟨</mo><mi>G</mi><mo separator="true">,</mo><mi>D</mi><msub><mo stretchy="false">⟩</mo><mi>F</mi></msub></mrow></mstyle><mo stretchy="true">⏟</mo></munder><mtext>the change we minimize</mtext></munder><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
L(W+D)&amp;\approx L(W)\\[8pt]
&amp;\quad+\underbrace{\color{#b54328}{\langle G,D\rangle_F}}_{\text{the change we minimize}}.
\end{aligned}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:4.8602em;vertical-align:-2.1801em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:2.6801em;"><span style="top:-4.8401em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">L</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mclose">)</span></span></span><span style="top:-2.5401em;"><span class="pstrut" style="height:3em;"></span><span class="mord"></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:2.1801em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:2.6801em;"><span style="top:-4.8401em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">≈</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord mathnormal">L</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="mclose">)</span></span></span><span style="top:-2.5401em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:1em;"></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="minner munder"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.75em;"><span style="top:-1.4159em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord text mtight"><span class="mord mtight">the change we minimize</span></span></span></span></span><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="minner munder"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.75em;"><span class="svg-align" style="top:-2.102em;"><span class="pstrut" style="height:3em;"></span><span class="stretchy" style="height:0.548em;min-width:1.6em;"><span class="brace-left" style="height:0.548em;"><svg xmlns="http://www.w3.org/2000/svg" width="400em" height="0.548em" viewBox="0 0 400000 548" preserveAspectRatio="xMinYMin slice"><path d="M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z"/></svg></span><span class="brace-center" style="height:0.548em;"><svg xmlns="http://www.w3.org/2000/svg" width="400em" height="0.548em" viewBox="0 0 400000 548" preserveAspectRatio="xMidYMin slice"><path d="M199572 214
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z"/></svg></span><span class="brace-right" style="height:0.548em;"><svg xmlns="http://www.w3.org/2000/svg" width="400em" height="0.548em" viewBox="0 0 400000 548" preserveAspectRatio="xMaxYMin slice"><path d="M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z"/></svg></span></span></span><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord" style="color:#b54328;"><span class="mopen" style="color:#b54328;">⟨</span><span class="mord mathnormal" style="color:#b54328;">G</span><span class="mpunct" style="color:#b54328;">,</span><span class="mspace" style="color:#b54328;margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;color:#b54328;">D</span><span class="mclose" style="color:#b54328;"><span class="mclose" style="color:#b54328;">⟩</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight" style="color:#b54328;"><span class="mord mathnormal mtight" style="margin-right:0.1389em;color:#b54328;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.898em;"><span></span></span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.7202em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">.</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:2.1801em;"><span></span></span></span></span></span></span></span></span></span></span></span></div>
<p>We changed which steps are allowed. The highlighted score is still the Frobenius inner product.</p>
<div id="the-svd-tells-us-where-to-spend-it" class="section-alias" aria-hidden="true"></div>

<h2 id="choose-a-step-in-each-independent-direction"><a class="anchor" href="#choose-a-step-in-each-independent-direction" aria-label="Permalink">§</a>Choose a step in each independent direction</h2>
<p>The diagonal examples show what the new budget allows. We now need the best step for a general matrix, whose useful directions may not line up with the coordinate axes:</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><munder><mrow><mi>min</mi><mo>⁡</mo></mrow><mrow><mi mathvariant="normal">∥</mi><mi>D</mi><msub><mi mathvariant="normal">∥</mi><mrow><mi mathvariant="normal">o</mi><mi mathvariant="normal">p</mi></mrow></msub><mo>≤</mo><mi>η</mi></mrow></munder><mo stretchy="false">⟨</mo><mi>G</mi><mo separator="true">,</mo><mi>D</mi><msub><mo stretchy="false">⟩</mo><mi>F</mi></msub><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\min_{\|D\|_{\mathrm{op}}\leq\eta}\langle G,D\rangle_F.</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.7383em;vertical-align:-0.9883em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.6679em;"><span style="top:-2.309em;margin-left:0em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">∥</span><span class="mord mathnormal mtight" style="margin-right:0.0278em;">D</span><span class="mord mtight"><span class="mord mtight">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1645em;"><span style="top:-2.357em;margin-left:0em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathrm mtight">op</span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2819em;"><span></span></span></span></span></span></span><span class="mrel mtight">≤</span><span class="mord mathnormal mtight" style="margin-right:0.0359em;">η</span></span></span></span><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span><span class="mop">min</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.9883em;"><span></span></span></span></span></span><span class="mopen">⟨</span><span class="mord mathnormal">G</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mclose"><span class="mclose">⟩</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span></span></div>
<p>The useful fact is that we can choose perpendicular input and output coordinates in which the matrix only stretches directions. This is the <strong>singular value decomposition</strong>, or SVD. It gives unit input directions <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>v</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">v_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">v</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>,</span> unit output directions <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>u</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">u_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">u</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>,</span> and stretch factors <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>σ</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">\sigma_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>,</span> called singular values. In these coordinates, <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi><msub><mi>v</mi><mi>i</mi></msub><mo>=</mo><msub><mi>σ</mi><mi>i</mi></msub><msub><mi>u</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">Gv_i=\sigma_i u_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord mathnormal">G</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">v</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal">u</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>.</span></p>
<div id="svd-refresher" class="section-alias" aria-hidden="true"></div>

<p>We will use the SVD theorem without proving it here. It says that every real matrix, square or rectangular, can be written as <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi><mi mathvariant="normal">Σ</mi><msup><mi>V</mi><mi mathvariant="normal">⊤</mi></msup></mrow><annotation encoding="application/x-tex">U\Sigma V^\top</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8491em;"></span><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="mord">Σ</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span></span></span></span></span></span></span></span>.</span> You can accept that result for this derivation, or follow the construction in <a href="https://ocw.mit.edu/courses/18-06-linear-algebra-spring-2010/resources/lecture-29-singular-value-decomposition/" target="_blank" rel="noopener noreferrer" class="external">Gilbert Strang&#39;s SVD lecture</a>. What matters for our optimizer is what the factors do.</p>
<p>For an <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi><mo>×</mo><mi>n</mi></mrow><annotation encoding="application/x-tex">m\times n</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6667em;vertical-align:-0.0833em;"></span><span class="mord mathnormal">m</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">×</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">n</span></span></span></span></span> matrix, the full factorization has <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi><mo>∈</mo><msup><mi mathvariant="double-struck">R</mi><mrow><mi>m</mi><mo>×</mo><mi>m</mi></mrow></msup></mrow><annotation encoding="application/x-tex">U\in\mathbb R^{m\times m}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7224em;vertical-align:-0.0391em;"></span><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7713em;"></span><span class="mord"><span class="mord mathbb">R</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7713em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">m</span><span class="mbin mtight">×</span><span class="mord mathnormal mtight">m</span></span></span></span></span></span></span></span></span></span></span></span>,</span> <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Σ</mi><mo>∈</mo><msup><mi mathvariant="double-struck">R</mi><mrow><mi>m</mi><mo>×</mo><mi>n</mi></mrow></msup></mrow><annotation encoding="application/x-tex">\Sigma\in\mathbb R^{m\times n}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7224em;vertical-align:-0.0391em;"></span><span class="mord">Σ</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7713em;"></span><span class="mord"><span class="mord mathbb">R</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7713em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">m</span><span class="mbin mtight">×</span><span class="mord mathnormal mtight">n</span></span></span></span></span></span></span></span></span></span></span></span>,</span> and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>V</mi><mo>∈</mo><msup><mi mathvariant="double-struck">R</mi><mrow><mi>n</mi><mo>×</mo><mi>n</mi></mrow></msup></mrow><annotation encoding="application/x-tex">V\in\mathbb R^{n\times n}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7224em;vertical-align:-0.0391em;"></span><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7713em;"></span><span class="mord"><span class="mord mathbb">R</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7713em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">n</span><span class="mbin mtight">×</span><span class="mord mathnormal mtight">n</span></span></span></span></span></span></span></span></span></span></span></span>.</span> The middle factor has the same rectangular shape as the original matrix, with nonnegative entries on its diagonal and zeros everywhere else. <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi></mrow><annotation encoding="application/x-tex">U</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.109em;">U</span></span></span></span></span> and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>V</mi></mrow><annotation encoding="application/x-tex">V</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.2222em;">V</span></span></span></span></span> are orthogonal, so they preserve lengths.</p>
<p>Read <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi><mi mathvariant="normal">Σ</mi><msup><mi>V</mi><mi mathvariant="normal">⊤</mi></msup></mrow><annotation encoding="application/x-tex">U\Sigma V^\top</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8491em;"></span><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="mord">Σ</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span></span></span></span></span></span></span></span></span> right to left: <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>V</mi><mi mathvariant="normal">⊤</mi></msup></mrow><annotation encoding="application/x-tex">V^\top</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8491em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span></span></span></span></span></span></span></span></span> changes input coordinates, <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Σ</mi></mrow><annotation encoding="application/x-tex">\Sigma</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord">Σ</span></span></span></span></span> stretches each coordinate, and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi></mrow><annotation encoding="application/x-tex">U</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.109em;">U</span></span></span></span></span> changes to output coordinates. Those coordinate changes can include reflections. The original matrix need not look diagonal at all.</p>
<p>For <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi><mo>=</mo><mrow><mo fence="true">[</mo><mtable rowspacing="0.16em" columnalign="center center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>3</mn></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0</mn></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0</mn></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>1</mn></mstyle></mtd></mtr></mtable><mo fence="true">]</mo></mrow></mrow><annotation encoding="application/x-tex">G=\begin{bmatrix}3&amp;0\\0&amp;1\end{bmatrix}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal">G</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:2.4em;vertical-align:-0.95em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">[</span></span><span class="mord"><span class="mtable"><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">3</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span><span class="arraycolsep" style="width:0.5em;"></span><span class="arraycolsep" style="width:0.5em;"></span><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">]</span></span></span></span></span></span>,</span> the useful directions are already the axes. It triples one and leaves the other unchanged, so <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi><mo>=</mo><mi>V</mi><mo>=</mo><mi>I</mi></mrow><annotation encoding="application/x-tex">U=V=I</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0785em;">I</span></span></span></span></span> and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Σ</mi><mo>=</mo><mi>G</mi></mrow><annotation encoding="application/x-tex">\Sigma=G</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord">Σ</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal">G</span></span></span></span>.</span> A less conveniently aligned matrix needs the coordinate changes too.</p>
<figure class="diagram"><svg xmlns="http://www.w3.org/2000/svg" class="muon-film" id="muon-svd" viewBox="0 0 720 440" role="img" aria-labelledby="muon-svd-title"><title id="muon-svd-title">SVD rotates and stretches a circle; the polar factor removes the stretch</title><desc>Replace both singular values with ones. A two-dimensional SVD with U a 30 degree rotation, singular values 2 and one half, and V transpose a minus 45 degree rotation. The current lengths of the two marked directions are 1.000 and 1.000. At the end both lengths are one and the polar factor preserves lengths.</desc><text x="24" y="28" class="mf-strong" text-anchor="start">From a circle to an ellipse, and back</text><text x="24" y="54" class="mf-small" text-anchor="start">Replace both singular values with ones</text><line x1="46" y1="367" x2="46" y2="91" class="mf-axis" /><line x1="46" y1="367" x2="322" y2="367" class="mf-axis" /><line x1="115" y1="367" x2="115" y2="91" class="mf-axis" /><line x1="46" y1="298" x2="322" y2="298" class="mf-axis" /><line x1="184" y1="367" x2="184" y2="91" class="mf-axis" /><line x1="46" y1="229" x2="322" y2="229" class="mf-axis" /><line x1="253" y1="367" x2="253" y2="91" class="mf-axis" /><line x1="46" y1="160" x2="322" y2="160" class="mf-axis" /><line x1="322" y1="367" x2="322" y2="91" class="mf-axis" /><line x1="46" y1="91" x2="322" y2="91" class="mf-axis" /><polyline fill="none" points="253.00,229.00 252.85,224.49 252.41,219.99 251.67,215.54 250.65,211.14 249.34,206.82 247.75,202.59 245.88,198.48 243.76,194.50 241.37,190.67 238.74,187.00 235.88,183.51 232.79,180.21 229.49,177.12 226.00,174.26 222.33,171.63 218.50,169.24 214.52,167.12 210.41,165.25 206.18,163.66 201.86,162.35 197.46,161.33 193.01,160.59 188.51,160.15 184.00,160.00 179.49,160.15 174.99,160.59 170.54,161.33 166.14,162.35 161.82,163.66 157.59,165.25 153.48,167.12 149.50,169.24 145.67,171.63 142.00,174.26 138.51,177.12 135.21,180.21 132.12,183.51 129.26,187.00 126.63,190.67 124.24,194.50 122.12,198.48 120.25,202.59 118.66,206.82 117.35,211.14 116.33,215.54 115.59,219.99 115.15,224.49 115.00,229.00 115.15,233.51 115.59,238.01 116.33,242.46 117.35,246.86 118.66,251.18 120.25,255.41 122.12,259.52 124.24,263.50 126.63,267.33 129.26,271.00 132.12,274.49 135.21,277.79 138.51,280.88 142.00,283.74 145.67,286.37 149.50,288.76 153.48,290.88 157.59,292.75 161.82,294.34 166.14,295.65 170.54,296.67 174.99,297.41 179.49,297.85 184.00,298.00 188.51,297.85 193.01,297.41 197.46,296.67 201.86,295.65 206.18,294.34 210.41,292.75 214.52,290.88 218.50,288.76 222.33,286.37 226.00,283.74 229.49,280.88 232.79,277.79 235.88,274.49 238.74,271.00 241.37,267.33 243.76,263.50 245.88,259.52 247.75,255.41 249.34,251.18 250.65,246.86 251.67,242.46 252.41,238.01 252.85,233.51 253.00,229.00" class="mf-ink mf-dashed mf-reference"/><polyline fill="none" points="250.65,246.86 251.67,242.46 252.41,238.01 252.85,233.51 253.00,229.00 252.85,224.49 252.41,219.99 251.67,215.54 250.65,211.14 249.34,206.82 247.75,202.59 245.88,198.48 243.76,194.50 241.37,190.67 238.74,187.00 235.88,183.51 232.79,180.21 229.49,177.12 226.00,174.26 222.33,171.63 218.50,169.24 214.52,167.12 210.41,165.25 206.18,163.66 201.86,162.35 197.46,161.33 193.01,160.59 188.51,160.15 184.00,160.00 179.49,160.15 174.99,160.59 170.54,161.33 166.14,162.35 161.82,163.66 157.59,165.25 153.48,167.12 149.50,169.24 145.67,171.63 142.00,174.26 138.51,177.12 135.21,180.21 132.12,183.51 129.26,187.00 126.63,190.67 124.24,194.50 122.12,198.48 120.25,202.59 118.66,206.82 117.35,211.14 116.33,215.54 115.59,219.99 115.15,224.49 115.00,229.00 115.15,233.51 115.59,238.01 116.33,242.46 117.35,246.86 118.66,251.18 120.25,255.41 122.12,259.52 124.24,263.50 126.63,267.33 129.26,271.00 132.12,274.49 135.21,277.79 138.51,280.88 142.00,283.74 145.67,286.37 149.50,288.76 153.48,290.88 157.59,292.75 161.82,294.34 166.14,295.65 170.54,296.67 174.99,297.41 179.49,297.85 184.00,298.00 188.51,297.85 193.01,297.41 197.46,296.67 201.86,295.65 206.18,294.34 210.41,292.75 214.52,290.88 218.50,288.76 222.33,286.37 226.00,283.74 229.49,280.88 232.79,277.79 235.88,274.49 238.74,271.00 241.37,267.33 243.76,263.50 245.88,259.52 247.75,255.41 249.34,251.18 250.65,246.86" class="mf-shape"/><circle cx="250.6488820139457" cy="246.85851411207392" r="2.3" class="mf-shape-point"/><circle cx="253" cy="229" r="2.3" class="mf-shape-point"/><circle cx="250.6488820139457" cy="211.14148588792608" r="2.3" class="mf-shape-point"/><circle cx="243.75575286112627" cy="194.5" r="2.3" class="mf-shape-point"/><circle cx="232.79036790187178" cy="180.20963209812822" r="2.3" class="mf-shape-point"/><circle cx="218.5" cy="169.24424713887373" r="2.3" class="mf-shape-point"/><circle cx="201.85851411207392" cy="162.3511179860543" r="2.3" class="mf-shape-point"/><circle cx="184" cy="160" r="2.3" class="mf-shape-point"/><circle cx="166.14148588792608" cy="162.3511179860543" r="2.3" class="mf-shape-point"/><circle cx="149.5" cy="169.24424713887373" r="2.3" class="mf-shape-point"/><circle cx="135.20963209812822" cy="180.20963209812822" r="2.3" class="mf-shape-point"/><circle cx="124.24424713887375" cy="194.5" r="2.3" class="mf-shape-point"/><circle cx="117.35111798605429" cy="211.14148588792605" r="2.3" class="mf-shape-point"/><circle cx="115" cy="229" r="2.3" class="mf-shape-point"/><circle cx="117.35111798605428" cy="246.85851411207392" r="2.3" class="mf-shape-point"/><circle cx="124.2442471388737" cy="263.5" r="2.3" class="mf-shape-point"/><circle cx="135.2096320981282" cy="277.7903679018718" r="2.3" class="mf-shape-point"/><circle cx="149.5" cy="288.75575286112627" r="2.3" class="mf-shape-point"/><circle cx="166.14148588792605" cy="295.6488820139457" r="2.3" class="mf-shape-point"/><circle cx="183.99999999999997" cy="298" r="2.3" class="mf-shape-point"/><circle cx="201.85851411207395" cy="295.6488820139457" r="2.3" class="mf-shape-point"/><circle cx="218.5" cy="288.75575286112627" r="2.3" class="mf-shape-point"/><circle cx="232.79036790187175" cy="277.79036790187183" r="2.3" class="mf-shape-point"/><circle cx="243.75575286112624" cy="263.50000000000006" r="2.3" class="mf-shape-point"/><line x1="184" y1="229" x2="243.75575286112627" y2="194.5" class="mf-memory-arrow" /><path d="M238.83,201.96 L243.76,194.50 L234.83,195.04" class="mf-memory-arrow"/><circle cx="243.75575286112627" cy="194.5" r="5" class="mf-blue-dot"/><text x="256.75575286112627" y="184.5" class="mf-blue-text" text-anchor="start">u₁</text><line x1="184" y1="229" x2="149.5" y2="169.24424713887373" class="mf-orange" /><path d="M156.96,174.17 L149.50,169.24 L150.04,178.17" class="mf-orange"/><circle cx="149.5" cy="169.24424713887373" r="5" class="mf-dot"/><text x="131.5" y="159.24424713887373" class="mf-accent-text" text-anchor="start">u₂</text><foreignObject x="358" y="87" width="338" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi><mo>=</mo><mi>U</mi><mi mathvariant="normal">Σ</mi><msup><mi>V</mi><mi mathvariant="normal">⊤</mi></msup><mtext> </mtext><mo>⟶</mo><mtext> </mtext><mi>Q</mi><mo>=</mo><mi>U</mi><msup><mi>V</mi><mi mathvariant="normal">⊤</mi></msup></mrow><annotation encoding="application/x-tex">G=U\Sigma V^\top\ \longrightarrow\ Q=UV^\top</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal">G</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8601em;vertical-align:-0.011em;"></span><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="mord">Σ</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span></span></span></span></span><span class="mspace"> </span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">⟶</span><span class="mspace"> </span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8778em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">Q</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8491em;"></span><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span></span></span></span></span></span></span></span></span></div></foreignObject><foreignObject x="358" y="145" width="338" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Q</mi><msub><mi>v</mi><mi>i</mi></msub><mo>=</mo><msub><mi>u</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">Qv_i=u_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8778em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">Q</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">v</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">u</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span></div></foreignObject><foreignObject x="358" y="203" width="338" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Σ</mi><mo>⟶</mo><mi>I</mi></mrow><annotation encoding="application/x-tex">\Sigma\longrightarrow I</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6943em;vertical-align:-0.011em;"></span><span class="mord">Σ</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">⟶</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0785em;">I</span></span></span></span></span></div></foreignObject><text x="527" y="278" class="mf-small" text-anchor="middle">Lengths of the marked directions</text><line x1="420" y1="312" x2="644" y2="312" class="mf-axis" /><line x1="532" y1="304" x2="532" y2="320" class="mf-target" /><line x1="420" y1="312" x2="532" y2="312" class="mf-memory-arrow" /><text x="408" y="318" class="mf-small mf-blue-text" text-anchor="end">1.00</text><line x1="420" y1="348" x2="644" y2="348" class="mf-axis" /><line x1="532" y1="340" x2="532" y2="356" class="mf-target" /><line x1="420" y1="348" x2="532" y2="348" class="mf-orange" /><text x="408" y="354" class="mf-small mf-accent-text" text-anchor="end">1.00</text><text x="532" y="376" class="mf-small" text-anchor="middle">1</text><text x="644" y="376" class="mf-small" text-anchor="middle">2</text><text x="184" y="407" class="mf-small" text-anchor="middle">Dashed circle: length 1</text></svg>
<figcaption>Follow the marked input directions through Vᵀ, Σ, and U. This full-rank 2 × 2 example has stretches 2 and ½, with input and output rotations of 45° and 30°. The final stage previews what happens when both stretches become 1.</figcaption></figure>
<div class="muon-controls" data-animation="svd"><button data-action="play" disabled>Play animation</button><button data-action="restart" disabled>Restart</button><button data-action="previous-step" disabled>← Back</button><button data-action="next-step" disabled>Next →</button><span data-status>Follow the factors from right to left.</span></div>

<p>The animation gives us the directions; now we can write the score in those coordinates. The <strong>compact SVD</strong> keeps only the <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>r</mi></mrow><annotation encoding="application/x-tex">r</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">r</span></span></span></span></span> directions with positive stretches.</p>
<p>For nonzero <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi></mrow><annotation encoding="application/x-tex">G</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal">G</span></span></span></span>,</span> its compact SVD is</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>G</mi><mo>=</mo><msub><mi>U</mi><mi>r</mi></msub><msub><mi mathvariant="normal">Σ</mi><mi>r</mi></msub><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup><mo>=</mo><munderover><mo>∑</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>r</mi></munderover><msub><mi>σ</mi><mi>i</mi></msub><msub><mi>u</mi><mi>i</mi></msub><msubsup><mi>v</mi><mi>i</mi><mi mathvariant="normal">⊤</mi></msubsup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">G=U_r\Sigma_rV_r^\top
=\sum_{i=1}^r\sigma_i u_i v_i^\top.</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal">G</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.1461em;vertical-align:-0.247em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord">Σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:2.9291em;vertical-align:-1.2777em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.6514em;"><span style="top:-1.8723em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">i</span><span class="mrel mtight">=</span><span class="mord mtight">1</span></span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span><span style="top:-4.3em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.2777em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal">u</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">v</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span></span></div>
<p>Here <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>r</mi></mrow><annotation encoding="application/x-tex">r</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">r</span></span></span></span></span> counts the independent active directions, and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="normal">Σ</mi><mi>r</mi></msub></mrow><annotation encoding="application/x-tex">\Sigma_r</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord">Σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> stores the positive stretches on its diagonal. The columns of <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>U</mi><mi>r</mi></msub></mrow><annotation encoding="application/x-tex">U_r</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>V</mi><mi>r</mi></msub></mrow><annotation encoding="application/x-tex">V_r</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> are the output and input directions.</p>
<p>The largest <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>σ</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">\sigma_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> is <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">∥</mi><mi>G</mi><msub><mi mathvariant="normal">∥</mi><mrow><mi mathvariant="normal">o</mi><mi mathvariant="normal">p</mi></mrow></msub></mrow><annotation encoding="application/x-tex">\|G\|_{\mathrm{op}}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0361em;vertical-align:-0.2861em;"></span><span class="mord">∥</span><span class="mord mathnormal">G</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathrm mtight">op</span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span></span></span></span>.</span> Combining all their squared lengths gives <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">∥</mi><mi>G</mi><msub><mi mathvariant="normal">∥</mi><mi>F</mi></msub><mo>=</mo><msqrt><mrow><msub><mo>∑</mo><mi>i</mi></msub><msubsup><mi>σ</mi><mi>i</mi><mn>2</mn></msubsup></mrow></msqrt></mrow><annotation encoding="application/x-tex">\|G\|_F=\sqrt{\sum_i\sigma_i^2}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">∥</span><span class="mord mathnormal">G</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.24em;vertical-align:-0.3069em;"></span><span class="mord sqrt"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.9331em;"><span class="svg-align" style="top:-3.2em;"><span class="pstrut" style="height:3.2em;"></span><span class="mord" style="padding-left:1em;"><span class="mop"><span class="mop op-symbol small-op" style="position:relative;top:0em;">∑</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.162em;"><span style="top:-2.4003em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2997em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.7959em;"><span style="top:-2.4231em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span><span style="top:-3.0448em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2769em;"><span></span></span></span></span></span></span></span></span><span style="top:-2.8931em;"><span class="pstrut" style="height:3.2em;"></span><span class="hide-tail" style="min-width:1.02em;height:1.28em;"><svg xmlns="http://www.w3.org/2000/svg" width="400em" height="1.28em" viewBox="0 0 400000 1296" preserveAspectRatio="xMinYMin slice"><path d="M263,681c0.7,0,18,39.7,52,119
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
c340,-704.7,510.7,-1060.3,512,-1067
l0 -0
c4.7,-7.3,11,-11,19,-11
H40000v40H1012.3
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
M1001 80h400000v40h-400000z"/></svg></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.3069em;"><span></span></span></span></span></span></span></span></span>.</span></p>
<p>Unlike eigenvalue diagonalization, SVD uses separate input and output coordinates. That is why the same construction works for rectangular matrices too.</p>
<p>Now the score separates into those directions:</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">⟨</mo><mi>G</mi><mo separator="true">,</mo><mi>D</mi><msub><mo stretchy="false">⟩</mo><mi>F</mi></msub><mo>=</mo><munderover><mo>∑</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>r</mi></munderover><msub><mi>σ</mi><mi>i</mi></msub><mtext> </mtext><msubsup><mi>u</mi><mi>i</mi><mi mathvariant="normal">⊤</mi></msubsup><mi>D</mi><msub><mi>v</mi><mi>i</mi></msub><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\langle G,D\rangle_F=\sum_{i=1}^r\sigma_i\,u_i^\top Dv_i.</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">⟨</span><span class="mord mathnormal">G</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mclose"><span class="mclose">⟩</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:2.9291em;vertical-align:-1.2777em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.6514em;"><span style="top:-1.8723em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">i</span><span class="mrel mtight">=</span><span class="mord mtight">1</span></span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span><span style="top:-4.3em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.2777em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">u</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">v</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span></span></div>
<p>Read one term before adding them all. The vector <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi><msub><mi>v</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">Dv_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">v</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> is the output change caused by the update when the input is <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>v</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">v_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">v</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>.</span> The scalar <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>u</mi><mi>i</mi><mi mathvariant="normal">⊤</mi></msubsup><mi>D</mi><msub><mi>v</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">u_i^\top Dv_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.1078em;vertical-align:-0.2587em;"></span><span class="mord"><span class="mord mathnormal">u</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-2.4413em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2587em;"><span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">v</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> is its signed component along the unit output direction <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>u</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">u_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">u</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>.</span> Positive means along <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>u</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">u_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">u</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>;</span> negative means against it. The positive number <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>σ</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">\sigma_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> weights that component in our score.</p>
<p>Our spectral budget limits the output change for <strong>every</strong> unit input. Each <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>v</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">v_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">v</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> is one of those inputs, so</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="normal">∥</mi><mi>D</mi><msub><mi>v</mi><mi>i</mi></msub><msub><mi mathvariant="normal">∥</mi><mn>2</mn></msub><mo>≤</mo><mi mathvariant="normal">∥</mi><mi>D</mi><msub><mi mathvariant="normal">∥</mi><mrow><mi mathvariant="normal">o</mi><mi mathvariant="normal">p</mi></mrow></msub><mi mathvariant="normal">∥</mi><msub><mi>v</mi><mi>i</mi></msub><msub><mi mathvariant="normal">∥</mi><mn>2</mn></msub><mo>≤</mo><mi>η</mi><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\|Dv_i\|_2\leq\|D\|_{\mathrm{op}}\|v_i\|_2
\leq\eta.</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">∥</span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">v</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">≤</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.0361em;vertical-align:-0.2861em;"></span><span class="mord">∥</span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathrm mtight">op</span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mord">∥</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">v</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">≤</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span><span class="mord">.</span></span></span></span></span></div>
<p>A signed component cannot have greater magnitude than the vector itself. A vector of length at most <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span></span></span></span></span> therefore cannot project farther than <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><mi>η</mi></mrow><annotation encoding="application/x-tex">-\eta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7778em;vertical-align:-0.1944em;"></span><span class="mord">−</span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span></span></span></span></span> in the opposite direction. Written as inequalities,</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msubsup><mi>u</mi><mi>i</mi><mi mathvariant="normal">⊤</mi></msubsup><mi>D</mi><msub><mi>v</mi><mi>i</mi></msub><mo>≥</mo><mo>−</mo><mi mathvariant="normal">∥</mi><mi>D</mi><msub><mi>v</mi><mi>i</mi></msub><msub><mi mathvariant="normal">∥</mi><mn>2</mn></msub><mo>≥</mo><mo>−</mo><mi>η</mi><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">u_i^\top Dv_i\geq-\|Dv_i\|_2\geq-\eta.</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.1461em;vertical-align:-0.247em;"></span><span class="mord"><span class="mord mathnormal">u</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">v</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">≥</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">−</span><span class="mord">∥</span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">v</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">≥</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7778em;vertical-align:-0.1944em;"></span><span class="mord">−</span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span><span class="mord">.</span></span></span></span></span></div>
<p>The most negative value occurs when <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi><msub><mi>v</mi><mi>i</mi></msub><mo>=</mo><mo>−</mo><mi>η</mi><msub><mi>u</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">Dv_i=-\eta u_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">v</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7778em;vertical-align:-0.1944em;"></span><span class="mord">−</span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span><span class="mord"><span class="mord mathnormal">u</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>:</span> use the full allowed length and point exactly against <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>u</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">u_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">u</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>.</span> Multiplying each bound by <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>σ</mi><mi>i</mi></msub><mo>&gt;</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\sigma_i&gt;0</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6891em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">&gt;</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0</span></span></span></span></span> preserves its direction. Adding gives</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mo stretchy="false">⟨</mo><mi>G</mi><mo separator="true">,</mo><mi>D</mi><msub><mo stretchy="false">⟩</mo><mi>F</mi></msub></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><munderover><mo>∑</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>r</mi></munderover><msub><mi>σ</mi><mi>i</mi></msub><msubsup><mi>u</mi><mi>i</mi><mi mathvariant="normal">⊤</mi></msubsup><mi>D</mi><msub><mi>v</mi><mi>i</mi></msub></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>≥</mo><munderover><mo>∑</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>r</mi></munderover><msub><mi>σ</mi><mi>i</mi></msub><mo stretchy="false">(</mo><mo>−</mo><mi>η</mi><mo stretchy="false">)</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mo>−</mo><mi>η</mi><munderover><mo>∑</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>r</mi></munderover><msub><mi>σ</mi><mi>i</mi></msub><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
\langle G,D\rangle_F
&amp;=\sum_{i=1}^r\sigma_i u_i^\top Dv_i\\[10pt]
&amp;\geq\sum_{i=1}^r\sigma_i(-\eta)\\[10pt]
&amp;=-\eta\sum_{i=1}^r\sigma_i.
\end{aligned}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:9.5519em;vertical-align:-4.5259em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:5.0259em;"><span style="top:-7.0259em;"><span class="pstrut" style="height:3.6514em;"></span><span class="mord"><span class="mopen">⟨</span><span class="mord mathnormal">G</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mclose"><span class="mclose">⟩</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span><span style="top:-3.7145em;"><span class="pstrut" style="height:3.6514em;"></span><span class="mord"></span></span><span style="top:-0.4031em;"><span class="pstrut" style="height:3.6514em;"></span><span class="mord"></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:4.5259em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:5.0259em;"><span style="top:-7.0259em;"><span class="pstrut" style="height:3.6514em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.6514em;"><span style="top:-1.8723em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">i</span><span class="mrel mtight">=</span><span class="mord mtight">1</span></span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span><span style="top:-4.3em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.2777em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal">u</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">v</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span><span style="top:-3.7145em;"><span class="pstrut" style="height:3.6514em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">≥</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.6514em;"><span style="top:-1.8723em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">i</span><span class="mrel mtight">=</span><span class="mord mtight">1</span></span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span><span style="top:-4.3em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.2777em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord">−</span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span><span class="mclose">)</span></span></span><span style="top:-0.4031em;"><span class="pstrut" style="height:3.6514em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord">−</span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.6514em;"><span style="top:-1.8723em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">i</span><span class="mrel mtight">=</span><span class="mord mtight">1</span></span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span><span style="top:-4.3em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.2777em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:4.5259em;"><span></span></span></span></span></span></span></span></span></span></span></span></div>
<p>That is a lower bound. To prove it is the best attainable score, we still need one matrix that sends <strong>every</strong> active <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>v</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">v_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">v</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> to <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><mi>η</mi><msub><mi>u</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">-\eta u_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7778em;vertical-align:-0.1944em;"></span><span class="mord">−</span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span><span class="mord"><span class="mord mathnormal">u</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> without breaking the budget. Choose</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><menclose notation="box"><mstyle scriptlevel="0" displaystyle="false"><mstyle scriptlevel="0" displaystyle="false"><mstyle scriptlevel="0" displaystyle="true"><mrow><msub><mi>D</mi><mo>∗</mo></msub><mo>=</mo><mo>−</mo><mi>η</mi><msub><mi>U</mi><mi>r</mi></msub><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup><mi mathvariant="normal">.</mi></mrow></mstyle></mstyle></mstyle></menclose></mrow><annotation encoding="application/x-tex">\boxed{D_*=-\eta U_rV_r^\top.}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.8261em;vertical-align:-0.587em;"></span><span class="mord"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.2391em;"><span style="top:-3.8261em;"><span class="pstrut" style="height:3.8261em;"></span><span class="boxpad"><span class="mord"><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1757em;"><span style="top:-2.55em;margin-left:-0.0278em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mbin mtight">∗</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord">−</span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span></span><span style="top:-3.2391em;"><span class="pstrut" style="height:3.8261em;"></span><span class="stretchy fbox" style="height:1.8261em;border-style:solid;border-width:0.04em;"></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.587em;"><span></span></span></span></span></span></span></span></span></span></div>
<p>To check this, multiply the proposed update by one input direction <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>v</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">v_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">v</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>.</span> Let <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>e</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">e_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">e</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> be the coordinate vector with a 1 in position <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>i</mi></mrow><annotation encoding="application/x-tex">i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6595em;"></span><span class="mord mathnormal">i</span></span></span></span></span> and zeros elsewhere. The columns of <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>V</mi><mi>r</mi></msub></mrow><annotation encoding="application/x-tex">V_r</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> have unit length and are perpendicular to one another, so their dot products with <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>v</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">v_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">v</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> give</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup><msub><mi>v</mi><mi>i</mi></msub><mo>=</mo><msub><mi>e</mi><mi>i</mi></msub><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">V_r^\top v_i=e_i.</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.1461em;vertical-align:-0.247em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">v</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">e</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span></span></div>
<p>Multiplying a matrix by <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>e</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">e_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">e</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> selects its <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>i</mi></mrow><annotation encoding="application/x-tex">i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6595em;"></span><span class="mord mathnormal">i</span></span></span></span></span>th column, so <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>U</mi><mi>r</mi></msub><msub><mi>e</mi><mi>i</mi></msub><mo>=</mo><msub><mi>u</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">U_re_i=u_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal">e</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">u</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>.</span> Substitute those two facts, one at a time:</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><msub><mi>D</mi><mo>∗</mo></msub><msub><mi>v</mi><mi>i</mi></msub></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mo stretchy="false">(</mo><mo>−</mo><mi>η</mi><msub><mi>U</mi><mi>r</mi></msub><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup><mo stretchy="false">)</mo><msub><mi>v</mi><mi>i</mi></msub></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mo>−</mo><mi>η</mi><msub><mi>U</mi><mi>r</mi></msub><mo stretchy="false">(</mo><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup><msub><mi>v</mi><mi>i</mi></msub><mo stretchy="false">)</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mo>−</mo><mi>η</mi><msub><mi>U</mi><mi>r</mi></msub><msub><mi>e</mi><mi>i</mi></msub></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mo>−</mo><mi>η</mi><msub><mi>u</mi><mi>i</mi></msub><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
D_*v_i&amp;=(-\eta U_rV_r^\top)v_i\\[8pt]
&amp;=-\eta U_r(V_r^\top v_i)\\[8pt]
&amp;=-\eta U_re_i\\[8pt]
&amp;=-\eta u_i.
\end{aligned}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:8.2182em;vertical-align:-3.8591em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:4.3591em;"><span style="top:-6.46em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1757em;"><span style="top:-2.55em;margin-left:-0.0278em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mbin mtight">∗</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">v</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span><span style="top:-4.1009em;"><span class="pstrut" style="height:3em;"></span><span class="mord"></span></span><span style="top:-1.8009em;"><span class="pstrut" style="height:3em;"></span><span class="mord"></span></span><span style="top:0.4991em;"><span class="pstrut" style="height:3em;"></span><span class="mord"></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:3.8591em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:4.3591em;"><span style="top:-6.46em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mopen">(</span><span class="mord">−</span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mclose">)</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">v</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span><span style="top:-4.1009em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord">−</span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">v</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span></span></span><span style="top:-1.8009em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord">−</span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal">e</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span><span style="top:0.4991em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord">−</span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span><span class="mord"><span class="mord mathnormal">u</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:3.8591em;"><span></span></span></span></span></span></span></span></span></span></span></span></div>
<p>Thus this single update matrix sends every active input direction to the opposite output direction with length <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span></span></span></span>.</span> Every term in the score reaches its lower bound.</p>
<p>It also respects the budget for combinations of inputs. <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup></mrow><annotation encoding="application/x-tex">V_r^\top</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0961em;vertical-align:-0.247em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span></span></span></span></span> extracts the coordinates in the active input directions without increasing length; <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>U</mi><mi>r</mi></msub></mrow><annotation encoding="application/x-tex">U_r</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> maps those coordinates into orthonormal output directions without changing their length. Multiplication by <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span></span></span></span></span> scales that length by <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span></span></span></span>.</span> So <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">∥</mi><msub><mi>D</mi><mo>∗</mo></msub><mi>x</mi><msub><mi mathvariant="normal">∥</mi><mn>2</mn></msub><mo>≤</mo><mi>η</mi><mi mathvariant="normal">∥</mi><mi>x</mi><msub><mi mathvariant="normal">∥</mi><mn>2</mn></msub></mrow><annotation encoding="application/x-tex">\|D_*x\|_2\leq\eta\|x\|_2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">∥</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1757em;"><span style="top:-2.55em;margin-left:-0.0278em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mbin mtight">∗</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal">x</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">≤</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span><span class="mord">∥</span><span class="mord mathnormal">x</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> for every <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi></mrow><annotation encoding="application/x-tex">x</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">x</span></span></span></span>,</span> with equality on each active <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>v</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">v_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">v</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>.</span></p>
<p>We have both pieces: no allowed update can score lower, and this update achieves the bound. After factoring out the minus sign and step size, its effect is to replace the positive stretches (the singular values stored in <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="normal">Σ</mi><mi>r</mi></msub></mrow><annotation encoding="application/x-tex">\Sigma_r</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord">Σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span>) by ones:</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>U</mi><mi>r</mi></msub><msub><mi mathvariant="normal">Σ</mi><mi>r</mi></msub><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup><mo>⟼</mo><msub><mi>U</mi><mi>r</mi></msub><msub><mi>I</mi><mi>r</mi></msub><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup><mo>=</mo><msub><mi>U</mi><mi>r</mi></msub><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">U_r\Sigma_rV_r^\top\longmapsto U_rI_rV_r^\top=U_rV_r^\top.</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.1461em;vertical-align:-0.247em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord">Σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">⟼</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.1461em;vertical-align:-0.247em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">I</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.1461em;vertical-align:-0.247em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span></span></div>
<p>Call <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>U</mi><mi>r</mi></msub><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup></mrow><annotation encoding="application/x-tex">U_rV_r^\top</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0961em;vertical-align:-0.247em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span></span></span></span></span> the <strong>polar factor</strong>, written <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">polar</mi><mo>⁡</mo><mo stretchy="false">(</mo><mi>G</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\operatorname{polar}(G)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mop"><span class="mord mathrm">polar</span></span><span class="mopen">(</span><span class="mord mathnormal">G</span><span class="mclose">)</span></span></span></span>.</span> It keeps the active input and output directions and replaces their positive stretches by 1. We have derived the matrix transformation at the center of Muon. Next we need to decide which gradient estimate to feed into it, and how to compute it cheaply.</p>
<h2 id="give-the-direction-some-memory"><a class="anchor" href="#give-the-direction-some-memory" aria-label="Permalink">§</a>Give the direction some memory</h2>
<p>So far we have treated <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi></mrow><annotation encoding="application/x-tex">G</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal">G</span></span></span></span></span> as the direction to trust. In training, we usually compute it from a minibatch, a small sample of the data. Different samples give different gradients. Before applying the polar transformation, combine recent gradients into a steadier estimate <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>M</mi><mi>t</mi></msub></mrow><annotation encoding="application/x-tex">M_t</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">M</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>:</span></p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>M</mi><mi>t</mi></msub><mo>=</mo><mi>β</mi><msub><mi>M</mi><mrow><mi>t</mi><mo>−</mo><mn>1</mn></mrow></msub><mo>+</mo><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><mi>β</mi><mo stretchy="false">)</mo><msub><mi>G</mi><mi>t</mi></msub><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">M_t=\beta M_{t-1}+(1-\beta)G_t.</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">M</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.9028em;vertical-align:-0.2083em;"></span><span class="mord mathnormal" style="margin-right:0.0528em;">β</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">M</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">t</span><span class="mbin mtight">−</span><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2083em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.0528em;">β</span><span class="mclose">)</span><span class="mord"><span class="mord mathnormal">G</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span></span></div>
<p>Start with <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>M</mi><mn>0</mn></msub><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">M_0=0</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">M</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">0</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0</span></span></span></span></span> and choose <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0</mn><mo>≤</mo><mi>β</mi><mo>&lt;</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">0\leq\beta&lt;1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7804em;vertical-align:-0.136em;"></span><span class="mord">0</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">≤</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.0528em;">β</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">&lt;</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span>.</span> With <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>=</mo><mn>0.8</mn></mrow><annotation encoding="application/x-tex">\beta=0.8</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.0528em;">β</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.8</span></span></span></span>,</span> keep 80% of the old estimate and add 20% of the incoming gradient. The animation builds that sum.</p>
<div class="muon-controls" data-animation="momentum"><button data-action="play" disabled>Play animation</button><button data-action="restart" disabled>Restart</button><button data-action="previous-step" disabled>← Back</button><button data-action="next-step" disabled>Next →</button><span data-status>β = 0.8, starting from M₀ = 0.</span></div>

<figure class="diagram"><svg xmlns="http://www.w3.org/2000/svg" class="muon-film" id="muon-momentum" viewBox="0 0 720 464" role="img" aria-labelledby="muon-momentum-title"><title id="muon-momentum-title">Momentum builds a weighted sum, with formulas synchronized to the arrows</title><desc>Batch 12. Use the result as the next memory. Previous estimate 0.923, 0.128 times 0.8, plus incoming gradient 1.000, −0.900 times 0.2, gives 0.939, −0.077. Formula values are rounded to three decimals.</desc><text x="24" y="28" class="mf-strong" text-anchor="start">Batch 12   ·   β = 0.8</text><text x="24" y="54" class="mf-small" text-anchor="start">Use the result as the next memory</text><foreignObject x="358" y="70" width="338" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation mf-symbolic"><span class="mf-result-math" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>M</mi><mi>t</mi></msub></mrow><annotation encoding="application/x-tex">M_t</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">M</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>=</mo></mrow><annotation encoding="application/x-tex">=</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.3669em;"></span><span class="mrel">=</span></span></span></span></span><span class="mf-memory-math" style="opacity:0.65"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><msub><mi>M</mi><mrow><mi>t</mi><mo>−</mo><mn>1</mn></mrow></msub></mrow><annotation encoding="application/x-tex">\beta M_{t-1}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.9028em;vertical-align:-0.2083em;"></span><span class="mord mathnormal" style="margin-right:0.0528em;">β</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">M</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">t</span><span class="mbin mtight">−</span><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2083em;"><span></span></span></span></span></span></span></span></span></span></span><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>+</mo></mrow><annotation encoding="application/x-tex">+</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6667em;vertical-align:-0.0833em;"></span><span class="mord">+</span></span></span></span></span><span class="mf-incoming-math" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><mi>β</mi><mo stretchy="false">)</mo><msub><mi>G</mi><mi>t</mi></msub></mrow><annotation encoding="application/x-tex">(1-\beta)G_t</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.0528em;">β</span><span class="mclose">)</span><span class="mord"><span class="mord mathnormal">G</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span></div></foreignObject><foreignObject x="358" y="124" width="338" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>≈</mo></mrow><annotation encoding="application/x-tex">\approx</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4831em;"></span><span class="mrel">≈</span></span></span></span></span><span class="mf-memory-math" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0.8</mn><mrow><mo fence="true">[</mo><mtable rowspacing="0.16em" columnalign="center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0.923</mn></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0.128</mn></mstyle></mtd></mtr></mtable><mo fence="true">]</mo></mrow></mrow><annotation encoding="application/x-tex">0.8\begin{bmatrix}0.923\\0.128\end{bmatrix}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:2.4em;vertical-align:-0.95em;"></span><span class="mord">0.8</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">[</span></span><span class="mord"><span class="mtable"><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0.923</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0.128</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">]</span></span></span></span></span></span></span><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>+</mo></mrow><annotation encoding="application/x-tex">+</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6667em;vertical-align:-0.0833em;"></span><span class="mord">+</span></span></span></span></span><span class="mf-incoming-math" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0.2</mn><mrow><mo fence="true">[</mo><mtable rowspacing="0.16em" columnalign="center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>1.000</mn></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mo>−</mo><mn>0.900</mn></mrow></mstyle></mtd></mtr></mtable><mo fence="true">]</mo></mrow></mrow><annotation encoding="application/x-tex">0.2\begin{bmatrix}1.000\\-0.900\end{bmatrix}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:2.4em;vertical-align:-0.95em;"></span><span class="mord">0.2</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">[</span></span><span class="mord"><span class="mtable"><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">1.000</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">−</span><span class="mord">0.900</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">]</span></span></span></span></span></span></span></div></foreignObject><foreignObject x="358" y="180" width="338" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>≈</mo></mrow><annotation encoding="application/x-tex">\approx</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4831em;"></span><span class="mrel">≈</span></span></span></span></span><span class="mf-memory-math" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">[</mo><mtable rowspacing="0.16em" columnalign="center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0.739</mn></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0.103</mn></mstyle></mtd></mtr></mtable><mo fence="true">]</mo></mrow><annotation encoding="application/x-tex">\begin{bmatrix}0.739\\0.103\end{bmatrix}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:2.4em;vertical-align:-0.95em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">[</span></span><span class="mord"><span class="mtable"><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0.739</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0.103</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">]</span></span></span></span></span></span></span><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>+</mo></mrow><annotation encoding="application/x-tex">+</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6667em;vertical-align:-0.0833em;"></span><span class="mord">+</span></span></span></span></span><span class="mf-incoming-math" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">[</mo><mtable rowspacing="0.16em" columnalign="center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0.200</mn></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mo>−</mo><mn>0.180</mn></mrow></mstyle></mtd></mtr></mtable><mo fence="true">]</mo></mrow><annotation encoding="application/x-tex">\begin{bmatrix}0.200\\-0.180\end{bmatrix}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:2.4em;vertical-align:-0.95em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">[</span></span><span class="mord"><span class="mtable"><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0.200</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">−</span><span class="mord">0.180</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">]</span></span></span></span></span></span></span></div></foreignObject><foreignObject x="358" y="236" width="338" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="mf-result-math" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>M</mi><mi>t</mi></msub></mrow><annotation encoding="application/x-tex">M_t</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">M</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>≈</mo></mrow><annotation encoding="application/x-tex">\approx</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4831em;"></span><span class="mrel">≈</span></span></span></span></span><span class="mf-result-math" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">[</mo><mtable rowspacing="0.16em" columnalign="center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0.939</mn></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mo>−</mo><mn>0.077</mn></mrow></mstyle></mtd></mtr></mtable><mo fence="true">]</mo></mrow><annotation encoding="application/x-tex">\begin{bmatrix}0.939\\-0.077\end{bmatrix}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:2.4em;vertical-align:-0.95em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">[</span></span><span class="mord"><span class="mtable"><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0.939</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">−</span><span class="mord">0.077</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">]</span></span></span></span></span></span></span></div></foreignObject><line x1="24" y1="187" x2="336" y2="187" class="mf-axis" /><line x1="95" y1="74" x2="95" y2="292" class="mf-axis" /><text x="332" y="213" class="mf-small" text-anchor="end">entry 1</text><text x="109" y="84" class="mf-small" text-anchor="start">entry 2</text><line x1="95" y1="187" x2="240" y2="92" class="mf-history" /><path d="M235.50,99.73 L240.00,92.00 L231.12,93.04" class="mf-history"/><line x1="95" y1="187" x2="211" y2="266.8" class="mf-history" /><path d="M202.14,265.56 L211.00,266.80 L206.68,258.97" class="mf-history"/><line x1="95" y1="187" x2="269" y2="114.8" class="mf-history" /><path d="M263.14,121.56 L269.00,114.80 L260.08,114.17" class="mf-history"/><line x1="95" y1="187" x2="225.5" y2="285.8" class="mf-history" /><path d="M216.71,284.16 L225.50,285.80 L221.54,277.78" class="mf-history"/><line x1="95" y1="187" x2="254.5" y2="99.60000000000001" class="mf-history" /><path d="M249.41,106.95 L254.50,99.60 L245.56,99.94" class="mf-history"/><line x1="95" y1="187" x2="276.25" y2="255.4" class="mf-history" /><path d="M267.35,256.32 L276.25,255.40 L270.18,248.83" class="mf-history"/><line x1="95" y1="187" x2="218.25" y2="133.8" class="mf-history" /><path d="M212.49,140.64 L218.25,133.80 L209.32,133.30" class="mf-history"/><line x1="95" y1="187" x2="247.25" y2="270.6" class="mf-history" /><path d="M238.31,270.26 L247.25,270.60 L242.16,263.24" class="mf-history"/><line x1="95" y1="187" x2="232.75" y2="88.2" class="mf-history" /><path d="M228.58,96.11 L232.75,88.20 L223.92,89.61" class="mf-history"/><line x1="95" y1="187" x2="261.75" y2="244" class="mf-history" /><path d="M252.89,245.20 L261.75,244.00 L255.47,237.63" class="mf-history"/><line x1="95" y1="187" x2="225.5" y2="126.19999999999999" class="mf-history" /><path d="M219.94,133.20 L225.50,126.20 L216.56,125.95" class="mf-history"/><line x1="228.87957406720002" y1="177.23982911488" x2="240" y2="255.4" class="mf-objective" /><line x1="95" y1="187" x2="240" y2="255.4" class="mf-history" /><path d="M231.06,255.60 L240.00,255.40 L234.47,248.37" class="mf-history"/><circle cx="228.87957406720002" cy="177.23982911488" r="4" class="mf-open"/><line x1="95" y1="187" x2="202.10365925376004" y2="179.191863291904" class="mf-memory-arrow" /><path d="M194.42,183.76 L202.10,179.19 L193.83,175.78" class="mf-memory-arrow"/><line x1="202.10365925376004" y1="179.191863291904" x2="231.10365925376001" y2="192.871863291904" class="mf-ink" /><path d="M222.16,193.08 L231.10,192.87 L225.57,185.84" class="mf-ink"/><g opacity="1"><line x1="95" y1="187" x2="231.10365925376004" y2="192.871863291904" class="mf-orange" /><path d="M222.94,196.52 L231.10,192.87 L223.28,188.53" class="mf-orange"/><circle cx="231.10365925376004" cy="192.871863291904" r="5" class="mf-dot"/></g><line x1="24" y1="318" x2="47" y2="318" class="mf-memory-arrow" /><text x="56" y="324" class="mf-small" text-anchor="start">memory</text><line x1="160" y1="318" x2="183" y2="318" class="mf-ink" /><text x="192" y="324" class="mf-small" text-anchor="start">this batch</text><line x1="310" y1="318" x2="333" y2="318" class="mf-orange" /><text x="342" y="324" class="mf-small" text-anchor="start">new estimate</text><text x="24" y="354" class="mf-small" text-anchor="start">Second entry over successive batches</text><line x1="50" y1="404" x2="674" y2="404" class="mf-axis" /><polyline fill="none" points="50.00,404.00 102.00,370.25 154.00,432.35 206.00,378.35 258.00,439.10 310.00,372.95 362.00,428.30 414.00,385.10 466.00,433.70 518.00,368.90 570.00,424.25 622.00,382.40 674.00,428.30" class="mf-noise"/><polyline fill="none" points="50.00,404.00 102.00,397.25 154.00,404.27 206.00,399.09 258.00,407.09 310.00,400.26 362.00,405.87 414.00,401.72 466.00,408.11 518.00,400.27 570.00,405.07 622.00,400.53" class="mf-trail"/><g opacity="1"><polyline fill="none" points="622.00,400.53 674.00,406.09" class="mf-trail"/></g><text x="50" y="452" class="mf-small" text-anchor="middle">0</text><text x="674" y="452" class="mf-small" text-anchor="end">12 batches</text></svg>
<figcaption>Blue is the retained estimate; dark ink is the new contribution. Add them head to tail to get orange. The vectors list two diagonal entries; values are rounded to three decimals. The lower trace follows the second entry across batches.</figcaption></figure>
<p>Now put that memory on a loss surface. The dark path follows each noisy gradient; the blue path averages them before stepping. Both start at the same weights, use the same learning rate, and receive the same sequence of batch perturbations. Each computes its gradient at its own current position.</p>
<figure class="diagram"><svg xmlns="http://www.w3.org/2000/svg" class="muon-film" id="muon-momentumlandscape" viewBox="0 0 720 700" role="img" aria-labelledby="muon-momentumlandscape-title"><title id="muon-momentumlandscape-title">Compare noisy gradient descent and momentum on a three-dimensional loss surface</title><desc>Step 48 of 48. Raw gradients and momentum on the same quadratic loss. Noise on, momentum beta 0.8. Both use learning rate 0.14. Current losses 0.334 and 0.018.</desc><text x="24" y="28" class="mf-strong" text-anchor="start">Same valley. Different memory.</text><text x="24" y="54" class="mf-small" text-anchor="start">Step 48 / 48 · α = 0.14 · β = 0.8 · noise on</text><foreignObject x="0" y="64" width="720" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>L</mi><mo stretchy="false">(</mo><msub><mi>w</mi><mn>1</mn></msub><mo separator="true">,</mo><msub><mi>w</mi><mn>2</mn></msub><mo stretchy="false">)</mo><mo>=</mo><mstyle scriptlevel="0" displaystyle="false"><mfrac><mn>1</mn><mn>2</mn></mfrac></mstyle><msubsup><mi>w</mi><mn>1</mn><mn>2</mn></msubsup><mo>+</mo><mn>6</mn><msubsup><mi>w</mi><mn>2</mn><mn>2</mn></msubsup></mrow><annotation encoding="application/x-tex">L(w_1,w_2)=\tfrac12w_1^2+6w_2^2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">L</span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0269em;">w</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0269em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0269em;">w</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0269em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.1901em;vertical-align:-0.345em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8451em;"><span style="top:-2.655em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">2</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.345em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0269em;">w</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-2.4519em;margin-left:-0.0269em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2481em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.0622em;vertical-align:-0.2481em;"></span><span class="mord">6</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0269em;">w</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-2.4519em;margin-left:-0.0269em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2481em;"><span></span></span></span></span></span></span></span></span></span></span></div></foreignObject><text x="24" y="136" class="mf-small" text-anchor="start">Height = loss</text><defs><clipPath id="momentum-landscape-clip"><rect x="12" y="145" width="696" height="262"/></clipPath></defs><g clip-path="url(#momentum-landscape-clip)"><polygon points="252.80,186.23 263.54,192.40 257.37,211.33 246.63,205.16" class="mf-surface-face" fill-opacity=".09"/><polygon points="246.63,205.16 257.37,211.33 251.21,228.25 240.47,222.08" class="mf-surface-face" fill-opacity=".09"/><polygon points="258.96,165.30 269.70,171.47 263.54,192.40 252.80,186.23" class="mf-surface-face" fill-opacity=".09"/><polygon points="240.47,222.08 251.21,228.25 245.05,243.16 234.31,237.00" class="mf-surface-face" fill-opacity=".09"/><polygon points="265.13,142.37 275.87,148.54 269.70,171.47 258.96,165.30" class="mf-surface-face" fill-opacity=".09"/><polygon points="263.54,192.40 274.28,198.25 268.11,217.18 257.37,211.33" class="mf-surface-face" fill-opacity=".09"/><polygon points="257.37,211.33 268.11,217.18 261.95,234.10 251.21,228.25" class="mf-surface-face" fill-opacity=".09"/><polygon points="269.70,171.47 280.44,177.33 274.28,198.25 263.54,192.40" class="mf-surface-face" fill-opacity=".09"/><polygon points="234.31,237.00 245.05,243.16 238.88,256.08 228.14,249.91" class="mf-surface-face" fill-opacity=".09"/><polygon points="251.21,228.25 261.95,234.10 255.79,249.02 245.05,243.16" class="mf-surface-face" fill-opacity=".09"/><polygon points="275.87,148.54 286.61,154.39 280.44,177.33 269.70,171.47" class="mf-surface-face" fill-opacity=".09"/><polygon points="274.28,198.25 285.02,203.79 278.85,222.71 268.11,217.18" class="mf-surface-face" fill-opacity=".09"/><polygon points="268.11,217.18 278.85,222.71 272.69,239.63 261.95,234.10" class="mf-surface-face" fill-opacity=".09"/><polygon points="280.44,177.33 291.18,182.86 285.02,203.79 274.28,198.25" class="mf-surface-face" fill-opacity=".09"/><polygon points="245.05,243.16 255.79,249.02 249.62,261.93 238.88,256.08" class="mf-surface-face" fill-opacity=".09"/><polygon points="261.95,234.10 272.69,239.63 266.52,254.55 255.79,249.02" class="mf-surface-face" fill-opacity=".09"/><polygon points="228.14,249.91 238.88,256.08 232.72,266.99 221.98,260.82" class="mf-surface-face" fill-opacity=".09"/><polygon points="286.61,154.39 297.34,159.93 291.18,182.86 280.44,177.33" class="mf-surface-face" fill-opacity=".09"/><polygon points="285.02,203.79 295.76,209.01 289.59,227.93 278.85,222.71" class="mf-surface-face" fill-opacity=".09"/><polygon points="278.85,222.71 289.59,227.93 283.43,244.85 272.69,239.63" class="mf-surface-face" fill-opacity=".09"/><polygon points="291.18,182.86 301.92,188.08 295.76,209.01 285.02,203.79" class="mf-surface-face" fill-opacity=".09"/><polygon points="255.79,249.02 266.52,254.55 260.36,267.46 249.62,261.93" class="mf-surface-face" fill-opacity=".09"/><polygon points="272.69,239.63 283.43,244.85 277.26,259.77 266.52,254.55" class="mf-surface-face" fill-opacity=".09"/><polygon points="238.88,256.08 249.62,261.93 243.46,272.84 232.72,266.99" class="mf-surface-face" fill-opacity=".09"/><polygon points="297.34,159.93 308.08,165.15 301.92,188.08 291.18,182.86" class="mf-surface-face" fill-opacity=".09"/><polygon points="295.76,209.01 306.50,213.91 300.33,232.83 289.59,227.93" class="mf-surface-face" fill-opacity=".09"/><polygon points="289.59,227.93 300.33,232.83 294.17,249.75 283.43,244.85" class="mf-surface-face" fill-opacity=".09"/><polygon points="301.92,188.08 312.66,192.98 306.50,213.91 295.76,209.01" class="mf-surface-face" fill-opacity=".09"/><polygon points="221.98,260.82 232.72,266.99 226.55,275.89 215.81,269.72" class="mf-surface-face" fill-opacity=".09"/><polygon points="266.52,254.55 277.26,259.77 271.10,272.68 260.36,267.46" class="mf-surface-face" fill-opacity=".09"/><polygon points="249.62,261.93 260.36,267.46 254.20,278.37 243.46,272.84" class="mf-surface-face" fill-opacity=".09"/><polygon points="283.43,244.85 294.17,249.75 288.00,264.67 277.26,259.77" class="mf-surface-face" fill-opacity=".09"/><polygon points="308.08,165.15 318.82,170.05 312.66,192.98 301.92,188.08" class="mf-surface-face" fill-opacity=".09"/><polygon points="306.50,213.91 317.23,218.49 311.07,237.42 300.33,232.83" class="mf-surface-face" fill-opacity=".09"/><polygon points="232.72,266.99 243.46,272.84 237.29,281.74 226.55,275.89" class="mf-surface-face" fill-opacity=".09"/><polygon points="300.33,232.83 311.07,237.42 304.91,254.34 294.17,249.75" class="mf-surface-face" fill-opacity=".09"/><polygon points="312.66,192.98 323.40,197.56 317.23,218.49 306.50,213.91" class="mf-surface-face" fill-opacity=".09"/><polygon points="277.26,259.77 288.00,264.67 281.84,277.58 271.10,272.68" class="mf-surface-face" fill-opacity=".09"/><polygon points="260.36,267.46 271.10,272.68 264.94,283.59 254.20,278.37" class="mf-surface-face" fill-opacity=".09"/><polygon points="294.17,249.75 304.91,254.34 298.74,269.25 288.00,264.67" class="mf-surface-face" fill-opacity=".09"/><polygon points="318.82,170.05 329.56,174.63 323.40,197.56 312.66,192.98" class="mf-surface-face" fill-opacity=".09"/><polygon points="243.46,272.84 254.20,278.37 248.03,287.28 237.29,281.74" class="mf-surface-face" fill-opacity=".09"/><polygon points="215.81,269.72 226.55,275.89 220.39,282.79 209.65,276.63" class="mf-surface-face" fill-opacity=".09"/><polygon points="317.23,218.49 327.97,222.76 321.81,241.68 311.07,237.42" class="mf-surface-face" fill-opacity=".09"/><polygon points="311.07,237.42 321.81,241.68 315.65,258.61 304.91,254.34" class="mf-surface-face" fill-opacity=".09"/><polygon points="323.40,197.56 334.14,201.83 327.97,222.76 317.23,218.49" class="mf-surface-face" fill-opacity=".09"/><polygon points="288.00,264.67 298.74,269.25 292.58,282.17 281.84,277.58" class="mf-surface-face" fill-opacity=".09"/><polygon points="271.10,272.68 281.84,277.58 275.67,288.49 264.94,283.59" class="mf-surface-face" fill-opacity=".09"/><polygon points="304.91,254.34 315.65,258.61 309.48,273.52 298.74,269.25" class="mf-surface-face" fill-opacity=".09"/><polygon points="226.55,275.89 237.29,281.74 231.13,288.65 220.39,282.79" class="mf-surface-face" fill-opacity=".09"/><polygon points="329.56,174.63 340.30,178.90 334.14,201.83 323.40,197.56" class="mf-surface-face" fill-opacity=".09"/><polygon points="254.20,278.37 264.94,283.59 258.77,292.50 248.03,287.28" class="mf-surface-face" fill-opacity=".09"/><polygon points="327.97,222.76 338.71,226.71 332.55,245.64 321.81,241.68" class="mf-surface-face" fill-opacity=".09"/><polygon points="321.81,241.68 332.55,245.64 326.38,262.56 315.65,258.61" class="mf-surface-face" fill-opacity=".09"/><polygon points="298.74,269.25 309.48,273.52 303.32,286.44 292.58,282.17" class="mf-surface-face" fill-opacity=".09"/><polygon points="334.14,201.83 344.88,205.78 338.71,226.71 327.97,222.76" class="mf-surface-face" fill-opacity=".09"/><polygon points="281.84,277.58 292.58,282.17 286.41,293.08 275.67,288.49" class="mf-surface-face" fill-opacity=".09"/><polygon points="237.29,281.74 248.03,287.28 241.87,294.18 231.13,288.65" class="mf-surface-face" fill-opacity=".09"/><polygon points="315.65,258.61 326.38,262.56 320.22,277.47 309.48,273.52" class="mf-surface-face" fill-opacity=".09"/><polygon points="264.94,283.59 275.67,288.49 269.51,297.40 258.77,292.50" class="mf-surface-face" fill-opacity=".09"/><polygon points="340.30,178.90 351.04,182.85 344.88,205.78 334.14,201.83" class="mf-surface-face" fill-opacity=".09"/><polygon points="209.65,276.63 220.39,282.79 214.23,287.69 203.49,281.52" class="mf-surface-face" fill-opacity=".09"/><polygon points="338.71,226.71 349.45,230.34 343.29,249.27 332.55,245.64" class="mf-surface-face" fill-opacity=".09"/><polygon points="292.58,282.17 303.32,286.44 297.15,297.35 286.41,293.08" class="mf-surface-face" fill-opacity=".09"/><polygon points="332.55,245.64 343.29,249.27 337.12,266.19 326.38,262.56" class="mf-surface-face" fill-opacity=".09"/><polygon points="309.48,273.52 320.22,277.47 314.06,290.39 303.32,286.44" class="mf-surface-face" fill-opacity=".09"/><polygon points="248.03,287.28 258.77,292.50 252.61,299.40 241.87,294.18" class="mf-surface-face" fill-opacity=".09"/><polygon points="344.88,205.78 355.62,209.42 349.45,230.34 338.71,226.71" class="mf-surface-face" fill-opacity=".09"/><polygon points="275.67,288.49 286.41,293.08 280.25,301.98 269.51,297.40" class="mf-surface-face" fill-opacity=".09"/><polygon points="220.39,282.79 231.13,288.65 224.96,293.54 214.23,287.69" class="mf-surface-face" fill-opacity=".09"/><polygon points="326.38,262.56 337.12,266.19 330.96,281.11 320.22,277.47" class="mf-surface-face" fill-opacity=".09"/><polygon points="351.04,182.85 361.78,186.48 355.62,209.42 344.88,205.78" class="mf-surface-face" fill-opacity=".09"/><polygon points="258.77,292.50 269.51,297.40 263.35,304.30 252.61,299.40" class="mf-surface-face" fill-opacity=".09"/><polygon points="349.45,230.34 360.19,233.66 354.03,252.59 343.29,249.27" class="mf-surface-face" fill-opacity=".09"/><polygon points="303.32,286.44 314.06,290.39 307.89,301.30 297.15,297.35" class="mf-surface-face" fill-opacity=".09"/><polygon points="320.22,277.47 330.96,281.11 324.80,294.02 314.06,290.39" class="mf-surface-face" fill-opacity=".09"/><polygon points="231.13,288.65 241.87,294.18 235.70,299.08 224.96,293.54" class="mf-surface-face" fill-opacity=".09"/><polygon points="343.29,249.27 354.03,252.59 347.86,269.51 337.12,266.19" class="mf-surface-face" fill-opacity=".09"/><polygon points="355.62,209.42 366.36,212.73 360.19,233.66 349.45,230.34" class="mf-surface-face" fill-opacity=".09"/><polygon points="286.41,293.08 297.15,297.35 290.99,306.25 280.25,301.98" class="mf-surface-face" fill-opacity=".09"/><polygon points="337.12,266.19 347.86,269.51 341.70,284.42 330.96,281.11" class="mf-surface-face" fill-opacity=".09"/><polygon points="361.78,186.48 372.52,189.80 366.36,212.73 355.62,209.42" class="mf-surface-face" fill-opacity=".09"/><polygon points="203.49,281.52 214.23,287.69 208.06,290.59 197.32,284.42" class="mf-surface-face" fill-opacity=".09"/><polygon points="269.51,297.40 280.25,301.98 274.09,308.88 263.35,304.30" class="mf-surface-face" fill-opacity=".09"/><polygon points="241.87,294.18 252.61,299.40 246.44,304.30 235.70,299.08" class="mf-surface-face" fill-opacity=".09"/><polygon points="314.06,290.39 324.80,294.02 318.63,304.93 307.89,301.30" class="mf-surface-face" fill-opacity=".09"/><polygon points="360.19,233.66 370.93,236.66 364.77,255.59 354.03,252.59" class="mf-surface-face" fill-opacity=".09"/><polygon points="330.96,281.11 341.70,284.42 335.54,297.34 324.80,294.02" class="mf-surface-face" fill-opacity=".09"/><polygon points="354.03,252.59 364.77,255.59 358.60,272.51 347.86,269.51" class="mf-surface-face" fill-opacity=".09"/><polygon points="297.15,297.35 307.89,301.30 301.73,310.20 290.99,306.25" class="mf-surface-face" fill-opacity=".09"/><polygon points="366.36,212.73 377.09,215.73 370.93,236.66 360.19,233.66" class="mf-surface-face" fill-opacity=".09"/><polygon points="214.23,287.69 224.96,293.54 218.80,296.44 208.06,290.59" class="mf-surface-face" fill-opacity=".09"/><polygon points="347.86,269.51 358.60,272.51 352.44,287.42 341.70,284.42" class="mf-surface-face" fill-opacity=".09"/><polygon points="252.61,299.40 263.35,304.30 257.18,309.20 246.44,304.30" class="mf-surface-face" fill-opacity=".09"/><polygon points="372.52,189.80 383.26,192.80 377.09,215.73 366.36,212.73" class="mf-surface-face" fill-opacity=".09"/><polygon points="280.25,301.98 290.99,306.25 284.83,313.15 274.09,308.88" class="mf-surface-face" fill-opacity=".09"/><polygon points="324.80,294.02 335.54,297.34 329.37,308.25 318.63,304.93" class="mf-surface-face" fill-opacity=".09"/><polygon points="224.96,293.54 235.70,299.08 229.54,301.97 218.80,296.44" class="mf-surface-face" fill-opacity=".09"/><polygon points="307.89,301.30 318.63,304.93 312.47,313.84 301.73,310.20" class="mf-surface-face" fill-opacity=".09"/><polygon points="341.70,284.42 352.44,287.42 346.27,300.34 335.54,297.34" class="mf-surface-face" fill-opacity=".09"/><polygon points="370.93,236.66 381.67,239.34 375.51,258.27 364.77,255.59" class="mf-surface-face" fill-opacity=".09"/><polygon points="364.77,255.59 375.51,258.27 369.34,275.19 358.60,272.51" class="mf-surface-face" fill-opacity=".09"/><polygon points="377.09,215.73 387.83,218.42 381.67,239.34 370.93,236.66" class="mf-surface-face" fill-opacity=".09"/><polygon points="263.35,304.30 274.09,308.88 267.92,313.78 257.18,309.20" class="mf-surface-face" fill-opacity=".09"/><polygon points="290.99,306.25 301.73,310.20 295.56,317.10 284.83,313.15" class="mf-surface-face" fill-opacity=".09"/><polygon points="358.60,272.51 369.34,275.19 363.18,290.11 352.44,287.42" class="mf-surface-face" fill-opacity=".09"/><polygon points="383.26,192.80 394.00,195.48 387.83,218.42 377.09,215.73" class="mf-surface-face" fill-opacity=".09"/><polygon points="235.70,299.08 246.44,304.30 240.28,307.19 229.54,301.97" class="mf-surface-face" fill-opacity=".09"/><polygon points="197.32,284.42 208.06,290.59 201.90,291.48 191.16,285.31" class="mf-surface-face" fill-opacity=".09"/><polygon points="335.54,297.34 346.27,300.34 340.11,311.25 329.37,308.25" class="mf-surface-face" fill-opacity=".09"/><polygon points="318.63,304.93 329.37,308.25 323.21,317.15 312.47,313.84" class="mf-surface-face" fill-opacity=".09"/><polygon points="352.44,287.42 363.18,290.11 357.01,303.02 346.27,300.34" class="mf-surface-face" fill-opacity=".09"/><polygon points="381.67,239.34 392.41,241.71 386.25,260.64 375.51,258.27" class="mf-surface-face" fill-opacity=".09"/><polygon points="274.09,308.88 284.83,313.15 278.66,318.05 267.92,313.78" class="mf-surface-face" fill-opacity=".09"/><polygon points="375.51,258.27 386.25,260.64 380.08,277.56 369.34,275.19" class="mf-surface-face" fill-opacity=".09"/><polygon points="387.83,218.42 398.57,220.78 392.41,241.71 381.67,239.34" class="mf-surface-face" fill-opacity=".09"/><polygon points="301.73,310.20 312.47,313.84 306.30,320.74 295.56,317.10" class="mf-surface-face" fill-opacity=".09"/><polygon points="208.06,290.59 218.80,296.44 212.64,297.33 201.90,291.48" class="mf-surface-face" fill-opacity=".09"/><polygon points="246.44,304.30 257.18,309.20 251.02,312.09 240.28,307.19" class="mf-surface-face" fill-opacity=".09"/><polygon points="369.34,275.19 380.08,277.56 373.92,292.47 363.18,290.11" class="mf-surface-face" fill-opacity=".09"/><polygon points="394.00,195.48 404.74,197.85 398.57,220.78 387.83,218.42" class="mf-surface-face" fill-opacity=".09"/><polygon points="346.27,300.34 357.01,303.02 350.85,313.93 340.11,311.25" class="mf-surface-face" fill-opacity=".09"/><polygon points="329.37,308.25 340.11,311.25 333.95,320.15 323.21,317.15" class="mf-surface-face" fill-opacity=".09"/><polygon points="218.80,296.44 229.54,301.97 223.38,302.86 212.64,297.33" class="mf-surface-face" fill-opacity=".09"/><polygon points="284.83,313.15 295.56,317.10 289.40,322.00 278.66,318.05" class="mf-surface-face" fill-opacity=".09"/><polygon points="363.18,290.11 373.92,292.47 367.75,305.39 357.01,303.02" class="mf-surface-face" fill-opacity=".09"/><polygon points="257.18,309.20 267.92,313.78 261.76,316.68 251.02,312.09" class="mf-surface-face" fill-opacity=".09"/><polygon points="392.41,241.71 403.15,243.76 396.98,262.69 386.25,260.64" class="mf-surface-face" fill-opacity=".09"/><polygon points="386.25,260.64 396.98,262.69 390.82,279.61 380.08,277.56" class="mf-surface-face" fill-opacity=".09"/><polygon points="312.47,313.84 323.21,317.15 317.04,324.05 306.30,320.74" class="mf-surface-face" fill-opacity=".09"/><polygon points="398.57,220.78 409.31,222.83 403.15,243.76 392.41,241.71" class="mf-surface-face" fill-opacity=".09"/><polygon points="380.08,277.56 390.82,279.61 384.66,294.52 373.92,292.47" class="mf-surface-face" fill-opacity=".09"/><polygon points="229.54,301.97 240.28,307.19 234.12,308.08 223.38,302.86" class="mf-surface-face" fill-opacity=".09"/><polygon points="404.74,197.85 415.48,199.90 409.31,222.83 398.57,220.78" class="mf-surface-face" fill-opacity=".09"/><polygon points="295.56,317.10 306.30,320.74 300.14,325.63 289.40,322.00" class="mf-surface-face" fill-opacity=".09"/><polygon points="357.01,303.02 367.75,305.39 361.59,316.30 350.85,313.93" class="mf-surface-face" fill-opacity=".09"/><polygon points="340.11,311.25 350.85,313.93 344.69,322.84 333.95,320.15" class="mf-surface-face" fill-opacity=".09"/><polygon points="267.92,313.78 278.66,318.05 272.50,320.94 261.76,316.68" class="mf-surface-face" fill-opacity=".09"/><polygon points="191.16,285.31 201.90,291.48 195.73,290.36 184.99,284.19" class="mf-surface-face" fill-opacity=".09"/><polygon points="373.92,292.47 384.66,294.52 378.49,307.44 367.75,305.39" class="mf-surface-face" fill-opacity=".09"/><polygon points="323.21,317.15 333.95,320.15 327.78,327.05 317.04,324.05" class="mf-surface-face" fill-opacity=".09"/><polygon points="403.15,243.76 413.89,245.49 407.72,264.42 396.98,262.69" class="mf-surface-face" fill-opacity=".09"/><polygon points="396.98,262.69 407.72,264.42 401.56,281.34 390.82,279.61" class="mf-surface-face" fill-opacity=".09"/><polygon points="240.28,307.19 251.02,312.09 244.85,312.98 234.12,308.08" class="mf-surface-face" fill-opacity=".09"/><polygon points="409.31,222.83 420.05,224.56 413.89,245.49 403.15,243.76" class="mf-surface-face" fill-opacity=".09"/><polygon points="201.90,291.48 212.64,297.33 206.47,296.22 195.73,290.36" class="mf-surface-face" fill-opacity=".09"/><polygon points="390.82,279.61 401.56,281.34 395.40,296.26 384.66,294.52" class="mf-surface-face" fill-opacity=".09"/><polygon points="278.66,318.05 289.40,322.00 283.24,324.90 272.50,320.94" class="mf-surface-face" fill-opacity=".09"/><polygon points="306.30,320.74 317.04,324.05 310.88,328.95 300.14,325.63" class="mf-surface-face" fill-opacity=".09"/><polygon points="415.48,199.90 426.22,201.63 420.05,224.56 409.31,222.83" class="mf-surface-face" fill-opacity=".09"/><polygon points="350.85,313.93 361.59,316.30 355.42,325.20 344.69,322.84" class="mf-surface-face" fill-opacity=".09"/><polygon points="367.75,305.39 378.49,307.44 372.33,318.35 361.59,316.30" class="mf-surface-face" fill-opacity=".09"/><polygon points="251.02,312.09 261.76,316.68 255.59,317.57 244.85,312.98" class="mf-surface-face" fill-opacity=".09"/><polygon points="333.95,320.15 344.69,322.84 338.52,329.74 327.78,327.05" class="mf-surface-face" fill-opacity=".09"/><polygon points="384.66,294.52 395.40,296.26 389.23,309.17 378.49,307.44" class="mf-surface-face" fill-opacity=".09"/><polygon points="212.64,297.33 223.38,302.86 217.21,301.75 206.47,296.22" class="mf-surface-face" fill-opacity=".09"/><polygon points="413.89,245.49 424.63,246.91 418.46,265.83 407.72,264.42" class="mf-surface-face" fill-opacity=".09"/><polygon points="407.72,264.42 418.46,265.83 412.30,282.75 401.56,281.34" class="mf-surface-face" fill-opacity=".09"/><polygon points="420.05,224.56 430.79,225.98 424.63,246.91 413.89,245.49" class="mf-surface-face" fill-opacity=".09"/><polygon points="289.40,322.00 300.14,325.63 293.98,328.53 283.24,324.90" class="mf-surface-face" fill-opacity=".09"/><polygon points="317.04,324.05 327.78,327.05 321.62,331.95 310.88,328.95" class="mf-surface-face" fill-opacity=".09"/><polygon points="401.56,281.34 412.30,282.75 406.13,297.67 395.40,296.26" class="mf-surface-face" fill-opacity=".09"/><polygon points="223.38,302.86 234.12,308.08 227.95,306.97 217.21,301.75" class="mf-surface-face" fill-opacity=".09"/><polygon points="426.22,201.63 436.96,203.05 430.79,225.98 420.05,224.56" class="mf-surface-face" fill-opacity=".09"/><polygon points="261.76,316.68 272.50,320.94 266.33,321.84 255.59,317.57" class="mf-surface-face" fill-opacity=".09"/><polygon points="361.59,316.30 372.33,318.35 366.16,327.25 355.42,325.20" class="mf-surface-face" fill-opacity=".09"/><polygon points="378.49,307.44 389.23,309.17 383.07,320.08 372.33,318.35" class="mf-surface-face" fill-opacity=".09"/><polygon points="344.69,322.84 355.42,325.20 349.26,332.10 338.52,329.74" class="mf-surface-face" fill-opacity=".09"/><polygon points="395.40,296.26 406.13,297.67 399.97,310.58 389.23,309.17" class="mf-surface-face" fill-opacity=".09"/><polygon points="184.99,284.19 195.73,290.36 189.57,287.25 178.83,281.08" class="mf-surface-face" fill-opacity=".09"/><polygon points="300.14,325.63 310.88,328.95 304.71,331.85 293.98,328.53" class="mf-surface-face" fill-opacity=".09"/><polygon points="424.63,246.91 435.37,248.01 429.20,266.93 418.46,265.83" class="mf-surface-face" fill-opacity=".09"/><polygon points="234.12,308.08 244.85,312.98 238.69,311.87 227.95,306.97" class="mf-surface-face" fill-opacity=".09"/><polygon points="418.46,265.83 429.20,266.93 423.04,283.85 412.30,282.75" class="mf-surface-face" fill-opacity=".09"/><polygon points="327.78,327.05 338.52,329.74 332.36,334.64 321.62,331.95" class="mf-surface-face" fill-opacity=".09"/><polygon points="430.79,225.98 441.53,227.08 435.37,248.01 424.63,246.91" class="mf-surface-face" fill-opacity=".09"/><polygon points="272.50,320.94 283.24,324.90 277.07,325.79 266.33,321.84" class="mf-surface-face" fill-opacity=".09"/><polygon points="412.30,282.75 423.04,283.85 416.87,298.77 406.13,297.67" class="mf-surface-face" fill-opacity=".09"/><polygon points="195.73,290.36 206.47,296.22 200.31,293.10 189.57,287.25" class="mf-surface-face" fill-opacity=".09"/><polygon points="372.33,318.35 383.07,320.08 376.90,328.98 366.16,327.25" class="mf-surface-face" fill-opacity=".09"/><polygon points="436.96,203.05 447.69,204.15 441.53,227.08 430.79,225.98" class="mf-surface-face" fill-opacity=".09"/><polygon points="389.23,309.17 399.97,310.58 393.81,321.49 383.07,320.08" class="mf-surface-face" fill-opacity=".09"/><polygon points="355.42,325.20 366.16,327.25 360.00,334.15 349.26,332.10" class="mf-surface-face" fill-opacity=".09"/><polygon points="244.85,312.98 255.59,317.57 249.43,316.45 238.69,311.87" class="mf-surface-face" fill-opacity=".09"/><polygon points="310.88,328.95 321.62,331.95 315.45,334.85 304.71,331.85" class="mf-surface-face" fill-opacity=".09"/><polygon points="406.13,297.67 416.87,298.77 410.71,311.68 399.97,310.58" class="mf-surface-face" fill-opacity=".09"/><polygon points="283.24,324.90 293.98,328.53 287.81,329.42 277.07,325.79" class="mf-surface-face" fill-opacity=".09"/><polygon points="206.47,296.22 217.21,301.75 211.05,298.63 200.31,293.10" class="mf-surface-face" fill-opacity=".09"/><polygon points="338.52,329.74 349.26,332.10 343.10,337.00 332.36,334.64" class="mf-surface-face" fill-opacity=".09"/><polygon points="435.37,248.01 446.11,248.79 439.94,267.71 429.20,266.93" class="mf-surface-face" fill-opacity=".09"/><polygon points="429.20,266.93 439.94,267.71 433.78,284.63 423.04,283.85" class="mf-surface-face" fill-opacity=".09"/><polygon points="441.53,227.08 452.27,227.86 446.11,248.79 435.37,248.01" class="mf-surface-face" fill-opacity=".09"/><polygon points="423.04,283.85 433.78,284.63 427.61,299.55 416.87,298.77" class="mf-surface-face" fill-opacity=".09"/><polygon points="255.59,317.57 266.33,321.84 260.17,320.72 249.43,316.45" class="mf-surface-face" fill-opacity=".09"/><polygon points="383.07,320.08 393.81,321.49 387.64,330.40 376.90,328.98" class="mf-surface-face" fill-opacity=".09"/><polygon points="447.69,204.15 458.43,204.93 452.27,227.86 441.53,227.08" class="mf-surface-face" fill-opacity=".09"/><polygon points="399.97,310.58 410.71,311.68 404.55,322.59 393.81,321.49" class="mf-surface-face" fill-opacity=".09"/><polygon points="366.16,327.25 376.90,328.98 370.74,335.89 360.00,334.15" class="mf-surface-face" fill-opacity=".09"/><polygon points="217.21,301.75 227.95,306.97 221.79,303.85 211.05,298.63" class="mf-surface-face" fill-opacity=".09"/><polygon points="321.62,331.95 332.36,334.64 326.19,337.53 315.45,334.85" class="mf-surface-face" fill-opacity=".09"/><polygon points="293.98,328.53 304.71,331.85 298.55,332.74 287.81,329.42" class="mf-surface-face" fill-opacity=".09"/><polygon points="416.87,298.77 427.61,299.55 421.45,312.47 410.71,311.68" class="mf-surface-face" fill-opacity=".09"/><polygon points="349.26,332.10 360.00,334.15 353.84,339.05 343.10,337.00" class="mf-surface-face" fill-opacity=".09"/><polygon points="266.33,321.84 277.07,325.79 270.91,324.67 260.17,320.72" class="mf-surface-face" fill-opacity=".09"/><polygon points="446.11,248.79 456.84,249.25 450.68,268.18 439.94,267.71" class="mf-surface-face" fill-opacity=".09"/><polygon points="439.94,267.71 450.68,268.18 444.52,285.10 433.78,284.63" class="mf-surface-face" fill-opacity=".09"/><polygon points="227.95,306.97 238.69,311.87 232.53,308.75 221.79,303.85" class="mf-surface-face" fill-opacity=".09"/><polygon points="452.27,227.86 463.01,228.33 456.84,249.25 446.11,248.79" class="mf-surface-face" fill-opacity=".09"/><polygon points="178.83,281.08 189.57,287.25 183.41,282.13 172.67,275.96" class="mf-surface-face" fill-opacity=".09"/><polygon points="393.81,321.49 404.55,322.59 398.38,331.50 387.64,330.40" class="mf-surface-face" fill-opacity=".09"/><polygon points="433.78,284.63 444.52,285.10 438.35,300.02 427.61,299.55" class="mf-surface-face" fill-opacity=".09"/><polygon points="304.71,331.85 315.45,334.85 309.29,335.74 298.55,332.74" class="mf-surface-face" fill-opacity=".09"/><polygon points="332.36,334.64 343.10,337.00 336.93,339.90 326.19,337.53" class="mf-surface-face" fill-opacity=".09"/><polygon points="376.90,328.98 387.64,330.40 381.48,337.30 370.74,335.89" class="mf-surface-face" fill-opacity=".09"/><polygon points="410.71,311.68 421.45,312.47 415.29,323.37 404.55,322.59" class="mf-surface-face" fill-opacity=".09"/><polygon points="458.43,204.93 469.17,205.39 463.01,228.33 452.27,227.86" class="mf-surface-face" fill-opacity=".09"/><polygon points="189.57,287.25 200.31,293.10 194.14,287.98 183.41,282.13" class="mf-surface-face" fill-opacity=".09"/><polygon points="238.69,311.87 249.43,316.45 243.27,313.34 232.53,308.75" class="mf-surface-face" fill-opacity=".09"/><polygon points="277.07,325.79 287.81,329.42 281.65,328.31 270.91,324.67" class="mf-surface-face" fill-opacity=".09"/><polygon points="360.00,334.15 370.74,335.89 364.58,340.78 353.84,339.05" class="mf-surface-face" fill-opacity=".09"/><polygon points="427.61,299.55 438.35,300.02 432.19,312.93 421.45,312.47" class="mf-surface-face" fill-opacity=".09"/><polygon points="456.84,249.25 467.58,249.40 461.42,268.33 450.68,268.18" class="mf-surface-face" fill-opacity=".09"/><polygon points="450.68,268.18 461.42,268.33 455.26,285.25 444.52,285.10" class="mf-surface-face" fill-opacity=".09"/><polygon points="200.31,293.10 211.05,298.63 204.88,293.51 194.14,287.98" class="mf-surface-face" fill-opacity=".09"/><polygon points="463.01,228.33 473.75,228.47 467.58,249.40 456.84,249.25" class="mf-surface-face" fill-opacity=".09"/><polygon points="315.45,334.85 326.19,337.53 320.03,338.42 309.29,335.74" class="mf-surface-face" fill-opacity=".09"/><polygon points="343.10,337.00 353.84,339.05 347.67,341.95 336.93,339.90" class="mf-surface-face" fill-opacity=".09"/><polygon points="404.55,322.59 415.29,323.37 409.12,332.28 398.38,331.50" class="mf-surface-face" fill-opacity=".09"/><polygon points="249.43,316.45 260.17,320.72 254.00,317.60 243.27,313.34" class="mf-surface-face" fill-opacity=".09"/><polygon points="387.64,330.40 398.38,331.50 392.22,338.40 381.48,337.30" class="mf-surface-face" fill-opacity=".09"/><polygon points="444.52,285.10 455.26,285.25 449.09,300.17 438.35,300.02" class="mf-surface-face" fill-opacity=".09"/><polygon points="287.81,329.42 298.55,332.74 292.39,331.62 281.65,328.31" class="mf-surface-face" fill-opacity=".09"/><polygon points="421.45,312.47 432.19,312.93 426.02,323.84 415.29,323.37" class="mf-surface-face" fill-opacity=".09"/><polygon points="469.17,205.39 479.91,205.54 473.75,228.47 463.01,228.33" class="mf-surface-face" fill-opacity=".09"/><polygon points="370.74,335.89 381.48,337.30 375.31,342.20 364.58,340.78" class="mf-surface-face" fill-opacity=".09"/><polygon points="211.05,298.63 221.79,303.85 215.62,298.73 204.88,293.51" class="mf-surface-face" fill-opacity=".09"/><polygon points="438.35,300.02 449.09,300.17 442.93,313.08 432.19,312.93" class="mf-surface-face" fill-opacity=".09"/><polygon points="260.17,320.72 270.91,324.67 264.74,321.56 254.00,317.60" class="mf-surface-face" fill-opacity=".09"/><polygon points="326.19,337.53 336.93,339.90 330.77,340.79 320.03,338.42" class="mf-surface-face" fill-opacity=".09"/><polygon points="467.58,249.40 478.32,249.23 472.16,268.16 461.42,268.33" class="mf-surface-face" fill-opacity=".09"/><polygon points="353.84,339.05 364.58,340.78 358.41,343.68 347.67,341.95" class="mf-surface-face" fill-opacity=".09"/><polygon points="461.42,268.33 472.16,268.16 466.00,285.08 455.26,285.25" class="mf-surface-face" fill-opacity=".09"/><polygon points="298.55,332.74 309.29,335.74 303.13,334.62 292.39,331.62" class="mf-surface-face" fill-opacity=".09"/><polygon points="473.75,228.47 484.49,228.31 478.32,249.23 467.58,249.40" class="mf-surface-face" fill-opacity=".09"/><polygon points="221.79,303.85 232.53,308.75 226.36,303.63 215.62,298.73" class="mf-surface-face" fill-opacity=".09"/><polygon points="415.29,323.37 426.02,323.84 419.86,332.75 409.12,332.28" class="mf-surface-face" fill-opacity=".09"/><polygon points="398.38,331.50 409.12,332.28 402.96,339.18 392.22,338.40" class="mf-surface-face" fill-opacity=".09"/><polygon points="455.26,285.25 466.00,285.08 459.83,300.00 449.09,300.17" class="mf-surface-face" fill-opacity=".09"/><polygon points="432.19,312.93 442.93,313.08 436.76,323.99 426.02,323.84" class="mf-surface-face" fill-opacity=".09"/><polygon points="172.67,275.96 183.41,282.13 177.24,275.00 166.50,268.83" class="mf-surface-face" fill-opacity=".09"/><polygon points="479.91,205.54 490.65,205.37 484.49,228.31 473.75,228.47" class="mf-surface-face" fill-opacity=".09"/><polygon points="381.48,337.30 392.22,338.40 386.05,343.30 375.31,342.20" class="mf-surface-face" fill-opacity=".09"/><polygon points="270.91,324.67 281.65,328.31 275.48,325.19 264.74,321.56" class="mf-surface-face" fill-opacity=".09"/><polygon points="336.93,339.90 347.67,341.95 341.51,342.84 330.77,340.79" class="mf-surface-face" fill-opacity=".09"/><polygon points="232.53,308.75 243.27,313.34 237.10,308.22 226.36,303.63" class="mf-surface-face" fill-opacity=".09"/><polygon points="449.09,300.17 459.83,300.00 453.67,312.91 442.93,313.08" class="mf-surface-face" fill-opacity=".09"/><polygon points="309.29,335.74 320.03,338.42 313.87,337.31 303.13,334.62" class="mf-surface-face" fill-opacity=".09"/><polygon points="183.41,282.13 194.14,287.98 187.98,280.85 177.24,275.00" class="mf-surface-face" fill-opacity=".09"/><polygon points="364.58,340.78 375.31,342.20 369.15,345.09 358.41,343.68" class="mf-surface-face" fill-opacity=".09"/><polygon points="478.32,249.23 489.06,248.75 482.90,267.67 472.16,268.16" class="mf-surface-face" fill-opacity=".09"/><polygon points="472.16,268.16 482.90,267.67 476.73,284.59 466.00,285.08" class="mf-surface-face" fill-opacity=".09"/><polygon points="409.12,332.28 419.86,332.75 413.70,339.65 402.96,339.18" class="mf-surface-face" fill-opacity=".09"/><polygon points="426.02,323.84 436.76,323.99 430.60,332.89 419.86,332.75" class="mf-surface-face" fill-opacity=".09"/><polygon points="484.49,228.31 495.23,227.82 489.06,248.75 478.32,249.23" class="mf-surface-face" fill-opacity=".09"/><polygon points="281.65,328.31 292.39,331.62 286.22,328.51 275.48,325.19" class="mf-surface-face" fill-opacity=".09"/><polygon points="243.27,313.34 254.00,317.60 247.84,312.48 237.10,308.22" class="mf-surface-face" fill-opacity=".09"/><polygon points="466.00,285.08 476.73,284.59 470.57,299.51 459.83,300.00" class="mf-surface-face" fill-opacity=".09"/><polygon points="194.14,287.98 204.88,293.51 198.72,286.39 187.98,280.85" class="mf-surface-face" fill-opacity=".09"/><polygon points="392.22,338.40 402.96,339.18 396.79,344.08 386.05,343.30" class="mf-surface-face" fill-opacity=".09"/><polygon points="442.93,313.08 453.67,312.91 447.50,323.82 436.76,323.99" class="mf-surface-face" fill-opacity=".09"/><polygon points="490.65,205.37 501.39,204.89 495.23,227.82 484.49,228.31" class="mf-surface-face" fill-opacity=".09"/><polygon points="347.67,341.95 358.41,343.68 352.25,344.57 341.51,342.84" class="mf-surface-face" fill-opacity=".09"/><polygon points="320.03,338.42 330.77,340.79 324.60,339.67 313.87,337.31" class="mf-surface-face" fill-opacity=".09"/><polygon points="375.31,342.20 386.05,343.30 379.89,346.19 369.15,345.09" class="mf-surface-face" fill-opacity=".09"/><polygon points="459.83,300.00 470.57,299.51 464.41,312.42 453.67,312.91" class="mf-surface-face" fill-opacity=".09"/><polygon points="204.88,293.51 215.62,298.73 209.46,291.61 198.72,286.39" class="mf-surface-face" fill-opacity=".09"/><polygon points="292.39,331.62 303.13,334.62 296.96,331.51 286.22,328.51" class="mf-surface-face" fill-opacity=".09"/><polygon points="254.00,317.60 264.74,321.56 258.58,316.43 247.84,312.48" class="mf-surface-face" fill-opacity=".09"/><polygon points="489.06,248.75 499.80,247.95 493.64,266.87 482.90,267.67" class="mf-surface-face" fill-opacity=".09"/><polygon points="419.86,332.75 430.60,332.89 424.44,339.80 413.70,339.65" class="mf-surface-face" fill-opacity=".09"/><polygon points="436.76,323.99 447.50,323.82 441.34,332.72 430.60,332.89" class="mf-surface-face" fill-opacity=".09"/><polygon points="482.90,267.67 493.64,266.87 487.47,283.79 476.73,284.59" class="mf-surface-face" fill-opacity=".09"/><polygon points="495.23,227.82 505.97,227.02 499.80,247.95 489.06,248.75" class="mf-surface-face" fill-opacity=".09"/><polygon points="402.96,339.18 413.70,339.65 407.53,344.54 396.79,344.08" class="mf-surface-face" fill-opacity=".09"/><polygon points="453.67,312.91 464.41,312.42 458.24,323.33 447.50,323.82" class="mf-surface-face" fill-opacity=".09"/><polygon points="358.41,343.68 369.15,345.09 362.99,345.98 352.25,344.57" class="mf-surface-face" fill-opacity=".09"/><polygon points="330.77,340.79 341.51,342.84 335.34,341.72 324.60,339.67" class="mf-surface-face" fill-opacity=".09"/><polygon points="215.62,298.73 226.36,303.63 220.20,296.51 209.46,291.61" class="mf-surface-face" fill-opacity=".09"/><polygon points="476.73,284.59 487.47,283.79 481.31,298.71 470.57,299.51" class="mf-surface-face" fill-opacity=".09"/><polygon points="501.39,204.89 512.13,204.09 505.97,227.02 495.23,227.82" class="mf-surface-face" fill-opacity=".09"/><polygon points="264.74,321.56 275.48,325.19 269.32,320.07 258.58,316.43" class="mf-surface-face" fill-opacity=".09"/><polygon points="386.05,343.30 396.79,344.08 390.63,346.97 379.89,346.19" class="mf-surface-face" fill-opacity=".09"/><polygon points="303.13,334.62 313.87,337.31 307.70,334.19 296.96,331.51" class="mf-surface-face" fill-opacity=".09"/><polygon points="166.50,268.83 177.24,275.00 171.08,265.87 160.34,259.70" class="mf-surface-face" fill-opacity=".09"/><polygon points="470.57,299.51 481.31,298.71 475.15,311.62 464.41,312.42" class="mf-surface-face" fill-opacity=".09"/><polygon points="226.36,303.63 237.10,308.22 230.94,301.09 220.20,296.51" class="mf-surface-face" fill-opacity=".09"/><polygon points="430.60,332.89 441.34,332.72 435.17,339.63 424.44,339.80" class="mf-surface-face" fill-opacity=".09"/><polygon points="447.50,323.82 458.24,323.33 452.08,332.24 441.34,332.72" class="mf-surface-face" fill-opacity=".09"/><polygon points="499.80,247.95 510.54,246.83 504.38,265.75 493.64,266.87" class="mf-surface-face" fill-opacity=".09"/><polygon points="341.51,342.84 352.25,344.57 346.08,343.45 335.34,341.72" class="mf-surface-face" fill-opacity=".09"/><polygon points="493.64,266.87 504.38,265.75 498.21,282.67 487.47,283.79" class="mf-surface-face" fill-opacity=".09"/><polygon points="413.70,339.65 424.44,339.80 418.27,344.69 407.53,344.54" class="mf-surface-face" fill-opacity=".09"/><polygon points="369.15,345.09 379.89,346.19 373.73,347.08 362.99,345.98" class="mf-surface-face" fill-opacity=".09"/><polygon points="177.24,275.00 187.98,280.85 181.82,271.72 171.08,265.87" class="mf-surface-face" fill-opacity=".09"/><polygon points="505.97,227.02 516.71,225.90 510.54,246.83 499.80,247.95" class="mf-surface-face" fill-opacity=".09"/><polygon points="275.48,325.19 286.22,328.51 280.06,323.39 269.32,320.07" class="mf-surface-face" fill-opacity=".09"/><polygon points="464.41,312.42 475.15,311.62 468.98,322.53 458.24,323.33" class="mf-surface-face" fill-opacity=".09"/><polygon points="313.87,337.31 324.60,339.67 318.44,336.56 307.70,334.19" class="mf-surface-face" fill-opacity=".09"/><polygon points="487.47,283.79 498.21,282.67 492.05,297.59 481.31,298.71" class="mf-surface-face" fill-opacity=".09"/><polygon points="237.10,308.22 247.84,312.48 241.68,305.36 230.94,301.09" class="mf-surface-face" fill-opacity=".09"/><polygon points="512.13,204.09 522.87,202.97 516.71,225.90 505.97,227.02" class="mf-surface-face" fill-opacity=".09"/><polygon points="396.79,344.08 407.53,344.54 401.37,347.44 390.63,346.97" class="mf-surface-face" fill-opacity=".09"/><polygon points="187.98,280.85 198.72,286.39 192.56,277.26 181.82,271.72" class="mf-surface-face" fill-opacity=".09"/><polygon points="481.31,298.71 492.05,297.59 485.88,310.50 475.15,311.62" class="mf-surface-face" fill-opacity=".09"/><polygon points="286.22,328.51 296.96,331.51 290.80,326.39 280.06,323.39" class="mf-surface-face" fill-opacity=".09"/><polygon points="352.25,344.57 362.99,345.98 356.82,344.87 346.08,343.45" class="mf-surface-face" fill-opacity=".09"/><polygon points="441.34,332.72 452.08,332.24 445.91,339.14 435.17,339.63" class="mf-surface-face" fill-opacity=".09"/><polygon points="379.89,346.19 390.63,346.97 384.46,347.86 373.73,347.08" class="mf-surface-face" fill-opacity=".09"/><polygon points="247.84,312.48 258.58,316.43 252.42,309.31 241.68,305.36" class="mf-surface-face" fill-opacity=".09"/><polygon points="458.24,323.33 468.98,322.53 462.82,331.44 452.08,332.24" class="mf-surface-face" fill-opacity=".09"/><polygon points="424.44,339.80 435.17,339.63 429.01,344.52 418.27,344.69" class="mf-surface-face" fill-opacity=".09"/><polygon points="324.60,339.67 335.34,341.72 329.18,338.60 318.44,336.56" class="mf-surface-face" fill-opacity=".09"/><polygon points="198.72,286.39 209.46,291.61 203.29,282.48 192.56,277.26" class="mf-surface-face" fill-opacity=".09"/><polygon points="510.54,246.83 521.28,245.39 515.12,264.32 504.38,265.75" class="mf-surface-face" fill-opacity=".09"/><polygon points="504.38,265.75 515.12,264.32 508.95,281.24 498.21,282.67" class="mf-surface-face" fill-opacity=".09"/><polygon points="516.71,225.90 527.44,224.46 521.28,245.39 510.54,246.83" class="mf-surface-face" fill-opacity=".09"/><polygon points="475.15,311.62 485.88,310.50 479.72,321.41 468.98,322.53" class="mf-surface-face" fill-opacity=".09"/><polygon points="407.53,344.54 418.27,344.69 412.11,347.59 401.37,347.44" class="mf-surface-face" fill-opacity=".09"/><polygon points="498.21,282.67 508.95,281.24 502.79,296.15 492.05,297.59" class="mf-surface-face" fill-opacity=".09"/><polygon points="522.87,202.97 533.61,201.53 527.44,224.46 516.71,225.90" class="mf-surface-face" fill-opacity=".09"/><polygon points="296.96,331.51 307.70,334.19 301.54,329.07 290.80,326.39" class="mf-surface-face" fill-opacity=".09"/><polygon points="209.46,291.61 220.20,296.51 214.03,287.38 203.29,282.48" class="mf-surface-face" fill-opacity=".09"/><polygon points="258.58,316.43 269.32,320.07 263.16,312.94 252.42,309.31" class="mf-surface-face" fill-opacity=".09"/><polygon points="362.99,345.98 373.73,347.08 367.56,345.97 356.82,344.87" class="mf-surface-face" fill-opacity=".09"/><polygon points="492.05,297.59 502.79,296.15 496.62,309.07 485.88,310.50" class="mf-surface-face" fill-opacity=".09"/><polygon points="335.34,341.72 346.08,343.45 339.92,340.34 329.18,338.60" class="mf-surface-face" fill-opacity=".09"/><polygon points="390.63,346.97 401.37,347.44 395.20,348.33 384.46,347.86" class="mf-surface-face" fill-opacity=".09"/><polygon points="452.08,332.24 462.82,331.44 456.65,338.34 445.91,339.14" class="mf-surface-face" fill-opacity=".09"/><polygon points="435.17,339.63 445.91,339.14 439.75,344.04 429.01,344.52" class="mf-surface-face" fill-opacity=".09"/><polygon points="468.98,322.53 479.72,321.41 473.56,330.32 462.82,331.44" class="mf-surface-face" fill-opacity=".09"/><polygon points="220.20,296.51 230.94,301.09 224.77,291.96 214.03,287.38" class="mf-surface-face" fill-opacity=".09"/><polygon points="160.34,259.70 171.08,265.87 164.91,254.74 154.17,248.57" class="mf-surface-face" fill-opacity=".09"/><polygon points="521.28,245.39 532.02,243.64 525.86,262.56 515.12,264.32" class="mf-surface-face" fill-opacity=".09"/><polygon points="515.12,264.32 525.86,262.56 519.69,279.48 508.95,281.24" class="mf-surface-face" fill-opacity=".09"/><polygon points="307.70,334.19 318.44,336.56 312.28,331.43 301.54,329.07" class="mf-surface-face" fill-opacity=".09"/><polygon points="269.32,320.07 280.06,323.39 273.89,316.26 263.16,312.94" class="mf-surface-face" fill-opacity=".09"/><polygon points="527.44,224.46 538.18,222.71 532.02,243.64 521.28,245.39" class="mf-surface-face" fill-opacity=".09"/><polygon points="418.27,344.69 429.01,344.52 422.85,347.42 412.11,347.59" class="mf-surface-face" fill-opacity=".09"/><polygon points="485.88,310.50 496.62,309.07 490.46,319.98 479.72,321.41" class="mf-surface-face" fill-opacity=".09"/><polygon points="508.95,281.24 519.69,279.48 513.53,294.40 502.79,296.15" class="mf-surface-face" fill-opacity=".09"/><polygon points="533.61,201.53 544.35,199.78 538.18,222.71 527.44,224.46" class="mf-surface-face" fill-opacity=".09"/><polygon points="171.08,265.87 181.82,271.72 175.65,260.59 164.91,254.74" class="mf-surface-face" fill-opacity=".09"/><polygon points="373.73,347.08 384.46,347.86 378.30,346.75 367.56,345.97" class="mf-surface-face" fill-opacity=".09"/><polygon points="346.08,343.45 356.82,344.87 350.66,341.75 339.92,340.34" class="mf-surface-face" fill-opacity=".09"/><polygon points="230.94,301.09 241.68,305.36 235.51,296.23 224.77,291.96" class="mf-surface-face" fill-opacity=".09"/><polygon points="401.37,347.44 412.11,347.59 405.94,348.48 395.20,348.33" class="mf-surface-face" fill-opacity=".09"/><polygon points="502.79,296.15 513.53,294.40 507.36,307.31 496.62,309.07" class="mf-surface-face" fill-opacity=".09"/><polygon points="280.06,323.39 290.80,326.39 284.63,319.26 273.89,316.26" class="mf-surface-face" fill-opacity=".09"/><polygon points="462.82,331.44 473.56,330.32 467.39,337.22 456.65,338.34" class="mf-surface-face" fill-opacity=".09"/><polygon points="318.44,336.56 329.18,338.60 323.02,333.48 312.28,331.43" class="mf-surface-face" fill-opacity=".09"/><polygon points="445.91,339.14 456.65,338.34 450.49,343.24 439.75,344.04" class="mf-surface-face" fill-opacity=".09"/><polygon points="181.82,271.72 192.56,277.26 186.39,266.13 175.65,260.59" class="mf-surface-face" fill-opacity=".09"/><polygon points="479.72,321.41 490.46,319.98 484.30,328.88 473.56,330.32" class="mf-surface-face" fill-opacity=".09"/><polygon points="532.02,243.64 542.76,241.57 536.59,260.49 525.86,262.56" class="mf-surface-face" fill-opacity=".09"/><polygon points="241.68,305.36 252.42,309.31 246.25,300.18 235.51,296.23" class="mf-surface-face" fill-opacity=".09"/><polygon points="429.01,344.52 439.75,344.04 433.59,346.93 422.85,347.42" class="mf-surface-face" fill-opacity=".09"/><polygon points="525.86,262.56 536.59,260.49 530.43,277.41 519.69,279.48" class="mf-surface-face" fill-opacity=".09"/><polygon points="538.18,222.71 548.92,220.64 542.76,241.57 532.02,243.64" class="mf-surface-face" fill-opacity=".09"/><polygon points="496.62,309.07 507.36,307.31 501.20,318.22 490.46,319.98" class="mf-surface-face" fill-opacity=".09"/><polygon points="384.46,347.86 395.20,348.33 389.04,347.22 378.30,346.75" class="mf-surface-face" fill-opacity=".09"/><polygon points="356.82,344.87 367.56,345.97 361.40,342.85 350.66,341.75" class="mf-surface-face" fill-opacity=".09"/><polygon points="192.56,277.26 203.29,282.48 197.13,271.34 186.39,266.13" class="mf-surface-face" fill-opacity=".09"/><polygon points="519.69,279.48 530.43,277.41 524.27,292.33 513.53,294.40" class="mf-surface-face" fill-opacity=".09"/><polygon points="290.80,326.39 301.54,329.07 295.37,321.94 284.63,319.26" class="mf-surface-face" fill-opacity=".09"/><polygon points="544.35,199.78 555.09,197.71 548.92,220.64 538.18,222.71" class="mf-surface-face" fill-opacity=".09"/><polygon points="412.11,347.59 422.85,347.42 416.68,348.31 405.94,348.48" class="mf-surface-face" fill-opacity=".09"/><polygon points="329.18,338.60 339.92,340.34 333.75,335.22 323.02,333.48" class="mf-surface-face" fill-opacity=".09"/><polygon points="252.42,309.31 263.16,312.94 256.99,303.81 246.25,300.18" class="mf-surface-face" fill-opacity=".09"/><polygon points="513.53,294.40 524.27,292.33 518.10,305.24 507.36,307.31" class="mf-surface-face" fill-opacity=".09"/><polygon points="473.56,330.32 484.30,328.88 478.13,335.78 467.39,337.22" class="mf-surface-face" fill-opacity=".09"/><polygon points="203.29,282.48 214.03,287.38 207.87,276.25 197.13,271.34" class="mf-surface-face" fill-opacity=".09"/><polygon points="456.65,338.34 467.39,337.22 461.23,342.12 450.49,343.24" class="mf-surface-face" fill-opacity=".09"/><polygon points="490.46,319.98 501.20,318.22 495.04,327.13 484.30,328.88" class="mf-surface-face" fill-opacity=".09"/><polygon points="439.75,344.04 450.49,343.24 444.33,346.13 433.59,346.93" class="mf-surface-face" fill-opacity=".09"/><polygon points="367.56,345.97 378.30,346.75 372.14,343.63 361.40,342.85" class="mf-surface-face" fill-opacity=".09"/><polygon points="301.54,329.07 312.28,331.43 306.11,324.31 295.37,321.94" class="mf-surface-face" fill-opacity=".09"/><polygon points="395.20,348.33 405.94,348.48 399.78,347.36 389.04,347.22" class="mf-surface-face" fill-opacity=".09"/><polygon points="542.76,241.57 553.50,239.18 547.33,258.11 536.59,260.49" class="mf-surface-face" fill-opacity=".09"/><polygon points="536.59,260.49 547.33,258.11 541.17,275.03 530.43,277.41" class="mf-surface-face" fill-opacity=".09"/><polygon points="548.92,220.64 559.66,218.25 553.50,239.18 542.76,241.57" class="mf-surface-face" fill-opacity=".09"/><polygon points="507.36,307.31 518.10,305.24 511.94,316.15 501.20,318.22" class="mf-surface-face" fill-opacity=".09"/><polygon points="263.16,312.94 273.89,316.26 267.73,307.13 256.99,303.81" class="mf-surface-face" fill-opacity=".09"/><polygon points="214.03,287.38 224.77,291.96 218.61,280.83 207.87,276.25" class="mf-surface-face" fill-opacity=".09"/><polygon points="339.92,340.34 350.66,341.75 344.49,336.63 333.75,335.22" class="mf-surface-face" fill-opacity=".09"/><polygon points="530.43,277.41 541.17,275.03 535.01,289.94 524.27,292.33" class="mf-surface-face" fill-opacity=".09"/><polygon points="422.85,347.42 433.59,346.93 427.42,347.82 416.68,348.31" class="mf-surface-face" fill-opacity=".09"/><polygon points="555.09,197.71 565.83,195.32 559.66,218.25 548.92,220.64" class="mf-surface-face" fill-opacity=".09"/><polygon points="484.30,328.88 495.04,327.13 488.87,334.03 478.13,335.78" class="mf-surface-face" fill-opacity=".09"/><polygon points="524.27,292.33 535.01,289.94 528.84,302.86 518.10,305.24" class="mf-surface-face" fill-opacity=".09"/><polygon points="467.39,337.22 478.13,335.78 471.97,340.68 461.23,342.12" class="mf-surface-face" fill-opacity=".09"/><polygon points="312.28,331.43 323.02,333.48 316.85,326.36 306.11,324.31" class="mf-surface-face" fill-opacity=".09"/><polygon points="224.77,291.96 235.51,296.23 229.35,285.10 218.61,280.83" class="mf-surface-face" fill-opacity=".09"/><polygon points="273.89,316.26 284.63,319.26 278.47,310.13 267.73,307.13" class="mf-surface-face" fill-opacity=".09"/><polygon points="378.30,346.75 389.04,347.22 382.88,344.10 372.14,343.63" class="mf-surface-face" fill-opacity=".09"/><polygon points="501.20,318.22 511.94,316.15 505.77,325.06 495.04,327.13" class="mf-surface-face" fill-opacity=".09"/><polygon points="450.49,343.24 461.23,342.12 455.06,345.01 444.33,346.13" class="mf-surface-face" fill-opacity=".09"/><polygon points="405.94,348.48 416.68,348.31 410.52,347.20 399.78,347.36" class="mf-surface-face" fill-opacity=".09"/><polygon points="350.66,341.75 361.40,342.85 355.23,337.73 344.49,336.63" class="mf-surface-face" fill-opacity=".09"/><polygon points="518.10,305.24 528.84,302.86 522.68,313.77 511.94,316.15" class="mf-surface-face" fill-opacity=".09"/><polygon points="433.59,346.93 444.33,346.13 438.16,347.02 427.42,347.82" class="mf-surface-face" fill-opacity=".09"/><polygon points="235.51,296.23 246.25,300.18 240.09,289.05 229.35,285.10" class="mf-surface-face" fill-opacity=".09"/><polygon points="323.02,333.48 333.75,335.22 327.59,328.09 316.85,326.36" class="mf-surface-face" fill-opacity=".09"/><polygon points="284.63,319.26 295.37,321.94 289.21,312.81 278.47,310.13" class="mf-surface-face" fill-opacity=".09"/><polygon points="389.04,347.22 399.78,347.36 393.62,344.25 382.88,344.10" class="mf-surface-face" fill-opacity=".09"/><polygon points="478.13,335.78 488.87,334.03 482.71,338.93 471.97,340.68" class="mf-surface-face" fill-opacity=".09"/><polygon points="495.04,327.13 505.77,325.06 499.61,331.96 488.87,334.03" class="mf-surface-face" fill-opacity=".09"/><polygon points="361.40,342.85 372.14,343.63 365.97,338.51 355.23,337.73" class="mf-surface-face" fill-opacity=".09"/><polygon points="416.68,348.31 427.42,347.82 421.26,346.71 410.52,347.20" class="mf-surface-face" fill-opacity=".09"/><polygon points="246.25,300.18 256.99,303.81 250.83,292.68 240.09,289.05" class="mf-surface-face" fill-opacity=".09"/><polygon points="461.23,342.12 471.97,340.68 465.80,343.58 455.06,345.01" class="mf-surface-face" fill-opacity=".09"/><polygon points="511.94,316.15 522.68,313.77 516.51,322.67 505.77,325.06" class="mf-surface-face" fill-opacity=".09"/><polygon points="295.37,321.94 306.11,324.31 299.95,315.18 289.21,312.81" class="mf-surface-face" fill-opacity=".09"/><polygon points="333.75,335.22 344.49,336.63 338.33,329.51 327.59,328.09" class="mf-surface-face" fill-opacity=".09"/><polygon points="444.33,346.13 455.06,345.01 448.90,345.90 438.16,347.02" class="mf-surface-face" fill-opacity=".09"/><polygon points="256.99,303.81 267.73,307.13 261.57,296.00 250.83,292.68" class="mf-surface-face" fill-opacity=".09"/><polygon points="399.78,347.36 410.52,347.20 404.35,344.08 393.62,344.25" class="mf-surface-face" fill-opacity=".09"/><polygon points="372.14,343.63 382.88,344.10 376.71,338.98 365.97,338.51" class="mf-surface-face" fill-opacity=".09"/><polygon points="488.87,334.03 499.61,331.96 493.45,336.86 482.71,338.93" class="mf-surface-face" fill-opacity=".09"/><polygon points="427.42,347.82 438.16,347.02 432.00,345.91 421.26,346.71" class="mf-surface-face" fill-opacity=".09"/><polygon points="505.77,325.06 516.51,322.67 510.35,329.57 499.61,331.96" class="mf-surface-face" fill-opacity=".09"/><polygon points="306.11,324.31 316.85,326.36 310.69,317.23 299.95,315.18" class="mf-surface-face" fill-opacity=".09"/><polygon points="471.97,340.68 482.71,338.93 476.54,341.82 465.80,343.58" class="mf-surface-face" fill-opacity=".09"/><polygon points="344.49,336.63 355.23,337.73 349.07,330.61 338.33,329.51" class="mf-surface-face" fill-opacity=".09"/><polygon points="267.73,307.13 278.47,310.13 272.31,299.00 261.57,296.00" class="mf-surface-face" fill-opacity=".09"/><polygon points="455.06,345.01 465.80,343.58 459.64,344.47 448.90,345.90" class="mf-surface-face" fill-opacity=".09"/><polygon points="410.52,347.20 421.26,346.71 415.09,343.59 404.35,344.08" class="mf-surface-face" fill-opacity=".09"/><polygon points="382.88,344.10 393.62,344.25 387.45,339.13 376.71,338.98" class="mf-surface-face" fill-opacity=".09"/><polygon points="316.85,326.36 327.59,328.09 321.43,318.96 310.69,317.23" class="mf-surface-face" fill-opacity=".09"/><polygon points="438.16,347.02 448.90,345.90 442.74,344.79 432.00,345.91" class="mf-surface-face" fill-opacity=".09"/><polygon points="278.47,310.13 289.21,312.81 283.04,301.68 272.31,299.00" class="mf-surface-face" fill-opacity=".09"/><polygon points="355.23,337.73 365.97,338.51 359.81,331.39 349.07,330.61" class="mf-surface-face" fill-opacity=".09"/><polygon points="499.61,331.96 510.35,329.57 504.19,334.47 493.45,336.86" class="mf-surface-face" fill-opacity=".09"/><polygon points="482.71,338.93 493.45,336.86 487.28,339.75 476.54,341.82" class="mf-surface-face" fill-opacity=".09"/><polygon points="465.80,343.58 476.54,341.82 470.38,342.71 459.64,344.47" class="mf-surface-face" fill-opacity=".09"/><polygon points="327.59,328.09 338.33,329.51 332.17,320.38 321.43,318.96" class="mf-surface-face" fill-opacity=".09"/><polygon points="393.62,344.25 404.35,344.08 398.19,338.96 387.45,339.13" class="mf-surface-face" fill-opacity=".09"/><polygon points="421.26,346.71 432.00,345.91 425.83,342.79 415.09,343.59" class="mf-surface-face" fill-opacity=".09"/><polygon points="289.21,312.81 299.95,315.18 293.78,304.05 283.04,301.68" class="mf-surface-face" fill-opacity=".09"/><polygon points="365.97,338.51 376.71,338.98 370.55,331.85 359.81,331.39" class="mf-surface-face" fill-opacity=".09"/><polygon points="448.90,345.90 459.64,344.47 453.48,343.35 442.74,344.79" class="mf-surface-face" fill-opacity=".09"/><polygon points="493.45,336.86 504.19,334.47 498.02,337.37 487.28,339.75" class="mf-surface-face" fill-opacity=".09"/><polygon points="338.33,329.51 349.07,330.61 342.91,321.48 332.17,320.38" class="mf-surface-face" fill-opacity=".09"/><polygon points="299.95,315.18 310.69,317.23 304.52,306.10 293.78,304.05" class="mf-surface-face" fill-opacity=".09"/><polygon points="476.54,341.82 487.28,339.75 481.12,340.64 470.38,342.71" class="mf-surface-face" fill-opacity=".09"/><polygon points="404.35,344.08 415.09,343.59 408.93,338.47 398.19,338.96" class="mf-surface-face" fill-opacity=".09"/><polygon points="432.00,345.91 442.74,344.79 436.57,341.67 425.83,342.79" class="mf-surface-face" fill-opacity=".09"/><polygon points="376.71,338.98 387.45,339.13 381.29,332.00 370.55,331.85" class="mf-surface-face" fill-opacity=".09"/><polygon points="459.64,344.47 470.38,342.71 464.21,341.60 453.48,343.35" class="mf-surface-face" fill-opacity=".09"/><polygon points="310.69,317.23 321.43,318.96 315.26,307.83 304.52,306.10" class="mf-surface-face" fill-opacity=".09"/><polygon points="349.07,330.61 359.81,331.39 353.64,322.26 342.91,321.48" class="mf-surface-face" fill-opacity=".09"/><polygon points="415.09,343.59 425.83,342.79 419.67,337.67 408.93,338.47" class="mf-surface-face" fill-opacity=".09"/><polygon points="487.28,339.75 498.02,337.37 491.86,338.26 481.12,340.64" class="mf-surface-face" fill-opacity=".09"/><polygon points="442.74,344.79 453.48,343.35 447.31,340.24 436.57,341.67" class="mf-surface-face" fill-opacity=".09"/><polygon points="387.45,339.13 398.19,338.96 392.03,331.83 381.29,332.00" class="mf-surface-face" fill-opacity=".09"/><polygon points="321.43,318.96 332.17,320.38 326.00,309.25 315.26,307.83" class="mf-surface-face" fill-opacity=".09"/><polygon points="470.38,342.71 481.12,340.64 474.95,339.53 464.21,341.60" class="mf-surface-face" fill-opacity=".09"/><polygon points="359.81,331.39 370.55,331.85 364.38,322.72 353.64,322.26" class="mf-surface-face" fill-opacity=".09"/><polygon points="425.83,342.79 436.57,341.67 430.41,336.55 419.67,337.67" class="mf-surface-face" fill-opacity=".09"/><polygon points="398.19,338.96 408.93,338.47 402.77,331.35 392.03,331.83" class="mf-surface-face" fill-opacity=".09"/><polygon points="453.48,343.35 464.21,341.60 458.05,338.48 447.31,340.24" class="mf-surface-face" fill-opacity=".09"/><polygon points="332.17,320.38 342.91,321.48 336.74,310.35 326.00,309.25" class="mf-surface-face" fill-opacity=".09"/><polygon points="370.55,331.85 381.29,332.00 375.12,322.87 364.38,322.72" class="mf-surface-face" fill-opacity=".09"/><polygon points="481.12,340.64 491.86,338.26 485.69,337.14 474.95,339.53" class="mf-surface-face" fill-opacity=".09"/><polygon points="436.57,341.67 447.31,340.24 441.15,335.11 430.41,336.55" class="mf-surface-face" fill-opacity=".09"/><polygon points="408.93,338.47 419.67,337.67 413.50,330.54 402.77,331.35" class="mf-surface-face" fill-opacity=".09"/><polygon points="342.91,321.48 353.64,322.26 347.48,311.13 336.74,310.35" class="mf-surface-face" fill-opacity=".09"/><polygon points="464.21,341.60 474.95,339.53 468.79,336.41 458.05,338.48" class="mf-surface-face" fill-opacity=".09"/><polygon points="381.29,332.00 392.03,331.83 385.86,322.70 375.12,322.87" class="mf-surface-face" fill-opacity=".09"/><polygon points="353.64,322.26 364.38,322.72 358.22,311.59 347.48,311.13" class="mf-surface-face" fill-opacity=".09"/><polygon points="419.67,337.67 430.41,336.55 424.24,329.43 413.50,330.54" class="mf-surface-face" fill-opacity=".09"/><polygon points="447.31,340.24 458.05,338.48 451.89,333.36 441.15,335.11" class="mf-surface-face" fill-opacity=".09"/><polygon points="392.03,331.83 402.77,331.35 396.60,322.22 385.86,322.70" class="mf-surface-face" fill-opacity=".09"/><polygon points="474.95,339.53 485.69,337.14 479.53,334.03 468.79,336.41" class="mf-surface-face" fill-opacity=".09"/><polygon points="364.38,322.72 375.12,322.87 368.96,311.74 358.22,311.59" class="mf-surface-face" fill-opacity=".09"/><polygon points="430.41,336.55 441.15,335.11 434.98,327.99 424.24,329.43" class="mf-surface-face" fill-opacity=".09"/><polygon points="458.05,338.48 468.79,336.41 462.63,331.29 451.89,333.36" class="mf-surface-face" fill-opacity=".09"/><polygon points="402.77,331.35 413.50,330.54 407.34,321.42 396.60,322.22" class="mf-surface-face" fill-opacity=".09"/><polygon points="375.12,322.87 385.86,322.70 379.70,311.57 368.96,311.74" class="mf-surface-face" fill-opacity=".09"/><polygon points="441.15,335.11 451.89,333.36 445.72,326.24 434.98,327.99" class="mf-surface-face" fill-opacity=".09"/><polygon points="468.79,336.41 479.53,334.03 473.37,328.90 462.63,331.29" class="mf-surface-face" fill-opacity=".09"/><polygon points="413.50,330.54 424.24,329.43 418.08,320.30 407.34,321.42" class="mf-surface-face" fill-opacity=".09"/><polygon points="385.86,322.70 396.60,322.22 390.44,311.09 379.70,311.57" class="mf-surface-face" fill-opacity=".09"/><polygon points="451.89,333.36 462.63,331.29 456.46,324.17 445.72,326.24" class="mf-surface-face" fill-opacity=".09"/><polygon points="424.24,329.43 434.98,327.99 428.82,318.86 418.08,320.30" class="mf-surface-face" fill-opacity=".09"/><polygon points="396.60,322.22 407.34,321.42 401.18,310.28 390.44,311.09" class="mf-surface-face" fill-opacity=".09"/><polygon points="462.63,331.29 473.37,328.90 467.20,321.78 456.46,324.17" class="mf-surface-face" fill-opacity=".09"/><polygon points="434.98,327.99 445.72,326.24 439.56,317.11 428.82,318.86" class="mf-surface-face" fill-opacity=".09"/><polygon points="407.34,321.42 418.08,320.30 411.92,309.16 401.18,310.28" class="mf-surface-face" fill-opacity=".09"/><polygon points="445.72,326.24 456.46,324.17 450.30,315.04 439.56,317.11" class="mf-surface-face" fill-opacity=".09"/><polygon points="418.08,320.30 428.82,318.86 422.66,307.73 411.92,309.16" class="mf-surface-face" fill-opacity=".09"/><polygon points="456.46,324.17 467.20,321.78 461.04,312.65 450.30,315.04" class="mf-surface-face" fill-opacity=".09"/><polygon points="428.82,318.86 439.56,317.11 433.39,305.98 422.66,307.73" class="mf-surface-face" fill-opacity=".09"/><polygon points="439.56,317.11 450.30,315.04 444.13,303.91 433.39,305.98" class="mf-surface-face" fill-opacity=".09"/><polygon points="450.30,315.04 461.04,312.65 454.87,301.52 444.13,303.91" class="mf-surface-face" fill-opacity=".09"/><polyline fill="none" points="209.65,276.63 219.67,282.39 229.70,287.88 239.72,293.10 249.74,298.04 259.77,302.70 269.79,307.09 279.81,311.20 289.84,315.04 299.86,318.59 309.88,321.88 319.91,324.88 329.93,327.62 339.95,330.07 349.98,332.25 360.00,334.15 370.02,335.78 380.05,337.13 390.07,338.21 400.09,339.00 410.12,339.53 420.14,339.77 430.16,339.74 440.19,339.44 450.21,338.86 460.23,338.00 470.26,336.87 480.28,335.46 490.30,333.77 500.33,331.81 510.35,329.57" class="mf-objective"/><circle cx="309.8834423736157" cy="321.8778148627357" r="5" class="mf-open"/><text x="301.8834423736157" y="343.8778148627357" class="mf-small" text-anchor="end">minimum</text><text x="518.3496728791529" y="339.57309030619524" class="mf-small" text-anchor="start">w₁</text><text x="254.40677498336248" y="397.97695639988035" class="mf-small" text-anchor="start">w₂</text><polyline fill="none" points="446.71,325.39 456.32,339.44 465.93,343.74 475.53,338.28 485.14,323.07 494.75,298.10 504.35,263.38 504.35,263.38 491.55,288.24 478.75,308.78 465.95,325.02 453.15,336.94 440.35,344.55 427.55,347.85 427.55,347.85 425.79,347.78 424.03,347.55 422.27,347.16 420.52,346.60 418.76,345.88 417.00,344.99 417.00,344.99 414.02,345.25 411.04,345.47 408.06,345.67 405.08,345.84 402.10,345.98 399.12,346.10 399.12,346.10 399.46,344.80 399.81,343.22 400.15,341.35 400.50,339.18 400.84,336.73 401.19,334.00 401.19,334.00 397.76,334.81 394.34,335.56 390.91,336.25 387.48,336.89 384.05,337.47 380.63,337.99 380.63,337.99 377.80,338.89 374.97,339.70 372.14,340.42 369.31,341.05 366.48,341.60 363.65,342.06 363.65,342.06 363.86,341.09 364.07,340.02 364.28,338.83 364.49,337.54 364.70,336.14 364.91,334.63 364.91,334.63 362.61,335.14 360.32,335.60 358.03,336.03 355.74,336.42 353.45,336.77 351.16,337.08 351.16,337.08 349.14,337.75 347.12,338.35 345.11,338.86 343.09,339.30 341.08,339.66 339.06,339.95 339.06,339.95 342.70,337.89 346.34,334.88 349.98,330.91 353.62,326.00 357.26,320.13 360.90,313.31 360.90,313.31 353.62,323.37 346.35,331.03 339.07,336.30 331.79,339.18 324.52,339.67 317.24,337.76 317.24,337.76 326.31,339.53 335.38,336.64 344.45,329.11 353.52,316.93 362.58,300.11 371.65,278.63 371.65,278.63 364.39,294.96 357.12,308.71 349.86,319.88 342.60,328.46 335.33,334.47 328.07,337.89 328.07,337.89 332.25,335.65 336.44,332.20 340.63,327.55 344.82,321.68 349.00,314.61 353.19,306.34 353.19,306.34 346.04,316.29 338.88,324.26 331.73,330.25 324.58,334.26 317.42,336.29 310.27,336.34 310.27,336.34 315.33,336.10 320.38,334.34 325.43,331.08 330.49,326.30 335.54,320.01 340.60,312.21 340.60,312.21 333.86,321.14 327.13,327.93 320.39,332.57 313.66,335.07 306.93,335.42 300.19,333.63 300.19,333.63 308.56,335.14 316.92,332.08 325.29,324.48 333.65,312.31 342.01,295.59 350.38,274.32 350.38,274.32 343.32,291.30 336.26,305.46 329.20,316.81 322.15,325.34 315.09,331.05 308.03,333.95 308.03,333.95 314.79,331.11 321.55,325.58 328.31,317.36 335.07,306.44 341.83,292.83 348.58,276.53 348.58,276.53 337.78,300.05 326.98,317.38 316.18,328.51 305.38,333.43 294.58,332.16 283.78,324.69 283.78,324.69 290.38,330.18 296.98,332.93 303.57,332.93 310.17,330.18 316.76,324.68 323.36,316.43 323.36,316.43 318.55,321.92 313.75,326.25 308.94,329.44 304.14,331.49 299.33,332.38 294.53,332.13 294.53,332.13 297.69,332.49 300.85,332.43 304.01,331.94 307.16,331.04 310.32,329.70 313.48,327.95 313.48,327.95 317.56,324.33 321.64,319.76 325.73,314.23 329.81,307.76 333.89,300.33 337.97,291.94 337.97,291.94 331.74,302.74 325.52,311.83 319.29,319.21 313.07,324.87 306.84,328.81 300.62,331.04 300.62,331.04 306.95,328.04 313.29,322.75 319.63,315.17 325.96,305.29 332.30,293.12 338.63,278.66 338.63,278.66 333.14,290.27 327.65,300.42 322.15,309.10 316.66,316.32 311.16,322.07 305.67,326.36 305.67,326.36 309.09,323.12 312.51,319.08 315.93,314.23 319.36,308.58 322.78,302.13 326.20,294.87 326.20,294.87 320.03,305.13 313.87,313.59 307.70,320.23 301.54,325.06 295.37,328.08 289.21,329.29 289.21,329.29 296.07,328.00 302.94,324.61 309.81,319.14 316.67,311.57 323.54,301.91 330.41,290.16 330.41,290.16 323.74,301.70 317.08,311.23 310.41,318.76 303.75,324.29 297.08,327.82 290.42,329.35 290.42,329.35 292.71,328.77 295.01,327.84 297.30,326.54 299.60,324.88 301.89,322.86 304.19,320.48 304.19,320.48 301.66,323.23 299.13,325.50 296.60,327.29 294.07,328.61 291.55,329.44 289.02,329.79 289.02,329.79 294.17,329.39 299.33,327.78 304.48,324.98 309.64,320.98 314.79,315.78 319.95,309.39 319.95,309.39 316.66,313.84 313.37,317.76 310.09,321.15 306.80,324.00 303.52,326.32 300.23,328.10 300.23,328.10 302.25,326.72 304.27,325.04 306.29,323.08 308.30,320.82 310.32,318.28 312.34,315.44 312.34,315.44 310.45,317.44 308.55,319.28 306.66,320.96 304.77,322.48 302.87,323.85 300.98,325.05 300.98,325.05 301.00,324.55 301.03,324.04 301.05,323.51 301.07,322.96 301.09,322.41 301.11,321.84 301.11,321.84 300.97,322.42 300.84,322.99 300.70,323.55 300.56,324.08 300.42,324.60 300.28,325.11 300.28,325.11 302.36,323.52 304.44,321.69 306.52,319.62 308.61,317.29 310.69,314.72 312.77,311.91 312.77,311.91 311.34,314.08 309.92,316.11 308.49,318.00 307.06,319.76 305.64,321.38 304.21,322.86 304.21,322.86 305.23,322.25 306.26,321.60 307.29,320.92 308.31,320.21 309.34,319.47 310.36,318.69 310.36,318.69 307.98,321.51 305.59,323.96 303.21,326.02 300.82,327.71 298.44,329.01 296.05,329.94 296.05,329.94 302.25,327.01 308.45,321.73 314.65,314.10 320.85,304.12 327.05,291.78 333.25,277.10 333.25,277.10 326.81,291.65 320.38,303.86 313.95,313.75 307.51,321.30 301.08,326.52 294.65,329.41 294.65,329.41 299.77,327.25 304.90,323.58 310.03,318.39 315.15,311.70 320.28,303.49 325.41,293.77" class="mf-trail-halo"/><polyline fill="none" points="446.71,325.39 456.32,339.44 465.93,343.74 475.53,338.28 485.14,323.07 494.75,298.10 504.35,263.38 504.35,263.38 491.55,288.24 478.75,308.78 465.95,325.02 453.15,336.94 440.35,344.55 427.55,347.85 427.55,347.85 425.79,347.78 424.03,347.55 422.27,347.16 420.52,346.60 418.76,345.88 417.00,344.99 417.00,344.99 414.02,345.25 411.04,345.47 408.06,345.67 405.08,345.84 402.10,345.98 399.12,346.10 399.12,346.10 399.46,344.80 399.81,343.22 400.15,341.35 400.50,339.18 400.84,336.73 401.19,334.00 401.19,334.00 397.76,334.81 394.34,335.56 390.91,336.25 387.48,336.89 384.05,337.47 380.63,337.99 380.63,337.99 377.80,338.89 374.97,339.70 372.14,340.42 369.31,341.05 366.48,341.60 363.65,342.06 363.65,342.06 363.86,341.09 364.07,340.02 364.28,338.83 364.49,337.54 364.70,336.14 364.91,334.63 364.91,334.63 362.61,335.14 360.32,335.60 358.03,336.03 355.74,336.42 353.45,336.77 351.16,337.08 351.16,337.08 349.14,337.75 347.12,338.35 345.11,338.86 343.09,339.30 341.08,339.66 339.06,339.95 339.06,339.95 342.70,337.89 346.34,334.88 349.98,330.91 353.62,326.00 357.26,320.13 360.90,313.31 360.90,313.31 353.62,323.37 346.35,331.03 339.07,336.30 331.79,339.18 324.52,339.67 317.24,337.76 317.24,337.76 326.31,339.53 335.38,336.64 344.45,329.11 353.52,316.93 362.58,300.11 371.65,278.63 371.65,278.63 364.39,294.96 357.12,308.71 349.86,319.88 342.60,328.46 335.33,334.47 328.07,337.89 328.07,337.89 332.25,335.65 336.44,332.20 340.63,327.55 344.82,321.68 349.00,314.61 353.19,306.34 353.19,306.34 346.04,316.29 338.88,324.26 331.73,330.25 324.58,334.26 317.42,336.29 310.27,336.34 310.27,336.34 315.33,336.10 320.38,334.34 325.43,331.08 330.49,326.30 335.54,320.01 340.60,312.21 340.60,312.21 333.86,321.14 327.13,327.93 320.39,332.57 313.66,335.07 306.93,335.42 300.19,333.63 300.19,333.63 308.56,335.14 316.92,332.08 325.29,324.48 333.65,312.31 342.01,295.59 350.38,274.32 350.38,274.32 343.32,291.30 336.26,305.46 329.20,316.81 322.15,325.34 315.09,331.05 308.03,333.95 308.03,333.95 314.79,331.11 321.55,325.58 328.31,317.36 335.07,306.44 341.83,292.83 348.58,276.53 348.58,276.53 337.78,300.05 326.98,317.38 316.18,328.51 305.38,333.43 294.58,332.16 283.78,324.69 283.78,324.69 290.38,330.18 296.98,332.93 303.57,332.93 310.17,330.18 316.76,324.68 323.36,316.43 323.36,316.43 318.55,321.92 313.75,326.25 308.94,329.44 304.14,331.49 299.33,332.38 294.53,332.13 294.53,332.13 297.69,332.49 300.85,332.43 304.01,331.94 307.16,331.04 310.32,329.70 313.48,327.95 313.48,327.95 317.56,324.33 321.64,319.76 325.73,314.23 329.81,307.76 333.89,300.33 337.97,291.94 337.97,291.94 331.74,302.74 325.52,311.83 319.29,319.21 313.07,324.87 306.84,328.81 300.62,331.04 300.62,331.04 306.95,328.04 313.29,322.75 319.63,315.17 325.96,305.29 332.30,293.12 338.63,278.66 338.63,278.66 333.14,290.27 327.65,300.42 322.15,309.10 316.66,316.32 311.16,322.07 305.67,326.36 305.67,326.36 309.09,323.12 312.51,319.08 315.93,314.23 319.36,308.58 322.78,302.13 326.20,294.87 326.20,294.87 320.03,305.13 313.87,313.59 307.70,320.23 301.54,325.06 295.37,328.08 289.21,329.29 289.21,329.29 296.07,328.00 302.94,324.61 309.81,319.14 316.67,311.57 323.54,301.91 330.41,290.16 330.41,290.16 323.74,301.70 317.08,311.23 310.41,318.76 303.75,324.29 297.08,327.82 290.42,329.35 290.42,329.35 292.71,328.77 295.01,327.84 297.30,326.54 299.60,324.88 301.89,322.86 304.19,320.48 304.19,320.48 301.66,323.23 299.13,325.50 296.60,327.29 294.07,328.61 291.55,329.44 289.02,329.79 289.02,329.79 294.17,329.39 299.33,327.78 304.48,324.98 309.64,320.98 314.79,315.78 319.95,309.39 319.95,309.39 316.66,313.84 313.37,317.76 310.09,321.15 306.80,324.00 303.52,326.32 300.23,328.10 300.23,328.10 302.25,326.72 304.27,325.04 306.29,323.08 308.30,320.82 310.32,318.28 312.34,315.44 312.34,315.44 310.45,317.44 308.55,319.28 306.66,320.96 304.77,322.48 302.87,323.85 300.98,325.05 300.98,325.05 301.00,324.55 301.03,324.04 301.05,323.51 301.07,322.96 301.09,322.41 301.11,321.84 301.11,321.84 300.97,322.42 300.84,322.99 300.70,323.55 300.56,324.08 300.42,324.60 300.28,325.11 300.28,325.11 302.36,323.52 304.44,321.69 306.52,319.62 308.61,317.29 310.69,314.72 312.77,311.91 312.77,311.91 311.34,314.08 309.92,316.11 308.49,318.00 307.06,319.76 305.64,321.38 304.21,322.86 304.21,322.86 305.23,322.25 306.26,321.60 307.29,320.92 308.31,320.21 309.34,319.47 310.36,318.69 310.36,318.69 307.98,321.51 305.59,323.96 303.21,326.02 300.82,327.71 298.44,329.01 296.05,329.94 296.05,329.94 302.25,327.01 308.45,321.73 314.65,314.10 320.85,304.12 327.05,291.78 333.25,277.10 333.25,277.10 326.81,291.65 320.38,303.86 313.95,313.75 307.51,321.30 301.08,326.52 294.65,329.41 294.65,329.41 299.77,327.25 304.90,323.58 310.03,318.39 315.15,311.70 320.28,303.49 325.41,293.77" class="mf-noise"/><circle cx="325.4081164613226" cy="293.77289235843216" r="6" class="mf-open"/><polyline fill="none" points="446.71,325.39 448.64,328.98 450.56,332.18 452.48,334.99 454.40,337.41 456.32,339.44 458.24,341.08 458.24,341.08 460.78,342.84 463.31,343.75 465.85,343.79 468.38,342.98 470.92,341.31 473.46,338.79 473.46,338.79 474.25,336.65 475.05,334.09 475.84,331.10 476.64,327.69 477.44,323.85 478.23,319.58 478.23,319.58 476.95,318.10 475.66,316.54 474.37,314.92 473.09,313.22 471.80,311.46 470.52,309.63 470.52,309.63 467.73,310.50 464.94,311.36 462.16,312.19 459.37,312.99 456.58,313.78 453.80,314.54 453.80,314.54 449.96,316.83 446.12,319.03 442.29,321.14 438.45,323.15 434.62,325.07 430.78,326.89 430.78,326.89 426.33,329.52 421.89,331.96 417.45,334.21 413.00,336.25 408.56,338.11 404.11,339.77 404.11,339.77 400.02,341.05 395.93,342.18 391.84,343.16 387.75,343.99 383.65,344.66 379.56,345.18 379.56,345.18 376.30,345.28 373.04,345.34 369.77,345.33 366.51,345.28 363.25,345.16 359.99,345.00 359.99,345.00 357.49,344.74 354.99,344.47 352.50,344.18 350.00,343.87 347.50,343.54 345.01,343.20 345.01,343.20 344.00,342.80 342.99,342.35 341.98,341.84 340.97,341.28 339.96,340.67 338.95,340.00 338.95,340.00 338.10,339.37 337.26,338.70 336.41,337.98 335.56,337.22 334.72,336.42 333.87,335.58 333.87,335.58 333.92,334.36 333.97,333.02 334.02,331.58 334.07,330.02 334.12,328.35 334.17,326.56 334.17,326.56 334.37,324.86 334.57,323.06 334.77,321.17 334.98,319.18 335.18,317.10 335.38,314.92 335.38,314.92 335.23,313.50 335.08,312.04 334.92,310.54 334.77,309.01 334.62,307.44 334.47,305.84 334.47,305.84 333.11,306.39 331.76,306.93 330.40,307.45 329.05,307.96 327.70,308.45 326.34,308.93 326.34,308.93 324.57,310.39 322.79,311.78 321.01,313.11 319.24,314.37 317.46,315.57 315.69,316.71 315.69,316.71 313.39,318.60 311.09,320.33 308.79,321.90 306.50,323.30 304.20,324.54 301.90,325.61 301.90,325.61 300.66,325.90 299.42,326.16 298.17,326.40 296.93,326.60 295.69,326.78 294.45,326.94 294.45,326.94 294.32,326.77 294.19,326.59 294.05,326.42 293.92,326.25 293.79,326.07 293.66,325.89 293.66,325.89 294.69,325.17 295.71,324.36 296.73,323.47 297.76,322.50 298.78,321.45 299.81,320.31 299.81,320.31 300.22,319.84 300.64,319.36 301.06,318.86 301.47,318.35 301.89,317.83 302.30,317.29 302.30,317.29 301.90,317.57 301.50,317.85 301.11,318.12 300.71,318.39 300.31,318.65 299.91,318.90 299.91,318.90 299.09,319.63 298.28,320.31 297.46,320.97 296.64,321.59 295.82,322.18 295.01,322.74 295.01,322.74 294.14,323.44 293.28,324.08 292.41,324.68 291.55,325.23 290.68,325.72 289.82,326.16 289.82,326.16 290.38,326.04 290.95,325.91 291.52,325.77 292.09,325.62 292.66,325.46 293.23,325.28 293.23,325.28 294.16,324.85 295.09,324.38 296.02,323.86 296.95,323.31 297.88,322.72 298.81,322.10 298.81,322.10 300.33,320.92 301.84,319.63 303.36,318.24 304.87,316.73 306.38,315.11 307.90,313.38 307.90,313.38 309.23,311.76 310.57,310.05 311.90,308.25 313.24,306.37 314.57,304.40 315.90,302.34 315.90,302.34 316.67,301.03 317.43,299.69 318.20,298.31 318.96,296.90 319.73,295.46 320.49,293.99 320.49,293.99 319.92,294.96 319.35,295.91 318.78,296.85 318.20,297.78 317.63,298.69 317.06,299.59 317.06,299.59 316.22,301.20 315.39,302.77 314.55,304.30 313.72,305.78 312.88,307.22 312.05,308.61 312.05,308.61 310.74,310.46 309.42,312.22 308.11,313.89 306.80,315.46 305.49,316.95 304.17,318.35 304.17,318.35 302.63,319.81 301.09,321.15 299.54,322.38 298.00,323.48 296.46,324.47 294.91,325.34 294.91,325.34 293.59,326.08 292.28,326.71 290.96,327.25 289.64,327.68 288.32,328.01 287.00,328.24 287.00,328.24 286.86,328.32 286.73,328.40 286.59,328.47 286.45,328.54 286.31,328.60 286.18,328.66 286.18,328.66 287.00,328.68 287.83,328.67 288.66,328.63 289.48,328.57 290.31,328.49 291.14,328.38 291.14,328.38 292.48,328.05 293.83,327.63 295.18,327.12 296.53,326.53 297.87,325.85 299.22,325.08 299.22,325.08 300.55,324.20 301.87,323.24 303.20,322.18 304.53,321.04 305.85,319.81 307.18,318.49 307.18,318.49 307.85,317.67 308.51,316.82 309.18,315.95 309.85,315.05 310.51,314.12 311.18,313.16 311.18,313.16 311.20,313.16 311.22,313.17 311.23,313.18 311.25,313.19 311.27,313.20 311.28,313.21 311.28,313.21 311.05,313.51 310.82,313.81 310.59,314.11 310.36,314.40 310.12,314.69 309.89,314.98 309.89,314.98 309.56,315.44 309.23,315.90 308.90,316.34 308.58,316.78 308.25,317.22 307.92,317.64 307.92,317.64 307.59,318.12 307.26,318.59 306.92,319.05 306.59,319.50 306.26,319.95 305.93,320.38 305.93,320.38 305.33,321.13 304.73,321.84 304.13,322.53 303.52,323.19 302.92,323.82 302.32,324.42 302.32,324.42 302.57,324.26 302.82,324.11 303.07,323.95 303.32,323.79 303.57,323.62 303.82,323.46 303.82,323.46 304.38,323.08 304.94,322.68 305.49,322.28 306.05,321.86 306.61,321.43 307.17,320.98 307.17,320.98 307.89,320.29 308.62,319.57 309.34,318.83 310.06,318.06 310.79,317.26 311.51,316.44" class="mf-trail-halo"/><polyline fill="none" points="446.71,325.39 448.64,328.98 450.56,332.18 452.48,334.99 454.40,337.41 456.32,339.44 458.24,341.08 458.24,341.08 460.78,342.84 463.31,343.75 465.85,343.79 468.38,342.98 470.92,341.31 473.46,338.79 473.46,338.79 474.25,336.65 475.05,334.09 475.84,331.10 476.64,327.69 477.44,323.85 478.23,319.58 478.23,319.58 476.95,318.10 475.66,316.54 474.37,314.92 473.09,313.22 471.80,311.46 470.52,309.63 470.52,309.63 467.73,310.50 464.94,311.36 462.16,312.19 459.37,312.99 456.58,313.78 453.80,314.54 453.80,314.54 449.96,316.83 446.12,319.03 442.29,321.14 438.45,323.15 434.62,325.07 430.78,326.89 430.78,326.89 426.33,329.52 421.89,331.96 417.45,334.21 413.00,336.25 408.56,338.11 404.11,339.77 404.11,339.77 400.02,341.05 395.93,342.18 391.84,343.16 387.75,343.99 383.65,344.66 379.56,345.18 379.56,345.18 376.30,345.28 373.04,345.34 369.77,345.33 366.51,345.28 363.25,345.16 359.99,345.00 359.99,345.00 357.49,344.74 354.99,344.47 352.50,344.18 350.00,343.87 347.50,343.54 345.01,343.20 345.01,343.20 344.00,342.80 342.99,342.35 341.98,341.84 340.97,341.28 339.96,340.67 338.95,340.00 338.95,340.00 338.10,339.37 337.26,338.70 336.41,337.98 335.56,337.22 334.72,336.42 333.87,335.58 333.87,335.58 333.92,334.36 333.97,333.02 334.02,331.58 334.07,330.02 334.12,328.35 334.17,326.56 334.17,326.56 334.37,324.86 334.57,323.06 334.77,321.17 334.98,319.18 335.18,317.10 335.38,314.92 335.38,314.92 335.23,313.50 335.08,312.04 334.92,310.54 334.77,309.01 334.62,307.44 334.47,305.84 334.47,305.84 333.11,306.39 331.76,306.93 330.40,307.45 329.05,307.96 327.70,308.45 326.34,308.93 326.34,308.93 324.57,310.39 322.79,311.78 321.01,313.11 319.24,314.37 317.46,315.57 315.69,316.71 315.69,316.71 313.39,318.60 311.09,320.33 308.79,321.90 306.50,323.30 304.20,324.54 301.90,325.61 301.90,325.61 300.66,325.90 299.42,326.16 298.17,326.40 296.93,326.60 295.69,326.78 294.45,326.94 294.45,326.94 294.32,326.77 294.19,326.59 294.05,326.42 293.92,326.25 293.79,326.07 293.66,325.89 293.66,325.89 294.69,325.17 295.71,324.36 296.73,323.47 297.76,322.50 298.78,321.45 299.81,320.31 299.81,320.31 300.22,319.84 300.64,319.36 301.06,318.86 301.47,318.35 301.89,317.83 302.30,317.29 302.30,317.29 301.90,317.57 301.50,317.85 301.11,318.12 300.71,318.39 300.31,318.65 299.91,318.90 299.91,318.90 299.09,319.63 298.28,320.31 297.46,320.97 296.64,321.59 295.82,322.18 295.01,322.74 295.01,322.74 294.14,323.44 293.28,324.08 292.41,324.68 291.55,325.23 290.68,325.72 289.82,326.16 289.82,326.16 290.38,326.04 290.95,325.91 291.52,325.77 292.09,325.62 292.66,325.46 293.23,325.28 293.23,325.28 294.16,324.85 295.09,324.38 296.02,323.86 296.95,323.31 297.88,322.72 298.81,322.10 298.81,322.10 300.33,320.92 301.84,319.63 303.36,318.24 304.87,316.73 306.38,315.11 307.90,313.38 307.90,313.38 309.23,311.76 310.57,310.05 311.90,308.25 313.24,306.37 314.57,304.40 315.90,302.34 315.90,302.34 316.67,301.03 317.43,299.69 318.20,298.31 318.96,296.90 319.73,295.46 320.49,293.99 320.49,293.99 319.92,294.96 319.35,295.91 318.78,296.85 318.20,297.78 317.63,298.69 317.06,299.59 317.06,299.59 316.22,301.20 315.39,302.77 314.55,304.30 313.72,305.78 312.88,307.22 312.05,308.61 312.05,308.61 310.74,310.46 309.42,312.22 308.11,313.89 306.80,315.46 305.49,316.95 304.17,318.35 304.17,318.35 302.63,319.81 301.09,321.15 299.54,322.38 298.00,323.48 296.46,324.47 294.91,325.34 294.91,325.34 293.59,326.08 292.28,326.71 290.96,327.25 289.64,327.68 288.32,328.01 287.00,328.24 287.00,328.24 286.86,328.32 286.73,328.40 286.59,328.47 286.45,328.54 286.31,328.60 286.18,328.66 286.18,328.66 287.00,328.68 287.83,328.67 288.66,328.63 289.48,328.57 290.31,328.49 291.14,328.38 291.14,328.38 292.48,328.05 293.83,327.63 295.18,327.12 296.53,326.53 297.87,325.85 299.22,325.08 299.22,325.08 300.55,324.20 301.87,323.24 303.20,322.18 304.53,321.04 305.85,319.81 307.18,318.49 307.18,318.49 307.85,317.67 308.51,316.82 309.18,315.95 309.85,315.05 310.51,314.12 311.18,313.16 311.18,313.16 311.20,313.16 311.22,313.17 311.23,313.18 311.25,313.19 311.27,313.20 311.28,313.21 311.28,313.21 311.05,313.51 310.82,313.81 310.59,314.11 310.36,314.40 310.12,314.69 309.89,314.98 309.89,314.98 309.56,315.44 309.23,315.90 308.90,316.34 308.58,316.78 308.25,317.22 307.92,317.64 307.92,317.64 307.59,318.12 307.26,318.59 306.92,319.05 306.59,319.50 306.26,319.95 305.93,320.38 305.93,320.38 305.33,321.13 304.73,321.84 304.13,322.53 303.52,323.19 302.92,323.82 302.32,324.42 302.32,324.42 302.57,324.26 302.82,324.11 303.07,323.95 303.32,323.79 303.57,323.62 303.82,323.46 303.82,323.46 304.38,323.08 304.94,322.68 305.49,322.28 306.05,321.86 306.61,321.43 307.17,320.98 307.17,320.98 307.89,320.29 308.62,319.57 309.34,318.83 310.06,318.06 310.79,317.26 311.51,316.44" class="mf-memory-arrow"/><circle cx="311.50961715209274" cy="316.4350883693336" r="6" class="mf-blue-dot"/></g><line x1="24" y1="418" x2="48" y2="418" class="mf-noise" /><text x="58" y="423" class="mf-small" text-anchor="start">raw gradient</text><line x1="360" y1="418" x2="384" y2="418" class="mf-memory-arrow" /><text x="394" y="423" class="mf-small" text-anchor="start">momentum</text><text x="24" y="454" class="mf-small" text-anchor="start">Memory carries the path past w₁ = 0.</text><text x="24" y="479" class="mf-small" text-anchor="start">Smoothing does not remove overshoot.</text><text x="24" y="515" class="mf-small" text-anchor="start">Position along the valley, w₁</text><line x1="50" y1="578" x2="690" y2="578" class="mf-objective" /><text x="28" y="583" class="mf-small" text-anchor="start">0</text><polyline fill="none" points="50.00,529.40 63.33,535.81 76.67,541.95 90.00,547.35 103.33,551.45 116.67,554.60 130.00,558.74 143.33,561.33 156.67,563.26 170.00,565.69 183.33,567.01 196.67,567.99 210.00,568.87 223.33,569.38 236.67,569.82 250.00,570.78 263.33,572.44 276.67,572.93 290.00,573.51 303.33,575.01 316.67,574.60 330.00,575.22 343.33,575.16 356.67,576.16 370.00,576.39 383.33,575.86 396.67,576.13 410.00,576.98 423.33,577.40 436.67,577.76 450.00,578.54 463.33,579.03 476.67,578.11 490.00,578.93 503.33,579.44 516.67,578.66 530.00,578.03 543.33,578.19 556.67,578.72 570.00,578.97 583.33,579.75 596.67,579.09 610.00,579.22 623.33,578.91 636.67,578.54 650.00,578.07 663.33,578.83 676.67,578.49 690.00,578.85" class="mf-noise"/><polyline fill="none" points="50.00,529.40 63.33,530.68 76.67,533.08 90.00,536.33 103.33,540.05 116.67,543.98 130.00,548.25 143.33,552.48 156.67,556.49 170.00,560.38 183.33,563.90 196.67,567.01 210.00,569.69 223.33,571.92 236.67,573.71 250.00,575.24 263.33,576.66 276.67,577.78 290.00,578.65 303.33,579.51 316.67,579.99 330.00,580.34 343.33,580.47 356.67,580.63 370.00,580.67 383.33,580.48 396.67,580.25 410.00,580.12 423.33,580.02 436.67,579.93 450.00,579.96 463.33,580.04 476.67,579.89 490.00,579.88 503.33,579.96 516.67,579.84 530.00,579.59 543.33,579.38 556.67,579.28 570.00,579.24 583.33,579.35 596.67,579.32 610.00,579.32 623.33,579.25 636.67,579.11 650.00,578.89 663.33,578.85 676.67,578.74 690.00,578.72" class="mf-memory-arrow"/><text x="50" y="614" class="mf-small" text-anchor="start">0</text><text x="690" y="614" class="mf-small" text-anchor="end">48 steps</text><text x="24" y="646" class="mf-small" text-anchor="start">Loss: raw 0.334 · memory 0.018</text><text x="24" y="671" class="mf-small" text-anchor="start">Sideways travel: 16.68 vs 3.63</text></svg>
<figcaption>Height is loss; the two floor coordinates are weights. Sideways travel counts the total movement across the narrow valley. The lower plot shows the position along the valley: crossing below zero means passing the minimum in that direction. Both methods take 48 computed steps with α = 0.14. Smooth motion between steps is only a visual aid.</figcaption></figure>
<div class="muon-controls" data-animation="momentumlandscape"><button data-action="play" disabled>Play animation</button><button data-action="restart" disabled>Restart</button><button data-action="previous-step" disabled>← Back</button><button data-action="next-step" disabled>Next →</button><button data-action="toggle-noise" disabled>Remove batch noise</button><button data-action="longer-memory" disabled>Longer memory: β = 0.95</button><button data-action="zoom-in" aria-label="Zoom in on the momentum surface" disabled>Zoom +</button><button data-action="zoom-out" aria-label="Zoom out of the momentum surface" disabled>Zoom −</button><button data-action="reset-view" disabled>Reset view</button><span data-status>Drag to rotate. Compare noisy steps with their moving average.</span></div>

<p>Watch the dark path bounce across the valley while the blue path filters those changing directions. Then remove the noise and try longer memory. The blue path can pass the minimum because its stored direction takes time to reverse. Momentum reduces jitter in this example; it does not guarantee that we avoid overshooting. The learning rate and memory length both matter. <a href="https://distill.pub/2017/momentum/" target="_blank" rel="noopener noreferrer" class="external">Why Momentum Really Works</a> explores this behavior in detail.</p>
<p>Use this momentum estimate in our update:</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><menclose notation="box"><mstyle scriptlevel="0" displaystyle="false"><mstyle scriptlevel="0" displaystyle="false"><mstyle scriptlevel="0" displaystyle="true"><mrow><msub><mi>W</mi><mrow><mi>t</mi><mo>+</mo><mn>1</mn></mrow></msub><mo>=</mo><msub><mi>W</mi><mi>t</mi></msub><mo>−</mo><msub><mi>η</mi><mi>t</mi></msub><mtext> </mtext><mi mathvariant="normal">polar</mi><mo>⁡</mo><mo stretchy="false">(</mo><msub><mi>M</mi><mi>t</mi></msub><mo stretchy="false">)</mo><mi mathvariant="normal">.</mi></mrow></mstyle></mstyle></mstyle></menclose></mrow><annotation encoding="application/x-tex">\boxed{W_{t+1}=W_t-\eta_t\,\operatorname{polar}(M_t).}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.68em;vertical-align:-0.59em;"></span><span class="mord"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.09em;"><span style="top:-3.68em;"><span class="pstrut" style="height:3.68em;"></span><span class="boxpad"><span class="mord"><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">t</span><span class="mbin mtight">+</span><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2083em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">η</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop"><span class="mord mathrm">polar</span></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">M</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span><span class="mord">.</span></span></span></span></span><span style="top:-3.09em;"><span class="pstrut" style="height:3.68em;"></span><span class="stretchy fbox" style="height:1.68em;border-style:solid;border-width:0.04em;"></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.59em;"><span></span></span></span></span></span></span></span></span></span></div>
<p>Momentum followed by orthogonalization gives the idealized core of Muon. Its step optimizes the local score built from <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>M</mi><mi>t</mi></msub></mrow><annotation encoding="application/x-tex">M_t</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">M</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>,</span> so it need not decrease the current minibatch&#39;s loss.</p>
<details class="muon-aside" id="momentum-details">
<summary>How much history is in that average, and why this order?</summary>

<p>Expanding the recurrence gives <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>M</mi><mi>t</mi></msub><mo>=</mo><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><mi>β</mi><mo stretchy="false">)</mo><msubsup><mo>∑</mo><mrow><mi>s</mi><mo>=</mo><mn>1</mn></mrow><mi>t</mi></msubsup><msup><mi>β</mi><mrow><mi>t</mi><mo>−</mo><mi>s</mi></mrow></msup><msub><mi>G</mi><mi>s</mi></msub></mrow><annotation encoding="application/x-tex">M_t=(1-\beta)\sum_{s=1}^t\beta^{t-s}G_s</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">M</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.2332em;vertical-align:-0.2997em;"></span><span class="mord mathnormal" style="margin-right:0.0528em;">β</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop"><span class="mop op-symbol small-op" style="position:relative;top:0em;">∑</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.9335em;"><span style="top:-2.4003em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">s</span><span class="mrel mtight">=</span><span class="mord mtight">1</span></span></span></span><span style="top:-3.2029em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2997em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0528em;">β</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7936em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">t</span><span class="mbin mtight">−</span><span class="mord mathnormal mtight">s</span></span></span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal">G</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">s</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>.</span> Older gradients fade geometrically. The weights sum to <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mo>−</mo><msup><mi>β</mi><mi>t</mi></msup></mrow><annotation encoding="application/x-tex">1-\beta^t</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.988em;vertical-align:-0.1944em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0528em;">β</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7936em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span></span></span></span></span></span></span></span>,</span> so starting at zero pulls early estimates toward zero.</p>
<p>Average first, then orthogonalize. These operations do not commute. In one dimension, averaging <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>10</mn></mrow><annotation encoding="application/x-tex">10</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">10</span></span></span></span></span> and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">-1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">−</span><span class="mord">1</span></span></span></span></span> gives a positive number whose sign is <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>+</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">+1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">+</span><span class="mord">1</span></span></span></span>.</span> Averaging their signs gives zero. The sign function is the scalar version of the polar transformation.</p>
</details>

<p>So far, our optimizer has a clean formula and an SVD bill. Let&#39;s deal with the bill.</p>
<div id="make-the-matrix-do-the-svd-algebra-for-us" class="section-alias" aria-hidden="true"></div>

<h2 id="change-the-stretches-without-finding-the-directions"><a class="anchor" href="#change-the-stretches-without-finding-the-directions" aria-label="Permalink">§</a>Change the stretches without finding the directions</h2>
<p>Computing a full decomposition at every training step would be expensive. But look at what we actually need from the momentum matrix:</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mi>M</mi></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><msub><mi>U</mi><mi>r</mi></msub><msub><mi mathvariant="normal">Σ</mi><mi>r</mi></msub><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mi>Q</mi></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><msub><mi>U</mi><mi>r</mi></msub><msub><mi>I</mi><mi>r</mi></msub><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup><mo>=</mo><msub><mi>U</mi><mi>r</mi></msub><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
M&amp;=U_r\Sigma_rV_r^\top,\\[10pt]
Q&amp;=U_rI_rV_r^\top=U_rV_r^\top.
\end{aligned}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:3.8182em;vertical-align:-1.6591em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:2.1591em;"><span style="top:-4.26em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">M</span></span></span><span style="top:-1.7009em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">Q</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.6591em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:2.1591em;"><span style="top:-4.26em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord">Σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mpunct">,</span></span></span><span style="top:-1.7009em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">I</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.6591em;"><span></span></span></span></span></span></span></span></span></span></span></span></div>
<p>The step from <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="normal">Σ</mi><mi>r</mi></msub></mrow><annotation encoding="application/x-tex">\Sigma_r</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord">Σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> to <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>I</mi><mi>r</mi></msub></mrow><annotation encoding="application/x-tex">I_r</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">I</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> is the important choice here. Let&#39;s work through why we made it, starting with two numbers instead of the whole factorization.</p>
<p>Suppose the momentum matrix is diagonal, with stretches (singular values on the diagonal of <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="normal">Σ</mi><mi>r</mi></msub></mrow><annotation encoding="application/x-tex">\Sigma_r</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord">Σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span>) equal to 10 and 1. Its input and output directions are just the two coordinate axes. Set the allowed output-change budget to <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">\eta=1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span>.</span> We are choosing an update, so we may choose its length in each of those directions.</p>
<p>Recall our score: multiply each slope by its proposed change, then add. Here we use the momentum values 10 and 1 as averaged slopes. A more negative total is better according to that score. Consider these two choices:</p>
<div class="table-scroll"><table><thead><tr><th align="left">Update along the two axes</th><th align="left">Largest output change for a unit input</th><th align="left">Score using the momentum</th></tr></thead><tbody>
<tr><td align="left"><span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">-1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">−</span><span class="mord">1</span></span></span></span></span> and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><mn>0.1</mn></mrow><annotation encoding="application/x-tex">-0.1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">−</span><span class="mord">0.1</span></span></span></span></span></td><td align="left"><span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn></mrow><annotation encoding="application/x-tex">1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span></span></td><td align="left"><span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>10</mn><mo stretchy="false">(</mo><mo>−</mo><mn>1</mn><mo stretchy="false">)</mo><mo>+</mo><mn>1</mn><mo stretchy="false">(</mo><mo>−</mo><mn>0.1</mn><mo stretchy="false">)</mo><mo>=</mo><mo>−</mo><mn>10.1</mn></mrow><annotation encoding="application/x-tex">10(-1)+1(-0.1)=-10.1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">10</span><span class="mopen">(</span><span class="mord">−</span><span class="mord">1</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">1</span><span class="mopen">(</span><span class="mord">−</span><span class="mord">0.1</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">−</span><span class="mord">10.1</span></span></span></span></span></td></tr>
<tr><td align="left"><span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">-1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">−</span><span class="mord">1</span></span></span></span></span> and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">-1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">−</span><span class="mord">1</span></span></span></span></span></td><td align="left"><span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn></mrow><annotation encoding="application/x-tex">1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span></span></td><td align="left"><span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>10</mn><mo stretchy="false">(</mo><mo>−</mo><mn>1</mn><mo stretchy="false">)</mo><mo>+</mo><mn>1</mn><mo stretchy="false">(</mo><mo>−</mo><mn>1</mn><mo stretchy="false">)</mo><mo>=</mo><mo>−</mo><mn>11</mn></mrow><annotation encoding="application/x-tex">10(-1)+1(-1)=-11</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">10</span><span class="mopen">(</span><span class="mord">−</span><span class="mord">1</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">1</span><span class="mopen">(</span><span class="mord">−</span><span class="mord">1</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">−</span><span class="mord">11</span></span></span></span></span></td></tr>
</tbody></table></div>
<p>The first choice preserves the momentum&#39;s 10-to-1 ratio. The second moves farther along the weaker direction. <strong>Both obey the same budget</strong>, and the second has the more negative score. Keeping that ratio would give up an improvement we are allowed to take.</p>
<p>Why doesn&#39;t moving in both directions break the budget? Take any unit input <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi><mo>=</mo><mo stretchy="false">(</mo><msub><mi>x</mi><mn>1</mn></msub><mo separator="true">,</mo><msub><mi>x</mi><mn>2</mn></msub><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">x=(x_1,x_2)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">x</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span></span></span></span>,</span> so <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>x</mi><mn>1</mn><mn>2</mn></msubsup><mo>+</mo><msubsup><mi>x</mi><mn>2</mn><mn>2</mn></msubsup><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">x_1^2+x_2^2=1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0622em;vertical-align:-0.2481em;"></span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-2.4519em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2481em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.0622em;vertical-align:-0.2481em;"></span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-2.4519em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2481em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span>.</span> The second update sends it to <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mo>−</mo><msub><mi>x</mi><mn>1</mn></msub><mo separator="true">,</mo><mo>−</mo><msub><mi>x</mi><mn>2</mn></msub><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(-x_1,-x_2)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord">−</span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">−</span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span></span></span></span>,</span> whose length is still 1. The input cannot have length 1 along both axes at once. That is why the spectral budget permits an update length of 1 along each axis. A Frobenius budget would instead measure the entries together as <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msqrt><mrow><msup><mn>1</mn><mn>2</mn></msup><mo>+</mo><msup><mn>1</mn><mn>2</mn></msup></mrow></msqrt><mo>=</mo><msqrt><mn>2</mn></msqrt></mrow><annotation encoding="application/x-tex">\sqrt{1^2+1^2}=\sqrt2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.04em;vertical-align:-0.1266em;"></span><span class="mord sqrt"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.9134em;"><span class="svg-align" style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord" style="padding-left:0.833em;"><span class="mord"><span class="mord">1</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7401em;"><span style="top:-2.989em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord"><span class="mord">1</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7401em;"><span style="top:-2.989em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span></span><span style="top:-2.8734em;"><span class="pstrut" style="height:3em;"></span><span class="hide-tail" style="min-width:0.853em;height:1.08em;"><svg xmlns="http://www.w3.org/2000/svg" width="400em" height="1.08em" viewBox="0 0 400000 1080" preserveAspectRatio="xMinYMin slice"><path d="M95,702
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l0 -0
c5.3,-9.3,12,-14,20,-14
H400000v40H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M834 80h400000v40h-400000z"/></svg></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.1266em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.04em;vertical-align:-0.1328em;"></span><span class="mord sqrt"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.9072em;"><span class="svg-align" style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord" style="padding-left:0.833em;">2</span></span><span style="top:-2.8672em;"><span class="pstrut" style="height:3em;"></span><span class="hide-tail" style="min-width:0.853em;height:1.08em;"><svg xmlns="http://www.w3.org/2000/svg" width="400em" height="1.08em" viewBox="0 0 400000 1080" preserveAspectRatio="xMinYMin slice"><path d="M95,702
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l0 -0
c5.3,-9.3,12,-14,20,-14
H400000v40H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M834 80h400000v40h-400000z"/></svg></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.1328em;"><span></span></span></span></span></span></span></span></span></span> and reject this update when <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">\eta=1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span>.</span> These are different definitions of a small update.</p>
<p>Now connect those numbers to the general matrix. Recall that the SVD describes each input direction <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>v</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">v_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">v</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> and its corresponding output direction <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>u</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">u_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">u</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>:</span></p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>M</mi><msub><mi>v</mi><mi>i</mi></msub><mo>=</mo><msub><mi>σ</mi><mi>i</mi></msub><msub><mi>u</mi><mi>i</mi></msub><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">Mv_i=\sigma_i u_i.</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord mathnormal" style="margin-right:0.109em;">M</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">v</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal">u</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span></span></div>
<p>Here <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>σ</mi><mi>i</mi></msub><mo>&gt;</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\sigma_i&gt;0</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6891em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">&gt;</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0</span></span></span></span></span> is the original stretch. It tells us what <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.109em;">M</span></span></span></span></span> does; it does not require our update <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span></span></span></span></span> to use that same length. Introduce <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>a</mi><mi>i</mi></msub><mo>≥</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">a_i\geq0</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.786em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">a</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">≥</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0</span></span></span></span></span> as the <strong>update length we choose</strong> in direction <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>i</mi></mrow><annotation encoding="application/x-tex">i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6595em;"></span><span class="mord mathnormal">i</span></span></span></span>.</span> To move against the momentum, we ask for</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>D</mi><msub><mi>v</mi><mi>i</mi></msub><mo>=</mo><mo>−</mo><msub><mi>a</mi><mi>i</mi></msub><msub><mi>u</mi><mi>i</mi></msub><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">Dv_i=-a_i u_i.</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">v</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7333em;vertical-align:-0.15em;"></span><span class="mord">−</span><span class="mord"><span class="mord mathnormal">a</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal">u</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span></span></div>
<p>This is our proposed update rule, not another property of the SVD. It means: when the input points along <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>v</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">v_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">v</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>,</span> the change in the layer&#39;s output points opposite <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>u</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">u_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">u</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>,</span> with length <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>a</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">a_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">a</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>.</span> One matrix that does this in every active direction is</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>D</mi><mo>=</mo><mo>−</mo><msub><mi>U</mi><mi>r</mi></msub><mi mathvariant="normal">diag</mi><mo>⁡</mo><mo stretchy="false">(</mo><msub><mi>a</mi><mn>1</mn></msub><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><msub><mi>a</mi><mi>r</mi></msub><mo stretchy="false">)</mo><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">D=-U_r\operatorname{diag}(a_1,\ldots,a_r)V_r^\top.</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.1491em;vertical-align:-0.25em;"></span><span class="mord">−</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop"><span class="mord mathrm" style="margin-right:0.0139em;">diag</span></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">a</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner">…</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">a</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span></span></div>
<p>As in the multiplication we checked earlier, <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup></mrow><annotation encoding="application/x-tex">V_r^\top</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0961em;vertical-align:-0.247em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span></span></span></span></span> selects a coordinate, the diagonal matrix scales it by <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>a</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">a_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">a</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>,</span> and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>U</mi><mi>r</mi></msub></mrow><annotation encoding="application/x-tex">U_r</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> turns it into <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>u</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">u_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">u</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>.</span> For this choice of <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span></span></span></span>,</span> the largest output stretch is <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mrow><mi>max</mi><mo>⁡</mo></mrow><mi>i</mi></msub><msub><mi>a</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">\max_i a_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mop"><span class="mop">max</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">a</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>.</span> The budget therefore says each <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>a</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">a_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">a</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> may be at most <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span></span></span></span>.</span></p>
<p>The score also comes from earlier: we used <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">⟨</mo><mi>G</mi><mo separator="true">,</mo><mi>D</mi><msub><mo stretchy="false">⟩</mo><mi>F</mi></msub></mrow><annotation encoding="application/x-tex">\langle G,D\rangle_F</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">⟨</span><span class="mord mathnormal">G</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mclose"><span class="mclose">⟩</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> to predict the loss change. After introducing momentum, we use <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">⟨</mo><mi>M</mi><mo separator="true">,</mo><mi>D</mi><msub><mo stretchy="false">⟩</mo><mi>F</mi></msub></mrow><annotation encoding="application/x-tex">\langle M,D\rangle_F</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">⟨</span><span class="mord mathnormal" style="margin-right:0.109em;">M</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mclose"><span class="mclose">⟩</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> to choose a step from the averaged slopes. This is a momentum-based score, not an exact prediction from the current gradient. Expanding it in the singular directions gives the same calculation as before:</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mo stretchy="false">⟨</mo><mi>M</mi><mo separator="true">,</mo><mi>D</mi><msub><mo stretchy="false">⟩</mo><mi>F</mi></msub></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><munder><mo>∑</mo><mi>i</mi></munder><msub><mi>σ</mi><mi>i</mi></msub><msubsup><mi>u</mi><mi>i</mi><mi mathvariant="normal">⊤</mi></msubsup><mi>D</mi><msub><mi>v</mi><mi>i</mi></msub></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><munder><mo>∑</mo><mi>i</mi></munder><msub><mi>σ</mi><mi>i</mi></msub><msubsup><mi>u</mi><mi>i</mi><mi mathvariant="normal">⊤</mi></msubsup><mo stretchy="false">(</mo><mo>−</mo><msub><mi>a</mi><mi>i</mi></msub><msub><mi>u</mi><mi>i</mi></msub><mo stretchy="false">)</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mo>−</mo><munder><mo>∑</mo><mi>i</mi></munder><msub><mi>σ</mi><mi>i</mi></msub><msub><mi>a</mi><mi>i</mi></msub><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
\langle M,D\rangle_F
&amp;=\sum_i\sigma_i u_i^\top Dv_i\\[8pt]
&amp;=\sum_i\sigma_i u_i^\top(-a_i u_i)\\[8pt]
&amp;=-\sum_i\sigma_i a_i.
\end{aligned}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:7.583em;vertical-align:-3.5415em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:4.0415em;"><span style="top:-6.0415em;"><span class="pstrut" style="height:3.05em;"></span><span class="mord"><span class="mopen">⟨</span><span class="mord mathnormal" style="margin-right:0.109em;">M</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mclose"><span class="mclose">⟩</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span><span style="top:-3.4138em;"><span class="pstrut" style="height:3.05em;"></span><span class="mord"></span></span><span style="top:-0.7862em;"><span class="pstrut" style="height:3.05em;"></span><span class="mord"></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:3.5415em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:4.0415em;"><span style="top:-6.0415em;"><span class="pstrut" style="height:3.05em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.05em;"><span style="top:-1.8723em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.2777em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal">u</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">v</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span><span style="top:-3.4138em;"><span class="pstrut" style="height:3.05em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.05em;"><span style="top:-1.8723em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.2777em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal">u</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord">−</span><span class="mord"><span class="mord mathnormal">a</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal">u</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span></span></span><span style="top:-0.7862em;"><span class="pstrut" style="height:3.05em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord">−</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.05em;"><span style="top:-1.8723em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.2777em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal">a</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:3.5415em;"><span></span></span></span></span></span></span></span></span></span></span></span></div>
<p>The last equality uses <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>u</mi><mi>i</mi><mi mathvariant="normal">⊤</mi></msubsup><msub><mi>u</mi><mi>i</mi></msub><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">u_i^\top u_i=1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.1078em;vertical-align:-0.2587em;"></span><span class="mord"><span class="mord mathnormal">u</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-2.4413em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2587em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal">u</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span>.</span> Each positive <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>σ</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">\sigma_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> multiplies a negative term, so increasing <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>a</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">a_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">a</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> makes the score smaller. We can increase every <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>a</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">a_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">a</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> to <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span></span></span></span></span> without exceeding the spectral budget. The earlier lower-bound argument shows this choice is optimal even among updates outside this proposed form.</p>
<p>All chosen lengths are now equal. Factoring out their common size <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span></span></span></span></span> leaves ones on the diagonal:</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><msub><mi>D</mi><mo>∗</mo></msub></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mo>−</mo><mi>η</mi><msub><mi>U</mi><mi>r</mi></msub><msub><mi>I</mi><mi>r</mi></msub><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mi>Q</mi></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><msub><mi>U</mi><mi>r</mi></msub><msub><mi>I</mi><mi>r</mi></msub><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
D_*&amp;=-\eta U_rI_rV_r^\top,\\[8pt]
Q&amp;=U_rI_rV_r^\top.
\end{aligned}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:3.6182em;vertical-align:-1.5591em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:2.0591em;"><span style="top:-4.16em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1757em;"><span style="top:-2.55em;margin-left:-0.0278em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mbin mtight">∗</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span><span style="top:-1.8009em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">Q</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.5591em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:2.0591em;"><span style="top:-4.16em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord">−</span><span class="mord mathnormal" style="margin-right:0.0359em;">η</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">I</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mpunct">,</span></span></span><span style="top:-1.8009em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">I</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.5591em;"><span></span></span></span></span></span></span></span></span></span></span></span></div>
<p>That is why we replace the positive stretches (the singular values stored in <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="normal">Σ</mi><mi>r</mi></msub></mrow><annotation encoding="application/x-tex">\Sigma_r</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord">Σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span>) by 1 in <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Q</mi></mrow><annotation encoding="application/x-tex">Q</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8778em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">Q</span></span></span></span>.</span> We keep the directions and choose new update lengths to fit our budget. The learning rate supplies the common size afterward. Only the middle factor becomes an identity; <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Q</mi></mrow><annotation encoding="application/x-tex">Q</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8778em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">Q</span></span></span></span></span> still maps the input directions to their corresponding output directions and generally is not the identity matrix.</p>
<p>Newton–Schulz offers a way to approach this target using repeated matrix multiplications. Before deriving its update, we need two tools: a multiplication that changes the stretches without changing their directions, and a scalar rule that brings each stretch toward 1 and keeps it there.</p>
<p>Start with the multiplication. Let <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>X</mi></mrow><annotation encoding="application/x-tex">X</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0785em;">X</span></span></span></span></span> be our current approximation. The following identity changes its stretches without computing the directions explicitly.</p>
<p>If <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>X</mi><mo>=</mo><msub><mi>U</mi><mi>r</mi></msub><msub><mi mathvariant="normal">Σ</mi><mi>r</mi></msub><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup></mrow><annotation encoding="application/x-tex">X=U_r\Sigma_rV_r^\top</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.0961em;vertical-align:-0.247em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord">Σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span></span></span></span>,</span> then</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>X</mi><msup><mi>X</mi><mi mathvariant="normal">⊤</mi></msup><mi>X</mi><mo>=</mo><msub><mi>U</mi><mi>r</mi></msub><msubsup><mi mathvariant="normal">Σ</mi><mi>r</mi><mn>3</mn></msubsup><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">XX^\top X=U_r\Sigma_r^3V_r^\top.</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8991em;"></span><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.1461em;vertical-align:-0.247em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord">Σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">3</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span></span></div>
<p>Multiplying by the transpose and then itself cubes every singular value while retaining the singular directions. That means</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>a</mi><mi>X</mi><mo>+</mo><mi>b</mi><mi>X</mi><msup><mi>X</mi><mi mathvariant="normal">⊤</mi></msup><mi>X</mi><mo>=</mo><msub><mi>U</mi><mi>r</mi></msub><mo stretchy="false">(</mo><mi>a</mi><msub><mi mathvariant="normal">Σ</mi><mi>r</mi></msub><mo>+</mo><mi>b</mi><msubsup><mi mathvariant="normal">Σ</mi><mi>r</mi><mn>3</mn></msubsup><mo stretchy="false">)</mo><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">aX+bXX^\top X=U_r(a\Sigma_r+b\Sigma_r^3)V_r^\top.</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7667em;vertical-align:-0.0833em;"></span><span class="mord mathnormal">a</span><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.8991em;"></span><span class="mord mathnormal">b</span><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal">a</span><span class="mord"><span class="mord">Σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.1491em;vertical-align:-0.25em;"></span><span class="mord mathnormal">b</span><span class="mord"><span class="mord">Σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">3</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mclose">)</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span></span></div>
<p>We can apply <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi><mo stretchy="false">(</mo><mi>s</mi><mo stretchy="false">)</mo><mo>=</mo><mi>a</mi><mi>s</mi><mo>+</mo><mi>b</mi><msup><mi>s</mi><mn>3</mn></msup></mrow><annotation encoding="application/x-tex">p(s)=as+bs^3</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">p</span><span class="mopen">(</span><span class="mord mathnormal">s</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6667em;vertical-align:-0.0833em;"></span><span class="mord mathnormal">a</span><span class="mord mathnormal">s</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.8141em;"></span><span class="mord mathnormal">b</span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">3</span></span></span></span></span></span></span></span></span></span></span></span> to all singular values using matrix multiplications alone. We never have to compute <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>U</mi><mi>r</mi></msub></mrow><annotation encoding="application/x-tex">U_r</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> or <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>V</mi><mi>r</mi></msub></mrow><annotation encoding="application/x-tex">V_r</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>.</span> That leaves a scalar design problem: choose <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi></mrow><annotation encoding="application/x-tex">p</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">p</span></span></span></span></span> so repeating it brings positive stretches (singular values stored in <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="normal">Σ</mi><mi>r</mi></msub></mrow><annotation encoding="application/x-tex">\Sigma_r</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord">Σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span>) to 1.</p>
<details class="muon-aside" id="svd-cancellation">
<summary>Show the factors cancelling</summary>

<p>The compact SVD has <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup><msub><mi>V</mi><mi>r</mi></msub><mo>=</mo><msub><mi>I</mi><mi>r</mi></msub></mrow><annotation encoding="application/x-tex">V_r^\top V_r=I_r</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0961em;vertical-align:-0.247em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">I</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>U</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup><msub><mi>U</mi><mi>r</mi></msub><mo>=</mo><msub><mi>I</mi><mi>r</mi></msub></mrow><annotation encoding="application/x-tex">U_r^\top U_r=I_r</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0961em;vertical-align:-0.247em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-2.453em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">I</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>.</span> Expand the product:</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mi>X</mi><msup><mi>X</mi><mi mathvariant="normal">⊤</mi></msup><mi>X</mi></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mo stretchy="false">(</mo><msub><mi>U</mi><mi>r</mi></msub><msub><mi mathvariant="normal">Σ</mi><mi>r</mi></msub><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup><mo stretchy="false">)</mo><mo stretchy="false">(</mo><msub><mi>V</mi><mi>r</mi></msub><msub><mi mathvariant="normal">Σ</mi><mi>r</mi></msub><msubsup><mi>U</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup><mo stretchy="false">)</mo><mo stretchy="false">(</mo><msub><mi>U</mi><mi>r</mi></msub><msub><mi mathvariant="normal">Σ</mi><mi>r</mi></msub><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup><mo stretchy="false">)</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><msub><mi>U</mi><mi>r</mi></msub><msub><mi mathvariant="normal">Σ</mi><mi>r</mi></msub><munder><munder><mrow><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup><msub><mi>V</mi><mi>r</mi></msub></mrow><mo stretchy="true">⏟</mo></munder><msub><mi>I</mi><mi>r</mi></msub></munder><msub><mi mathvariant="normal">Σ</mi><mi>r</mi></msub><munder><munder><mrow><msubsup><mi>U</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup><msub><mi>U</mi><mi>r</mi></msub></mrow><mo stretchy="true">⏟</mo></munder><msub><mi>I</mi><mi>r</mi></msub></munder><msub><mi mathvariant="normal">Σ</mi><mi>r</mi></msub><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><msub><mi>U</mi><mi>r</mi></msub><msubsup><mi mathvariant="normal">Σ</mi><mi>r</mi><mn>3</mn></msubsup><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
&amp;XX^\top X\\[8pt]
&amp;=(U_r\Sigma_rV_r^\top)(V_r\Sigma_rU_r^\top)
  (U_r\Sigma_rV_r^\top)\\[10pt]
&amp;=U_r\Sigma_r\underbrace{V_r^\top V_r}_{I_r}
\Sigma_r\underbrace{U_r^\top U_r}_{I_r}\Sigma_rV_r^\top\\[10pt]
&amp;=U_r\Sigma_r^3V_r^\top.
\end{aligned}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:9.0499em;vertical-align:-4.2749em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:4.7749em;"><span style="top:-6.7749em;"><span class="pstrut" style="height:2.8991em;"></span><span class="mord"></span></span><span style="top:-4.4158em;"><span class="pstrut" style="height:2.8991em;"></span><span class="mord"></span></span><span style="top:-1.8567em;"><span class="pstrut" style="height:2.8991em;"></span><span class="mord"></span></span><span style="top:1.0158em;"><span class="pstrut" style="height:2.8991em;"></span><span class="mord"></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:4.2749em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:4.7749em;"><span style="top:-6.8758em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.0785em;">X</span></span></span><span style="top:-4.5167em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord">Σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mclose">)</span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord">Σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mclose">)</span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord">Σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mclose">)</span></span></span><span style="top:-1.9576em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord">Σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner munder"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-1.4267em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0785em;">I</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1645em;"><span style="top:-2.357em;margin-left:-0.0785em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.143em;"><span></span></span></span></span></span></span></span></span></span><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="minner munder"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span class="svg-align" style="top:-2.105em;"><span class="pstrut" style="height:3em;"></span><span class="stretchy" style="height:0.548em;min-width:1.6em;"><span class="brace-left" style="height:0.548em;"><svg xmlns="http://www.w3.org/2000/svg" width="400em" height="0.548em" viewBox="0 0 400000 548" preserveAspectRatio="xMinYMin slice"><path d="M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z"/></svg></span><span class="brace-center" style="height:0.548em;"><svg xmlns="http://www.w3.org/2000/svg" width="400em" height="0.548em" viewBox="0 0 400000 548" preserveAspectRatio="xMidYMin slice"><path d="M199572 214
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z"/></svg></span><span class="brace-right" style="height:0.548em;"><svg xmlns="http://www.w3.org/2000/svg" width="400em" height="0.548em" viewBox="0 0 400000 548" preserveAspectRatio="xMaxYMin slice"><path d="M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z"/></svg></span></span></span><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.895em;"><span></span></span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.6734em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord">Σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner munder"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-1.4267em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0785em;">I</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1645em;"><span style="top:-2.357em;margin-left:-0.0785em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.143em;"><span></span></span></span></span></span></span></span></span></span><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="minner munder"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span class="svg-align" style="top:-2.105em;"><span class="pstrut" style="height:3em;"></span><span class="stretchy" style="height:0.548em;min-width:1.6em;"><span class="brace-left" style="height:0.548em;"><svg xmlns="http://www.w3.org/2000/svg" width="400em" height="0.548em" viewBox="0 0 400000 548" preserveAspectRatio="xMinYMin slice"><path d="M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z"/></svg></span><span class="brace-center" style="height:0.548em;"><svg xmlns="http://www.w3.org/2000/svg" width="400em" height="0.548em" viewBox="0 0 400000 548" preserveAspectRatio="xMidYMin slice"><path d="M199572 214
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z"/></svg></span><span class="brace-right" style="height:0.548em;"><svg xmlns="http://www.w3.org/2000/svg" width="400em" height="0.548em" viewBox="0 0 400000 548" preserveAspectRatio="xMaxYMin slice"><path d="M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z"/></svg></span></span></span><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.895em;"><span></span></span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.6734em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord">Σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span></span></span><span style="top:0.9149em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord">Σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">3</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:4.2749em;"><span></span></span></span></span></span></span></span></span></span></span></span></div>
<p>The same argument produces higher odd powers of <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="normal">Σ</mi><mi>r</mi></msub></mrow><annotation encoding="application/x-tex">\Sigma_r</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord">Σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>.</span> If a polynomial produces a negative value, that sign can be absorbed into a singular vector; the actual singular value is its magnitude. Our classical cubic below stays nonnegative on the interval we use.</p>
</details>

<div id="build-a-polynomial-that-brings-values-to-one" class="section-alias" aria-hidden="true"></div>

<h2 id="make-one-the-destination-and-keep-it-there"><a class="anchor" href="#make-one-the-destination-and-keep-it-there" aria-label="Permalink">§</a>Make one the destination, and keep it there</h2>
<p>Now we can work on one stretch at a time. If all the positive diagonal entries approach 1, then</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><msub><mi mathvariant="normal">Σ</mi><mrow><mi>r</mi><mo separator="true">,</mo><mi>k</mi></mrow></msub></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>⟶</mo><msub><mi>I</mi><mi>r</mi></msub><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><msub><mi>X</mi><mi>k</mi></msub><mo>=</mo><msub><mi>U</mi><mi>r</mi></msub><msub><mi mathvariant="normal">Σ</mi><mrow><mi>r</mi><mo separator="true">,</mo><mi>k</mi></mrow></msub><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>⟶</mo><msub><mi>U</mi><mi>r</mi></msub><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup><mo>=</mo><mi>Q</mi><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
\Sigma_{r,k}&amp;\longrightarrow I_r,\\[10pt]
X_k=U_r\Sigma_{r,k}V_r^\top&amp;\longrightarrow U_rV_r^\top=Q.
\end{aligned}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:3.7591em;vertical-align:-1.6296em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:2.1296em;"><span style="top:-4.2896em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"><span class="mord">Σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span><span class="mpunct mtight">,</span><span class="mord mathnormal mtight" style="margin-right:0.0315em;">k</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span></span></span><span style="top:-1.7304em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0315em;">k</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord">Σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span><span class="mpunct mtight">,</span><span class="mord mathnormal mtight" style="margin-right:0.0315em;">k</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.6296em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:2.1296em;"><span style="top:-4.2896em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">⟶</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">I</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mpunct">,</span></span></span><span style="top:-1.7304em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">⟶</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord mathnormal">Q</span><span class="mord">.</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.6296em;"><span></span></span></span></span></span></span></span></span></span></span></span></div>
<p>That is why 1 is the destination. Reaching it in the scalar calculation gives us the polar direction in the matrix calculation. We still need a rule for getting there.</p>
<p>Take one positive stretch <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>s</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">s_0</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">0</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> and repeatedly feed the result of a function back into that same function:</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>s</mi><mn>1</mn></msub><mo>=</mo><mi>p</mi><mo stretchy="false">(</mo><msub><mi>s</mi><mn>0</mn></msub><mo stretchy="false">)</mo><mo separator="true">,</mo><mspace width="2em"/><msub><mi>s</mi><mn>2</mn></msub><mo>=</mo><mi>p</mi><mo stretchy="false">(</mo><msub><mi>s</mi><mn>1</mn></msub><mo stretchy="false">)</mo><mo separator="true">,</mo><mspace width="2em"/><mo>…</mo></mrow><annotation encoding="application/x-tex">s_1=p(s_0),\qquad s_2=p(s_1),\qquad \ldots</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">p</span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">0</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span><span class="mpunct">,</span><span class="mspace" style="margin-right:2em;"></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">p</span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span><span class="mpunct">,</span><span class="mspace" style="margin-right:2em;"></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner">…</span></span></span></span></span></div>
<p>In general, <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>s</mi><mrow><mi>k</mi><mo>+</mo><mn>1</mn></mrow></msub><mo>=</mo><mi>p</mi><mo stretchy="false">(</mo><msub><mi>s</mi><mi>k</mi></msub><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">s_{k+1}=p(s_k)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6389em;vertical-align:-0.2083em;"></span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0315em;">k</span><span class="mbin mtight">+</span><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2083em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">p</span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0315em;">k</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span></span></span></span>.</span> Here <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.0315em;">k</span></span></span></span></span> counts these inner iterations, not training steps. We want the numbers to approach 1. Once a number gets there, another iteration should leave it there, so we require <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi><mo stretchy="false">(</mo><mn>1</mn><mo stretchy="false">)</mo><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">p(1)=1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">p</span><span class="mopen">(</span><span class="mord">1</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span>.</span> A value that a function leaves unchanged is called a <strong>fixed point</strong>.</p>
<p>Staying at the destination is only half the job. Nearby values also need to move toward it. For example, <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi><mo stretchy="false">(</mo><mi>s</mi><mo stretchy="false">)</mo><mo>=</mo><mstyle scriptlevel="0" displaystyle="false"><mfrac><mn>1</mn><mn>2</mn></mfrac></mstyle><mi>s</mi><mo>+</mo><mstyle scriptlevel="0" displaystyle="false"><mfrac><mn>1</mn><mn>2</mn></mfrac></mstyle></mrow><annotation encoding="application/x-tex">p(s)=\tfrac12s+\tfrac12</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">p</span><span class="mopen">(</span><span class="mord mathnormal">s</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.1901em;vertical-align:-0.345em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8451em;"><span style="top:-2.655em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">2</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.345em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mord mathnormal">s</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.1901em;vertical-align:-0.345em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8451em;"><span style="top:-2.655em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">2</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.345em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span></span></span> sends <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0.9</mn></mrow><annotation encoding="application/x-tex">0.9</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.9</span></span></span></span></span> to <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0.95</mn></mrow><annotation encoding="application/x-tex">0.95</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.95</span></span></span></span>,</span> then <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0.975</mn></mrow><annotation encoding="application/x-tex">0.975</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.975</span></span></span></span>,</span> halving the distance to 1 each time. But <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi><mo stretchy="false">(</mo><mi>s</mi><mo stretchy="false">)</mo><mo>=</mo><mn>2</mn><mi>s</mi><mo>−</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">p(s)=2s-1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">p</span><span class="mopen">(</span><span class="mord mathnormal">s</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">2</span><span class="mord mathnormal">s</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span></span> sends <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0.9</mn></mrow><annotation encoding="application/x-tex">0.9</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.9</span></span></span></span></span> to <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0.8</mn></mrow><annotation encoding="application/x-tex">0.8</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.8</span></span></span></span>,</span> then <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0.6</mn></mrow><annotation encoding="application/x-tex">0.6</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.6</span></span></span></span>.</span> Both fix 1; only the first attracts nearby values. A fixed point can be a place you approach or a place you get kicked away from.</p>
<details class="muon-aside" id="fixed-point-refresher">
<summary>Watch a value go into the function, then come back as its next input</summary>

<p>A fixed point is where <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi><mo>=</mo><mi>p</mi><mo stretchy="false">(</mo><mi>s</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">y=p(s)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">y</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">p</span><span class="mopen">(</span><span class="mord mathnormal">s</span><span class="mclose">)</span></span></span></span></span> meets <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi><mo>=</mo><mi>s</mi></mrow><annotation encoding="application/x-tex">y=s</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">y</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">s</span></span></span></span>.</span> Orange goes vertically to evaluate the function, then horizontally to the diagonal to reuse the output. The number also moves into the formula above the graph, so the geometry and substitution tell the same story.</p>
<div class="muon-controls" data-animation="fixedpoints"><button data-action="play" disabled>Play animation</button><button data-action="restart" disabled>Restart</button><button data-action="previous-step" disabled>← Back</button><button data-action="next-step" disabled>Next →</button><span data-status>Plug in the number. Reuse the result.</span></div>

<figure class="diagram"><svg xmlns="http://www.w3.org/2000/svg" class="muon-film" id="muon-fixedpoints" viewBox="0 0 720 590" role="img" aria-labelledby="muon-fixedpoints-title"><title id="muon-fixedpoints-title">An animated staircase compares attracting and repelling fixed points</title><desc>Repelling fixed point at 1. The error doubles at every step. Input 0.6000 moves into the fixed formula, which produces 0.2000. The output moves to the diagonal and is reused as the next input.</desc><text x="24" y="28" class="mf-strong" text-anchor="start">Same fixed point, opposite behavior</text><text x="24" y="54" class="mf-small" text-anchor="start">The error doubles at every step</text><foreignObject x="0" y="65" width="720" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="mf-memory-math" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi><mo stretchy="false">(</mo><mi>s</mi><mo stretchy="false">)</mo><mo>=</mo><mn>2</mn><mi>s</mi><mo>−</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">p(s)=2s-1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">p</span><span class="mopen">(</span><span class="mord mathnormal">s</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">2</span><span class="mord mathnormal">s</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span></span></div></foreignObject><foreignObject x="207" y="109" width="93" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>2</mn><mo>×</mo></mrow><annotation encoding="application/x-tex">2\times</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">2</span><span class="mord">×</span></span></span></span></span></div></foreignObject><foreignObject x="420" y="109" width="110" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">-1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">−</span><span class="mord">1</span></span></span></span></span></div></foreignObject><line x1="310" y1="153" x2="410" y2="153" class="mf-axis" /><foreignObject x="187" y="164" width="213" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="mf-result-math" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi><mo stretchy="false">(</mo><mn>0.6000</mn><mo stretchy="false">)</mo><mo>=</mo></mrow><annotation encoding="application/x-tex">p(0.6000)=</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">p</span><span class="mopen">(</span><span class="mord">0.6000</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span></span></span></span></span></div></foreignObject><g opacity="1"><text x="440" y="200" class="mf-accent-text" text-anchor="middle">0.2000</text></g><line x1="24" y1="228" x2="696" y2="228" class="mf-axis" /><line x1="55" y1="498" x2="334.59999999999997" y2="498" class="mf-axis" /><line x1="55" y1="498" x2="55" y2="218.40000000000003" class="mf-axis" /><text x="55" y="521" class="mf-small" text-anchor="middle">0</text><text x="171.5" y="521" class="mf-small" text-anchor="middle">0.5</text><text x="42" y="386.5" class="mf-small" text-anchor="end">0.5</text><text x="288" y="521" class="mf-small" text-anchor="middle">1</text><text x="42" y="270" class="mf-small" text-anchor="end">1</text><line x1="55" y1="498" x2="334.59999999999997" y2="218.40000000000003" class="mf-ink mf-dashed" /><line x1="171.5" y1="498" x2="311.3" y2="218.39999999999998" class="mf-memory-arrow" /><circle cx="288" cy="265" r="11" class="mf-fixed-ring"/><circle cx="288" cy="265" r="4" class="mf-open"/><polyline fill="none" points="264.70,498.00 264.70,311.60 241.40,311.60 241.40,358.20 194.80,358.20 194.80,451.40 101.60,451.40" class="mf-orange"/><circle cx="101.60000000000005" cy="451.4" r="5" class="mf-dot"/><line x1="288" y1="498" x2="288" y2="265" class="mf-target" /><line x1="55" y1="555" x2="79" y2="555" class="mf-memory-arrow" /><text x="87" y="561" class="mf-small" text-anchor="start">p(s)</text><line x1="187" y1="555" x2="211" y2="555" class="mf-ink mf-dashed" /><text x="221" y="561" class="mf-small" text-anchor="start">y = s</text><foreignObject x="365" y="270" width="330" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi><mo stretchy="false">(</mo><mn>1</mn><mo stretchy="false">)</mo><mo>=</mo><mn>1</mn><mspace width="1em"/><mtext>always</mtext></mrow><annotation encoding="application/x-tex">p(1)=1\quad\text{always}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">p</span><span class="mopen">(</span><span class="mord">1</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord">1</span><span class="mspace" style="margin-right:1em;"></span><span class="mord text"><span class="mord">always</span></span></span></span></span></span></div></foreignObject><foreignObject x="365" y="328" width="330" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>s</mi><mn>2</mn></msub><mo>=</mo><mn>0.6000</mn></mrow><annotation encoding="application/x-tex">s_2=0.6000</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.6000</span></span></span></span></span></div></foreignObject><foreignObject x="365" y="386" width="330" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="mf-result-math" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>s</mi><mn>3</mn></msub><mo>=</mo><mn>0.2000</mn></mrow><annotation encoding="application/x-tex">s_{3}=0.2000</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">3</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.2000</span></span></span></span></span></div></foreignObject><foreignObject x="365" y="444" width="330" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="mf-result-math" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">∣</mi><msub><mi>e</mi><mrow><mi>k</mi><mo>+</mo><mn>1</mn></mrow></msub><mi mathvariant="normal">∣</mi><mo>=</mo><mn>2</mn><mi mathvariant="normal">∣</mi><msub><mi>e</mi><mi>k</mi></msub><mi mathvariant="normal">∣</mi></mrow><annotation encoding="application/x-tex">|e_{k+1}|=2|e_k|</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">∣</span><span class="mord"><span class="mord mathnormal">e</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0315em;">k</span><span class="mbin mtight">+</span><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2083em;"><span></span></span></span></span></span></span><span class="mord">∣</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">2∣</span><span class="mord"><span class="mord mathnormal">e</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0315em;">k</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">∣</span></span></span></span></span></div></foreignObject><text x="530" y="528" class="mf-small" text-anchor="middle">Error: eₖ = sₖ − 1</text><g opacity="1"><text x="360" y="145" class="mf-blue-text" text-anchor="middle">0.6000</text></g></svg>
<figcaption>Both maps fix 1. Starting at 0.9, p(s) = ½s + ½ halves the error; p(s) = 2s − 1 doubles it. Watch the input travel into the function, the arithmetic appear, and the result feed the next iteration.</figcaption></figure>
</details>

<p>We want the attracting behavior, with fast error reduction near the target. Write the current stretch as <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi><mo>=</mo><mn>1</mn><mo>+</mo><mi>e</mi></mrow><annotation encoding="application/x-tex">s=1+e</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">s</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">e</span></span></span></span>,</span> where <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>e</mi></mrow><annotation encoding="application/x-tex">e</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">e</span></span></span></span></span> is its error. The local approximation we used for the loss now tells us how the next error behaves. Assuming <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi><mo stretchy="false">(</mo><mn>1</mn><mo stretchy="false">)</mo><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">p(1)=1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">p</span><span class="mopen">(</span><span class="mord">1</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span>,</span></p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>p</mi><mo stretchy="false">(</mo><mn>1</mn><mo>+</mo><mi>e</mi><mo stretchy="false">)</mo><mo>−</mo><mn>1</mn><mo>=</mo><msup><mi>p</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo stretchy="false">(</mo><mn>1</mn><mo stretchy="false">)</mo><mi>e</mi><mo>+</mo><mi>O</mi><mo stretchy="false">(</mo><msup><mi>e</mi><mn>2</mn></msup><mo stretchy="false">)</mo><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">p(1+e)-1=p&#x27;(1)e+O(e^2).</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">p</span><span class="mopen">(</span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">e</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.0519em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathnormal">p</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8019em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">′</span></span></span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord">1</span><span class="mclose">)</span><span class="mord mathnormal">e</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.1141em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">O</span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">e</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mclose">)</span><span class="mord">.</span></span></span></span></span></div>
<p>So <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>p</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo stretchy="false">(</mo><mn>1</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">p&#x27;(1)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0019em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathnormal">p</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7519em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">′</span></span></span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord">1</span><span class="mclose">)</span></span></span></span></span> multiplies the leading part of the error. A slope with magnitude below 1 shrinks nearby errors; choosing <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>p</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo stretchy="false">(</mo><mn>1</mn><mo stretchy="false">)</mo><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">p&#x27;(1)=0</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0019em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathnormal">p</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7519em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">′</span></span></span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord">1</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0</span></span></span></span></span> removes that linear term altogether. For the cubic <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi><mo stretchy="false">(</mo><mi>s</mi><mo stretchy="false">)</mo><mo>=</mo><mi>a</mi><mi>s</mi><mo>+</mo><mi>b</mi><msup><mi>s</mi><mn>3</mn></msup></mrow><annotation encoding="application/x-tex">p(s)=as+bs^3</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">p</span><span class="mopen">(</span><span class="mord mathnormal">s</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6667em;vertical-align:-0.0833em;"></span><span class="mord mathnormal">a</span><span class="mord mathnormal">s</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.8141em;"></span><span class="mord mathnormal">b</span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">3</span></span></span></span></span></span></span></span></span></span></span></span> that our matrix multiplication can compute, the two requirements are</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>p</mi><mo stretchy="false">(</mo><mn>1</mn><mo stretchy="false">)</mo><mo>=</mo><mn>1</mn></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mspace width="1em"/><mtext>keeps the target fixed</mtext><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><msup><mi>p</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo stretchy="false">(</mo><mn>1</mn><mo stretchy="false">)</mo><mo>=</mo><mn>0</mn></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mspace width="1em"/><mtext>removes the linear error</mtext><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
p(1)=1&amp;\quad\text{keeps the target fixed},\\[10pt]
p&#x27;(1)=0&amp;\quad\text{removes the linear error}.
\end{aligned}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:3.7em;vertical-align:-1.6em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:2.1em;"><span style="top:-4.26em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">p</span><span class="mopen">(</span><span class="mord">1</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord">1</span></span></span><span style="top:-1.76em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal">p</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8019em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">′</span></span></span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord">1</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord">0</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.6em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:2.1em;"><span style="top:-4.26em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:1em;"></span><span class="mord text"><span class="mord">keeps the target fixed</span></span><span class="mpunct">,</span></span></span><span style="top:-1.76em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:1em;"></span><span class="mord text"><span class="mord">removes the linear error</span></span><span class="mord">.</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.6em;"><span></span></span></span></span></span></span></span></span></span></span></span></div>
<p>Substituting the cubic and its derivative gives</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>a</mi><mo>+</mo><mi>b</mi></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mn>1</mn><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>a</mi><mo>+</mo><mn>3</mn><mi>b</mi></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mn>0.</mn></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
a+b&amp;=1,\\[8pt]
a+3b&amp;=0.
\end{aligned}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:3.5em;vertical-align:-1.5em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:2em;"><span style="top:-4.16em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">a</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal">b</span></span></span><span style="top:-1.86em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">a</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord">3</span><span class="mord mathnormal">b</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.5em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:2em;"><span style="top:-4.16em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord">1</span><span class="mpunct">,</span></span></span><span style="top:-1.86em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord">0.</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.5em;"><span></span></span></span></span></span></span></span></span></span></span></span></div>
<p>Subtract the first equation from the second: <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>2</mn><mi>b</mi><mo>=</mo><mo>−</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">2b=-1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord">2</span><span class="mord mathnormal">b</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">−</span><span class="mord">1</span></span></span></span>.</span> So <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>b</mi><mo>=</mo><mo>−</mo><mn>1</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow><annotation encoding="application/x-tex">b=-1/2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">b</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">−</span><span class="mord">1/2</span></span></span></span></span> and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><mo>=</mo><mn>3</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow><annotation encoding="application/x-tex">a=3/2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">a</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">3/2</span></span></span></span>.</span> Putting these coefficients back into the scalar rule and its matrix counterpart gives the classical <strong>Newton–Schulz</strong> iteration:</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>p</mi><mo stretchy="false">(</mo><mi>s</mi><mo stretchy="false">)</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mstyle scriptlevel="0" displaystyle="false"><mfrac><mn>3</mn><mn>2</mn></mfrac></mstyle><mi>s</mi><mo>−</mo><mstyle scriptlevel="0" displaystyle="false"><mfrac><mn>1</mn><mn>2</mn></mfrac></mstyle><msup><mi>s</mi><mn>3</mn></msup><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><msub><mi>X</mi><mrow><mi>k</mi><mo>+</mo><mn>1</mn></mrow></msub></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mstyle scriptlevel="0" displaystyle="false"><mfrac><mn>3</mn><mn>2</mn></mfrac></mstyle><msub><mi>X</mi><mi>k</mi></msub><mo>−</mo><mstyle scriptlevel="0" displaystyle="false"><mfrac><mn>1</mn><mn>2</mn></mfrac></mstyle><msub><mi>X</mi><mi>k</mi></msub><msubsup><mi>X</mi><mi>k</mi><mi mathvariant="normal">⊤</mi></msubsup><msub><mi>X</mi><mi>k</mi></msub><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
p(s)&amp;=\tfrac32s-\tfrac12s^3,\\[10pt]
X_{k+1}&amp;=\tfrac32X_k-\tfrac12X_kX_k^\top X_k.
\end{aligned}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:3.7832em;vertical-align:-1.6416em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:2.1416em;"><span style="top:-4.2775em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">p</span><span class="mopen">(</span><span class="mord mathnormal">s</span><span class="mclose">)</span></span></span><span style="top:-1.7184em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0315em;">k</span><span class="mbin mtight">+</span><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2083em;"><span></span></span></span></span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.6416em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:2.1416em;"><span style="top:-4.2775em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8451em;"><span style="top:-2.655em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">2</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">3</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.345em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mord mathnormal">s</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8451em;"><span style="top:-2.655em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">2</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.345em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">3</span></span></span></span></span></span></span></span><span class="mpunct">,</span></span></span><span style="top:-1.7184em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8451em;"><span style="top:-2.655em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">2</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">3</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.345em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0315em;">k</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8451em;"><span style="top:-2.655em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">2</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.345em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0315em;">k</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0315em;">k</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0315em;">k</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.6416em;"><span></span></span></span></span></span></span></span></span></span></span></span></div>
<p>Normalize a nonzero momentum matrix with <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>X</mi><mn>0</mn></msub><mo>=</mo><mi>M</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">∥</mi><mi>M</mi><msub><mi mathvariant="normal">∥</mi><mi>F</mi></msub></mrow><annotation encoding="application/x-tex">X_0=M/\|M\|_F</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">0</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.109em;">M</span><span class="mord">/∥</span><span class="mord mathnormal" style="margin-right:0.109em;">M</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>.</span> Since <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">∥</mi><mi>M</mi><msub><mi mathvariant="normal">∥</mi><mrow><mi mathvariant="normal">o</mi><mi mathvariant="normal">p</mi></mrow></msub><mo>≤</mo><mi mathvariant="normal">∥</mi><mi>M</mi><msub><mi mathvariant="normal">∥</mi><mi>F</mi></msub></mrow><annotation encoding="application/x-tex">\|M\|_{\mathrm{op}}\leq\|M\|_F</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0361em;vertical-align:-0.2861em;"></span><span class="mord">∥</span><span class="mord mathnormal" style="margin-right:0.109em;">M</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathrm mtight">op</span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">≤</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">∥</span><span class="mord mathnormal" style="margin-right:0.109em;">M</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>,</span> its singular values start in <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">[</mo><mn>0</mn><mo separator="true">,</mo><mn>1</mn><mo stretchy="false">]</mo></mrow><annotation encoding="application/x-tex">[0,1]</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">[</span><span class="mord">0</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">1</span><span class="mclose">]</span></span></span></span>.</span> Repeated cubic steps bring each positive one toward 1 and keep zero at zero. Consequently, the middle factor approaches <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>I</mi><mi>r</mi></msub></mrow><annotation encoding="application/x-tex">I_r</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">I</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>,</span> and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>X</mi><mi>k</mi></msub></mrow><annotation encoding="application/x-tex">X_k</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0315em;">k</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> approaches <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Q</mi><mo>=</mo><msub><mi>U</mi><mi>r</mi></msub><msubsup><mi>V</mi><mi>r</mi><mi mathvariant="normal">⊤</mi></msubsup></mrow><annotation encoding="application/x-tex">Q=U_rV_r^\top</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8778em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">Q</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.0961em;vertical-align:-0.247em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-2.453em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span></span></span></span>.</span> The scalar fixed point gives us the matrix direction we wanted. Zero stretches stay zero, so this also preserves the active subspace when the original matrix has missing directions.</p>
<details class="muon-aside" id="cubic-convergence">
<summary>Why do the iterates actually reach one?</summary>

<p>For <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0</mn><mo>&lt;</mo><mi>s</mi><mo>&lt;</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">0&lt;s&lt;1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6835em;vertical-align:-0.0391em;"></span><span class="mord">0</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">&lt;</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.5782em;vertical-align:-0.0391em;"></span><span class="mord mathnormal">s</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">&lt;</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span>,</span></p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>p</mi><mo stretchy="false">(</mo><mi>s</mi><mo stretchy="false">)</mo><mo>−</mo><mi>s</mi></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mstyle scriptlevel="0" displaystyle="false"><mfrac><mn>1</mn><mn>2</mn></mfrac></mstyle><mi>s</mi><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><msup><mi>s</mi><mn>2</mn></msup><mo stretchy="false">)</mo><mo>&gt;</mo><mn>0</mn><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mn>1</mn><mo>−</mo><mi>p</mi><mo stretchy="false">(</mo><mi>s</mi><mo stretchy="false">)</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mstyle scriptlevel="0" displaystyle="false"><mfrac><mn>1</mn><mn>2</mn></mfrac></mstyle><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><mi>s</mi><msup><mo stretchy="false">)</mo><mn>2</mn></msup><mo stretchy="false">(</mo><mi>s</mi><mo>+</mo><mn>2</mn><mo stretchy="false">)</mo><mo>≥</mo><mn>0.</mn></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
p(s)-s&amp;=\tfrac12s(1-s^2)&gt;0,\\[10pt]
1-p(s)&amp;=\tfrac12(1-s)^2(s+2)\geq0.
\end{aligned}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:3.7482em;vertical-align:-1.6241em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:2.1241em;"><span style="top:-4.26em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">p</span><span class="mopen">(</span><span class="mord mathnormal">s</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal">s</span></span></span><span style="top:-1.7359em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal">p</span><span class="mopen">(</span><span class="mord mathnormal">s</span><span class="mclose">)</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.6241em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:2.1241em;"><span style="top:-4.26em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8451em;"><span style="top:-2.655em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">2</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.345em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mord mathnormal">s</span><span class="mopen">(</span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">&gt;</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord">0</span><span class="mpunct">,</span></span></span><span style="top:-1.7359em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8451em;"><span style="top:-2.655em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">2</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.345em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mopen">(</span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal">s</span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal">s</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord">2</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">≥</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord">0.</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.6241em;"><span></span></span></span></span></span></span></span></span></span></span></span></div>
<p>The value increases without crossing 1. Its limit must be a fixed point; the only positive one in this interval is 1. The squared error factor gives quadratic convergence near 1. Very small starting values can still need many iterations to get close.</p>
<p>More generally, <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">∣</mi><msup><mi>p</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo stretchy="false">(</mo><mn>1</mn><mo stretchy="false">)</mo><mi mathvariant="normal">∣</mi><mo>&lt;</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">|p&#x27;(1)|&lt;1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0019em;vertical-align:-0.25em;"></span><span class="mord">∣</span><span class="mord"><span class="mord mathnormal">p</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7519em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">′</span></span></span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord">1</span><span class="mclose">)</span><span class="mord">∣</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">&lt;</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span></span> gives local attraction. Setting it to zero improves the local error reduction; it does not, on its own, prove that arbitrary starting values converge. That is why we checked the interval.</p>
</details>

<div id="the-useful-approximation-breaks-the-pretty-proof" class="section-alias" aria-hidden="true"></div>

<h2 id="get-a-useful-approximation-in-five-steps"><a class="anchor" href="#get-a-useful-approximation-in-five-steps" aria-label="Permalink">§</a>Get a useful approximation in five steps</h2>
<p>We now have an iteration that converges, but a tiny initial stretch can take many steps to get close to 1. Every training step contains this inner matrix calculation. We need to stop it somewhere, or we will spend the training budget polishing one update. The <a href="https://kellerjordan.github.io/posts/muon/" target="_blank" rel="noopener noreferrer" class="external">original Muon experiments</a> found five inner steps sufficient for the models tested. Five is a compute-budget choice, not a convergence guarantee. They use this tuned quintic:</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>q</mi><mo stretchy="false">(</mo><mi>s</mi><mo stretchy="false">)</mo><mo>=</mo><mn>3.4445</mn><mi>s</mi><mo>−</mo><mn>4.7750</mn><msup><mi>s</mi><mn>3</mn></msup><mo>+</mo><mn>2.0315</mn><msup><mi>s</mi><mn>5</mn></msup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">q(s)=3.4445s-4.7750s^3+2.0315s^5.</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">q</span><span class="mopen">(</span><span class="mord mathnormal">s</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">3.4445</span><span class="mord mathnormal">s</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.9474em;vertical-align:-0.0833em;"></span><span class="mord">4.7750</span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">3</span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.8641em;"></span><span class="mord">2.0315</span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">5</span></span></span></span></span></span></span></span><span class="mord">.</span></span></span></span></span></div>
<p>Its slope at zero is <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>3.4445</mn></mrow><annotation encoding="application/x-tex">3.4445</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">3.4445</span></span></span></span>,</span> versus the cubic&#39;s <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1.5</mn></mrow><annotation encoding="application/x-tex">1.5</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1.5</span></span></span></span>,</span> so small values initially grow faster. There is a catch: <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>q</mi><mo stretchy="false">(</mo><mn>1</mn><mo stretchy="false">)</mo><mo>=</mo><mn>0.701</mn></mrow><annotation encoding="application/x-tex">q(1)=0.701</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">q</span><span class="mopen">(</span><span class="mord">1</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.701</span></span></span></span>.</span> One is not even a fixed point.</p>
<p>The bargain is fast early progress toward unit-sized stretches, with some error left over. Running this same quintic forever does not finish the job; it can keep oscillating. Our two cubic conditions do not derive these tuned coefficients. The <a href="https://docs.modula.systems/algorithms/newton-schulz/" target="_blank" rel="noopener noreferrer" class="external">Newton–Schulz notes</a> explain this choice and the resulting oscillation.</p>
<section id="quintic-behavior" aria-label="Compare cubic and quintic iterations">

<figure class="diagram"><svg xmlns="http://www.w3.org/2000/svg" class="muon-film" id="muon-polynomials" viewBox="0 0 720 930" role="img" aria-labelledby="muon-polynomials-title"><title id="muon-polynomials-title">Substitute each value into the cubic and quintic, then return the result to the graph</title><desc>Starting at 0.1, iteration 12. The cubic receives 1.000000 and returns 1.000000. The quintic receives 0.703558 and returns 1.110680. Both substitutions and their numerical terms are shown beside the trace.</desc><text x="24" y="28" class="mf-strong" text-anchor="start">Start 0.1 · iteration 12 of 12</text><text x="24" y="54" class="mf-small" text-anchor="start">Return each result to the graph</text><line x1="54" y1="350" x2="674" y2="350" class="mf-axis" /><line x1="54" y1="350" x2="54" y2="96.25" class="mf-axis" /><rect x="54" y="122.5" width="620" height="105" class="mf-tolerance-band"/><line x1="54" y1="175" x2="674" y2="175" class="mf-target" /><text x="40" y="181" class="mf-small" text-anchor="end">1</text><line x1="312.3333333333333" y1="350" x2="312.3333333333333" y2="105.00000000000003" class="mf-five" /><text x="54" y="83" class="mf-small" text-anchor="start">value sₖ</text><text x="54" y="376" class="mf-small" text-anchor="middle">0</text><text x="312.3333333333333" y="376" class="mf-small" text-anchor="middle">5</text><text x="674" y="376" class="mf-small" text-anchor="end">12 · k</text><text x="312.3333333333333" y="100" class="mf-small" text-anchor="middle">5-step budget</text><polyline fill="none" points="54.00,332.50 105.67,323.84 157.33,311.05 209.00,292.54 260.67,266.90 312.33,234.72 364.00,202.10 415.67,180.97 467.33,175.30 519.00,175.00 570.67,175.00 622.33,175.00 674.00,175.00" class="mf-trail"/><circle cx="674" cy="175" r="4.5" class="mf-dot"/><polyline fill="none" points="54.00,332.50 105.67,290.55 157.33,176.38 209.00,226.26 260.67,156.35 312.33,225.38 364.00,157.40 415.67,226.50 467.33,156.07 519.00,225.06 570.67,157.79 622.33,226.88 674.00,155.63" class="mf-memory-arrow mf-dashed"/><circle cx="674" cy="155.6310847899556" r="4.5" class="mf-blue-dot"/><line x1="54" y1="401" x2="78" y2="401" class="mf-orange" /><text x="87" y="407" class="mf-small" text-anchor="start">cubic</text><line x1="183" y1="401" x2="207" y2="401" class="mf-memory-arrow mf-dashed" /><text x="216" y="407" class="mf-small" text-anchor="start">quintic</text><text x="54" y="447" class="mf-small" text-anchor="start">Band: 0.7 ≤ s ≤ 1.3</text><text x="54" y="480" class="mf-small mf-blue-text" text-anchor="start">quintic: in band at step 2</text><circle cx="157.33333333333331" cy="176.38303677068006" r="7" class="mf-open"/><circle cx="157.33333333333331" cy="176.38303677068006" r="3" class="mf-blue-dot"/><text x="54" y="512" class="mf-small mf-accent-text" text-anchor="start">cubic: in band at step 6</text><circle cx="364" cy="202.09597456985594" r="7" class="mf-open"/><circle cx="364" cy="202.09597456985594" r="3" class="mf-dot"/><text x="54" y="548" class="mf-small" text-anchor="start">Past 5: the quintic oscillates.</text><foreignObject x="24" y="594" width="326" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation mf-polynomial-equation"><span class="mf-result-math" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi><mo stretchy="false">(</mo><mi>s</mi><mo stretchy="false">)</mo><mo>=</mo><mn>1.5</mn><mi>s</mi><mo>−</mo><mn>0.5</mn><msup><mi>s</mi><mn>3</mn></msup></mrow><annotation encoding="application/x-tex">p(s)=1.5s-0.5s^3</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">p</span><span class="mopen">(</span><span class="mord mathnormal">s</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">1.5</span><span class="mord mathnormal">s</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.8141em;"></span><span class="mord">0.5</span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">3</span></span></span></span></span></span></span></span></span></span></span></span></div></foreignObject><foreignObject x="82.68" y="640" width="97.8" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>s</mi><mn>11</mn></msub><mo>=</mo></mrow><annotation encoding="application/x-tex">s_{11}=</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">11</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span></span></span></span></span></div></foreignObject><line x1="211.72000000000003" y1="683" x2="305.72" y2="683" class="mf-axis" /><text x="258.72" y="676" class="mf-accent-text" text-anchor="middle">1.0000</text><foreignObject x="24" y="686" width="326" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation mf-polynomial-equation"><span class="mf-result-math" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>≈</mo><mn>1.5</mn><mo stretchy="false">(</mo><mn>1.0000</mn><mo stretchy="false">)</mo><mo>−</mo><mn>0.5</mn><mo stretchy="false">(</mo><mn>1.0000</mn><msup><mo stretchy="false">)</mo><mn>3</mn></msup></mrow><annotation encoding="application/x-tex">\approx1.5(1.0000)-0.5(1.0000)^{3}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4831em;"></span><span class="mrel">≈</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">1.5</span><span class="mopen">(</span><span class="mord">1.0000</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.0641em;vertical-align:-0.25em;"></span><span class="mord">0.5</span><span class="mopen">(</span><span class="mord">1.0000</span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">3</span></span></span></span></span></span></span></span></span></span></span></span></span></div></foreignObject><foreignObject x="24" y="720" width="326" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation mf-polynomial-equation"><span class="mf-result-math" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>≈</mo><mn>1.50000</mn><mo>−</mo><mn>0.50000</mn></mrow><annotation encoding="application/x-tex">\approx1.50000-0.50000</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4831em;"></span><span class="mrel">≈</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">1.50000</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.50000</span></span></span></span></span></div></foreignObject><foreignObject x="50.08" y="776" width="136.92" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="mf-result-math" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>s</mi><mn>12</mn></msub><mo>≈</mo></mrow><annotation encoding="application/x-tex">s_{12}\approx</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6331em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">12</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">≈</span></span></span></span></span></div></foreignObject><g opacity="1"><text x="258.72" y="809" class="mf-accent-text" text-anchor="middle">1.0000</text></g><foreignObject x="374" y="594" width="326" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation mf-polynomial-equation"><span class="mf-memory-math" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>q</mi><mo stretchy="false">(</mo><mi>s</mi><mo stretchy="false">)</mo><mo>=</mo><mn>3.4445</mn><mi>s</mi><mo>−</mo><mn>4.775</mn><msup><mi>s</mi><mn>3</mn></msup><mo>+</mo><mn>2.0315</mn><msup><mi>s</mi><mn>5</mn></msup></mrow><annotation encoding="application/x-tex">q(s)=3.4445s-4.775s^3+2.0315s^5</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">q</span><span class="mopen">(</span><span class="mord mathnormal">s</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">3.4445</span><span class="mord mathnormal">s</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.8974em;vertical-align:-0.0833em;"></span><span class="mord">4.775</span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">3</span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.8141em;"></span><span class="mord">2.0315</span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">5</span></span></span></span></span></span></span></span></span></span></span></span></div></foreignObject><foreignObject x="432.68" y="640" width="97.8" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>s</mi><mn>11</mn></msub><mo>=</mo></mrow><annotation encoding="application/x-tex">s_{11}=</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">11</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span></span></span></span></span></div></foreignObject><line x1="561.72" y1="683" x2="655.72" y2="683" class="mf-axis" /><text x="608.72" y="676" class="mf-blue-text" text-anchor="middle">0.7036</text><foreignObject x="374" y="686" width="326" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation mf-polynomial-equation"><span class="mf-memory-math" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>≈</mo><mn>3.4445</mn><mo stretchy="false">(</mo><mn>0.7036</mn><mo stretchy="false">)</mo><mo>−</mo><mn>4.775</mn><mo stretchy="false">(</mo><mn>0.7036</mn><msup><mo stretchy="false">)</mo><mn>3</mn></msup></mrow><annotation encoding="application/x-tex">\approx3.4445(0.7036)-4.775(0.7036)^{3}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4831em;"></span><span class="mrel">≈</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">3.4445</span><span class="mopen">(</span><span class="mord">0.7036</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.0641em;vertical-align:-0.25em;"></span><span class="mord">4.775</span><span class="mopen">(</span><span class="mord">0.7036</span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">3</span></span></span></span></span></span></span></span></span></span></span></span></span></div></foreignObject><foreignObject x="374" y="724" width="326" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation mf-polynomial-equation"><span class="mf-memory-math" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>+</mo><mn>2.0315</mn><mo stretchy="false">(</mo><mn>0.7036</mn><msup><mo stretchy="false">)</mo><mn>5</mn></msup></mrow><annotation encoding="application/x-tex">+2.0315(0.7036)^{5}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0641em;vertical-align:-0.25em;"></span><span class="mord">+</span><span class="mord">2.0315</span><span class="mopen">(</span><span class="mord">0.7036</span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">5</span></span></span></span></span></span></span></span></span></span></span></span></span></div></foreignObject><foreignObject x="374" y="758" width="326" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation mf-polynomial-equation"><span class="mf-memory-math" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>≈</mo><mn>2.42340</mn><mo>−</mo><mn>1.66292</mn><mo>+</mo><mn>0.35020</mn></mrow><annotation encoding="application/x-tex">\approx2.42340-1.66292+0.35020</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4831em;"></span><span class="mrel">≈</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">2.42340</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">1.66292</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.35020</span></span></span></span></span></div></foreignObject><foreignObject x="400.08" y="814" width="136.92" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="mf-memory-math" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>s</mi><mn>12</mn></msub><mo>≈</mo></mrow><annotation encoding="application/x-tex">s_{12}\approx</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6331em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">12</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">≈</span></span></span></span></span></div></foreignObject><g opacity="1"><text x="608.72" y="847" class="mf-blue-text" text-anchor="middle">1.1107</text></g><text x="24" y="900" class="mf-small" text-anchor="start">Substitutions are rounded; the recurrence uses full precision.</text></svg>
<figcaption>Starting at 0.1, the quintic first enters the shaded 0.7–1.3 band at step 2; the cubic takes 6. The band is an illustrative tolerance around 1. Rings mark the first arrival, and the vertical line marks the five-step compute budget. Each value travels into its polynomial and back to the graph. Keep going to see the difference between getting close early and converging. Try starts at 1 and 0 too. Arithmetic is displayed rounded and computed at full precision.</figcaption></figure>
<div class="muon-controls" data-animation="polynomials"><button data-action="play" disabled>Play animation</button><button data-action="restart" disabled>Restart</button><button data-action="previous-step" disabled>← Back</button><button data-action="next-step" disabled>Next →</button><button data-action="five-steps" disabled>Show five steps</button><button data-action="cycle-start" disabled>Try start at 1</button><span data-status>Substitute, calculate, and reuse each result.</span></div>

<p>A quintic <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>q</mi><mo stretchy="false">(</mo><mi>s</mi><mo stretchy="false">)</mo><mo>=</mo><mi>a</mi><mi>s</mi><mo>+</mo><mi>b</mi><msup><mi>s</mi><mn>3</mn></msup><mo>+</mo><mi>c</mi><msup><mi>s</mi><mn>5</mn></msup></mrow><annotation encoding="application/x-tex">q(s)=as+bs^3+cs^5</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">q</span><span class="mopen">(</span><span class="mord mathnormal">s</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6667em;vertical-align:-0.0833em;"></span><span class="mord mathnormal">a</span><span class="mord mathnormal">s</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.8974em;vertical-align:-0.0833em;"></span><span class="mord mathnormal">b</span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">3</span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.8141em;"></span><span class="mord mathnormal">c</span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">5</span></span></span></span></span></span></span></span></span></span></span></span> has three coefficients. We could impose <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>q</mi><mo stretchy="false">(</mo><mn>1</mn><mo stretchy="false">)</mo><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">q(1)=1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">q</span><span class="mopen">(</span><span class="mord">1</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span></span> and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>q</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo stretchy="false">(</mo><mn>1</mn><mo stretchy="false">)</mo><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">q&#x27;(1)=0</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0019em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">q</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7519em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">′</span></span></span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord">1</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0</span></span></span></span>,</span> then use the remaining freedom to shape the interval. Muon&#39;s original coefficients make a different tradeoff. Polynomial design includes choosing the conditions, not only solving for the coefficients.</p>
</section>

<details class="muon-aside" id="muon-code">
<summary>Show the matrix code and the practical optimizer details</summary>

<p>Here is the five-step direction calculation in float32. The reference implementation uses bfloat16 for speed.</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">import</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> torch</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666">@</span><span style="--shiki-light:#59873A;--shiki-dark:#80A665">torch</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#59873A;--shiki-dark:#80A665">no_grad</span><span style="--shiki-light:#999999;--shiki-dark:#666666">()</span></span>
<span class="line"><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">def</span><span style="--shiki-light:#59873A;--shiki-dark:#80A665"> muon_direction</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">M</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> steps</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">=</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91">5</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> eps</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">=</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91">1e-7</span><span style="--shiki-light:#999999;--shiki-dark:#666666">):</span></span>
<span class="line"><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">    """</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">Approximate polar direction for one finite 2D matrix.</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"""</span></span>
<span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">    assert</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> M</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">ndim </span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">==</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 2</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">    X </span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> M</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">float</span><span style="--shiki-light:#999999;--shiki-dark:#666666">()</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">    transposed </span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> X</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">shape</span><span style="--shiki-light:#999999;--shiki-dark:#666666">[</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91">0</span><span style="--shiki-light:#999999;--shiki-dark:#666666">]</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676"> ></span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> X</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">shape</span><span style="--shiki-light:#999999;--shiki-dark:#666666">[</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91">1</span><span style="--shiki-light:#999999;--shiki-dark:#666666">]</span></span>
<span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">    if</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> transposed</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">        X </span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> X</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">T</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">    X </span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> X </span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">/</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> (</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">X</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">norm</span><span style="--shiki-light:#999999;--shiki-dark:#666666">()</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676"> +</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> eps</span><span style="--shiki-light:#999999;--shiki-dark:#666666">)</span><span style="--shiki-light:#A0ADA0;--shiki-dark:#758575DD">  # Frobenius norm; zero stays zero.</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">    a</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> b</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> c </span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 3.4445</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676"> -</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91">4.7750</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 2.0315</span></span>
<span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">    for</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> _ </span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">in</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965"> range</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">steps</span><span style="--shiki-light:#999999;--shiki-dark:#666666">):</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">        A </span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> X </span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">@</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> X</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">T</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">        X </span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> a </span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">*</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> X </span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">+</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> (</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">b </span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">*</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> A </span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">+</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> c </span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">*</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> (</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">A </span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">@</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> A</span><span style="--shiki-light:#999999;--shiki-dark:#666666">))</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676"> @</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> X</span></span>
<span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">    return</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> X</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">T </span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">if</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> transposed </span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">else</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> X</span></span></code></pre><p>Transposing a tall matrix makes <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>X</mi><msup><mi>X</mi><mi mathvariant="normal">⊤</mi></msup></mrow><annotation encoding="application/x-tex">XX^\top</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8491em;"></span><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span></span></span></span></span></span></span></span></span> smaller and cheaper to multiply; the return restores its shape. The quintic uses the same SVD algebra, adding a <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="normal">Σ</mi><mi>r</mi><mn>5</mn></msubsup></mrow><annotation encoding="application/x-tex">\Sigma_r^5</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0611em;vertical-align:-0.247em;"></span><span class="mord"><span class="mord">Σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">r</span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">5</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span></span></span></span></span> term.</p>
<p>The <a href="https://github.com/KellerJordan/Muon/blob/master/muon.py" target="_blank" rel="noopener noreferrer" class="external">reference optimizer</a> also uses a <a href="https://distill.pub/2017/momentum/" target="_blank" rel="noopener noreferrer" class="external">Nesterov-style</a> blend <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>H</mi><mi>t</mi></msub><mo>=</mo><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><mi>β</mi><mo stretchy="false">)</mo><msub><mi>G</mi><mi>t</mi></msub><mo>+</mo><mi>β</mi><msub><mi>M</mi><mi>t</mi></msub></mrow><annotation encoding="application/x-tex">H_t=(1-\beta)G_t+\beta M_t</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0813em;">H</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:-0.0813em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.0528em;">β</span><span class="mclose">)</span><span class="mord"><span class="mord mathnormal">G</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.0528em;">β</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">M</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> by default, applies matrix-shape scaling, and supports <a href="https://arxiv.org/abs/1711.05101" target="_blank" rel="noopener noreferrer" class="external">decoupled weight decay</a>. The finite quintic output need not have spectral norm exactly 1.</p>
<p>The reference setup uses Muon for hidden weight matrices and another optimizer, such as AdamW, for embeddings, the output layer, and scalar or vector parameters. The function above computes the direction, not the full training recipe.</p>
</details>

<h2 id="put-the-pieces-together-one-muon-step"><a class="anchor" href="#put-the-pieces-together-one-muon-step" aria-label="Permalink">§</a>Put the pieces together: one Muon step</h2>
<p>We have enough parts. Time to assemble the optimizer.</p>
<p>At training step <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>t</mi></mrow><annotation encoding="application/x-tex">t</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6151em;"></span><span class="mord mathnormal">t</span></span></span></span>,</span> backpropagation gives the gradient <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>G</mi><mi>t</mi></msub></mrow><annotation encoding="application/x-tex">G_t</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">G</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>.</span> Blend it into the momentum, normalize that matrix, and run five polynomial steps. Then scale the result by the learning rate and subtract it from the weights:</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><msub><mi>M</mi><mi>t</mi></msub></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mi>β</mi><msub><mi>M</mi><mrow><mi>t</mi><mo>−</mo><mn>1</mn></mrow></msub><mo>+</mo><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><mi>β</mi><mo stretchy="false">)</mo><msub><mi>G</mi><mi>t</mi></msub><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><msub><mi>X</mi><mn>0</mn></msub></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mfrac><msub><mi>M</mi><mi>t</mi></msub><mrow><mi mathvariant="normal">∥</mi><msub><mi>M</mi><mi>t</mi></msub><msub><mi mathvariant="normal">∥</mi><mi>F</mi></msub><mo>+</mo><mi>ε</mi></mrow></mfrac><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><msub><mi>A</mi><mi>k</mi></msub></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><msub><mi>X</mi><mi>k</mi></msub><msubsup><mi>X</mi><mi>k</mi><mi mathvariant="normal">⊤</mi></msubsup><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><msub><mi>X</mi><mrow><mi>k</mi><mo>+</mo><mn>1</mn></mrow></msub></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mi>a</mi><msub><mi>X</mi><mi>k</mi></msub><mo>+</mo><mo stretchy="false">(</mo><mi>b</mi><msub><mi>A</mi><mi>k</mi></msub><mo>+</mo><mi>c</mi><msubsup><mi>A</mi><mi>k</mi><mn>2</mn></msubsup><mo stretchy="false">)</mo><msub><mi>X</mi><mi>k</mi></msub><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><msub><mi>W</mi><mrow><mi>t</mi><mo>+</mo><mn>1</mn></mrow></msub></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><msub><mi>η</mi><mi>t</mi></msub><mi>λ</mi><mo stretchy="false">)</mo><msub><mi>W</mi><mi>t</mi></msub><mo>−</mo><msub><mi>η</mi><mi>t</mi></msub><msub><mi>X</mi><mn>5</mn></msub><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
M_t&amp;=\beta M_{t-1}+(1-\beta)G_t,\\[10pt]
X_0&amp;=\frac{M_t}{\|M_t\|_F+\varepsilon},\\[10pt]
A_k&amp;=X_kX_k^\top,\\[10pt]
X_{k+1}&amp;=aX_k+(bA_k+cA_k^2)X_k,\\[10pt]
W_{t+1}&amp;=(1-\eta_t\lambda)W_t-\eta_tX_5.
\end{aligned}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:11.8035em;vertical-align:-5.6518em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:6.1518em;"><span style="top:-8.6721em;"><span class="pstrut" style="height:3.3603em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">M</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span><span style="top:-5.6518em;"><span class="pstrut" style="height:3.3603em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">0</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span><span style="top:-3.0927em;"><span class="pstrut" style="height:3.3603em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal">A</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0315em;">k</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span><span style="top:-0.5686em;"><span class="pstrut" style="height:3.3603em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0315em;">k</span><span class="mbin mtight">+</span><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2083em;"><span></span></span></span></span></span></span></span></span><span style="top:1.9314em;"><span class="pstrut" style="height:3.3603em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">t</span><span class="mbin mtight">+</span><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2083em;"><span></span></span></span></span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:5.6518em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:6.1518em;"><span style="top:-8.6721em;"><span class="pstrut" style="height:3.3603em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord mathnormal" style="margin-right:0.0528em;">β</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">M</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">t</span><span class="mbin mtight">−</span><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2083em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mopen">(</span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal" style="margin-right:0.0528em;">β</span><span class="mclose">)</span><span class="mord"><span class="mord mathnormal">G</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mpunct">,</span></span></span><span style="top:-5.6518em;"><span class="pstrut" style="height:3.3603em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.3603em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">∥</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">M</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.1389em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal">ε</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">M</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.936em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mpunct">,</span></span></span><span style="top:-3.0927em;"><span class="pstrut" style="height:3.3603em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0315em;">k</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0315em;">k</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mpunct">,</span></span></span><span style="top:-0.5686em;"><span class="pstrut" style="height:3.3603em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord mathnormal">a</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0315em;">k</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mopen">(</span><span class="mord mathnormal">b</span><span class="mord"><span class="mord mathnormal">A</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0315em;">k</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal">c</span><span class="mord"><span class="mord mathnormal">A</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0315em;">k</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mclose">)</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0315em;">k</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mpunct">,</span></span></span><span style="top:1.9314em;"><span class="pstrut" style="height:3.3603em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mopen">(</span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">η</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal">λ</span><span class="mclose">)</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">η</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">5</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:5.6518em;"><span></span></span></span></span></span></span></span></span></span></span></span></div>
<p>Run the recurrence for <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi><mo>=</mo><mn>0</mn><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><mn>4</mn></mrow><annotation encoding="application/x-tex">k=0,\ldots,4</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.0315em;">k</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8389em;vertical-align:-0.1944em;"></span><span class="mord">0</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner">…</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">4</span></span></span></span>,</span> with <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><mo>=</mo><mn>3.4445</mn></mrow><annotation encoding="application/x-tex">a=3.4445</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">a</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">3.4445</span></span></span></span>,</span> <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>b</mi><mo>=</mo><mo>−</mo><mn>4.7750</mn></mrow><annotation encoding="application/x-tex">b=-4.7750</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">b</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">−</span><span class="mord">4.7750</span></span></span></span>,</span> and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>c</mi><mo>=</mo><mn>2.0315</mn></mrow><annotation encoding="application/x-tex">c=2.0315</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">c</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">2.0315</span></span></span></span>.</span> The tiny <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ε</mi></mrow><annotation encoding="application/x-tex">\varepsilon</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">ε</span></span></span></span></span> prevents division by zero. The optional decay <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi></mrow><annotation encoding="application/x-tex">\lambda</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">λ</span></span></span></span></span> shrinks the old weights separately from the gradient calculation. Set it to zero to recover the update we derived.</p>
<p>This is a minimal Muon step. Practical variants can blend in the current gradient again with Nesterov momentum, scale the update for the matrix shape, or use different polynomial schedules. The <a href="https://github.com/KellerJordan/Muon/blob/master/muon.py" target="_blank" rel="noopener noreferrer" class="external">reference implementation</a> makes those choices explicit. The central operation stays the same: turn the momentum matrix into an approximate polar direction.</p>
<figure class="diagram"><svg xmlns="http://www.w3.org/2000/svg" class="muon-film" id="muon-step" viewBox="0 0 720 650" role="img" aria-labelledby="muon-step-title"><title id="muon-step-title">Follow one complete Muon matrix update from gradient to new weights</title><desc>Operation 10: Add the step to the weights. Displayed matrix 0.9319, 0.5515, −0.2841, 0.9198. The unit circle is mapped by exactly this matrix. Dotted arrows show the exact SVD target, with its scale or weight addition applied at the final operations.</desc><text x="24" y="28" class="mf-strong" text-anchor="start">10 / 10 · Add the step to the weights</text><text x="24" y="54" class="mf-small" text-anchor="start">One matrix through the complete Muon step</text><line x1="40" y1="388" x2="40" y2="108" class="mf-axis" /><line x1="40" y1="388" x2="320" y2="388" class="mf-axis" /><line x1="110" y1="388" x2="110" y2="108" class="mf-axis" /><line x1="40" y1="318" x2="320" y2="318" class="mf-axis" /><line x1="180" y1="388" x2="180" y2="108" class="mf-axis" /><line x1="40" y1="248" x2="320" y2="248" class="mf-axis" /><line x1="250" y1="388" x2="250" y2="108" class="mf-axis" /><line x1="40" y1="178" x2="320" y2="178" class="mf-axis" /><line x1="320" y1="388" x2="320" y2="108" class="mf-axis" /><line x1="40" y1="108" x2="320" y2="108" class="mf-axis" /><polyline fill="none" points="250.00,248.00 249.85,243.42 249.40,238.86 248.65,234.34 247.61,229.88 246.29,225.50 244.67,221.21 242.78,217.04 240.62,213.00 238.20,209.11 235.53,205.39 232.63,201.85 229.50,198.50 226.15,195.37 222.61,192.47 218.89,189.80 215.00,187.38 210.96,185.22 206.79,183.33 202.50,181.71 198.12,180.39 193.66,179.35 189.14,178.60 184.58,178.15 180.00,178.00 175.42,178.15 170.86,178.60 166.34,179.35 161.88,180.39 157.50,181.71 153.21,183.33 149.04,185.22 145.00,187.38 141.11,189.80 137.39,192.47 133.85,195.37 130.50,198.50 127.37,201.85 124.47,205.39 121.80,209.11 119.38,213.00 117.22,217.04 115.33,221.21 113.71,225.50 112.39,229.88 111.35,234.34 110.60,238.86 110.15,243.42 110.00,248.00 110.15,252.58 110.60,257.14 111.35,261.66 112.39,266.12 113.71,270.50 115.33,274.79 117.22,278.96 119.38,283.00 121.80,286.89 124.47,290.61 127.37,294.15 130.50,297.50 133.85,300.63 137.39,303.53 141.11,306.20 145.00,308.62 149.04,310.78 153.21,312.67 157.50,314.29 161.88,315.61 166.34,316.65 170.86,317.40 175.42,317.85 180.00,318.00 184.58,317.85 189.14,317.40 193.66,316.65 198.12,315.61 202.50,314.29 206.79,312.67 210.96,310.78 215.00,308.62 218.89,306.20 222.61,303.53 226.15,300.63 229.50,297.50 232.63,294.15 235.53,290.61 238.20,286.89 240.62,283.00 242.78,278.96 244.67,274.79 246.29,270.50 247.61,266.12 248.65,261.66 249.40,257.14 249.85,252.58 250.00,248.00" class="mf-ink mf-dashed mf-reference"/><polyline fill="none" points="245.23,267.89 247.62,263.64 249.71,259.31 251.51,254.95 253.00,250.55 254.18,246.14 255.04,241.73 255.58,237.36 255.79,233.03 255.69,228.77 255.25,224.58 254.50,220.50 253.42,216.53 252.03,212.70 250.34,209.03 248.34,205.51 246.05,202.18 243.47,199.05 240.63,196.12 237.52,193.42 234.17,190.95 230.59,188.73 226.79,186.76 222.79,185.05 218.60,183.61 214.25,182.45 209.76,181.57 205.14,180.97 200.41,180.66 195.59,180.64 190.70,180.90 185.77,181.46 180.82,182.29 175.86,183.41 170.92,184.81 166.01,186.48 161.17,188.41 156.41,190.59 151.75,193.02 147.21,195.69 142.81,198.58 138.57,201.68 134.51,204.98 130.64,208.47 126.98,212.12 123.55,215.93 120.36,219.88 117.43,223.94 114.77,228.11 112.38,232.36 110.29,236.69 108.49,241.05 107.00,245.45 105.82,249.86 104.96,254.27 104.42,258.64 104.21,262.97 104.31,267.23 104.75,271.42 105.50,275.50 106.58,279.47 107.97,283.30 109.66,286.97 111.66,290.49 113.95,293.82 116.53,296.95 119.37,299.88 122.48,302.58 125.83,305.05 129.41,307.27 133.21,309.24 137.21,310.95 141.40,312.39 145.75,313.55 150.24,314.43 154.86,315.03 159.59,315.34 164.41,315.36 169.30,315.10 174.23,314.54 179.18,313.71 184.14,312.59 189.08,311.19 193.99,309.52 198.83,307.59 203.59,305.41 208.25,302.98 212.79,300.31 217.19,297.42 221.43,294.32 225.49,291.02 229.36,287.53 233.02,283.88 236.45,280.07 239.64,276.12 242.57,272.06 245.23,267.89" class="mf-shape"/><line x1="180" y1="248" x2="250.7967388318647" y2="254.54599145055735" class="mf-memory-arrow mf-exact-arrow" /><path d="M242.46,257.79 L250.80,254.55 L243.20,249.83" class="mf-memory-arrow mf-exact-arrow"/><circle cx="250.7967388318647" cy="254.54599145055735" r="4" class="mf-open"/><line x1="180" y1="248" x2="252.082432882417" y2="253.3637118987385" class="mf-memory-arrow" /><path d="M243.81,256.76 L252.08,253.36 L244.40,248.78" class="mf-memory-arrow"/><circle cx="252.082432882417" cy="253.3637118987385" r="3" class="mf-blue-dot"/><line x1="180" y1="248" x2="203.62449735050444" y2="181.0209353587221" class="mf-orange mf-exact-arrow" /><path d="M204.74,189.90 L203.62,181.02 L197.19,187.23" class="mf-orange mf-exact-arrow"/><circle cx="203.62449735050444" cy="181.0209353587221" r="4" class="mf-open"/><line x1="180" y1="248" x2="203.44342767455063" y2="180.82402744066582" class="mf-orange" /><path d="M204.58,189.70 L203.44,180.82 L197.03,187.06" class="mf-orange"/><circle cx="203.44342767455063" cy="180.82402744066582" r="3" class="mf-dot"/><text x="180" y="427" class="mf-small" text-anchor="middle">Solid: images of v₁ and v₂</text><text x="180" y="454" class="mf-small" text-anchor="middle">Dotted: W − 0.1Q</text><foreignObject x="364" y="89" width="332" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation mf-compact-equation"><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>W</mi><mrow><mi>t</mi><mo>+</mo><mn>1</mn></mrow></msub><mo>=</mo><msub><mi>W</mi><mi>t</mi></msub><mo>+</mo><mi>D</mi></mrow><annotation encoding="application/x-tex">W_{t+1}=W_t+D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8917em;vertical-align:-0.2083em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">t</span><span class="mbin mtight">+</span><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2083em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span></span></span></span></span></div></foreignObject><foreignObject x="364" y="143" width="332" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>W</mi><mi>t</mi></msub><mo>=</mo></mrow><annotation encoding="application/x-tex">W_t=</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span></span></span></span></span></div></foreignObject><g transform="translate(530 225) scale(0.7)"><polyline fill="none" points="-77.00,-35.00 -84.00,-35.00 -84.00,35.00 -77.00,35.00" class="mf-ink"/><polyline fill="none" points="77.00,-35.00 84.00,-35.00 84.00,35.00 77.00,35.00" class="mf-ink"/><text x="-43" y="-8" class="mf-matrix-number " text-anchor="middle">1.000</text><text x="43" y="-8" class="mf-matrix-number " text-anchor="middle">0.500</text><text x="-43" y="27" class="mf-matrix-number " text-anchor="middle">−0.250</text><text x="43" y="27" class="mf-matrix-number " text-anchor="middle">1.000</text></g><foreignObject x="364" y="261" width="332" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="mf-result-math" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>W</mi><mrow><mi>t</mi><mo>+</mo><mn>1</mn></mrow></msub><mo>=</mo></mrow><annotation encoding="application/x-tex">W_{t+1}=</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8917em;vertical-align:-0.2083em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">t</span><span class="mbin mtight">+</span><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2083em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span></span></span></span></span></div></foreignObject><g transform="translate(530 354) scale(1)"><polyline fill="none" points="-77.00,-35.00 -84.00,-35.00 -84.00,35.00 -77.00,35.00" class="mf-ink"/><polyline fill="none" points="77.00,-35.00 84.00,-35.00 84.00,35.00 77.00,35.00" class="mf-ink"/><text x="-43" y="-8" class="mf-matrix-number mf-accent-text" text-anchor="middle">0.932</text><text x="43" y="-8" class="mf-matrix-number mf-accent-text" text-anchor="middle">0.551</text><text x="-43" y="27" class="mf-matrix-number mf-accent-text" text-anchor="middle">−0.284</text><text x="43" y="27" class="mf-matrix-number mf-accent-text" text-anchor="middle">0.920</text></g><text x="530" y="423" class="mf-small" text-anchor="middle">stretches: 1.150, 0.882</text><text x="530" y="459" class="mf-small" text-anchor="middle">gap to dotted target: 0.0252</text><foreignObject x="12" y="495" width="696" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation mf-compact-equation"><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Q</mi><mo>=</mo><mi>U</mi><msup><mi>V</mi><mi mathvariant="normal">⊤</mi></msup><mo>=</mo><mrow><mo fence="true">[</mo><mtable rowspacing="0.16em" columnalign="center center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><msqrt><mn>3</mn></msqrt><mi mathvariant="normal">/</mi><mn>2</mn></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mo>−</mo><mn>1</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mn>1</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><msqrt><mn>3</mn></msqrt><mi mathvariant="normal">/</mi><mn>2</mn></mrow></mstyle></mtd></mtr></mtable><mo fence="true">]</mo></mrow></mrow><annotation encoding="application/x-tex">Q=UV^\top=\begin{bmatrix}\sqrt3/2&amp;-1/2\\1/2&amp;\sqrt3/2\end{bmatrix}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8778em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">Q</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8491em;"></span><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:2.5344em;vertical-align:-1.0172em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">[</span></span><span class="mord"><span class="mtable"><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.5172em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord sqrt"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.9072em;"><span class="svg-align" style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord" style="padding-left:0.833em;">3</span></span><span style="top:-2.8672em;"><span class="pstrut" style="height:3em;"></span><span class="hide-tail" style="min-width:0.853em;height:1.08em;"><svg xmlns="http://www.w3.org/2000/svg" width="400em" height="1.08em" viewBox="0 0 400000 1080" preserveAspectRatio="xMinYMin slice"><path d="M95,702
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l0 -0
c5.3,-9.3,12,-14,20,-14
H400000v40H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M834 80h400000v40h-400000z"/></svg></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.1328em;"><span></span></span></span></span></span><span class="mord">/2</span></span></span><span style="top:-2.3428em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">1/2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.0172em;"><span></span></span></span></span></span><span class="arraycolsep" style="width:0.5em;"></span><span class="arraycolsep" style="width:0.5em;"></span><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.5172em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">−</span><span class="mord">1/2</span></span></span><span style="top:-2.3428em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord sqrt"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.9072em;"><span class="svg-align" style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord" style="padding-left:0.833em;">3</span></span><span style="top:-2.8672em;"><span class="pstrut" style="height:3em;"></span><span class="hide-tail" style="min-width:0.853em;height:1.08em;"><svg xmlns="http://www.w3.org/2000/svg" width="400em" height="1.08em" viewBox="0 0 400000 1080" preserveAspectRatio="xMinYMin slice"><path d="M95,702
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l0 -0
c5.3,-9.3,12,-14,20,-14
H400000v40H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M834 80h400000v40h-400000z"/></svg></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.1328em;"><span></span></span></span></span></span><span class="mord">/2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.0172em;"><span></span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">]</span></span></span></span></span></span></span></div></foreignObject><text x="360" y="575" class="mf-small" text-anchor="middle">Exact SVD reference · gap measured with the Frobenius norm</text><text x="24" y="615" class="mf-small" text-anchor="start">Updated weights need not be orthogonal.</text></svg>
<figcaption>Follow one matrix through memory, normalization, five quintic iterations, and the weight update. Solid arrows show what the current matrix does to the momentum’s two singular input directions v₁ and v₂. Dotted arrows show the exact target Qvᵢ = uᵢ, and the printed gap measures the remaining error. At the last two operations the reference becomes −0.1Q, then W − 0.1Q, so we compare like with like. The ellipse is the current image of the unit circle; the dashed circle has radius 1. Settings: β = 0.8, η = 0.1, λ = 0, no Nesterov blend.</figcaption></figure>
<div class="muon-controls" data-animation="step"><button data-action="play" disabled>Play animation</button><button data-action="restart" disabled>Restart</button><button data-action="previous-step" disabled>← Back</button><button data-action="next-step" disabled>Next →</button><span data-status>Follow one matrix through the whole update.</span></div>

<p>Here <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Q</mi><mo>=</mo><mi>U</mi><msup><mi>V</mi><mi mathvariant="normal">⊤</mi></msup></mrow><annotation encoding="application/x-tex">Q=UV^\top</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8778em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">Q</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8491em;"></span><span class="mord mathnormal" style="margin-right:0.109em;">U</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.2222em;">V</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span></span></span></span></span></span></span></span></span> is the exact polar factor of the momentum matrix, computed as a reference for the illustration. Muon computes <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>X</mi><mn>5</mn></msub></mrow><annotation encoding="application/x-tex">X_5</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">5</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> instead. The solid arrows approach the dotted ones without landing exactly on them, because five quintic steps leave residual stretch.</p>
<p>Momentum chooses which matrix we trust. Normalization puts its stretches in range. The polynomial reshapes them, and the minus sign turns the result into a weight update. The updated weights themselves need not be orthogonal.</p>
<h2 id="same-gradients-different-optimizers"><a class="anchor" href="#same-gradients-different-optimizers" aria-label="Permalink">§</a>Same gradients, different optimizers</h2>
<p>We have assembled a complete Muon step. To see what its matrix transformation changes, give the same gradient sequence to three update rules.</p>
<p>SGD uses the gradient directly. <a href="https://arxiv.org/abs/1412.6980" target="_blank" rel="noopener noreferrer" class="external">Adam</a> keeps moving averages of both gradients and their elementwise squares, then divides each coordinate by its own estimated scale. <a href="https://arxiv.org/abs/1711.05101" target="_blank" rel="noopener noreferrer" class="external">AdamW</a> adds weight decay separately. Muon rescales the momentum matrix along its singular directions.</p>
<p>Let <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>R</mi><mi>t</mi></msub></mrow><annotation encoding="application/x-tex">R_t</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0077em;">R</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:-0.0077em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span> denote the gradient-driven part before the learning rate and decay:</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><msubsup><mi>R</mi><mi>t</mi><mrow><mi mathvariant="normal">S</mi><mi mathvariant="normal">G</mi><mi mathvariant="normal">D</mi></mrow></msubsup></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><msub><mi>G</mi><mi>t</mi></msub><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><msubsup><mi>R</mi><mi>t</mi><mrow><mi mathvariant="normal">A</mi><mi mathvariant="normal">d</mi><mi mathvariant="normal">a</mi><mi mathvariant="normal">m</mi><mi mathvariant="normal">W</mi></mrow></msubsup></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><msub><mover accent="true"><mi>m</mi><mo stretchy="true">^</mo></mover><mi>t</mi></msub><mo>⊘</mo><mrow><mo fence="true">(</mo><msqrt><msub><mover accent="true"><mi>v</mi><mo stretchy="true">^</mo></mover><mi>t</mi></msub></msqrt><mo>+</mo><mi>ε</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><msubsup><mi>R</mi><mi>t</mi><mrow><mi mathvariant="normal">M</mi><mi mathvariant="normal">u</mi><mi mathvariant="normal">o</mi><mi mathvariant="normal">n</mi></mrow></msubsup></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><msub><mi>X</mi><mn>5</mn></msub><mo>≈</mo><mi mathvariant="normal">polar</mi><mo>⁡</mo><mo stretchy="false">(</mo><msub><mi>M</mi><mi>t</mi></msub><mo stretchy="false">)</mo><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
R_t^{\mathrm{SGD}}&amp;=G_t,\\[10pt]
R_t^{\mathrm{AdamW}}&amp;=\widehat m_t\oslash
\left(\sqrt{\widehat v_t}+\varepsilon\right),\\[10pt]
R_t^{\mathrm{Muon}}&amp;=X_5\approx\operatorname{polar}(M_t).
\end{aligned}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:6.6127em;vertical-align:-3.0563em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:3.5563em;"><span style="top:-5.815em;"><span class="pstrut" style="height:3.15em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right:0.0077em;">R</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8913em;"><span style="top:-2.453em;margin-left:-0.0077em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathrm mtight">SGD</span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span></span></span><span style="top:-3.005em;"><span class="pstrut" style="height:3.15em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right:0.0077em;">R</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.0077em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathrm mtight" style="margin-right:0.0139em;">AdamW</span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span></span></span><span style="top:-0.4537em;"><span class="pstrut" style="height:3.15em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right:0.0077em;">R</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8913em;"><span style="top:-2.453em;margin-left:-0.0077em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathrm mtight">Muon</span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:3.0563em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:3.5563em;"><span style="top:-5.815em;"><span class="pstrut" style="height:3.15em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mord mathnormal">G</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mpunct">,</span></span></span><span style="top:-3.005em;"><span class="pstrut" style="height:3.15em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mord accent"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.6706em;"><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord mathnormal">m</span></span><span class="svg-align" style="top:-3.4306em;"><span class="pstrut" style="height:3em;"></span><span style="height:0.24em;"><svg xmlns="http://www.w3.org/2000/svg" width="100%" height="0.24em" viewBox="0 0 1062 239" preserveAspectRatio="none"><path d="M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z"/></svg></span></span></span></span></span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">⊘</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size2">(</span></span><span class="mord sqrt"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.9942em;"><span class="svg-align" style="top:-3.2em;"><span class="pstrut" style="height:3.2em;"></span><span class="mord" style="padding-left:1em;"><span class="mord"><span class="mord accent"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.6706em;"><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord mathnormal" style="margin-right:0.0359em;">v</span></span><span class="svg-align" style="width:calc(100% - 0.0556em);margin-left:0.0556em;top:-3.4306em;"><span class="pstrut" style="height:3em;"></span><span style="height:0.24em;"><svg xmlns="http://www.w3.org/2000/svg" width="100%" height="0.24em" viewBox="0 0 1062 239" preserveAspectRatio="none"><path d="M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z"/></svg></span></span></span></span></span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span><span style="top:-2.9542em;"><span class="pstrut" style="height:3.2em;"></span><span class="hide-tail" style="min-width:1.02em;height:1.28em;"><svg xmlns="http://www.w3.org/2000/svg" width="400em" height="1.28em" viewBox="0 0 400000 1296" preserveAspectRatio="xMinYMin slice"><path d="M263,681c0.7,0,18,39.7,52,119
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
c340,-704.7,510.7,-1060.3,512,-1067
l0 -0
c4.7,-7.3,11,-11,19,-11
H40000v40H1012.3
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
M1001 80h400000v40h-400000z"/></svg></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2458em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal">ε</span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size2">)</span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mpunct">,</span></span></span><span style="top:-0.4537em;"><span class="pstrut" style="height:3.15em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">5</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">≈</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mop"><span class="mord mathrm">polar</span></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.109em;">M</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:-0.109em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span><span class="mord">.</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:3.0563em;"><span></span></span></span></span></span></span></span></span></span></span></span></div>
<p>An <strong>entry</strong> is one number in the matrix, such as the number in row 1, column 2. The symbol <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>⊘</mo></mrow><annotation encoding="application/x-tex">\oslash</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6667em;vertical-align:-0.0833em;"></span><span class="mord">⊘</span></span></span></span></span> means dividing each number by the number in the same position in another matrix. AdamW keeps a separate running scale for each position. For example, if two momentum entries are 4 and 1, and their estimated scales are 4 and 1, their contributions become <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>4</mn><mi mathvariant="normal">/</mi><mn>4</mn><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">4/4=1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">4/4</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span></span> and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mi mathvariant="normal">/</mi><mn>1</mn><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">1/1=1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">1/1</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span>.</span> Those scales come from past squared gradients; this is an example of the arithmetic, not a fixed rule that all entries become 1.</p>
<p>That is <strong>entrywise scaling</strong>: rescaling each matrix entry separately. Muon instead uses the matrix&#39;s singular directions, which can involve several entries moving together. The next comparison asks whether that distinction changes the path through a loss function.</p>
<figure class="diagram"><svg xmlns="http://www.w3.org/2000/svg" class="muon-film" id="muon-optimizers" viewBox="0 0 720 656" role="img" aria-labelledby="muon-optimizers-title"><title id="muon-optimizers-title">Compute SGD, AdamW and Muon updates from six identical gradients</title><desc>Supplied gradient 6 of 6. Three computed steps. Different shapes.. SGD, AdamW and Muon compute different updates from the same gradient sequence. Ellipses use unit Frobenius norm for display; raw norms and matrix entries are shown.</desc><text x="24" y="27" class="mf-strong" text-anchor="start">Gradient 6 / 6</text><text x="24" y="53" class="mf-small" text-anchor="start">Three computed steps. Different shapes.</text><foreignObject x="0" y="65" width="302.4" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>G</mi><mi>t</mi></msub><mo>=</mo></mrow><annotation encoding="application/x-tex">G_t=</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">G</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span></span></span></span></span></div></foreignObject><g transform="translate(316.8 108) scale(0.66)"><polyline fill="none" points="-77.00,-35.00 -84.00,-35.00 -84.00,35.00 -77.00,35.00" class="mf-ink"/><polyline fill="none" points="77.00,-35.00 84.00,-35.00 84.00,35.00 77.00,35.00" class="mf-ink"/><text x="-43" y="-8" class="mf-matrix-number " text-anchor="middle">1.000</text><text x="43" y="-8" class="mf-matrix-number " text-anchor="middle">0.400</text><text x="-43" y="27" class="mf-matrix-number " text-anchor="middle">−0.200</text><text x="43" y="27" class="mf-matrix-number " text-anchor="middle">1.300</text></g><text x="700" y="92" class="mf-small" text-anchor="end">η = 0.1</text><text x="700" y="119" class="mf-small" text-anchor="end">same inputs</text><line x1="24" y1="151" x2="696" y2="151" class="mf-axis" /><g transform="translate(0,166)"><text x="120" y="23" class="mf-strong" text-anchor="middle">SGD</text><foreignObject x="0" y="34" width="240" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation mf-compact-equation"><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>R</mi><mi>t</mi></msub><mo>=</mo><msub><mi>G</mi><mi>t</mi></msub></mrow><annotation encoding="application/x-tex">R_t=G_t</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0077em;">R</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:-0.0077em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">G</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span></div></foreignObject><line x1="37.5" y1="171" x2="202.5" y2="171" class="mf-axis" /><line x1="120" y1="253.5" x2="120" y2="88.5" class="mf-axis" /><polyline fill="none" points="195.00,171.00 194.77,165.12 194.08,159.27 192.93,153.49 191.33,147.82 189.29,142.30 186.83,136.95 183.95,131.81 180.68,126.92 177.03,122.29 173.03,117.97 168.71,113.97 164.08,110.32 159.19,107.05 154.05,104.17 148.70,101.71 143.18,99.67 137.51,98.07 131.73,96.92 125.88,96.23 120.00,96.00 114.12,96.23 108.27,96.92 102.49,98.07 96.82,99.67 91.30,101.71 85.95,104.17 80.81,107.05 75.92,110.32 71.29,113.97 66.97,117.97 62.97,122.29 59.32,126.92 56.05,131.81 53.17,136.95 50.71,142.30 48.67,147.82 47.07,153.49 45.92,159.27 45.23,165.12 45.00,171.00 45.23,176.88 45.92,182.73 47.07,188.51 48.67,194.18 50.71,199.70 53.17,205.05 56.05,210.19 59.32,215.08 62.97,219.71 66.97,224.03 71.29,228.03 75.92,231.68 80.81,234.95 85.95,237.83 91.30,240.29 96.82,242.33 102.49,243.93 108.27,245.08 114.12,245.77 120.00,246.00 125.88,245.77 131.73,245.08 137.51,243.93 143.18,242.33 148.70,240.29 154.05,237.83 159.19,234.95 164.08,231.68 168.71,228.03 173.03,224.03 177.03,219.71 180.68,215.08 183.95,210.19 186.83,205.05 189.29,199.70 191.33,194.18 192.93,188.51 194.08,182.73 194.77,176.88 195.00,171.00" class="mf-ink mf-dashed mf-reference"/><polyline fill="none" points="75.88,162.18 74.63,166.70 73.66,171.26 72.98,175.81 72.59,180.33 72.49,184.80 72.68,189.18 73.16,193.44 73.94,197.57 74.99,201.54 76.33,205.32 77.93,208.88 79.79,212.21 81.90,215.29 84.25,218.10 86.81,220.61 89.58,222.82 92.54,224.71 95.67,226.27 98.95,227.48 102.35,228.35 105.87,228.87 109.47,229.03 113.14,228.83 116.85,228.27 120.58,227.36 124.31,226.11 128.00,224.51 131.65,222.59 135.23,220.34 138.72,217.79 142.09,214.96 145.32,211.85 148.40,208.49 151.30,204.90 154.01,201.10 156.51,197.11 158.78,192.97 160.81,188.69 162.60,184.30 164.12,179.82 165.37,175.30 166.34,170.74 167.02,166.19 167.41,161.67 167.51,157.20 167.32,152.82 166.84,148.56 166.06,144.43 165.01,140.46 163.67,136.68 162.07,133.12 160.21,129.79 158.10,126.71 155.75,123.90 153.19,121.39 150.42,119.18 147.46,117.29 144.33,115.73 141.05,114.52 137.65,113.65 134.13,113.13 130.53,112.97 126.86,113.17 123.15,113.73 119.42,114.64 115.69,115.89 112.00,117.49 108.35,119.41 104.77,121.66 101.28,124.21 97.91,127.04 94.68,130.15 91.60,133.51 88.70,137.10 85.99,140.90 83.49,144.89 81.22,149.03 79.19,153.31 77.40,157.70 75.88,162.18" class="mf-shape"/><line x1="120" y1="171" x2="75.88235294117646" y2="162.1764705882353" class="mf-memory-arrow" /><path d="M84.51,159.82 L75.88,162.18 L82.94,167.67" class="mf-memory-arrow"/><line x1="120" y1="171" x2="102.35294117647058" y2="228.35294117647058" class="mf-orange" /><path d="M100.88,219.53 L102.35,228.35 L108.53,221.88" class="mf-orange"/><text x="120" y="266" class="mf-small" text-anchor="middle">D =</text><g transform="translate(120 310) scale(0.74)"><polyline fill="none" points="-77.00,-35.00 -84.00,-35.00 -84.00,35.00 -77.00,35.00" class="mf-ink"/><polyline fill="none" points="77.00,-35.00 84.00,-35.00 84.00,35.00 77.00,35.00" class="mf-ink"/><text x="-43" y="-8" class="mf-matrix-number " text-anchor="middle">−0.100</text><text x="43" y="-8" class="mf-matrix-number " text-anchor="middle">−0.040</text><text x="-43" y="27" class="mf-matrix-number " text-anchor="middle">0.020</text><text x="43" y="27" class="mf-matrix-number " text-anchor="middle">−0.130</text></g><text x="120" y="363" class="mf-small" text-anchor="middle">‖D‖F = 0.170</text><text x="120" y="393" class="mf-small" text-anchor="middle">No momentum · no decay</text></g><g transform="translate(240,166)"><text x="120" y="23" class="mf-strong" text-anchor="middle">AdamW</text><foreignObject x="0" y="34" width="240" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation mf-compact-equation"><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>R</mi><mi>t</mi></msub><mo>=</mo><mfrac><msub><mover accent="true"><mi>m</mi><mo stretchy="true">^</mo></mover><mi>t</mi></msub><mrow><msqrt><msub><mover accent="true"><mi>v</mi><mo stretchy="true">^</mo></mover><mi>t</mi></msub></msqrt><mo>+</mo><mi>ε</mi></mrow></mfrac></mrow><annotation encoding="application/x-tex">R_t={\widehat m_t\over\sqrt{\widehat v_t}+\varepsilon}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0077em;">R</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:-0.0077em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.4175em;vertical-align:-0.538em;"></span><span class="mord"><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8795em;"><span style="top:-2.5919em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord sqrt mtight"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8544em;"><span class="svg-align" style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord mtight" style="padding-left:0.833em;"><span class="mord mtight"><span class="mord accent mtight"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.6706em;"><span style="top:-2.7em;"><span class="pstrut" style="height:2.7em;"></span><span class="mord mathnormal mtight" style="margin-right:0.0359em;">v</span></span><span class="svg-align" style="width:calc(100% - 0.0556em);margin-left:0.0556em;top:-3.1306em;"><span class="pstrut" style="height:2.7em;"></span><span class="mtight" style="height:0.24em;"><svg xmlns="http://www.w3.org/2000/svg" width="100%" height="0.24em" viewBox="0 0 1062 239" preserveAspectRatio="none"><path d="M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z"/></svg></span></span></span></span></span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2963em;"><span style="top:-2.357em;margin-left:-0.0359em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.143em;"><span></span></span></span></span></span></span></span></span><span style="top:-2.8144em;"><span class="pstrut" style="height:3em;"></span><span class="hide-tail mtight" style="min-width:0.853em;height:1.08em;"><svg xmlns="http://www.w3.org/2000/svg" width="400em" height="1.08em" viewBox="0 0 400000 1080" preserveAspectRatio="xMinYMin slice"><path d="M95,702
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l0 -0
c5.3,-9.3,12,-14,20,-14
H400000v40H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M834 80h400000v40h-400000z"/></svg></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.1856em;"><span></span></span></span></span></span><span class="mbin mtight">+</span><span class="mord mathnormal mtight">ε</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.4101em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord accent mtight"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.6706em;"><span style="top:-2.7em;"><span class="pstrut" style="height:2.7em;"></span><span class="mord mathnormal mtight">m</span></span><span class="svg-align" style="top:-3.1306em;"><span class="pstrut" style="height:2.7em;"></span><span class="mtight" style="height:0.24em;"><svg xmlns="http://www.w3.org/2000/svg" width="100%" height="0.24em" viewBox="0 0 1062 239" preserveAspectRatio="none"><path d="M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z"/></svg></span></span></span></span></span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2963em;"><span style="top:-2.357em;margin-left:0em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.143em;"><span></span></span></span></span></span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.538em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span></span></span></span></div></foreignObject><line x1="37.5" y1="171" x2="202.5" y2="171" class="mf-axis" /><line x1="120" y1="253.5" x2="120" y2="88.5" class="mf-axis" /><polyline fill="none" points="195.00,171.00 194.77,165.12 194.08,159.27 192.93,153.49 191.33,147.82 189.29,142.30 186.83,136.95 183.95,131.81 180.68,126.92 177.03,122.29 173.03,117.97 168.71,113.97 164.08,110.32 159.19,107.05 154.05,104.17 148.70,101.71 143.18,99.67 137.51,98.07 131.73,96.92 125.88,96.23 120.00,96.00 114.12,96.23 108.27,96.92 102.49,98.07 96.82,99.67 91.30,101.71 85.95,104.17 80.81,107.05 75.92,110.32 71.29,113.97 66.97,117.97 62.97,122.29 59.32,126.92 56.05,131.81 53.17,136.95 50.71,142.30 48.67,147.82 47.07,153.49 45.92,159.27 45.23,165.12 45.00,171.00 45.23,176.88 45.92,182.73 47.07,188.51 48.67,194.18 50.71,199.70 53.17,205.05 56.05,210.19 59.32,215.08 62.97,219.71 66.97,224.03 71.29,228.03 75.92,231.68 80.81,234.95 85.95,237.83 91.30,240.29 96.82,242.33 102.49,243.93 108.27,245.08 114.12,245.77 120.00,246.00 125.88,245.77 131.73,245.08 137.51,243.93 143.18,242.33 148.70,240.29 154.05,237.83 159.19,234.95 164.08,231.68 168.71,228.03 173.03,224.03 177.03,219.71 180.68,215.08 183.95,210.19 186.83,205.05 189.29,199.70 191.33,194.18 192.93,188.51 194.08,182.73 194.77,176.88 195.00,171.00" class="mf-ink mf-dashed mf-reference"/><polyline fill="none" points="101.74,186.45 102.61,191.92 103.58,197.26 104.66,202.44 105.83,207.42 107.09,212.18 108.43,216.69 109.84,220.92 111.31,224.83 112.83,228.42 114.40,231.65 116.01,234.51 117.64,236.97 119.28,239.03 120.93,240.67 122.57,241.88 124.20,242.66 125.80,242.99 127.36,242.88 128.88,242.32 130.35,241.33 131.75,239.90 133.08,238.05 134.32,235.78 135.48,233.11 136.55,230.06 137.51,226.65 138.36,222.89 139.10,218.82 139.73,214.45 140.23,209.81 140.61,204.93 140.86,199.84 140.98,194.58 140.97,189.17 140.83,183.64 140.56,178.04 140.17,172.40 139.66,166.75 139.02,161.12 138.26,155.55 137.39,150.08 136.42,144.74 135.34,139.56 134.17,134.58 132.91,129.82 131.57,125.31 130.16,121.08 128.69,117.17 127.17,113.58 125.60,110.35 123.99,107.49 122.36,105.03 120.72,102.97 119.07,101.33 117.43,100.12 115.80,99.34 114.20,99.01 112.64,99.12 111.12,99.68 109.65,100.67 108.25,102.10 106.92,103.95 105.68,106.22 104.52,108.89 103.45,111.94 102.49,115.35 101.64,119.11 100.90,123.18 100.27,127.55 99.77,132.19 99.39,137.07 99.14,142.16 99.02,147.42 99.03,152.83 99.17,158.36 99.44,163.96 99.83,169.60 100.34,175.25 100.98,180.88 101.74,186.45" class="mf-shape"/><line x1="120" y1="171" x2="101.7384646193222" y2="186.4454763295736" class="mf-memory-arrow" /><path d="M105.26,178.23 L101.74,186.45 L110.43,184.33" class="mf-memory-arrow"/><line x1="120" y1="171" x2="130.34601187354974" y2="241.32718979744038" class="mf-orange" /><path d="M125.22,233.99 L130.35,241.33 L133.14,232.83" class="mf-orange"/><text x="120" y="266" class="mf-small" text-anchor="middle">D =</text><g transform="translate(120 310) scale(0.74)"><polyline fill="none" points="-77.00,-35.00 -84.00,-35.00 -84.00,35.00 -77.00,35.00" class="mf-ink"/><polyline fill="none" points="77.00,-35.00 84.00,-35.00 84.00,35.00 77.00,35.00" class="mf-ink"/><text x="-43" y="-8" class="mf-matrix-number " text-anchor="middle">−0.027</text><text x="43" y="-8" class="mf-matrix-number " text-anchor="middle">0.015</text><text x="-43" y="27" class="mf-matrix-number " text-anchor="middle">−0.023</text><text x="43" y="27" class="mf-matrix-number " text-anchor="middle">−0.103</text></g><text x="120" y="363" class="mf-small" text-anchor="middle">‖D‖F = 0.110</text><text x="120" y="393" class="mf-small" text-anchor="middle">Momentum + decay λ = 0.1</text></g><g transform="translate(480,166)"><text x="120" y="23" class="mf-strong" text-anchor="middle">Muon</text><foreignObject x="0" y="34" width="240" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation mf-compact-equation"><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>R</mi><mi>t</mi></msub><mo>=</mo><msub><mi>X</mi><mn>5</mn></msub></mrow><annotation encoding="application/x-tex">R_t=X_5</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0077em;">R</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:-0.0077em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">5</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span></div></foreignObject><line x1="37.5" y1="171" x2="202.5" y2="171" class="mf-axis" /><line x1="120" y1="253.5" x2="120" y2="88.5" class="mf-axis" /><polyline fill="none" points="195.00,171.00 194.77,165.12 194.08,159.27 192.93,153.49 191.33,147.82 189.29,142.30 186.83,136.95 183.95,131.81 180.68,126.92 177.03,122.29 173.03,117.97 168.71,113.97 164.08,110.32 159.19,107.05 154.05,104.17 148.70,101.71 143.18,99.67 137.51,98.07 131.73,96.92 125.88,96.23 120.00,96.00 114.12,96.23 108.27,96.92 102.49,98.07 96.82,99.67 91.30,101.71 85.95,104.17 80.81,107.05 75.92,110.32 71.29,113.97 66.97,117.97 62.97,122.29 59.32,126.92 56.05,131.81 53.17,136.95 50.71,142.30 48.67,147.82 47.07,153.49 45.92,159.27 45.23,165.12 45.00,171.00 45.23,176.88 45.92,182.73 47.07,188.51 48.67,194.18 50.71,199.70 53.17,205.05 56.05,210.19 59.32,215.08 62.97,219.71 66.97,224.03 71.29,228.03 75.92,231.68 80.81,234.95 85.95,237.83 91.30,240.29 96.82,242.33 102.49,243.93 108.27,245.08 114.12,245.77 120.00,246.00 125.88,245.77 131.73,245.08 137.51,243.93 143.18,242.33 148.70,240.29 154.05,237.83 159.19,234.95 164.08,231.68 168.71,228.03 173.03,224.03 177.03,219.71 180.68,215.08 183.95,210.19 186.83,205.05 189.29,199.70 191.33,194.18 192.93,188.51 194.08,182.73 194.77,176.88 195.00,171.00" class="mf-ink mf-dashed mf-reference"/><polyline fill="none" points="75.88,180.11 76.37,184.78 77.13,189.35 78.16,193.82 79.45,198.14 80.98,202.30 82.76,206.26 84.76,210.01 86.99,213.51 89.41,216.76 92.03,219.72 94.82,222.38 97.76,224.72 100.84,226.74 104.04,228.41 107.33,229.72 110.71,230.67 114.14,231.26 117.61,231.47 121.09,231.32 124.57,230.78 128.01,229.89 131.41,228.62 134.74,227.00 137.98,225.04 141.10,222.75 144.10,220.13 146.95,217.21 149.63,214.01 152.13,210.54 154.43,206.83 156.52,202.90 158.38,198.77 160.01,194.47 161.39,190.02 162.51,185.46 163.38,180.81 163.97,176.09 164.29,171.35 164.35,166.60 164.12,161.89 163.63,157.22 162.87,152.65 161.84,148.18 160.55,143.86 159.02,139.70 157.24,135.74 155.24,131.99 153.01,128.49 150.59,125.24 147.97,122.28 145.18,119.62 142.24,117.28 139.16,115.26 135.96,113.59 132.67,112.28 129.29,111.33 125.86,110.74 122.39,110.53 118.91,110.68 115.43,111.22 111.99,112.11 108.59,113.38 105.26,115.00 102.02,116.96 98.90,119.25 95.90,121.87 93.05,124.79 90.37,127.99 87.87,131.46 85.57,135.17 83.48,139.10 81.62,143.23 79.99,147.53 78.61,151.98 77.49,156.54 76.62,161.19 76.03,165.91 75.71,170.65 75.65,175.40 75.88,180.11" class="mf-shape"/><line x1="120" y1="171" x2="75.8764258441042" y2="180.11422856850317" class="mf-memory-arrow" /><path d="M82.90,174.58 L75.88,180.11 L84.52,182.41" class="mf-memory-arrow"/><line x1="120" y1="171" x2="124.56660071819574" y2="230.7845063473039" class="mf-orange" /><path d="M119.97,223.11 L124.57,230.78 L127.95,222.50" class="mf-orange"/><text x="120" y="266" class="mf-small" text-anchor="middle">D =</text><g transform="translate(120 310) scale(0.74)"><polyline fill="none" points="-77.00,-35.00 -84.00,-35.00 -84.00,35.00 -77.00,35.00" class="mf-ink"/><polyline fill="none" points="77.00,-35.00 84.00,-35.00 84.00,35.00 77.00,35.00" class="mf-ink"/><text x="-43" y="-8" class="mf-matrix-number " text-anchor="middle">−0.075</text><text x="43" y="-8" class="mf-matrix-number " text-anchor="middle">0.008</text><text x="-43" y="27" class="mf-matrix-number " text-anchor="middle">−0.015</text><text x="43" y="27" class="mf-matrix-number " text-anchor="middle">−0.102</text></g><text x="120" y="363" class="mf-small" text-anchor="middle">‖D‖F = 0.127</text><text x="120" y="393" class="mf-small" text-anchor="middle">Momentum + decay λ = 0.1</text></g><text x="24" y="604" class="mf-small" text-anchor="start">Shapes show D / ‖D‖F; the numbers show the actual step.</text><text x="24" y="632" class="mf-small" text-anchor="start">Blue: image of (1, 0) · orange: image of (0, 1)</text></svg>
<figcaption>Replay the same six supplied gradient matrices through all three methods. Each panel shows the actual step D and its image of the unit circle. The images are divided by each step's Frobenius norm so their shapes fit the same scale; the unscaled norm is printed below. Watch the blue and orange basis arrows as well as the outline. This compares update rules, not training speed or final loss.</figcaption></figure>
<div class="muon-controls" data-animation="optimizers"><button data-action="play" disabled>Play animation</button><button data-action="restart" disabled>Restart</button><button data-action="previous-step" disabled>← Back</button><button data-action="next-step" disabled>Next →</button><span data-status>Same supplied gradients. Watch how each rule reshapes the update.</span></div>

<p>The first gradient has four positive entries. SGD keeps their relative sizes. AdamW&#39;s first bias-corrected gradient contribution is nearly the sign of each entry, so it is nearly rank one here. Muon&#39;s result keeps both matrix directions active. That difference comes from the rules, before we have trained anything.</p>
<p>The useful conclusion is that Muon gives weaker singular directions room to contribute instead of letting the strongest one dominate the update. That is what the rounder shape shows. It does not mean every step is smaller or gentler. These pictures normalize away the overall size; use the printed norms to compare size. The learning rate still decides how far we move, and a large rate can overshoot.</p>
<h2 id="now-give-them-a-loss-to-minimize"><a class="anchor" href="#now-give-them-a-loss-to-minimize" aria-label="Permalink">§</a>Now give them a loss to minimize</h2>
<p>The replay showed how the same gradients produce different steps. During training, those steps also change where the next gradient is evaluated. To see that feedback, give all three optimizers an actual loss and let each follow its own path.</p>
<p>Here is a quadratic loss with a narrow valley. In the two matrix directions shown below, it is</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>L</mi><mo stretchy="false">(</mo><mi>a</mi><mo separator="true">,</mo><mi>b</mi><mo stretchy="false">)</mo><mo>=</mo><mstyle scriptlevel="0" displaystyle="false"><mfrac><mn>1</mn><mn>2</mn></mfrac></mstyle><mo stretchy="false">(</mo><mn>40</mn><msup><mi>a</mi><mn>2</mn></msup><mo>+</mo><msup><mi>b</mi><mn>2</mn></msup><mo stretchy="false">)</mo><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">L(a,b)=\tfrac12(40a^2+b^2).</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">L</span><span class="mopen">(</span><span class="mord mathnormal">a</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal">b</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.2091em;vertical-align:-0.345em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8451em;"><span style="top:-2.655em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">2</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.345em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mopen">(</span><span class="mord">40</span><span class="mord"><span class="mord mathnormal">a</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.1141em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathnormal">b</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mclose">)</span><span class="mord">.</span></span></span></span></span></div>
<p>The bottom is at <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mn>0</mn><mo separator="true">,</mo><mn>0</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(0,0)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord">0</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">0</span><span class="mclose">)</span></span></span></span>.</span> The loss curves forty times more sharply along <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi></mrow><annotation encoding="application/x-tex">a</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">a</span></span></span></span></span> than along <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>b</mi></mrow><annotation encoding="application/x-tex">b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">b</span></span></span></span>.</span> All three methods start at <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mn>1.5</mn><mo separator="true">,</mo><mn>1.5</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(1.5,1.5)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord">1.5</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">1.5</span><span class="mclose">)</span></span></span></span>,</span> then recompute their gradients at their own new weights. Each curve is an actual optimization run.</p>
<p>Why compare two ways of writing this same valley? AdamW gives each matrix entry its own scale. We want to see whether its behavior changes when one useful movement is spread across several entries instead of stored in just one. Muon&#39;s rule uses singular directions, so this is a concrete way to compare what the two rules pay attention to.</p>
<p>Here <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi></mrow><annotation encoding="application/x-tex">a</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">a</span></span></span></span></span> measures movement across the steep side of the valley, and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>b</mi></mrow><annotation encoding="application/x-tex">b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">b</span></span></span></span></span> measures movement along its shallow side. The optimizer updates the entries of <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>W</mi></mrow><annotation encoding="application/x-tex">W</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.1389em;">W</span></span></span></span>,</span> not the letters <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi></mrow><annotation encoding="application/x-tex">a</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">a</span></span></span></span></span> and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>b</mi></mrow><annotation encoding="application/x-tex">b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">b</span></span></span></span></span> directly. We can encode those two coordinates in <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>W</mi></mrow><annotation encoding="application/x-tex">W</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.1389em;">W</span></span></span></span></span> in either of these ways.</p>
<p><strong>Separate entries.</strong> Put <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi></mrow><annotation encoding="application/x-tex">a</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">a</span></span></span></span></span> in the top-left entry and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>b</mi></mrow><annotation encoding="application/x-tex">b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">b</span></span></span></span></span> in the bottom-right entry. Hold <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">a=1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">a</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span></span> and increase only <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>b</mi></mrow><annotation encoding="application/x-tex">b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">b</span></span></span></span></span> from 0 to 0.2:</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mrow><mo fence="true">[</mo><mtable rowspacing="0.16em" columnalign="center center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>1</mn></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0</mn></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0</mn></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0</mn></mstyle></mtd></mtr></mtable><mo fence="true">]</mo></mrow><mspace width="1em"/><mo>⟶</mo><mspace width="1em"/><mrow><mo fence="true">[</mo><mtable rowspacing="0.16em" columnalign="center center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>1</mn></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0</mn></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0</mn></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0.2</mn></mstyle></mtd></mtr></mtable><mo fence="true">]</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\begin{bmatrix}1&amp;0\\0&amp;0\end{bmatrix}
\quad\longrightarrow\quad
\begin{bmatrix}1&amp;0\\0&amp;0.2\end{bmatrix}.</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:2.4em;vertical-align:-0.95em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">[</span></span><span class="mord"><span class="mtable"><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">1</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span><span class="arraycolsep" style="width:0.5em;"></span><span class="arraycolsep" style="width:0.5em;"></span><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">]</span></span></span><span class="mspace" style="margin-right:1em;"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">⟶</span><span class="mspace" style="margin-right:1em;"></span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:2.4em;vertical-align:-0.95em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">[</span></span><span class="mord"><span class="mtable"><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">1</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span><span class="arraycolsep" style="width:0.5em;"></span><span class="arraycolsep" style="width:0.5em;"></span><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0.2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">]</span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">.</span></span></span></span></span></div>
<p>Only the bottom-right number changes. AdamW&#39;s scale for that entry is based on gradients for the shallow movement alone.</p>
<p><strong>Mixed entries.</strong> Store the same coordinates using <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>W</mi><mn>11</mn></msub><mo>=</mo><msub><mi>W</mi><mn>22</mn></msub><mo>=</mo><mo stretchy="false">(</mo><mi>a</mi><mo>+</mo><mi>b</mi><mo stretchy="false">)</mo><mi mathvariant="normal">/</mi><mn>2</mn></mrow><annotation encoding="application/x-tex">W_{11}=W_{22}=(a+b)/2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">11</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">22</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal">a</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">b</span><span class="mclose">)</span><span class="mord">/2</span></span></span></span></span> and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>W</mi><mn>12</mn></msub><mo>=</mo><msub><mi>W</mi><mn>21</mn></msub><mo>=</mo><mo stretchy="false">(</mo><mi>a</mi><mo>−</mo><mi>b</mi><mo stretchy="false">)</mo><mi mathvariant="normal">/</mi><mn>2</mn></mrow><annotation encoding="application/x-tex">W_{12}=W_{21}=(a-b)/2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">12</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">21</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal">a</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">b</span><span class="mclose">)</span><span class="mord">/2</span></span></span></span>.</span> Make exactly the same change, <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">a=1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">a</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span></span> and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>b</mi><mo>:</mo><mn>0</mn><mo>→</mo><mn>0.2</mn></mrow><annotation encoding="application/x-tex">b:0\to0.2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">b</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">:</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">→</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.2</span></span></span></span>:</span></p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mrow><mo fence="true">[</mo><mtable rowspacing="0.16em" columnalign="center center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0.5</mn></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0.5</mn></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0.5</mn></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0.5</mn></mstyle></mtd></mtr></mtable><mo fence="true">]</mo></mrow><mspace width="1em"/><mo>⟶</mo><mspace width="1em"/><mrow><mo fence="true">[</mo><mtable rowspacing="0.16em" columnalign="center center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0.6</mn></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0.4</mn></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0.4</mn></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0.6</mn></mstyle></mtd></mtr></mtable><mo fence="true">]</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\begin{bmatrix}0.5&amp;0.5\\0.5&amp;0.5\end{bmatrix}
\quad\longrightarrow\quad
\begin{bmatrix}0.6&amp;0.4\\0.4&amp;0.6\end{bmatrix}.</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:2.4em;vertical-align:-0.95em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">[</span></span><span class="mord"><span class="mtable"><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0.5</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0.5</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span><span class="arraycolsep" style="width:0.5em;"></span><span class="arraycolsep" style="width:0.5em;"></span><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0.5</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0.5</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">]</span></span></span><span class="mspace" style="margin-right:1em;"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">⟶</span><span class="mspace" style="margin-right:1em;"></span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:2.4em;vertical-align:-0.95em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">[</span></span><span class="mord"><span class="mtable"><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0.6</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0.4</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span><span class="arraycolsep" style="width:0.5em;"></span><span class="arraycolsep" style="width:0.5em;"></span><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0.4</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0.6</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">]</span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">.</span></span></span></span></span></div>
<p>Now the shallow movement needs <strong>all four numbers</strong> to change: add 0.1 on the diagonal and subtract 0.1 off it. Increasing <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi></mrow><annotation encoding="application/x-tex">a</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">a</span></span></span></span></span> would instead add to all four entries. Each position therefore participates in both the steep and shallow movements. Its gradient history mixes their contributions, and AdamW&#39;s separate scale for that position cannot assign an independent scale to each movement.</p>
<p>The button <strong>Use separate entries for a and b</strong> switches from the second encoding to the first. It changes the formula for <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>W</mi></mrow><annotation encoding="application/x-tex">W</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.1389em;">W</span></span></span></span></span> and reruns all three optimizers. It does not change <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>L</mi><mo stretchy="false">(</mo><mi>a</mi><mo separator="true">,</mo><mi>b</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">L(a,b)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">L</span><span class="mopen">(</span><span class="mord mathnormal">a</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal">b</span><span class="mclose">)</span></span></span></span>,</span> so the bowl itself stays the same. Watch whether the optimizer follows the same path through that bowl. The formula and example matrix above the plots show the selected encoding; the matrices below show the actual weights during the run.</p>
<p>Both encodings start from <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><mo>=</mo><mi>b</mi><mo>=</mo><mn>1.5</mn></mrow><annotation encoding="application/x-tex">a=b=1.5</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">a</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">b</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1.5</span></span></span></span>,</span> which gives <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>W</mi><mo>=</mo><mn>1.5</mn><mi>I</mi></mrow><annotation encoding="application/x-tex">W=1.5I</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord">1.5</span><span class="mord mathnormal" style="margin-right:0.0785em;">I</span></span></span></span></span> in either case. That is why the starting weights look identical even though subsequent updates can differ. With the initial mixed encoding and learning rates, SGD bounces across the steep direction, AdamW makes slow progress along the shallow direction, and Muon gets farther down the valley in 80 steps. Use the switch to test how much of that result depends on the encoding.</p>
<figure class="diagram"><svg xmlns="http://www.w3.org/2000/svg" class="muon-film" id="muon-valley" viewBox="0 0 720 1490" role="img" aria-labelledby="muon-valley-title"><title id="muon-valley-title">Follow SGD, AdamW and Muon down a computed quadratic matrix loss</title><desc>Actual matrix-loss optimization, step 80 of 80. The matrix basis mixes the two directions by 45 degrees. Current losses: SGD 0.0304436; AdamW 0.145701; Muon 0.0000156281. Every method recomputes its gradient from its own current weights.</desc><text x="24" y="28" class="mf-strong" text-anchor="start">Training step 80 / 80</text><text x="24" y="55" class="mf-small" text-anchor="start">Mixed matrix entries · basis rotated 45°</text><text x="24" y="85" class="mf-strong" text-anchor="start">How valley coordinates become matrix entries</text><foreignObject x="12" y="102" width="696" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>W</mi><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><mrow><mo fence="true">[</mo><mtable rowspacing="0.16em" columnalign="center center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mi>a</mi><mo>+</mo><mi>b</mi></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mi>a</mi><mo>−</mo><mi>b</mi></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mi>a</mi><mo>−</mo><mi>b</mi></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mi>a</mi><mo>+</mo><mi>b</mi></mrow></mstyle></mtd></mtr></mtable><mo fence="true">]</mo></mrow></mrow><annotation encoding="application/x-tex">W=\frac12\begin{bmatrix}a+b&amp;a-b\\a-b&amp;a+b\end{bmatrix}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:2.4em;vertical-align:-0.95em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8451em;"><span style="top:-2.655em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">2</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.345em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">[</span></span><span class="mord"><span class="mtable"><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">a</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal">b</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">a</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal">b</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span><span class="arraycolsep" style="width:0.5em;"></span><span class="arraycolsep" style="width:0.5em;"></span><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">a</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal">b</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">a</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal">b</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">]</span></span></span></span></span></span></span></div></foreignObject><text x="24" y="197" class="mf-small" text-anchor="start">Same example point: a = 1, b = 0</text><g transform="translate(595 217) scale(0.75)"><polyline fill="none" points="-77.00,-35.00 -84.00,-35.00 -84.00,35.00 -77.00,35.00" class="mf-ink"/><polyline fill="none" points="77.00,-35.00 84.00,-35.00 84.00,35.00 77.00,35.00" class="mf-ink"/><text x="-43" y="-8" class="mf-matrix-number " text-anchor="middle">0.500</text><text x="43" y="-8" class="mf-matrix-number " text-anchor="middle">0.500</text><text x="-43" y="27" class="mf-matrix-number " text-anchor="middle">0.500</text><text x="43" y="27" class="mf-matrix-number " text-anchor="middle">0.500</text></g><text x="24" y="270" class="mf-small" text-anchor="start">The switch changes this map, not the valley axes.</text><g transform="translate(0 230)"><foreignObject x="24" y="72" width="365" height="58"><div xmlns="http://www.w3.org/1999/xhtml" class="mf-equation "><span class="" style="opacity:1"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>L</mi><mo stretchy="false">(</mo><mi>a</mi><mo separator="true">,</mo><mi>b</mi><mo stretchy="false">)</mo><mo>=</mo><mstyle scriptlevel="0" displaystyle="false"><mfrac><mn>1</mn><mn>2</mn></mfrac></mstyle><mo stretchy="false">(</mo><mn>40</mn><msup><mi>a</mi><mn>2</mn></msup><mo>+</mo><msup><mi>b</mi><mn>2</mn></msup><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">L(a,b)=\tfrac12(40a^2+b^2)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">L</span><span class="mopen">(</span><span class="mord mathnormal">a</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal">b</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.1901em;vertical-align:-0.345em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8451em;"><span style="top:-2.655em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">2</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.345em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mopen">(</span><span class="mord">40</span><span class="mord"><span class="mord mathnormal">a</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.0641em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathnormal">b</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mclose">)</span></span></span></span></span></div></foreignObject><defs><clipPath id="muon-valley-clip"><rect x="40" y="142" width="330" height="330"/></clipPath></defs><g clip-path="url(#muon-valley-clip)"><polyline fill="none" points="173.37,342.36 173.37,341.53 173.36,340.71 173.35,339.89 173.33,339.08 173.31,338.26 173.29,337.46 173.26,336.65 173.23,335.86 173.19,335.07 173.15,334.30 173.10,333.53 173.05,332.77 172.99,332.02 172.93,331.29 172.87,330.57 172.80,329.87 172.73,329.18 172.66,328.50 172.58,327.85 172.50,327.21 172.41,326.58 172.32,325.98 172.23,325.40 172.14,324.84 172.04,324.30 171.94,323.78 171.83,323.29 171.73,322.82 171.62,322.37 171.51,321.94 171.39,321.54 171.28,321.17 171.16,320.82 171.04,320.50 170.92,320.21 170.79,319.94 170.67,319.70 170.54,319.49 170.42,319.30 170.29,319.14 170.16,319.02 170.03,318.91 169.90,318.84 169.77,318.80 169.64,318.79 169.51,318.80 169.38,318.84 169.25,318.91 169.12,319.02 169.00,319.14 168.87,319.30 168.74,319.49 168.62,319.70 168.49,319.94 168.37,320.21 168.25,320.50 168.13,320.82 168.01,321.17 167.89,321.54 167.78,321.94 167.67,322.37 167.56,322.82 167.45,323.29 167.35,323.78 167.25,324.30 167.15,324.84 167.05,325.40 166.96,325.98 166.87,326.58 166.79,327.21 166.71,327.85 166.63,328.50 166.55,329.18 166.48,329.87 166.42,330.57 166.35,331.29 166.29,332.02 166.24,332.77 166.19,333.53 166.14,334.30 166.10,335.07 166.06,335.86 166.03,336.65 166.00,337.46 165.97,338.26 165.95,339.08 165.94,339.89 165.92,340.71 165.92,341.53 165.92,342.36 165.92,343.18 165.92,344.00 165.94,344.82 165.95,345.64 165.97,346.45 166.00,347.26 166.03,348.06 166.06,348.85 166.10,349.64 166.14,350.42 166.19,351.19 166.24,351.94 166.29,352.69 166.35,353.42 166.42,354.14 166.48,354.85 166.55,355.54 166.63,356.21 166.71,356.87 166.79,357.51 166.87,358.13 166.96,358.73 167.05,359.31 167.15,359.87 167.25,360.41 167.35,360.93 167.45,361.43 167.56,361.90 167.67,362.35 167.78,362.77 167.89,363.17 168.01,363.54 168.13,363.89 168.25,364.21 168.37,364.51 168.49,364.77 168.62,365.02 168.74,365.23 168.87,365.41 169.00,365.57 169.12,365.70 169.25,365.80 169.38,365.87 169.51,365.91 169.64,365.93 169.77,365.91 169.90,365.87 170.03,365.80 170.16,365.70 170.29,365.57 170.42,365.41 170.54,365.23 170.67,365.02 170.79,364.77 170.92,364.51 171.04,364.21 171.16,363.89 171.28,363.54 171.39,363.17 171.51,362.77 171.62,362.35 171.73,361.90 171.83,361.43 171.94,360.93 172.04,360.41 172.14,359.87 172.23,359.31 172.32,358.73 172.41,358.13 172.50,357.51 172.58,356.87 172.66,356.21 172.73,355.54 172.80,354.85 172.87,354.14 172.93,353.42 172.99,352.69 173.05,351.94 173.10,351.19 173.15,350.42 173.19,349.64 173.23,348.85 173.26,348.06 173.29,347.26 173.31,346.45 173.33,345.64 173.35,344.82 173.36,344.00 173.37,343.18 173.37,342.36" class="mf-loss-contour"/><polyline fill="none" points="177.98,342.36 177.97,340.52 177.96,338.68 177.93,336.85 177.90,335.02 177.85,333.20 177.79,331.40 177.73,329.61 177.65,327.83 177.57,326.07 177.47,324.33 177.37,322.61 177.26,320.92 177.13,319.25 177.00,317.61 176.86,316.00 176.71,314.43 176.55,312.88 176.39,311.38 176.21,309.91 176.03,308.48 175.84,307.09 175.64,305.74 175.43,304.44 175.22,303.19 175.00,301.98 174.77,300.82 174.54,299.72 174.30,298.66 174.06,297.66 173.81,296.71 173.56,295.82 173.30,294.98 173.03,294.21 172.76,293.49 172.49,292.83 172.22,292.23 171.94,291.69 171.66,291.22 171.38,290.80 171.09,290.45 170.80,290.16 170.51,289.94 170.22,289.78 169.93,289.68 169.64,289.65 169.35,289.68 169.06,289.78 168.77,289.94 168.48,290.16 168.20,290.45 167.91,290.80 167.63,291.22 167.35,291.69 167.07,292.23 166.79,292.83 166.52,293.49 166.25,294.21 165.99,294.98 165.73,295.82 165.48,296.71 165.23,297.66 164.98,298.66 164.74,299.72 164.51,300.82 164.29,301.98 164.07,303.19 163.85,304.44 163.65,305.74 163.45,307.09 163.26,308.48 163.08,309.91 162.90,311.38 162.73,312.88 162.58,314.43 162.43,316.00 162.28,317.61 162.15,319.25 162.03,320.92 161.92,322.61 161.81,324.33 161.72,326.07 161.63,327.83 161.56,329.61 161.49,331.40 161.44,333.20 161.39,335.02 161.35,336.85 161.33,338.68 161.31,340.52 161.31,342.36 161.31,344.20 161.33,346.03 161.35,347.87 161.39,349.69 161.44,351.51 161.49,353.32 161.56,355.11 161.63,356.89 161.72,358.64 161.81,360.38 161.92,362.10 162.03,363.80 162.15,365.46 162.28,367.10 162.43,368.71 162.58,370.29 162.73,371.83 162.90,373.34 163.08,374.81 163.26,376.24 163.45,377.63 163.65,378.97 163.85,380.27 164.07,381.53 164.29,382.73 164.51,383.89 164.74,385.00 164.98,386.05 165.23,387.06 165.48,388.00 165.73,388.89 165.99,389.73 166.25,390.51 166.52,391.23 166.79,391.89 167.07,392.48 167.35,393.02 167.63,393.50 167.91,393.91 168.20,394.26 168.48,394.55 168.77,394.78 169.06,394.94 169.35,395.03 169.64,395.06 169.93,395.03 170.22,394.94 170.51,394.78 170.80,394.55 171.09,394.26 171.38,393.91 171.66,393.50 171.94,393.02 172.22,392.48 172.49,391.89 172.76,391.23 173.03,390.51 173.30,389.73 173.56,388.89 173.81,388.00 174.06,387.06 174.30,386.05 174.54,385.00 174.77,383.89 175.00,382.73 175.22,381.53 175.43,380.27 175.64,378.97 175.84,377.63 176.03,376.24 176.21,374.81 176.39,373.34 176.55,371.83 176.71,370.29 176.86,368.71 177.00,367.10 177.13,365.46 177.26,363.80 177.37,362.10 177.47,360.38 177.57,358.64 177.65,356.89 177.73,355.11 177.79,353.32 177.85,351.51 177.90,349.69 177.93,347.87 177.96,346.03 177.97,344.20 177.98,342.36" class="mf-loss-contour"/><polyline fill="none" points="188.28,342.36 188.27,338.24 188.23,334.14 188.18,330.04 188.10,325.95 187.99,321.89 187.87,317.85 187.72,313.84 187.56,309.87 187.37,305.94 187.15,302.05 186.92,298.21 186.67,294.42 186.39,290.69 186.10,287.03 185.78,283.43 185.45,279.90 185.09,276.45 184.72,273.08 184.33,269.80 183.92,266.60 183.49,263.50 183.05,260.49 182.59,257.58 182.11,254.77 181.62,252.07 181.12,249.48 180.60,247.01 180.06,244.65 179.52,242.41 178.96,240.29 178.39,238.30 177.81,236.43 177.22,234.69 176.62,233.08 176.02,231.61 175.40,230.27 174.78,229.07 174.15,228.00 173.52,227.08 172.88,226.29 172.24,225.65 171.59,225.15 170.94,224.79 170.29,224.57 169.64,224.50 168.99,224.57 168.34,224.79 167.69,225.15 167.05,225.65 166.41,226.29 165.77,227.08 165.13,228.00 164.51,229.07 163.88,230.27 163.27,231.61 162.66,233.08 162.06,234.69 161.47,236.43 160.89,238.30 160.33,240.29 159.77,242.41 159.22,244.65 158.69,247.01 158.17,249.48 157.66,252.07 157.17,254.77 156.70,257.58 156.24,260.49 155.79,263.50 155.37,266.60 154.96,269.80 154.57,273.08 154.19,276.45 153.84,279.90 153.50,283.43 153.19,287.03 152.89,290.69 152.62,294.42 152.36,298.21 152.13,302.05 151.92,305.94 151.73,309.87 151.56,313.84 151.42,317.85 151.29,321.89 151.19,325.95 151.11,330.04 151.05,334.14 151.02,338.24 151.01,342.36 151.02,346.47 151.05,350.58 151.11,354.68 151.19,358.76 151.29,362.82 151.42,366.86 151.56,370.87 151.73,374.84 151.92,378.78 152.13,382.67 152.36,386.51 152.62,390.29 152.89,394.02 153.19,397.69 153.50,401.29 153.84,404.81 154.19,408.26 154.57,411.63 154.96,414.92 155.37,418.11 155.79,421.22 156.24,424.23 156.70,427.14 157.17,429.94 157.66,432.64 158.17,435.23 158.69,437.71 159.22,440.07 159.77,442.31 160.33,444.42 160.89,446.42 161.47,448.29 162.06,450.03 162.66,451.63 163.27,453.11 163.88,454.45 164.51,455.65 165.13,456.71 165.77,457.64 166.41,458.42 167.05,459.07 167.69,459.57 168.34,459.93 168.99,460.14 169.64,460.21 170.29,460.14 170.94,459.93 171.59,459.57 172.24,459.07 172.88,458.42 173.52,457.64 174.15,456.71 174.78,455.65 175.40,454.45 176.02,453.11 176.62,451.63 177.22,450.03 177.81,448.29 178.39,446.42 178.96,444.42 179.52,442.31 180.06,440.07 180.60,437.71 181.12,435.23 181.62,432.64 182.11,429.94 182.59,427.14 183.05,424.23 183.49,421.22 183.92,418.11 184.33,414.92 184.72,411.63 185.09,408.26 185.45,404.81 185.78,401.29 186.10,397.69 186.39,394.02 186.67,390.29 186.92,386.51 187.15,382.67 187.37,378.78 187.56,374.84 187.72,370.87 187.87,366.86 187.99,362.82 188.10,358.76 188.18,354.68 188.23,350.58 188.27,346.47 188.28,342.36" class="mf-loss-contour"/><polyline fill="none" points="206.91,342.36 206.89,334.13 206.82,325.91 206.71,317.72 206.55,309.55 206.35,301.43 206.10,293.35 205.81,285.33 205.47,277.39 205.09,269.52 204.66,261.74 204.20,254.06 203.69,246.48 203.14,239.03 202.55,231.70 201.92,224.50 201.25,217.45 200.54,210.55 199.79,203.81 199.01,197.24 198.19,190.84 197.34,184.63 196.45,178.62 195.53,172.80 194.58,167.19 193.60,161.79 192.59,156.61 191.55,151.66 190.48,146.94 189.39,142.46 188.28,138.22 187.14,134.23 185.98,130.50 184.80,127.02 183.60,123.81 182.39,120.86 181.16,118.18 179.92,115.77 178.66,113.64 177.39,111.79 176.11,110.22 174.83,108.94 173.54,107.93 172.24,107.22 170.94,106.79 169.64,106.64 168.34,106.79 167.04,107.22 165.75,107.93 164.46,108.94 163.17,110.22 161.89,111.79 160.63,113.64 159.37,115.77 158.13,118.18 156.90,120.86 155.68,123.81 154.48,127.02 153.30,130.50 152.15,134.23 151.01,138.22 149.89,142.46 148.80,146.94 147.74,151.66 146.70,156.61 145.69,161.79 144.70,167.19 143.75,172.80 142.83,178.62 141.95,184.63 141.09,190.84 140.27,197.24 139.49,203.81 138.74,210.55 138.04,217.45 137.37,224.50 136.74,231.70 136.15,239.03 135.60,246.48 135.09,254.06 134.62,261.74 134.20,269.52 133.82,277.39 133.48,285.33 133.19,293.35 132.94,301.43 132.74,309.55 132.58,317.72 132.46,325.91 132.40,334.13 132.37,342.36 132.40,350.58 132.46,358.80 132.58,367.00 132.74,375.16 132.94,383.29 133.19,391.36 133.48,399.38 133.82,407.33 134.20,415.20 134.62,422.98 135.09,430.66 135.60,438.23 136.15,445.69 136.74,453.02 137.37,460.21 138.04,467.27 138.74,474.17 139.49,480.91 140.27,487.48 141.09,493.87 141.95,500.08 142.83,506.10 143.75,511.92 144.70,517.53 145.69,522.92 146.70,528.10 147.74,533.05 148.80,537.77 149.89,542.25 151.01,546.49 152.15,550.48 153.30,554.22 154.48,557.69 155.68,560.91 156.90,563.86 158.13,566.53 159.37,568.94 160.63,571.07 161.89,572.92 163.17,574.49 164.46,575.78 165.75,576.78 167.04,577.50 168.34,577.93 169.64,578.07 170.94,577.93 172.24,577.50 173.54,576.78 174.83,575.78 176.11,574.49 177.39,572.92 178.66,571.07 179.92,568.94 181.16,566.53 182.39,563.86 183.60,560.91 184.80,557.69 185.98,554.22 187.14,550.48 188.28,546.49 189.39,542.25 190.48,537.77 191.55,533.05 192.59,528.10 193.60,522.92 194.58,517.53 195.53,511.92 196.45,506.10 197.34,500.08 198.19,493.87 199.01,487.48 199.79,480.91 200.54,474.17 201.25,467.27 201.92,460.21 202.55,453.02 203.14,445.69 203.69,438.23 204.20,430.66 204.66,422.98 205.09,415.20 205.47,407.33 205.81,399.38 206.10,391.36 206.35,383.29 206.55,375.16 206.71,367.00 206.82,358.80 206.89,350.58 206.91,342.36" class="mf-loss-contour"/><polyline fill="none" points="252.98,342.36 252.93,323.96 252.78,305.59 252.52,287.26 252.17,269.00 251.71,250.83 251.16,232.77 250.50,214.85 249.75,197.08 248.90,179.48 247.95,162.09 246.91,144.91 245.78,127.98 244.55,111.30 243.23,94.91 241.82,78.82 240.32,63.05 238.73,47.62 237.06,32.55 235.31,17.86 233.48,3.56 231.57,-10.32 229.59,-23.78 227.53,-36.79 225.41,-49.33 223.21,-61.40 220.95,-72.98 218.63,-84.05 216.24,-94.61 213.81,-104.63 211.31,-114.10 208.77,-123.02 206.18,-131.37 203.54,-139.15 200.86,-146.34 198.15,-152.93 195.40,-158.92 192.61,-164.30 189.80,-169.06 186.97,-173.20 184.11,-176.71 181.24,-179.59 178.35,-181.83 175.46,-183.43 172.55,-184.39 169.64,-184.72 166.73,-184.39 163.83,-183.43 160.93,-181.83 158.04,-179.59 155.17,-176.71 152.32,-173.20 149.48,-169.06 146.67,-164.30 143.89,-158.92 141.14,-152.93 138.42,-146.34 135.75,-139.15 133.11,-131.37 130.52,-123.02 127.97,-114.10 125.48,-104.63 123.04,-94.61 120.66,-84.05 118.34,-72.98 116.07,-61.40 113.88,-49.33 111.75,-36.79 109.69,-23.78 107.71,-10.32 105.80,3.56 103.97,17.86 102.22,32.55 100.55,47.62 98.97,63.05 97.47,78.82 96.06,94.91 94.74,111.30 93.51,127.98 92.37,144.91 91.33,162.09 90.38,179.48 89.53,197.08 88.78,214.85 88.13,232.77 87.57,250.83 87.12,269.00 86.76,287.26 86.51,305.59 86.36,323.96 86.31,342.36 86.36,360.75 86.51,379.12 86.76,397.45 87.12,415.71 87.57,433.88 88.13,451.94 88.78,469.87 89.53,487.64 90.38,505.23 91.33,522.63 92.37,539.80 93.51,556.74 94.74,573.41 96.06,589.80 97.47,605.89 98.97,621.66 100.55,637.09 102.22,652.16 103.97,666.86 105.80,681.15 107.71,695.04 109.69,708.49 111.75,721.50 113.88,734.05 116.07,746.12 118.34,757.70 120.66,768.77 123.04,779.32 125.48,789.34 127.97,798.82 130.52,807.74 133.11,816.09 135.75,823.86 138.42,831.05 141.14,837.64 143.89,843.63 146.67,849.01 149.48,853.77 152.32,857.91 155.17,861.42 158.04,864.30 160.93,866.54 163.83,868.15 166.73,869.11 169.64,869.43 172.55,869.11 175.46,868.15 178.35,866.54 181.24,864.30 184.11,861.42 186.97,857.91 189.80,853.77 192.61,849.01 195.40,843.63 198.15,837.64 200.86,831.05 203.54,823.86 206.18,816.09 208.77,807.74 211.31,798.82 213.81,789.34 216.24,779.32 218.63,768.77 220.95,757.70 223.21,746.12 225.41,734.05 227.53,721.50 229.59,708.49 231.57,695.04 233.48,681.15 235.31,666.86 237.06,652.16 238.73,637.09 240.32,621.66 241.82,605.89 243.23,589.80 244.55,573.41 245.78,556.74 246.91,539.80 247.95,522.63 248.90,505.23 249.75,487.64 250.50,469.87 251.16,451.94 251.71,433.88 252.17,415.71 252.52,397.45 252.78,379.12 252.93,360.75 252.98,342.36" class="mf-loss-contour"/><polyline fill="none" points="336.32,342.36 336.22,305.57 335.91,268.82 335.40,232.17 334.70,195.65 333.79,159.31 332.68,123.19 331.37,87.34 329.86,51.80 328.16,16.61 326.27,-18.18 324.18,-52.53 321.91,-86.40 319.45,-119.75 316.81,-152.53 313.99,-184.72 310.99,-216.26 307.82,-247.11 304.49,-277.25 300.98,-306.64 297.32,-335.24 293.51,-363.00 289.54,-389.91 285.43,-415.93 281.17,-441.03 276.78,-465.17 272.26,-488.32 267.61,-510.47 262.85,-531.57 257.97,-551.61 252.98,-570.56 247.89,-588.40 242.71,-605.10 237.44,-620.65 232.08,-635.03 226.65,-648.22 221.15,-660.20 215.58,-670.95 209.97,-680.48 204.30,-688.75 198.59,-695.77 192.84,-701.53 187.07,-706.01 181.27,-709.22 175.46,-711.15 169.64,-711.79 163.83,-711.15 158.02,-709.22 152.22,-706.01 146.45,-701.53 140.70,-695.77 134.99,-688.75 129.32,-680.48 123.70,-670.95 118.14,-660.20 112.64,-648.22 107.21,-635.03 101.85,-620.65 96.58,-605.10 91.39,-588.40 86.31,-570.56 81.32,-551.61 76.44,-531.57 71.67,-510.47 67.03,-488.32 62.51,-465.17 58.12,-441.03 53.86,-415.93 49.75,-389.91 45.78,-363.00 41.96,-335.24 38.30,-306.64 34.80,-277.25 31.46,-247.11 28.29,-216.26 25.30,-184.72 22.48,-152.53 19.84,-119.75 17.38,-86.40 15.10,-52.53 13.02,-18.18 11.13,16.61 9.42,51.80 7.92,87.34 6.61,123.19 5.50,159.31 4.59,195.65 3.88,232.17 3.37,268.82 3.07,305.57 2.97,342.36 3.07,379.15 3.37,415.89 3.88,452.55 4.59,489.07 5.50,525.41 6.61,561.53 7.92,597.38 9.42,632.92 11.13,668.11 13.02,702.90 15.10,737.25 17.38,771.12 19.84,804.46 22.48,837.25 25.30,869.43 28.29,900.97 31.46,931.83 34.80,961.97 38.30,991.35 41.96,1019.95 45.78,1047.72 49.75,1074.63 53.86,1100.65 58.12,1125.74 62.51,1149.88 67.03,1173.04 71.67,1195.18 76.44,1216.28 81.32,1236.32 86.31,1255.27 91.39,1273.11 96.58,1289.82 101.85,1305.37 107.21,1319.74 112.64,1332.93 118.14,1344.91 123.70,1355.67 129.32,1365.19 134.99,1373.47 140.70,1380.49 146.45,1386.24 152.22,1390.73 158.02,1393.94 163.83,1395.86 169.64,1396.50 175.46,1395.86 181.27,1393.94 187.07,1390.73 192.84,1386.24 198.59,1380.49 204.30,1373.47 209.97,1365.19 215.58,1355.67 221.15,1344.91 226.65,1332.93 232.08,1319.74 237.44,1305.37 242.71,1289.82 247.89,1273.11 252.98,1255.27 257.97,1236.32 262.85,1216.28 267.61,1195.18 272.26,1173.04 276.78,1149.88 281.17,1125.74 285.43,1100.65 289.54,1074.63 293.51,1047.72 297.32,1019.95 300.98,991.35 304.49,961.97 307.82,931.83 310.99,900.97 313.99,869.43 316.81,837.25 319.45,804.46 321.91,771.12 324.18,737.25 326.27,702.90 328.16,668.11 329.86,632.92 331.37,597.38 332.68,561.53 333.79,525.41 334.70,489.07 335.40,452.55 335.91,415.89 336.22,379.15 336.32,342.36" class="mf-loss-contour"/><line x1="40" y1="342.3571428571429" x2="370" y2="342.3571428571429" class="mf-axis" /><line x1="169.64285714285717" y1="472" x2="169.64285714285717" y2="142" class="mf-axis" /><polyline fill="none" points="346.43,165.57 63.57,172.64 233.23,179.43 131.63,185.94 192.26,192.17 156.27,198.15 177.48,203.87 165.10,209.34 172.25,214.57 168.17,219.57 170.46,224.34 169.20,228.90 169.88,233.25 169.52,237.40 169.71,241.36 169.61,245.13 169.66,248.73 169.64,252.15 169.65,255.41 169.64,258.51 169.64,261.46 169.64,264.27 169.64,266.95 169.64,269.49 169.64,271.90 169.64,274.20 169.64,276.38 169.64,278.45 169.64,280.42 169.64,282.29 169.64,284.06 169.64,285.75 169.64,287.34 169.64,288.86 169.64,290.30 169.64,291.66 169.64,292.96 169.64,294.18 169.64,295.34 169.64,296.44 169.64,297.49 169.64,298.47 169.64,299.41 169.64,300.29 169.64,301.13 169.64,301.92 169.64,302.67 169.64,303.37 169.64,304.04 169.64,304.67 169.64,305.26 169.64,305.83 169.64,306.35 169.64,306.85 169.64,307.32 169.64,307.76 169.64,308.18 169.64,308.57 169.64,308.93 169.64,309.28 169.64,309.60 169.64,309.91 169.64,310.19 169.64,310.46 169.64,310.71 169.64,310.94 169.64,311.17 169.64,311.37 169.64,311.57 169.64,311.75 169.64,311.92 169.64,312.09 169.64,312.24 169.64,312.39 169.64,312.53 169.64,312.66 169.64,312.79 169.64,312.92 169.64,313.04 169.64,313.16 169.64,313.28" class="mf-sgd"/><circle cx="169.64285714285717" cy="313.27550511637656" r="5" class="mf-sgd-dot"/><polyline fill="none" points="346.43,165.57 327.57,165.57 308.81,165.57 290.25,165.58 271.98,165.61 254.14,165.65 236.89,165.71 220.39,165.82 204.86,165.98 190.54,166.23 177.67,166.57 166.51,167.03 157.30,167.64 150.21,168.41 145.31,169.34 142.57,170.40 141.84,171.59 142.87,172.86 145.35,174.19 148.93,175.57 153.23,176.99 157.90,178.44 162.61,179.92 167.03,181.45 170.91,183.03 174.04,184.65 176.28,186.32 177.57,188.03 177.96,189.78 177.54,191.55 176.48,193.35 174.96,195.17 173.20,197.01 171.41,198.88 169.76,200.79 168.40,202.74 167.43,204.72 166.89,206.73 166.76,208.78 167.00,210.84 167.50,212.93 168.18,215.02 168.91,217.12 169.60,219.22 170.17,221.33 170.57,223.43 170.77,225.53 170.80,227.61 170.67,229.68 170.44,231.73 170.16,233.76 169.86,235.77 169.61,237.75 169.41,239.71 169.29,241.64 169.25,243.54 169.27,245.40 169.35,247.23 169.45,249.02 169.56,250.76 169.66,252.47 169.74,254.13 169.80,255.75 169.83,257.32 169.83,258.85 169.81,260.33 169.78,261.77 169.75,263.17 169.71,264.53 169.68,265.84 169.65,267.12 169.63,268.37 169.62,269.59 169.62,270.78 169.62,271.94 169.63,273.09 169.64,274.22 169.65,275.35 169.66,276.47 169.67,277.60 169.68,278.74" class="mf-memory-arrow mf-dashed"/><circle cx="169.67753523139265" cy="278.73620296307377" r="5" class="mf-blue-dot"/><polyline fill="none" points="346.43,165.57 339.86,174.37 333.29,183.05 326.73,191.60 320.18,200.02 313.65,208.27 307.14,216.35 300.65,224.24 294.19,231.94 287.77,239.43 281.38,246.71 275.04,253.78 268.74,260.64 262.49,267.29 256.30,273.74 250.17,280.00 244.10,286.10 238.09,292.05 232.16,297.88 226.30,303.61 220.52,309.30 214.81,314.98 209.20,320.75 203.66,326.68 198.22,332.92 192.87,339.60 187.62,346.67 182.46,353.42 177.41,358.64 172.45,364.77 167.61,371.07 162.86,363.63 158.23,357.34 153.70,350.78 149.27,344.30 153.68,337.88 157.87,331.07 161.94,326.82 165.90,331.92 169.75,337.02 173.48,340.80 177.09,346.61 180.60,351.81 177.22,347.47 173.95,343.40 170.80,340.10 167.77,335.31 164.84,339.17 162.02,343.64 164.72,346.39 167.31,343.68 169.79,339.45 172.17,343.48 174.44,343.98 172.27,341.72 170.20,338.17 168.23,340.63 166.35,343.67 168.13,346.56 169.82,344.79 171.43,343.02 173.77,341.46 172.33,339.50 170.97,341.86 169.68,343.95 168.46,342.03 167.30,341.10 168.43,342.40 169.47,343.67 170.45,342.43 171.38,341.01 170.50,342.21 169.66,343.06 168.86,342.97 168.09,341.84 168.83,342.11 169.54,343.34 170.23,342.42 170.91,341.33 170.24,342.23 169.58,342.90" class="mf-orange"/><circle cx="169.58497516726177" cy="342.90499902017405" r="5" class="mf-dot"/></g><text x="51.7857142857143" y="496" class="mf-small" text-anchor="middle">-1</text><text x="28" y="465.2142857142858" class="mf-small" text-anchor="end">-1</text><text x="169.64285714285717" y="496" class="mf-small" text-anchor="middle">0</text><text x="28" y="347.3571428571429" class="mf-small" text-anchor="end">0</text><text x="287.5" y="496" class="mf-small" text-anchor="middle">1</text><text x="28" y="229.5" class="mf-small" text-anchor="end">1</text><text x="370" y="496" class="mf-small" text-anchor="end">a</text><text x="27" y="130" class="mf-small" text-anchor="start">b</text><circle cx="346.42857142857144" cy="165.57142857142856" r="4" class="mf-open"/><text x="336.42857142857144" y="152.57142857142856" class="mf-small" text-anchor="end">start</text><line x1="163.64285714285717" y1="336.3571428571429" x2="175.64285714285717" y2="348.3571428571429" class="mf-ink" /><line x1="163.64285714285717" y1="348.3571428571429" x2="175.64285714285717" y2="336.3571428571429" class="mf-ink" /><text x="181.64285714285717" y="365.3571428571429" class="mf-small" text-anchor="start">minimum: L = 0</text><text x="40" y="529" class="mf-small" text-anchor="start">Contours join points with equal loss.</text><text x="435" y="132" class="mf-strong" text-anchor="start">Loss · logarithmic scale</text><line x1="435" y1="155" x2="687" y2="155" class="mf-axis" /><text x="425" y="160" class="mf-small" text-anchor="end">10²</text><line x1="435" y1="192.2" x2="687" y2="192.2" class="mf-axis" /><text x="425" y="197.2" class="mf-small" text-anchor="end">1</text><line x1="435" y1="266.6" x2="687" y2="266.6" class="mf-axis" /><text x="425" y="271.6" class="mf-small" text-anchor="end">10⁻⁴</text><line x1="435" y1="341" x2="687" y2="341" class="mf-axis" /><text x="425" y="346" class="mf-small" text-anchor="end">10⁻⁸</text><text x="435" y="366" class="mf-small" text-anchor="middle">0</text><text x="561" y="366" class="mf-small" text-anchor="middle">40</text><text x="687" y="366" class="mf-small" text-anchor="middle">80</text><text x="687" y="390" class="mf-small" text-anchor="end">training steps</text><polyline fill="none" points="435.00,161.25 438.15,169.20 441.30,176.74 444.45,183.43 447.60,188.67 450.75,192.15 453.90,194.22 457.05,195.48 460.20,196.36 463.35,197.09 466.50,197.76 469.65,198.41 472.80,199.04 475.95,199.67 479.10,200.29 482.25,200.91 485.40,201.52 488.55,202.12 491.70,202.71 494.85,203.30 498.00,203.88 501.15,204.45 504.30,205.01 507.45,205.57 510.60,206.11 513.75,206.65 516.90,207.17 520.05,207.69 523.20,208.19 526.35,208.69 529.50,209.17 532.65,209.65 535.80,210.11 538.95,210.56 542.10,211.00 545.25,211.43 548.40,211.85 551.55,212.25 554.70,212.65 557.85,213.03 561.00,213.40 564.15,213.76 567.30,214.11 570.45,214.44 573.60,214.77 576.75,215.08 579.90,215.38 583.05,215.67 586.20,215.95 589.35,216.22 592.50,216.48 595.65,216.72 598.80,216.96 601.95,217.18 605.10,217.40 608.25,217.60 611.40,217.80 614.55,217.98 617.70,218.16 620.85,218.33 624.00,218.49 627.15,218.64 630.30,218.78 633.45,218.91 636.60,219.04 639.75,219.16 642.90,219.28 646.05,219.38 649.20,219.49 652.35,219.58 655.50,219.67 658.65,219.76 661.80,219.84 664.95,219.92 668.10,220.00 671.25,220.07 674.40,220.14 677.55,220.21 680.70,220.28 683.85,220.34 687.00,220.41" class="mf-sgd"/><circle cx="687" cy="220.40697611394242" r="4" class="mf-sgd-dot"/><line x1="435" y1="416" x2="457" y2="416" class="mf-sgd" /><text x="466" y="422" class="mf-strong" text-anchor="start">SGD</text><text x="687" y="422" class="mf-small" text-anchor="end">0.03044</text><text x="466" y="446" class="mf-small" text-anchor="start">initial η = 0.04</text><polyline fill="none" points="435.00,161.25 438.15,163.02 441.30,165.00 444.45,167.21 447.60,169.70 450.75,172.54 453.90,175.78 457.05,179.48 460.20,183.58 463.35,187.70 466.50,190.69 469.65,191.28 472.80,189.97 475.95,188.24 479.10,186.89 482.25,186.13 485.40,185.97 488.55,186.34 491.70,187.15 494.85,188.31 498.00,189.64 501.15,190.96 504.30,192.03 507.45,192.68 510.60,192.91 513.75,192.85 516.90,192.70 520.05,192.63 523.20,192.72 526.35,192.97 529.50,193.36 532.65,193.80 535.80,194.22 538.95,194.57 542.10,194.84 545.25,195.04 548.40,195.21 551.55,195.40 554.70,195.63 557.85,195.90 561.00,196.20 564.15,196.51 567.30,196.81 570.45,197.09 573.60,197.36 576.75,197.63 579.90,197.91 583.05,198.20 586.20,198.50 589.35,198.80 592.50,199.11 595.65,199.42 598.80,199.73 601.95,200.03 605.10,200.33 608.25,200.64 611.40,200.95 614.55,201.26 617.70,201.57 620.85,201.87 624.00,202.18 627.15,202.48 630.30,202.78 633.45,203.07 636.60,203.36 639.75,203.65 642.90,203.94 646.05,204.22 649.20,204.50 652.35,204.78 655.50,205.05 658.65,205.32 661.80,205.59 664.95,205.85 668.10,206.12 671.25,206.39 674.40,206.65 677.55,206.92 680.70,207.19 683.85,207.47 687.00,207.76" class="mf-memory-arrow mf-dashed"/><circle cx="687" cy="207.75957871250844" r="4" class="mf-blue-dot"/><line x1="435" y1="476" x2="457" y2="476" class="mf-memory-arrow mf-dashed" /><text x="466" y="482" class="mf-strong" text-anchor="start">AdamW</text><text x="687" y="482" class="mf-small" text-anchor="end">0.14570</text><text x="466" y="506" class="mf-small" text-anchor="start">initial η = 0.08</text><polyline fill="none" points="435.00,161.25 438.15,161.87 441.30,162.51 444.45,163.17 447.60,163.87 450.75,164.59 453.90,165.34 457.05,166.13 460.20,166.95 463.35,167.81 466.50,168.72 469.65,169.67 472.80,170.67 475.95,171.72 479.10,172.84 482.25,174.03 485.40,175.31 488.55,176.67 491.70,178.14 494.85,179.74 498.00,181.49 501.15,183.42 504.30,185.58 507.45,188.03 510.60,190.87 513.75,194.24 516.90,198.37 520.05,203.69 523.20,211.10 526.35,220.67 529.50,219.13 532.65,212.36 535.80,205.38 538.95,200.26 542.10,196.36 545.25,200.28 548.40,205.04 551.55,211.30 554.70,222.31 557.85,247.67 561.00,223.31 564.15,212.55 567.30,206.24 570.45,212.25 573.60,221.45 576.75,241.94 579.90,232.45 583.05,219.63 586.20,212.24 589.35,219.18 592.50,231.32 595.65,256.78 598.80,230.06 601.95,219.71 605.10,229.45 608.25,247.37 611.40,239.18 614.55,225.76 617.70,236.96 620.85,258.85 624.00,235.62 627.15,222.12 630.30,228.84 633.45,240.48 636.60,267.14 639.75,242.28 642.90,231.25 646.05,241.98 649.20,266.09 652.35,248.61 655.50,236.03 658.65,247.61 661.80,280.39 664.95,248.80 668.10,237.90 671.25,248.30 674.40,272.15 677.55,253.59 680.70,241.10 683.85,253.27 687.00,281.59" class="mf-orange"/><circle cx="687" cy="281.59332431406443" r="4" class="mf-dot"/><line x1="435" y1="536" x2="457" y2="536" class="mf-orange" /><text x="466" y="542" class="mf-strong" text-anchor="start">Muon</text><text x="687" y="542" class="mf-small" text-anchor="end">1.56e−5</text><text x="466" y="566" class="mf-small" text-anchor="start">initial η = 0.08</text><text x="40" y="558" class="mf-small" text-anchor="start">Fresh gradients at every point.</text><text x="40" y="585" class="mf-small" text-anchor="start">Try the basis and rate controls.</text><text x="24" y="628" class="mf-small" text-anchor="start">λ = 0 · same rate schedule · different cost per step</text><text x="24" y="680" class="mf-strong" text-anchor="start">The same paths on the loss surface</text><text x="24" y="706" class="mf-small" text-anchor="start">Height = loss · drag to rotate · arrows also rotate</text><defs><clipPath id="valley-surface-clip"><rect x="12" y="720" width="696" height="325"/></clipPath></defs><g clip-path="url(#valley-surface-clip)"><polygon points="315.86,717.11 324.46,739.12 319.54,744.32 310.93,722.31" class="mf-surface-face" fill-opacity=".08"/><polygon points="324.46,739.12 333.07,759.44 328.14,764.64 319.54,744.32" class="mf-surface-face" fill-opacity=".08"/><polygon points="310.93,722.31 319.54,744.32 314.61,749.47 306.00,727.47" class="mf-surface-face" fill-opacity=".08"/><polygon points="333.07,759.44 341.68,778.09 336.75,783.29 328.14,764.64" class="mf-surface-face" fill-opacity=".08"/><polygon points="319.54,744.32 328.14,764.64 323.22,769.80 314.61,749.47" class="mf-surface-face" fill-opacity=".08"/><polygon points="341.68,778.09 350.28,795.06 345.35,800.26 336.75,783.29" class="mf-surface-face" fill-opacity=".08"/><polygon points="306.00,727.47 314.61,749.47 309.68,754.59 301.08,732.58" class="mf-surface-face" fill-opacity=".08"/><polygon points="328.14,764.64 336.75,783.29 331.82,788.45 323.22,769.80" class="mf-surface-face" fill-opacity=".08"/><polygon points="350.28,795.06 358.89,810.35 353.96,815.55 345.35,800.26" class="mf-surface-face" fill-opacity=".08"/><polygon points="314.61,749.47 323.22,769.80 318.29,774.91 309.68,754.59" class="mf-surface-face" fill-opacity=".08"/><polygon points="336.75,783.29 345.35,800.26 340.43,805.42 331.82,788.45" class="mf-surface-face" fill-opacity=".08"/><polygon points="358.89,810.35 367.49,823.96 362.57,829.16 353.96,815.55" class="mf-surface-face" fill-opacity=".08"/><polygon points="301.08,732.58 309.68,754.59 304.75,759.66 296.15,737.65" class="mf-surface-face" fill-opacity=".08"/><polygon points="323.22,769.80 331.82,788.45 326.89,793.56 318.29,774.91" class="mf-surface-face" fill-opacity=".08"/><polygon points="345.35,800.26 353.96,815.55 349.03,820.71 340.43,805.42" class="mf-surface-face" fill-opacity=".08"/><polygon points="367.49,823.96 376.10,835.90 371.17,841.10 362.57,829.16" class="mf-surface-face" fill-opacity=".08"/><polygon points="309.68,754.59 318.29,774.91 313.36,779.99 304.75,759.66" class="mf-surface-face" fill-opacity=".08"/><polygon points="331.82,788.45 340.43,805.42 335.50,810.53 326.89,793.56" class="mf-surface-face" fill-opacity=".08"/><polygon points="353.96,815.55 362.57,829.16 357.64,834.32 349.03,820.71" class="mf-surface-face" fill-opacity=".08"/><polygon points="296.15,737.65 304.75,759.66 299.83,764.69 291.22,742.69" class="mf-surface-face" fill-opacity=".08"/><polygon points="376.10,835.90 384.71,846.15 379.78,851.35 371.17,841.10" class="mf-surface-face" fill-opacity=".08"/><polygon points="318.29,774.91 326.89,793.56 321.97,798.64 313.36,779.99" class="mf-surface-face" fill-opacity=".08"/><polygon points="340.43,805.42 349.03,820.71 344.11,825.82 335.50,810.53" class="mf-surface-face" fill-opacity=".08"/><polygon points="362.57,829.16 371.17,841.10 366.24,846.25 357.64,834.32" class="mf-surface-face" fill-opacity=".08"/><polygon points="304.75,759.66 313.36,779.99 308.43,785.02 299.83,764.69" class="mf-surface-face" fill-opacity=".08"/><polygon points="384.71,846.15 393.31,854.73 388.38,859.93 379.78,851.35" class="mf-surface-face" fill-opacity=".08"/><polygon points="326.89,793.56 335.50,810.53 330.57,815.61 321.97,798.64" class="mf-surface-face" fill-opacity=".08"/><polygon points="349.03,820.71 357.64,834.32 352.71,839.44 344.11,825.82" class="mf-surface-face" fill-opacity=".08"/><polygon points="291.22,742.69 299.83,764.69 294.90,769.68 286.29,747.67" class="mf-surface-face" fill-opacity=".08"/><polygon points="371.17,841.10 379.78,851.35 374.85,856.51 366.24,846.25" class="mf-surface-face" fill-opacity=".08"/><polygon points="313.36,779.99 321.97,798.64 317.04,803.67 308.43,785.02" class="mf-surface-face" fill-opacity=".08"/><polygon points="393.31,854.73 401.92,861.63 396.99,866.82 388.38,859.93" class="mf-surface-face" fill-opacity=".08"/><polygon points="335.50,810.53 344.11,825.82 339.18,830.90 330.57,815.61" class="mf-surface-face" fill-opacity=".08"/><polygon points="357.64,834.32 366.24,846.25 361.32,851.37 352.71,839.44" class="mf-surface-face" fill-opacity=".08"/><polygon points="299.83,764.69 308.43,785.02 303.51,790.01 294.90,769.68" class="mf-surface-face" fill-opacity=".08"/><polygon points="379.78,851.35 388.38,859.93 383.46,865.08 374.85,856.51" class="mf-surface-face" fill-opacity=".08"/><polygon points="321.97,798.64 330.57,815.61 325.64,820.64 317.04,803.67" class="mf-surface-face" fill-opacity=".08"/><polygon points="401.92,861.63 410.52,866.84 405.60,872.04 396.99,866.82" class="mf-surface-face" fill-opacity=".08"/><polygon points="344.11,825.82 352.71,839.44 347.78,844.51 339.18,830.90" class="mf-surface-face" fill-opacity=".08"/><polygon points="286.29,747.67 294.90,769.68 289.97,774.63 281.37,752.62" class="mf-surface-face" fill-opacity=".08"/><polygon points="366.24,846.25 374.85,856.51 369.92,861.62 361.32,851.37" class="mf-surface-face" fill-opacity=".08"/><polygon points="308.43,785.02 317.04,803.67 312.11,808.66 303.51,790.01" class="mf-surface-face" fill-opacity=".08"/><polygon points="388.38,859.93 396.99,866.82 392.06,871.98 383.46,865.08" class="mf-surface-face" fill-opacity=".08"/><polygon points="330.57,815.61 339.18,830.90 334.25,835.93 325.64,820.64" class="mf-surface-face" fill-opacity=".08"/><polygon points="410.52,866.84 419.13,870.38 414.20,875.58 405.60,872.04" class="mf-surface-face" fill-opacity=".08"/><polygon points="352.71,839.44 361.32,851.37 356.39,856.44 347.78,844.51" class="mf-surface-face" fill-opacity=".08"/><polygon points="294.90,769.68 303.51,790.01 298.58,794.95 289.97,774.63" class="mf-surface-face" fill-opacity=".08"/><polygon points="374.85,856.51 383.46,865.08 378.53,870.20 369.92,861.62" class="mf-surface-face" fill-opacity=".08"/><polygon points="317.04,803.67 325.64,820.64 320.72,825.63 312.11,808.66" class="mf-surface-face" fill-opacity=".08"/><polygon points="396.99,866.82 405.60,872.04 400.67,877.20 392.06,871.98" class="mf-surface-face" fill-opacity=".08"/><polygon points="339.18,830.90 347.78,844.51 342.86,849.54 334.25,835.93" class="mf-surface-face" fill-opacity=".08"/><polygon points="419.13,870.38 427.73,872.24 422.81,877.44 414.20,875.58" class="mf-surface-face" fill-opacity=".08"/><polygon points="281.37,752.62 289.97,774.63 285.04,779.53 276.44,757.53" class="mf-surface-face" fill-opacity=".08"/><polygon points="361.32,851.37 369.92,861.62 365.00,866.70 356.39,856.44" class="mf-surface-face" fill-opacity=".08"/><polygon points="303.51,790.01 312.11,808.66 307.18,813.60 298.58,794.95" class="mf-surface-face" fill-opacity=".08"/><polygon points="383.46,865.08 392.06,871.98 387.13,877.10 378.53,870.20" class="mf-surface-face" fill-opacity=".08"/><polygon points="325.64,820.64 334.25,835.93 329.32,840.92 320.72,825.63" class="mf-surface-face" fill-opacity=".08"/><polygon points="405.60,872.04 414.20,875.58 409.27,880.74 400.67,877.20" class="mf-surface-face" fill-opacity=".08"/><polygon points="347.78,844.51 356.39,856.44 351.46,861.47 342.86,849.54" class="mf-surface-face" fill-opacity=".08"/><polygon points="427.73,872.24 436.34,872.43 431.41,877.63 422.81,877.44" class="mf-surface-face" fill-opacity=".08"/><polygon points="289.97,774.63 298.58,794.95 293.65,799.86 285.04,779.53" class="mf-surface-face" fill-opacity=".08"/><polygon points="369.92,861.62 378.53,870.20 373.60,875.27 365.00,866.70" class="mf-surface-face" fill-opacity=".08"/><polygon points="312.11,808.66 320.72,825.63 315.79,830.57 307.18,813.60" class="mf-surface-face" fill-opacity=".08"/><polygon points="392.06,871.98 400.67,877.20 395.74,882.31 387.13,877.10" class="mf-surface-face" fill-opacity=".08"/><polygon points="334.25,835.93 342.86,849.54 337.93,854.53 329.32,840.92" class="mf-surface-face" fill-opacity=".08"/><polygon points="414.20,875.58 422.81,877.44 417.88,882.60 409.27,880.74" class="mf-surface-face" fill-opacity=".08"/><polygon points="276.44,757.53 285.04,779.53 280.12,784.40 271.51,762.39" class="mf-surface-face" fill-opacity=".08"/><polygon points="356.39,856.44 365.00,866.70 360.07,871.73 351.46,861.47" class="mf-surface-face" fill-opacity=".08"/><polygon points="436.34,872.43 444.95,870.93 440.02,876.13 431.41,877.63" class="mf-surface-face" fill-opacity=".08"/><polygon points="298.58,794.95 307.18,813.60 302.26,818.51 293.65,799.86" class="mf-surface-face" fill-opacity=".08"/><polygon points="378.53,870.20 387.13,877.10 382.21,882.17 373.60,875.27" class="mf-surface-face" fill-opacity=".08"/><polygon points="320.72,825.63 329.32,840.92 324.40,845.86 315.79,830.57" class="mf-surface-face" fill-opacity=".08"/><polygon points="400.67,877.20 409.27,880.74 404.35,885.85 395.74,882.31" class="mf-surface-face" fill-opacity=".08"/><polygon points="342.86,849.54 351.46,861.47 346.54,866.46 337.93,854.53" class="mf-surface-face" fill-opacity=".08"/><polygon points="422.81,877.44 431.41,877.63 426.49,882.78 417.88,882.60" class="mf-surface-face" fill-opacity=".08"/><polygon points="285.04,779.53 293.65,799.86 288.72,804.72 280.12,784.40" class="mf-surface-face" fill-opacity=".08"/><polygon points="365.00,866.70 373.60,875.27 368.67,880.30 360.07,871.73" class="mf-surface-face" fill-opacity=".08"/><polygon points="444.95,870.93 453.55,867.76 448.62,872.95 440.02,876.13" class="mf-surface-face" fill-opacity=".08"/><polygon points="307.18,813.60 315.79,830.57 310.86,835.48 302.26,818.51" class="mf-surface-face" fill-opacity=".08"/><polygon points="387.13,877.10 395.74,882.31 390.81,887.39 382.21,882.17" class="mf-surface-face" fill-opacity=".08"/><polygon points="329.32,840.92 337.93,854.53 333.00,859.48 324.40,845.86" class="mf-surface-face" fill-opacity=".08"/><polygon points="409.27,880.74 417.88,882.60 412.95,887.72 404.35,885.85" class="mf-surface-face" fill-opacity=".08"/><polygon points="271.51,762.39 280.12,784.40 275.19,789.22 266.58,767.21" class="mf-surface-face" fill-opacity=".08"/><polygon points="351.46,861.47 360.07,871.73 355.14,876.72 346.54,866.46" class="mf-surface-face" fill-opacity=".08"/><polygon points="431.41,877.63 440.02,876.13 435.09,881.29 426.49,882.78" class="mf-surface-face" fill-opacity=".08"/><polygon points="293.65,799.86 302.26,818.51 297.33,823.37 288.72,804.72" class="mf-surface-face" fill-opacity=".08"/><polygon points="373.60,875.27 382.21,882.17 377.28,887.20 368.67,880.30" class="mf-surface-face" fill-opacity=".08"/><polygon points="453.55,867.76 462.16,862.90 457.23,868.10 448.62,872.95" class="mf-surface-face" fill-opacity=".08"/><polygon points="315.79,830.57 324.40,845.86 319.47,850.77 310.86,835.48" class="mf-surface-face" fill-opacity=".08"/><polygon points="395.74,882.31 404.35,885.85 399.42,890.93 390.81,887.39" class="mf-surface-face" fill-opacity=".08"/><polygon points="337.93,854.53 346.54,866.46 341.61,871.41 333.00,859.48" class="mf-surface-face" fill-opacity=".08"/><polygon points="417.88,882.60 426.49,882.78 421.56,887.90 412.95,887.72" class="mf-surface-face" fill-opacity=".08"/><polygon points="280.12,784.40 288.72,804.72 283.80,809.54 275.19,789.22" class="mf-surface-face" fill-opacity=".08"/><polygon points="360.07,871.73 368.67,880.30 363.75,885.29 355.14,876.72" class="mf-surface-face" fill-opacity=".08"/><polygon points="440.02,876.13 448.62,872.95 443.70,878.11 435.09,881.29" class="mf-surface-face" fill-opacity=".08"/><polygon points="302.26,818.51 310.86,835.48 305.94,840.34 297.33,823.37" class="mf-surface-face" fill-opacity=".08"/><polygon points="382.21,882.17 390.81,887.39 385.89,892.42 377.28,887.20" class="mf-surface-face" fill-opacity=".08"/><polygon points="462.16,862.90 470.76,856.37 465.84,861.57 457.23,868.10" class="mf-surface-face" fill-opacity=".08"/><polygon points="324.40,845.86 333.00,859.48 328.07,864.38 319.47,850.77" class="mf-surface-face" fill-opacity=".08"/><polygon points="404.35,885.85 412.95,887.72 408.03,892.79 399.42,890.93" class="mf-surface-face" fill-opacity=".08"/><polygon points="266.58,767.21 275.19,789.22 270.26,794.00 261.66,771.99" class="mf-surface-face" fill-opacity=".08"/><polygon points="346.54,866.46 355.14,876.72 350.21,881.66 341.61,871.41" class="mf-surface-face" fill-opacity=".08"/><polygon points="426.49,882.78 435.09,881.29 430.16,886.40 421.56,887.90" class="mf-surface-face" fill-opacity=".08"/><polygon points="288.72,804.72 297.33,823.37 292.40,828.19 283.80,809.54" class="mf-surface-face" fill-opacity=".08"/><polygon points="368.67,880.30 377.28,887.20 372.35,892.19 363.75,885.29" class="mf-surface-face" fill-opacity=".08"/><polygon points="448.62,872.95 457.23,868.10 452.30,873.26 443.70,878.11" class="mf-surface-face" fill-opacity=".08"/><polygon points="310.86,835.48 319.47,850.77 314.54,855.63 305.94,840.34" class="mf-surface-face" fill-opacity=".08"/><polygon points="390.81,887.39 399.42,890.93 394.49,895.96 385.89,892.42" class="mf-surface-face" fill-opacity=".08"/><polygon points="470.76,856.37 479.37,848.16 474.44,853.36 465.84,861.57" class="mf-surface-face" fill-opacity=".08"/><polygon points="333.00,859.48 341.61,871.41 336.68,876.31 328.07,864.38" class="mf-surface-face" fill-opacity=".08"/><polygon points="412.95,887.72 421.56,887.90 416.63,892.97 408.03,892.79" class="mf-surface-face" fill-opacity=".08"/><polygon points="275.19,789.22 283.80,809.54 278.87,814.32 270.26,794.00" class="mf-surface-face" fill-opacity=".08"/><polygon points="355.14,876.72 363.75,885.29 358.82,890.24 350.21,881.66" class="mf-surface-face" fill-opacity=".08"/><polygon points="435.09,881.29 443.70,878.11 438.77,883.23 430.16,886.40" class="mf-surface-face" fill-opacity=".08"/><polygon points="297.33,823.37 305.94,840.34 301.01,845.16 292.40,828.19" class="mf-surface-face" fill-opacity=".08"/><polygon points="377.28,887.20 385.89,892.42 380.96,897.41 372.35,892.19" class="mf-surface-face" fill-opacity=".08"/><polygon points="457.23,868.10 465.84,861.57 460.91,866.72 452.30,873.26" class="mf-surface-face" fill-opacity=".08"/><polygon points="319.47,850.77 328.07,864.38 323.15,869.24 314.54,855.63" class="mf-surface-face" fill-opacity=".08"/><polygon points="399.42,890.93 408.03,892.79 403.10,897.82 394.49,895.96" class="mf-surface-face" fill-opacity=".08"/><polygon points="479.37,848.16 487.98,838.27 483.05,843.47 474.44,853.36" class="mf-surface-face" fill-opacity=".08"/><polygon points="261.66,771.99 270.26,794.00 265.34,798.73 256.73,776.73" class="mf-surface-face" fill-opacity=".08"/><polygon points="341.61,871.41 350.21,881.66 345.29,886.57 336.68,876.31" class="mf-surface-face" fill-opacity=".08"/><polygon points="421.56,887.90 430.16,886.40 425.24,891.47 416.63,892.97" class="mf-surface-face" fill-opacity=".08"/><polygon points="283.80,809.54 292.40,828.19 287.47,832.97 278.87,814.32" class="mf-surface-face" fill-opacity=".08"/><polygon points="363.75,885.29 372.35,892.19 367.43,897.14 358.82,890.24" class="mf-surface-face" fill-opacity=".08"/><polygon points="443.70,878.11 452.30,873.26 447.38,878.37 438.77,883.23" class="mf-surface-face" fill-opacity=".08"/><polygon points="305.94,840.34 314.54,855.63 309.61,860.45 301.01,845.16" class="mf-surface-face" fill-opacity=".08"/><polygon points="385.89,892.42 394.49,895.96 389.56,900.95 380.96,897.41" class="mf-surface-face" fill-opacity=".08"/><polygon points="465.84,861.57 474.44,853.36 469.52,858.51 460.91,866.72" class="mf-surface-face" fill-opacity=".08"/><polygon points="328.07,864.38 336.68,876.31 331.75,881.18 323.15,869.24" class="mf-surface-face" fill-opacity=".08"/><polygon points="408.03,892.79 416.63,892.97 411.70,898.00 403.10,897.82" class="mf-surface-face" fill-opacity=".08"/><polygon points="487.98,838.27 496.58,826.70 491.65,831.90 483.05,843.47" class="mf-surface-face" fill-opacity=".08"/><polygon points="270.26,794.00 278.87,814.32 273.94,819.06 265.34,798.73" class="mf-surface-face" fill-opacity=".08"/><polygon points="350.21,881.66 358.82,890.24 353.89,895.14 345.29,886.57" class="mf-surface-face" fill-opacity=".08"/><polygon points="430.16,886.40 438.77,883.23 433.84,888.30 425.24,891.47" class="mf-surface-face" fill-opacity=".08"/><polygon points="292.40,828.19 301.01,845.16 296.08,849.94 287.47,832.97" class="mf-surface-face" fill-opacity=".08"/><polygon points="372.35,892.19 380.96,897.41 376.03,902.35 367.43,897.14" class="mf-surface-face" fill-opacity=".08"/><polygon points="452.30,873.26 460.91,866.72 455.98,871.84 447.38,878.37" class="mf-surface-face" fill-opacity=".08"/><polygon points="314.54,855.63 323.15,869.24 318.22,874.06 309.61,860.45" class="mf-surface-face" fill-opacity=".08"/><polygon points="394.49,895.96 403.10,897.82 398.17,902.81 389.56,900.95" class="mf-surface-face" fill-opacity=".08"/><polygon points="474.44,853.36 483.05,843.47 478.12,848.62 469.52,858.51" class="mf-surface-face" fill-opacity=".08"/><polygon points="256.73,776.73 265.34,798.73 260.41,803.43 251.80,781.42" class="mf-surface-face" fill-opacity=".08"/><polygon points="336.68,876.31 345.29,886.57 340.36,891.43 331.75,881.18" class="mf-surface-face" fill-opacity=".08"/><polygon points="416.63,892.97 425.24,891.47 420.31,896.50 411.70,898.00" class="mf-surface-face" fill-opacity=".08"/><polygon points="496.58,826.70 505.19,813.45 500.26,818.65 491.65,831.90" class="mf-surface-face" fill-opacity=".08"/><polygon points="278.87,814.32 287.47,832.97 282.55,837.71 273.94,819.06" class="mf-surface-face" fill-opacity=".08"/><polygon points="358.82,890.24 367.43,897.14 362.50,902.04 353.89,895.14" class="mf-surface-face" fill-opacity=".08"/><polygon points="438.77,883.23 447.38,878.37 442.45,883.44 433.84,888.30" class="mf-surface-face" fill-opacity=".08"/><polygon points="301.01,845.16 309.61,860.45 304.69,865.23 296.08,849.94" class="mf-surface-face" fill-opacity=".08"/><polygon points="380.96,897.41 389.56,900.95 384.64,905.89 376.03,902.35" class="mf-surface-face" fill-opacity=".08"/><polygon points="460.91,866.72 469.52,858.51 464.59,863.63 455.98,871.84" class="mf-surface-face" fill-opacity=".08"/><polygon points="323.15,869.24 331.75,881.18 326.83,886.00 318.22,874.06" class="mf-surface-face" fill-opacity=".08"/><polygon points="403.10,897.82 411.70,898.00 406.78,902.99 398.17,902.81" class="mf-surface-face" fill-opacity=".08"/><polygon points="483.05,843.47 491.65,831.90 486.73,837.05 478.12,848.62" class="mf-surface-face" fill-opacity=".08"/><polygon points="265.34,798.73 273.94,819.06 269.01,823.76 260.41,803.43" class="mf-surface-face" fill-opacity=".08"/><polygon points="345.29,886.57 353.89,895.14 348.96,900.01 340.36,891.43" class="mf-surface-face" fill-opacity=".08"/><polygon points="425.24,891.47 433.84,888.30 428.92,893.33 420.31,896.50" class="mf-surface-face" fill-opacity=".08"/><polygon points="505.19,813.45 513.79,798.52 508.87,803.72 500.26,818.65" class="mf-surface-face" fill-opacity=".08"/><polygon points="287.47,832.97 296.08,849.94 291.15,854.68 282.55,837.71" class="mf-surface-face" fill-opacity=".08"/><polygon points="367.43,897.14 376.03,902.35 371.10,907.26 362.50,902.04" class="mf-surface-face" fill-opacity=".08"/><polygon points="447.38,878.37 455.98,871.84 451.05,876.91 442.45,883.44" class="mf-surface-face" fill-opacity=".08"/><polygon points="309.61,860.45 318.22,874.06 313.29,878.84 304.69,865.23" class="mf-surface-face" fill-opacity=".08"/><polygon points="389.56,900.95 398.17,902.81 393.24,907.76 384.64,905.89" class="mf-surface-face" fill-opacity=".08"/><polygon points="469.52,858.51 478.12,848.62 473.19,853.74 464.59,863.63" class="mf-surface-face" fill-opacity=".08"/><polygon points="251.80,781.42 260.41,803.43 255.48,808.08 246.87,786.08" class="mf-surface-face" fill-opacity=".08"/><polygon points="331.75,881.18 340.36,891.43 335.43,896.25 326.83,886.00" class="mf-surface-face" fill-opacity=".08"/><polygon points="411.70,898.00 420.31,896.50 415.38,901.49 406.78,902.99" class="mf-surface-face" fill-opacity=".08"/><polygon points="491.65,831.90 500.26,818.65 495.33,823.81 486.73,837.05" class="mf-surface-face" fill-opacity=".08"/><polygon points="273.94,819.06 282.55,837.71 277.62,842.40 269.01,823.76" class="mf-surface-face" fill-opacity=".08"/><polygon points="353.89,895.14 362.50,902.04 357.57,906.90 348.96,900.01" class="mf-surface-face" fill-opacity=".08"/><polygon points="433.84,888.30 442.45,883.44 437.52,888.48 428.92,893.33" class="mf-surface-face" fill-opacity=".08"/><polygon points="513.79,798.52 522.40,781.92 517.47,787.12 508.87,803.72" class="mf-surface-face" fill-opacity=".08"/><polygon points="296.08,849.94 304.69,865.23 299.76,869.97 291.15,854.68" class="mf-surface-face" fill-opacity=".08"/><polygon points="376.03,902.35 384.64,905.89 379.71,910.80 371.10,907.26" class="mf-surface-face" fill-opacity=".08"/><polygon points="455.98,871.84 464.59,863.63 459.66,868.70 451.05,876.91" class="mf-surface-face" fill-opacity=".08"/><polygon points="318.22,874.06 326.83,886.00 321.90,890.78 313.29,878.84" class="mf-surface-face" fill-opacity=".08"/><polygon points="398.17,902.81 406.78,902.99 401.85,907.94 393.24,907.76" class="mf-surface-face" fill-opacity=".08"/><polygon points="478.12,848.62 486.73,837.05 481.80,842.17 473.19,853.74" class="mf-surface-face" fill-opacity=".08"/><polygon points="260.41,803.43 269.01,823.76 264.09,828.41 255.48,808.08" class="mf-surface-face" fill-opacity=".08"/><polygon points="340.36,891.43 348.96,900.01 344.04,904.83 335.43,896.25" class="mf-surface-face" fill-opacity=".08"/><polygon points="420.31,896.50 428.92,893.33 423.99,898.32 415.38,901.49" class="mf-surface-face" fill-opacity=".08"/><polygon points="500.26,818.65 508.87,803.72 503.94,808.88 495.33,823.81" class="mf-surface-face" fill-opacity=".08"/><polygon points="282.55,837.71 291.15,854.68 286.23,859.37 277.62,842.40" class="mf-surface-face" fill-opacity=".08"/><polygon points="362.50,902.04 371.10,907.26 366.18,912.12 357.57,906.90" class="mf-surface-face" fill-opacity=".08"/><polygon points="442.45,883.44 451.05,876.91 446.13,881.94 437.52,888.48" class="mf-surface-face" fill-opacity=".08"/><polygon points="304.69,865.23 313.29,878.84 308.36,883.58 299.76,869.97" class="mf-surface-face" fill-opacity=".08"/><polygon points="384.64,905.89 393.24,907.76 388.32,912.66 379.71,910.80" class="mf-surface-face" fill-opacity=".08"/><polygon points="464.59,863.63 473.19,853.74 468.27,858.81 459.66,868.70" class="mf-surface-face" fill-opacity=".08"/><polygon points="246.87,786.08 255.48,808.08 250.55,812.69 241.95,790.69" class="mf-surface-face" fill-opacity=".08"/><polygon points="326.83,886.00 335.43,896.25 330.50,901.03 321.90,890.78" class="mf-surface-face" fill-opacity=".08"/><polygon points="406.78,902.99 415.38,901.49 410.45,906.44 401.85,907.94" class="mf-surface-face" fill-opacity=".08"/><polygon points="486.73,837.05 495.33,823.81 490.41,828.92 481.80,842.17" class="mf-surface-face" fill-opacity=".08"/><polygon points="269.01,823.76 277.62,842.40 272.69,847.06 264.09,828.41" class="mf-surface-face" fill-opacity=".08"/><polygon points="348.96,900.01 357.57,906.90 352.64,911.73 344.04,904.83" class="mf-surface-face" fill-opacity=".08"/><polygon points="428.92,893.33 437.52,888.48 432.59,893.46 423.99,898.32" class="mf-surface-face" fill-opacity=".08"/><polygon points="508.87,803.72 517.47,787.12 512.54,792.27 503.94,808.88" class="mf-surface-face" fill-opacity=".08"/><polygon points="291.15,854.68 299.76,869.97 294.83,874.66 286.23,859.37" class="mf-surface-face" fill-opacity=".08"/><polygon points="371.10,907.26 379.71,910.80 374.78,915.66 366.18,912.12" class="mf-surface-face" fill-opacity=".08"/><polygon points="451.05,876.91 459.66,868.70 454.73,873.73 446.13,881.94" class="mf-surface-face" fill-opacity=".08"/><polygon points="313.29,878.84 321.90,890.78 316.97,895.51 308.36,883.58" class="mf-surface-face" fill-opacity=".08"/><polygon points="393.24,907.76 401.85,907.94 396.92,912.84 388.32,912.66" class="mf-surface-face" fill-opacity=".08"/><polygon points="473.19,853.74 481.80,842.17 476.87,847.24 468.27,858.81" class="mf-surface-face" fill-opacity=".08"/><polygon points="255.48,808.08 264.09,828.41 259.16,833.02 250.55,812.69" class="mf-surface-face" fill-opacity=".08"/><polygon points="335.43,896.25 344.04,904.83 339.11,909.61 330.50,901.03" class="mf-surface-face" fill-opacity=".08"/><polygon points="415.38,901.49 423.99,898.32 419.06,903.27 410.45,906.44" class="mf-surface-face" fill-opacity=".08"/><polygon points="495.33,823.81 503.94,808.88 499.01,813.99 490.41,828.92" class="mf-surface-face" fill-opacity=".08"/><polygon points="277.62,842.40 286.23,859.37 281.30,864.03 272.69,847.06" class="mf-surface-face" fill-opacity=".08"/><polygon points="357.57,906.90 366.18,912.12 361.25,916.94 352.64,911.73" class="mf-surface-face" fill-opacity=".08"/><polygon points="437.52,888.48 446.13,881.94 441.20,886.93 432.59,893.46" class="mf-surface-face" fill-opacity=".08"/><polygon points="299.76,869.97 308.36,883.58 303.44,888.28 294.83,874.66" class="mf-surface-face" fill-opacity=".08"/><polygon points="379.71,910.80 388.32,912.66 383.39,917.52 374.78,915.66" class="mf-surface-face" fill-opacity=".08"/><polygon points="459.66,868.70 468.27,858.81 463.34,863.84 454.73,873.73" class="mf-surface-face" fill-opacity=".08"/><polygon points="241.95,790.69 250.55,812.69 245.63,817.26 237.02,795.26" class="mf-surface-face" fill-opacity=".08"/><polygon points="321.90,890.78 330.50,901.03 325.58,905.77 316.97,895.51" class="mf-surface-face" fill-opacity=".08"/><polygon points="401.85,907.94 410.45,906.44 405.53,911.35 396.92,912.84" class="mf-surface-face" fill-opacity=".08"/><polygon points="481.80,842.17 490.41,828.92 485.48,833.99 476.87,847.24" class="mf-surface-face" fill-opacity=".08"/><polygon points="264.09,828.41 272.69,847.06 267.76,851.67 259.16,833.02" class="mf-surface-face" fill-opacity=".08"/><polygon points="344.04,904.83 352.64,911.73 347.72,916.50 339.11,909.61" class="mf-surface-face" fill-opacity=".08"/><polygon points="423.99,898.32 432.59,893.46 427.67,898.41 419.06,903.27" class="mf-surface-face" fill-opacity=".08"/><polygon points="503.94,808.88 512.54,792.27 507.62,797.39 499.01,813.99" class="mf-surface-face" fill-opacity=".08"/><polygon points="286.23,859.37 294.83,874.66 289.90,879.32 281.30,864.03" class="mf-surface-face" fill-opacity=".08"/><polygon points="366.18,912.12 374.78,915.66 369.85,920.48 361.25,916.94" class="mf-surface-face" fill-opacity=".08"/><polygon points="446.13,881.94 454.73,873.73 449.81,878.72 441.20,886.93" class="mf-surface-face" fill-opacity=".08"/><polygon points="308.36,883.58 316.97,895.51 312.04,900.21 303.44,888.28" class="mf-surface-face" fill-opacity=".08"/><polygon points="388.32,912.66 396.92,912.84 391.99,917.71 383.39,917.52" class="mf-surface-face" fill-opacity=".08"/><polygon points="468.27,858.81 476.87,847.24 471.94,852.27 463.34,863.84" class="mf-surface-face" fill-opacity=".08"/><polygon points="250.55,812.69 259.16,833.02 254.23,837.59 245.63,817.26" class="mf-surface-face" fill-opacity=".08"/><polygon points="330.50,901.03 339.11,909.61 334.18,914.34 325.58,905.77" class="mf-surface-face" fill-opacity=".08"/><polygon points="410.45,906.44 419.06,903.27 414.13,908.17 405.53,911.35" class="mf-surface-face" fill-opacity=".08"/><polygon points="490.41,828.92 499.01,813.99 494.08,819.07 485.48,833.99" class="mf-surface-face" fill-opacity=".08"/><polygon points="272.69,847.06 281.30,864.03 276.37,868.64 267.76,851.67" class="mf-surface-face" fill-opacity=".08"/><polygon points="352.64,911.73 361.25,916.94 356.32,921.72 347.72,916.50" class="mf-surface-face" fill-opacity=".08"/><polygon points="432.59,893.46 441.20,886.93 436.27,891.88 427.67,898.41" class="mf-surface-face" fill-opacity=".08"/><polygon points="294.83,874.66 303.44,888.28 298.51,892.93 289.90,879.32" class="mf-surface-face" fill-opacity=".08"/><polygon points="374.78,915.66 383.39,917.52 378.46,922.34 369.85,920.48" class="mf-surface-face" fill-opacity=".08"/><polygon points="454.73,873.73 463.34,863.84 458.41,868.83 449.81,878.72" class="mf-surface-face" fill-opacity=".08"/><polygon points="237.02,795.26 245.63,817.26 240.70,821.79 232.09,799.78" class="mf-surface-face" fill-opacity=".08"/><polygon points="316.97,895.51 325.58,905.77 320.65,910.46 312.04,900.21" class="mf-surface-face" fill-opacity=".08"/><polygon points="396.92,912.84 405.53,911.35 400.60,916.21 391.99,917.71" class="mf-surface-face" fill-opacity=".08"/><polygon points="476.87,847.24 485.48,833.99 480.55,839.02 471.94,852.27" class="mf-surface-face" fill-opacity=".08"/><polygon points="259.16,833.02 267.76,851.67 262.84,856.24 254.23,837.59" class="mf-surface-face" fill-opacity=".08"/><polygon points="339.11,909.61 347.72,916.50 342.79,921.24 334.18,914.34" class="mf-surface-face" fill-opacity=".08"/><polygon points="419.06,903.27 427.67,898.41 422.74,903.32 414.13,908.17" class="mf-surface-face" fill-opacity=".08"/><polygon points="499.01,813.99 507.62,797.39 502.69,802.46 494.08,819.07" class="mf-surface-face" fill-opacity=".08"/><polygon points="281.30,864.03 289.90,879.32 284.98,883.93 276.37,868.64" class="mf-surface-face" fill-opacity=".08"/><polygon points="361.25,916.94 369.85,920.48 364.93,925.26 356.32,921.72" class="mf-surface-face" fill-opacity=".08"/><polygon points="441.20,886.93 449.81,878.72 444.88,883.67 436.27,891.88" class="mf-surface-face" fill-opacity=".08"/><polygon points="303.44,888.28 312.04,900.21 307.12,904.86 298.51,892.93" class="mf-surface-face" fill-opacity=".08"/><polygon points="383.39,917.52 391.99,917.71 387.07,922.53 378.46,922.34" class="mf-surface-face" fill-opacity=".08"/><polygon points="463.34,863.84 471.94,852.27 467.02,857.26 458.41,868.83" class="mf-surface-face" fill-opacity=".08"/><polygon points="245.63,817.26 254.23,837.59 249.30,842.12 240.70,821.79" class="mf-surface-face" fill-opacity=".08"/><polygon points="325.58,905.77 334.18,914.34 329.25,919.04 320.65,910.46" class="mf-surface-face" fill-opacity=".08"/><polygon points="405.53,911.35 414.13,908.17 409.21,913.03 400.60,916.21" class="mf-surface-face" fill-opacity=".08"/><polygon points="485.48,833.99 494.08,819.07 489.16,824.10 480.55,839.02" class="mf-surface-face" fill-opacity=".08"/><polygon points="267.76,851.67 276.37,868.64 271.44,873.21 262.84,856.24" class="mf-surface-face" fill-opacity=".08"/><polygon points="347.72,916.50 356.32,921.72 351.39,926.46 342.79,921.24" class="mf-surface-face" fill-opacity=".08"/><polygon points="427.67,898.41 436.27,891.88 431.34,896.78 422.74,903.32" class="mf-surface-face" fill-opacity=".08"/><polygon points="289.90,879.32 298.51,892.93 293.58,897.54 284.98,883.93" class="mf-surface-face" fill-opacity=".08"/><polygon points="369.85,920.48 378.46,922.34 373.53,927.12 364.93,925.26" class="mf-surface-face" fill-opacity=".08"/><polygon points="449.81,878.72 458.41,868.83 453.48,873.78 444.88,883.67" class="mf-surface-face" fill-opacity=".08"/><polygon points="232.09,799.78 240.70,821.79 235.77,826.27 227.17,804.27" class="mf-surface-face" fill-opacity=".08"/><polygon points="312.04,900.21 320.65,910.46 315.72,915.12 307.12,904.86" class="mf-surface-face" fill-opacity=".08"/><polygon points="391.99,917.71 400.60,916.21 395.67,921.03 387.07,922.53" class="mf-surface-face" fill-opacity=".08"/><polygon points="471.94,852.27 480.55,839.02 475.62,844.01 467.02,857.26" class="mf-surface-face" fill-opacity=".08"/><polygon points="254.23,837.59 262.84,856.24 257.91,860.76 249.30,842.12" class="mf-surface-face" fill-opacity=".08"/><polygon points="334.18,914.34 342.79,921.24 337.86,925.94 329.25,919.04" class="mf-surface-face" fill-opacity=".08"/><polygon points="414.13,908.17 422.74,903.32 417.81,908.18 409.21,913.03" class="mf-surface-face" fill-opacity=".08"/><polygon points="494.08,819.07 502.69,802.46 497.76,807.49 489.16,824.10" class="mf-surface-face" fill-opacity=".08"/><polygon points="276.37,868.64 284.98,883.93 280.05,888.50 271.44,873.21" class="mf-surface-face" fill-opacity=".08"/><polygon points="356.32,921.72 364.93,925.26 360.00,930.00 351.39,926.46" class="mf-surface-face" fill-opacity=".08"/><polygon points="436.27,891.88 444.88,883.67 439.95,888.57 431.34,896.78" class="mf-surface-face" fill-opacity=".08"/><polygon points="298.51,892.93 307.12,904.86 302.19,909.47 293.58,897.54" class="mf-surface-face" fill-opacity=".08"/><polygon points="378.46,922.34 387.07,922.53 382.14,927.31 373.53,927.12" class="mf-surface-face" fill-opacity=".08"/><polygon points="458.41,868.83 467.02,857.26 462.09,862.21 453.48,873.78" class="mf-surface-face" fill-opacity=".08"/><polygon points="240.70,821.79 249.30,842.12 244.38,846.60 235.77,826.27" class="mf-surface-face" fill-opacity=".08"/><polygon points="320.65,910.46 329.25,919.04 324.33,923.69 315.72,915.12" class="mf-surface-face" fill-opacity=".08"/><polygon points="400.60,916.21 409.21,913.03 404.28,917.86 395.67,921.03" class="mf-surface-face" fill-opacity=".08"/><polygon points="480.55,839.02 489.16,824.10 484.23,829.09 475.62,844.01" class="mf-surface-face" fill-opacity=".08"/><polygon points="262.84,856.24 271.44,873.21 266.52,877.73 257.91,860.76" class="mf-surface-face" fill-opacity=".08"/><polygon points="342.79,921.24 351.39,926.46 346.47,931.16 337.86,925.94" class="mf-surface-face" fill-opacity=".08"/><polygon points="422.74,903.32 431.34,896.78 426.42,901.65 417.81,908.18" class="mf-surface-face" fill-opacity=".08"/><polygon points="284.98,883.93 293.58,897.54 288.66,902.11 280.05,888.50" class="mf-surface-face" fill-opacity=".08"/><polygon points="364.93,925.26 373.53,927.12 368.61,931.86 360.00,930.00" class="mf-surface-face" fill-opacity=".08"/><polygon points="444.88,883.67 453.48,873.78 448.56,878.68 439.95,888.57" class="mf-surface-face" fill-opacity=".08"/><polygon points="227.17,804.27 235.77,826.27 230.84,830.72 222.24,808.71" class="mf-surface-face" fill-opacity=".08"/><polygon points="307.12,904.86 315.72,915.12 310.79,919.73 302.19,909.47" class="mf-surface-face" fill-opacity=".08"/><polygon points="387.07,922.53 395.67,921.03 390.75,925.81 382.14,927.31" class="mf-surface-face" fill-opacity=".08"/><polygon points="467.02,857.26 475.62,844.01 470.70,848.96 462.09,862.21" class="mf-surface-face" fill-opacity=".08"/><polygon points="249.30,842.12 257.91,860.76 252.98,865.25 244.38,846.60" class="mf-surface-face" fill-opacity=".08"/><polygon points="329.25,919.04 337.86,925.94 332.93,930.59 324.33,923.69" class="mf-surface-face" fill-opacity=".08"/><polygon points="409.21,913.03 417.81,908.18 412.88,913.00 404.28,917.86" class="mf-surface-face" fill-opacity=".08"/><polygon points="489.16,824.10 497.76,807.49 492.83,812.48 484.23,829.09" class="mf-surface-face" fill-opacity=".08"/><polygon points="271.44,873.21 280.05,888.50 275.12,893.03 266.52,877.73" class="mf-surface-face" fill-opacity=".08"/><polygon points="351.39,926.46 360.00,930.00 355.07,934.70 346.47,931.16" class="mf-surface-face" fill-opacity=".08"/><polygon points="431.34,896.78 439.95,888.57 435.02,893.44 426.42,901.65" class="mf-surface-face" fill-opacity=".08"/><polygon points="293.58,897.54 302.19,909.47 297.26,914.04 288.66,902.11" class="mf-surface-face" fill-opacity=".08"/><polygon points="373.53,927.12 382.14,927.31 377.21,932.04 368.61,931.86" class="mf-surface-face" fill-opacity=".08"/><polygon points="453.48,873.78 462.09,862.21 457.16,867.11 448.56,878.68" class="mf-surface-face" fill-opacity=".08"/><polygon points="235.77,826.27 244.38,846.60 239.45,851.05 230.84,830.72" class="mf-surface-face" fill-opacity=".08"/><polygon points="315.72,915.12 324.33,923.69 319.40,928.30 310.79,919.73" class="mf-surface-face" fill-opacity=".08"/><polygon points="395.67,921.03 404.28,917.86 399.35,922.63 390.75,925.81" class="mf-surface-face" fill-opacity=".08"/><polygon points="475.62,844.01 484.23,829.09 479.30,834.03 470.70,848.96" class="mf-surface-face" fill-opacity=".08"/><polygon points="257.91,860.76 266.52,877.73 261.59,882.22 252.98,865.25" class="mf-surface-face" fill-opacity=".08"/><polygon points="337.86,925.94 346.47,931.16 341.54,935.81 332.93,930.59" class="mf-surface-face" fill-opacity=".08"/><polygon points="417.81,908.18 426.42,901.65 421.49,906.47 412.88,913.00" class="mf-surface-face" fill-opacity=".08"/><polygon points="280.05,888.50 288.66,902.11 283.73,906.64 275.12,893.03" class="mf-surface-face" fill-opacity=".08"/><polygon points="360.00,930.00 368.61,931.86 363.68,936.56 355.07,934.70" class="mf-surface-face" fill-opacity=".08"/><polygon points="439.95,888.57 448.56,878.68 443.63,883.55 435.02,893.44" class="mf-surface-face" fill-opacity=".08"/><polygon points="222.24,808.71 230.84,830.72 225.92,835.12 217.31,813.11" class="mf-surface-face" fill-opacity=".08"/><polygon points="302.19,909.47 310.79,919.73 305.87,924.30 297.26,914.04" class="mf-surface-face" fill-opacity=".08"/><polygon points="382.14,927.31 390.75,925.81 385.82,930.55 377.21,932.04" class="mf-surface-face" fill-opacity=".08"/><polygon points="462.09,862.21 470.70,848.96 465.77,853.87 457.16,867.11" class="mf-surface-face" fill-opacity=".08"/><polygon points="244.38,846.60 252.98,865.25 248.06,869.69 239.45,851.05" class="mf-surface-face" fill-opacity=".08"/><polygon points="324.33,923.69 332.93,930.59 328.01,935.20 319.40,928.30" class="mf-surface-face" fill-opacity=".08"/><polygon points="404.28,917.86 412.88,913.00 407.96,917.78 399.35,922.63" class="mf-surface-face" fill-opacity=".08"/><polygon points="484.23,829.09 492.83,812.48 487.91,817.43 479.30,834.03" class="mf-surface-face" fill-opacity=".08"/><polygon points="266.52,877.73 275.12,893.03 270.19,897.51 261.59,882.22" class="mf-surface-face" fill-opacity=".08"/><polygon points="346.47,931.16 355.07,934.70 350.15,939.35 341.54,935.81" class="mf-surface-face" fill-opacity=".08"/><polygon points="426.42,901.65 435.02,893.44 430.10,898.26 421.49,906.47" class="mf-surface-face" fill-opacity=".08"/><polygon points="288.66,902.11 297.26,914.04 292.33,918.57 283.73,906.64" class="mf-surface-face" fill-opacity=".08"/><polygon points="368.61,931.86 377.21,932.04 372.28,936.74 363.68,936.56" class="mf-surface-face" fill-opacity=".08"/><polygon points="448.56,878.68 457.16,867.11 452.24,871.98 443.63,883.55" class="mf-surface-face" fill-opacity=".08"/><polygon points="230.84,830.72 239.45,851.05 234.52,855.45 225.92,835.12" class="mf-surface-face" fill-opacity=".08"/><polygon points="310.79,919.73 319.40,928.30 314.47,932.87 305.87,924.30" class="mf-surface-face" fill-opacity=".08"/><polygon points="390.75,925.81 399.35,922.63 394.42,927.37 385.82,930.55" class="mf-surface-face" fill-opacity=".08"/><polygon points="470.70,848.96 479.30,834.03 474.37,838.94 465.77,853.87" class="mf-surface-face" fill-opacity=".08"/><polygon points="252.98,865.25 261.59,882.22 256.66,886.66 248.06,869.69" class="mf-surface-face" fill-opacity=".08"/><polygon points="332.93,930.59 341.54,935.81 336.61,940.42 328.01,935.20" class="mf-surface-face" fill-opacity=".08"/><polygon points="412.88,913.00 421.49,906.47 416.56,911.25 407.96,917.78" class="mf-surface-face" fill-opacity=".08"/><polygon points="275.12,893.03 283.73,906.64 278.80,911.12 270.19,897.51" class="mf-surface-face" fill-opacity=".08"/><polygon points="355.07,934.70 363.68,936.56 358.75,941.21 350.15,939.35" class="mf-surface-face" fill-opacity=".08"/><polygon points="435.02,893.44 443.63,883.55 438.70,888.37 430.10,898.26" class="mf-surface-face" fill-opacity=".08"/><polygon points="217.31,813.11 225.92,835.12 220.99,839.48 212.38,817.47" class="mf-surface-face" fill-opacity=".08"/><polygon points="297.26,914.04 305.87,924.30 300.94,928.83 292.33,918.57" class="mf-surface-face" fill-opacity=".08"/><polygon points="377.21,932.04 385.82,930.55 380.89,935.24 372.28,936.74" class="mf-surface-face" fill-opacity=".08"/><polygon points="457.16,867.11 465.77,853.87 460.84,858.73 452.24,871.98" class="mf-surface-face" fill-opacity=".08"/><polygon points="239.45,851.05 248.06,869.69 243.13,874.10 234.52,855.45" class="mf-surface-face" fill-opacity=".08"/><polygon points="319.40,928.30 328.01,935.20 323.08,939.77 314.47,932.87" class="mf-surface-face" fill-opacity=".08"/><polygon points="399.35,922.63 407.96,917.78 403.03,922.52 394.42,927.37" class="mf-surface-face" fill-opacity=".08"/><polygon points="479.30,834.03 487.91,817.43 482.98,822.33 474.37,838.94" class="mf-surface-face" fill-opacity=".08"/><polygon points="261.59,882.22 270.19,897.51 265.27,901.95 256.66,886.66" class="mf-surface-face" fill-opacity=".08"/><polygon points="341.54,935.81 350.15,939.35 345.22,943.96 336.61,940.42" class="mf-surface-face" fill-opacity=".08"/><polygon points="421.49,906.47 430.10,898.26 425.17,903.04 416.56,911.25" class="mf-surface-face" fill-opacity=".08"/><polygon points="283.73,906.64 292.33,918.57 287.41,923.06 278.80,911.12" class="mf-surface-face" fill-opacity=".08"/><polygon points="363.68,936.56 372.28,936.74 367.36,941.39 358.75,941.21" class="mf-surface-face" fill-opacity=".08"/><polygon points="443.63,883.55 452.24,871.98 447.31,876.80 438.70,888.37" class="mf-surface-face" fill-opacity=".08"/><polygon points="225.92,835.12 234.52,855.45 229.59,859.81 220.99,839.48" class="mf-surface-face" fill-opacity=".08"/><polygon points="305.87,924.30 314.47,932.87 309.55,937.40 300.94,928.83" class="mf-surface-face" fill-opacity=".08"/><polygon points="385.82,930.55 394.42,927.37 389.50,932.07 380.89,935.24" class="mf-surface-face" fill-opacity=".08"/><polygon points="465.77,853.87 474.37,838.94 469.45,843.80 460.84,858.73" class="mf-surface-face" fill-opacity=".08"/><polygon points="248.06,869.69 256.66,886.66 251.73,891.06 243.13,874.10" class="mf-surface-face" fill-opacity=".08"/><polygon points="328.01,935.20 336.61,940.42 331.68,944.99 323.08,939.77" class="mf-surface-face" fill-opacity=".08"/><polygon points="407.96,917.78 416.56,911.25 411.64,915.98 403.03,922.52" class="mf-surface-face" fill-opacity=".08"/><polygon points="270.19,897.51 278.80,911.12 273.87,915.57 265.27,901.95" class="mf-surface-face" fill-opacity=".08"/><polygon points="350.15,939.35 358.75,941.21 353.82,945.82 345.22,943.96" class="mf-surface-face" fill-opacity=".08"/><polygon points="430.10,898.26 438.70,888.37 433.77,893.15 425.17,903.04" class="mf-surface-face" fill-opacity=".08"/><polygon points="212.38,817.47 220.99,839.48 216.06,843.80 207.46,821.79" class="mf-surface-face" fill-opacity=".08"/><polygon points="292.33,918.57 300.94,928.83 296.01,933.31 287.41,923.06" class="mf-surface-face" fill-opacity=".08"/><polygon points="372.28,936.74 380.89,935.24 375.96,939.90 367.36,941.39" class="mf-surface-face" fill-opacity=".08"/><polygon points="452.24,871.98 460.84,858.73 455.91,863.55 447.31,876.80" class="mf-surface-face" fill-opacity=".08"/><polygon points="234.52,855.45 243.13,874.10 238.20,878.45 229.59,859.81" class="mf-surface-face" fill-opacity=".08"/><polygon points="314.47,932.87 323.08,939.77 318.15,944.30 309.55,937.40" class="mf-surface-face" fill-opacity=".08"/><polygon points="394.42,927.37 403.03,922.52 398.10,927.21 389.50,932.07" class="mf-surface-face" fill-opacity=".08"/><polygon points="474.37,838.94 482.98,822.33 478.05,827.20 469.45,843.80" class="mf-surface-face" fill-opacity=".08"/><polygon points="256.66,886.66 265.27,901.95 260.34,906.36 251.73,891.06" class="mf-surface-face" fill-opacity=".08"/><polygon points="336.61,940.42 345.22,943.96 340.29,948.53 331.68,944.99" class="mf-surface-face" fill-opacity=".08"/><polygon points="416.56,911.25 425.17,903.04 420.24,907.77 411.64,915.98" class="mf-surface-face" fill-opacity=".08"/><polygon points="278.80,911.12 287.41,923.06 282.48,927.50 273.87,915.57" class="mf-surface-face" fill-opacity=".08"/><polygon points="358.75,941.21 367.36,941.39 362.43,946.00 353.82,945.82" class="mf-surface-face" fill-opacity=".08"/><polygon points="438.70,888.37 447.31,876.80 442.38,881.58 433.77,893.15" class="mf-surface-face" fill-opacity=".08"/><polygon points="220.99,839.48 229.59,859.81 224.67,864.12 216.06,843.80" class="mf-surface-face" fill-opacity=".08"/><polygon points="300.94,928.83 309.55,937.40 304.62,941.89 296.01,933.31" class="mf-surface-face" fill-opacity=".08"/><polygon points="380.89,935.24 389.50,932.07 384.57,936.72 375.96,939.90" class="mf-surface-face" fill-opacity=".08"/><polygon points="460.84,858.73 469.45,843.80 464.52,848.62 455.91,863.55" class="mf-surface-face" fill-opacity=".08"/><polygon points="243.13,874.10 251.73,891.06 246.81,895.42 238.20,878.45" class="mf-surface-face" fill-opacity=".08"/><polygon points="323.08,939.77 331.68,944.99 326.76,949.52 318.15,944.30" class="mf-surface-face" fill-opacity=".08"/><polygon points="403.03,922.52 411.64,915.98 406.71,920.68 398.10,927.21" class="mf-surface-face" fill-opacity=".08"/><polygon points="265.27,901.95 273.87,915.57 268.95,919.97 260.34,906.36" class="mf-surface-face" fill-opacity=".08"/><polygon points="345.22,943.96 353.82,945.82 348.90,950.39 340.29,948.53" class="mf-surface-face" fill-opacity=".08"/><polygon points="425.17,903.04 433.77,893.15 428.85,897.88 420.24,907.77" class="mf-surface-face" fill-opacity=".08"/><polygon points="207.46,821.79 216.06,843.80 211.13,848.07 202.53,826.07" class="mf-surface-face" fill-opacity=".08"/><polygon points="287.41,923.06 296.01,933.31 291.08,937.75 282.48,927.50" class="mf-surface-face" fill-opacity=".08"/><polygon points="367.36,941.39 375.96,939.90 371.04,944.51 362.43,946.00" class="mf-surface-face" fill-opacity=".08"/><polygon points="447.31,876.80 455.91,863.55 450.99,868.33 442.38,881.58" class="mf-surface-face" fill-opacity=".08"/><polygon points="229.59,859.81 238.20,878.45 233.27,882.77 224.67,864.12" class="mf-surface-face" fill-opacity=".08"/><polygon points="309.55,937.40 318.15,944.30 313.22,948.78 304.62,941.89" class="mf-surface-face" fill-opacity=".08"/><polygon points="389.50,932.07 398.10,927.21 393.17,931.87 384.57,936.72" class="mf-surface-face" fill-opacity=".08"/><polygon points="469.45,843.80 478.05,827.20 473.13,832.02 464.52,848.62" class="mf-surface-face" fill-opacity=".08"/><polygon points="251.73,891.06 260.34,906.36 255.41,910.72 246.81,895.42" class="mf-surface-face" fill-opacity=".08"/><polygon points="331.68,944.99 340.29,948.53 335.36,953.06 326.76,949.52" class="mf-surface-face" fill-opacity=".08"/><polygon points="411.64,915.98 420.24,907.77 415.31,912.47 406.71,920.68" class="mf-surface-face" fill-opacity=".08"/><polygon points="273.87,915.57 282.48,927.50 277.55,931.90 268.95,919.97" class="mf-surface-face" fill-opacity=".08"/><polygon points="353.82,945.82 362.43,946.00 357.50,950.57 348.90,950.39" class="mf-surface-face" fill-opacity=".08"/><polygon points="433.77,893.15 442.38,881.58 437.45,886.31 428.85,897.88" class="mf-surface-face" fill-opacity=".08"/><polygon points="216.06,843.80 224.67,864.12 219.74,868.40 211.13,848.07" class="mf-surface-face" fill-opacity=".08"/><polygon points="296.01,933.31 304.62,941.89 299.69,946.33 291.08,937.75" class="mf-surface-face" fill-opacity=".08"/><polygon points="375.96,939.90 384.57,936.72 379.64,941.33 371.04,944.51" class="mf-surface-face" fill-opacity=".08"/><polygon points="455.91,863.55 464.52,848.62 459.59,853.40 450.99,868.33" class="mf-surface-face" fill-opacity=".08"/><polygon points="238.20,878.45 246.81,895.42 241.88,899.74 233.27,882.77" class="mf-surface-face" fill-opacity=".08"/><polygon points="318.15,944.30 326.76,949.52 321.83,954.00 313.22,948.78" class="mf-surface-face" fill-opacity=".08"/><polygon points="398.10,927.21 406.71,920.68 401.78,925.33 393.17,931.87" class="mf-surface-face" fill-opacity=".08"/><polygon points="260.34,906.36 268.95,919.97 264.02,924.33 255.41,910.72" class="mf-surface-face" fill-opacity=".08"/><polygon points="340.29,948.53 348.90,950.39 343.97,954.92 335.36,953.06" class="mf-surface-face" fill-opacity=".08"/><polygon points="420.24,907.77 428.85,897.88 423.92,902.58 415.31,912.47" class="mf-surface-face" fill-opacity=".08"/><polygon points="202.53,826.07 211.13,848.07 206.21,852.31 197.60,830.30" class="mf-surface-face" fill-opacity=".08"/><polygon points="282.48,927.50 291.08,937.75 286.16,942.16 277.55,931.90" class="mf-surface-face" fill-opacity=".08"/><polygon points="362.43,946.00 371.04,944.51 366.11,949.08 357.50,950.57" class="mf-surface-face" fill-opacity=".08"/><polygon points="442.38,881.58 450.99,868.33 446.06,873.07 437.45,886.31" class="mf-surface-face" fill-opacity=".08"/><polygon points="224.67,864.12 233.27,882.77 228.35,887.05 219.74,868.40" class="mf-surface-face" fill-opacity=".08"/><polygon points="304.62,941.89 313.22,948.78 308.30,953.23 299.69,946.33" class="mf-surface-face" fill-opacity=".08"/><polygon points="384.57,936.72 393.17,931.87 388.25,936.48 379.64,941.33" class="mf-surface-face" fill-opacity=".08"/><polygon points="464.52,848.62 473.13,832.02 468.20,836.80 459.59,853.40" class="mf-surface-face" fill-opacity=".08"/><polygon points="246.81,895.42 255.41,910.72 250.48,915.03 241.88,899.74" class="mf-surface-face" fill-opacity=".08"/><polygon points="326.76,949.52 335.36,953.06 330.44,957.54 321.83,954.00" class="mf-surface-face" fill-opacity=".08"/><polygon points="406.71,920.68 415.31,912.47 410.39,917.12 401.78,925.33" class="mf-surface-face" fill-opacity=".08"/><polygon points="268.95,919.97 277.55,931.90 272.62,936.26 264.02,924.33" class="mf-surface-face" fill-opacity=".08"/><polygon points="348.90,950.39 357.50,950.57 352.57,955.10 343.97,954.92" class="mf-surface-face" fill-opacity=".08"/><polygon points="428.85,897.88 437.45,886.31 432.53,891.01 423.92,902.58" class="mf-surface-face" fill-opacity=".08"/><polygon points="211.13,848.07 219.74,868.40 214.81,872.63 206.21,852.31" class="mf-surface-face" fill-opacity=".08"/><polygon points="291.08,937.75 299.69,946.33 294.76,950.73 286.16,942.16" class="mf-surface-face" fill-opacity=".08"/><polygon points="371.04,944.51 379.64,941.33 374.71,945.90 366.11,949.08" class="mf-surface-face" fill-opacity=".08"/><polygon points="450.99,868.33 459.59,853.40 454.66,858.14 446.06,873.07" class="mf-surface-face" fill-opacity=".08"/><polygon points="233.27,882.77 241.88,899.74 236.95,904.02 228.35,887.05" class="mf-surface-face" fill-opacity=".08"/><polygon points="313.22,948.78 321.83,954.00 316.90,958.45 308.30,953.23" class="mf-surface-face" fill-opacity=".08"/><polygon points="393.17,931.87 401.78,925.33 396.85,929.94 388.25,936.48" class="mf-surface-face" fill-opacity=".08"/><polygon points="255.41,910.72 264.02,924.33 259.09,928.64 250.48,915.03" class="mf-surface-face" fill-opacity=".08"/><polygon points="335.36,953.06 343.97,954.92 339.04,959.40 330.44,957.54" class="mf-surface-face" fill-opacity=".08"/><polygon points="415.31,912.47 423.92,902.58 418.99,907.23 410.39,917.12" class="mf-surface-face" fill-opacity=".08"/><polygon points="277.55,931.90 286.16,942.16 281.23,946.52 272.62,936.26" class="mf-surface-face" fill-opacity=".08"/><polygon points="357.50,950.57 366.11,949.08 361.18,953.60 352.57,955.10" class="mf-surface-face" fill-opacity=".08"/><polygon points="437.45,886.31 446.06,873.07 441.13,877.76 432.53,891.01" class="mf-surface-face" fill-opacity=".08"/><polygon points="219.74,868.40 228.35,887.05 223.42,891.28 214.81,872.63" class="mf-surface-face" fill-opacity=".08"/><polygon points="299.69,946.33 308.30,953.23 303.37,957.63 294.76,950.73" class="mf-surface-face" fill-opacity=".08"/><polygon points="379.64,941.33 388.25,936.48 383.32,941.05 374.71,945.90" class="mf-surface-face" fill-opacity=".08"/><polygon points="459.59,853.40 468.20,836.80 463.27,841.54 454.66,858.14" class="mf-surface-face" fill-opacity=".08"/><polygon points="241.88,899.74 250.48,915.03 245.56,919.31 236.95,904.02" class="mf-surface-face" fill-opacity=".08"/><polygon points="321.83,954.00 330.44,957.54 325.51,961.99 316.90,958.45" class="mf-surface-face" fill-opacity=".08"/><polygon points="401.78,925.33 410.39,917.12 405.46,921.73 396.85,929.94" class="mf-surface-face" fill-opacity=".08"/><polygon points="264.02,924.33 272.62,936.26 267.70,940.58 259.09,928.64" class="mf-surface-face" fill-opacity=".08"/><polygon points="343.97,954.92 352.57,955.10 347.65,959.59 339.04,959.40" class="mf-surface-face" fill-opacity=".08"/><polygon points="423.92,902.58 432.53,891.01 427.60,895.66 418.99,907.23" class="mf-surface-face" fill-opacity=".08"/><polygon points="286.16,942.16 294.76,950.73 289.84,955.09 281.23,946.52" class="mf-surface-face" fill-opacity=".08"/><polygon points="366.11,949.08 374.71,945.90 369.79,950.43 361.18,953.60" class="mf-surface-face" fill-opacity=".08"/><polygon points="446.06,873.07 454.66,858.14 449.74,862.84 441.13,877.76" class="mf-surface-face" fill-opacity=".08"/><polygon points="228.35,887.05 236.95,904.02 232.02,908.25 223.42,891.28" class="mf-surface-face" fill-opacity=".08"/><polygon points="308.30,953.23 316.90,958.45 311.97,962.85 303.37,957.63" class="mf-surface-face" fill-opacity=".08"/><polygon points="388.25,936.48 396.85,929.94 391.93,934.51 383.32,941.05" class="mf-surface-face" fill-opacity=".08"/><polygon points="250.48,915.03 259.09,928.64 254.16,932.92 245.56,919.31" class="mf-surface-face" fill-opacity=".08"/><polygon points="330.44,957.54 339.04,959.40 334.11,963.85 325.51,961.99" class="mf-surface-face" fill-opacity=".08"/><polygon points="410.39,917.12 418.99,907.23 414.06,911.84 405.46,921.73" class="mf-surface-face" fill-opacity=".08"/><polygon points="272.62,936.26 281.23,946.52 276.30,950.83 267.70,940.58" class="mf-surface-face" fill-opacity=".08"/><polygon points="352.57,955.10 361.18,953.60 356.25,958.09 347.65,959.59" class="mf-surface-face" fill-opacity=".08"/><polygon points="432.53,891.01 441.13,877.76 436.20,882.42 427.60,895.66" class="mf-surface-face" fill-opacity=".08"/><polygon points="294.76,950.73 303.37,957.63 298.44,961.99 289.84,955.09" class="mf-surface-face" fill-opacity=".08"/><polygon points="374.71,945.90 383.32,941.05 378.39,945.57 369.79,950.43" class="mf-surface-face" fill-opacity=".08"/><polygon points="454.66,858.14 463.27,841.54 458.34,846.23 449.74,862.84" class="mf-surface-face" fill-opacity=".08"/><polygon points="236.95,904.02 245.56,919.31 240.63,923.54 232.02,908.25" class="mf-surface-face" fill-opacity=".08"/><polygon points="316.90,958.45 325.51,961.99 320.58,966.39 311.97,962.85" class="mf-surface-face" fill-opacity=".08"/><polygon points="396.85,929.94 405.46,921.73 400.53,926.30 391.93,934.51" class="mf-surface-face" fill-opacity=".08"/><polygon points="259.09,928.64 267.70,940.58 262.77,944.85 254.16,932.92" class="mf-surface-face" fill-opacity=".08"/><polygon points="339.04,959.40 347.65,959.59 342.72,964.03 334.11,963.85" class="mf-surface-face" fill-opacity=".08"/><polygon points="418.99,907.23 427.60,895.66 422.67,900.27 414.06,911.84" class="mf-surface-face" fill-opacity=".08"/><polygon points="281.23,946.52 289.84,955.09 284.91,959.41 276.30,950.83" class="mf-surface-face" fill-opacity=".08"/><polygon points="361.18,953.60 369.79,950.43 364.86,954.91 356.25,958.09" class="mf-surface-face" fill-opacity=".08"/><polygon points="441.13,877.76 449.74,862.84 444.81,867.49 436.20,882.42" class="mf-surface-face" fill-opacity=".08"/><polygon points="303.37,957.63 311.97,962.85 307.05,967.21 298.44,961.99" class="mf-surface-face" fill-opacity=".08"/><polygon points="383.32,941.05 391.93,934.51 387.00,939.04 378.39,945.57" class="mf-surface-face" fill-opacity=".08"/><polygon points="245.56,919.31 254.16,932.92 249.24,937.15 240.63,923.54" class="mf-surface-face" fill-opacity=".08"/><polygon points="325.51,961.99 334.11,963.85 329.19,968.25 320.58,966.39" class="mf-surface-face" fill-opacity=".08"/><polygon points="405.46,921.73 414.06,911.84 409.14,916.41 400.53,926.30" class="mf-surface-face" fill-opacity=".08"/><polygon points="267.70,940.58 276.30,950.83 271.38,955.11 262.77,944.85" class="mf-surface-face" fill-opacity=".08"/><polygon points="347.65,959.59 356.25,958.09 351.33,962.53 342.72,964.03" class="mf-surface-face" fill-opacity=".08"/><polygon points="427.60,895.66 436.20,882.42 431.28,887.03 422.67,900.27" class="mf-surface-face" fill-opacity=".08"/><polygon points="289.84,955.09 298.44,961.99 293.51,966.31 284.91,959.41" class="mf-surface-face" fill-opacity=".08"/><polygon points="369.79,950.43 378.39,945.57 373.46,950.06 364.86,954.91" class="mf-surface-face" fill-opacity=".08"/><polygon points="449.74,862.84 458.34,846.23 453.42,850.88 444.81,867.49" class="mf-surface-face" fill-opacity=".08"/><polygon points="311.97,962.85 320.58,966.39 315.65,970.75 307.05,967.21" class="mf-surface-face" fill-opacity=".08"/><polygon points="391.93,934.51 400.53,926.30 395.60,930.83 387.00,939.04" class="mf-surface-face" fill-opacity=".08"/><polygon points="254.16,932.92 262.77,944.85 257.84,949.09 249.24,937.15" class="mf-surface-face" fill-opacity=".08"/><polygon points="334.11,963.85 342.72,964.03 337.79,968.43 329.19,968.25" class="mf-surface-face" fill-opacity=".08"/><polygon points="414.06,911.84 422.67,900.27 417.74,904.84 409.14,916.41" class="mf-surface-face" fill-opacity=".08"/><polygon points="276.30,950.83 284.91,959.41 279.98,963.68 271.38,955.11" class="mf-surface-face" fill-opacity=".08"/><polygon points="356.25,958.09 364.86,954.91 359.93,959.36 351.33,962.53" class="mf-surface-face" fill-opacity=".08"/><polygon points="436.20,882.42 444.81,867.49 439.88,872.10 431.28,887.03" class="mf-surface-face" fill-opacity=".08"/><polygon points="298.44,961.99 307.05,967.21 302.12,971.52 293.51,966.31" class="mf-surface-face" fill-opacity=".08"/><polygon points="378.39,945.57 387.00,939.04 382.07,943.53 373.46,950.06" class="mf-surface-face" fill-opacity=".08"/><polygon points="320.58,966.39 329.19,968.25 324.26,972.61 315.65,970.75" class="mf-surface-face" fill-opacity=".08"/><polygon points="400.53,926.30 409.14,916.41 404.21,920.94 395.60,930.83" class="mf-surface-face" fill-opacity=".08"/><polygon points="262.77,944.85 271.38,955.11 266.45,959.34 257.84,949.09" class="mf-surface-face" fill-opacity=".08"/><polygon points="342.72,964.03 351.33,962.53 346.40,966.93 337.79,968.43" class="mf-surface-face" fill-opacity=".08"/><polygon points="422.67,900.27 431.28,887.03 426.35,891.60 417.74,904.84" class="mf-surface-face" fill-opacity=".08"/><polygon points="284.91,959.41 293.51,966.31 288.59,970.58 279.98,963.68" class="mf-surface-face" fill-opacity=".08"/><polygon points="364.86,954.91 373.46,950.06 368.54,954.50 359.93,959.36" class="mf-surface-face" fill-opacity=".08"/><polygon points="444.81,867.49 453.42,850.88 448.49,855.49 439.88,872.10" class="mf-surface-face" fill-opacity=".08"/><polygon points="307.05,967.21 315.65,970.75 310.73,975.06 302.12,971.52" class="mf-surface-face" fill-opacity=".08"/><polygon points="387.00,939.04 395.60,930.83 390.68,935.32 382.07,943.53" class="mf-surface-face" fill-opacity=".08"/><polygon points="329.19,968.25 337.79,968.43 332.87,972.79 324.26,972.61" class="mf-surface-face" fill-opacity=".08"/><polygon points="409.14,916.41 417.74,904.84 412.82,909.37 404.21,920.94" class="mf-surface-face" fill-opacity=".08"/><polygon points="271.38,955.11 279.98,963.68 275.05,967.92 266.45,959.34" class="mf-surface-face" fill-opacity=".08"/><polygon points="351.33,962.53 359.93,959.36 355.00,963.76 346.40,966.93" class="mf-surface-face" fill-opacity=".08"/><polygon points="431.28,887.03 439.88,872.10 434.96,876.67 426.35,891.60" class="mf-surface-face" fill-opacity=".08"/><polygon points="293.51,966.31 302.12,971.52 297.19,975.80 288.59,970.58" class="mf-surface-face" fill-opacity=".08"/><polygon points="373.46,950.06 382.07,943.53 377.14,947.97 368.54,954.50" class="mf-surface-face" fill-opacity=".08"/><polygon points="315.65,970.75 324.26,972.61 319.33,976.92 310.73,975.06" class="mf-surface-face" fill-opacity=".08"/><polygon points="395.60,930.83 404.21,920.94 399.28,925.43 390.68,935.32" class="mf-surface-face" fill-opacity=".08"/><polygon points="337.79,968.43 346.40,966.93 341.47,971.29 332.87,972.79" class="mf-surface-face" fill-opacity=".08"/><polygon points="417.74,904.84 426.35,891.60 421.42,896.12 412.82,909.37" class="mf-surface-face" fill-opacity=".08"/><polygon points="279.98,963.68 288.59,970.58 283.66,974.81 275.05,967.92" class="mf-surface-face" fill-opacity=".08"/><polygon points="359.93,959.36 368.54,954.50 363.61,958.90 355.00,963.76" class="mf-surface-face" fill-opacity=".08"/><polygon points="439.88,872.10 448.49,855.49 443.56,860.06 434.96,876.67" class="mf-surface-face" fill-opacity=".08"/><polygon points="302.12,971.52 310.73,975.06 305.80,979.34 297.19,975.80" class="mf-surface-face" fill-opacity=".08"/><polygon points="382.07,943.53 390.68,935.32 385.75,939.76 377.14,947.97" class="mf-surface-face" fill-opacity=".08"/><polygon points="324.26,972.61 332.87,972.79 327.94,977.11 319.33,976.92" class="mf-surface-face" fill-opacity=".08"/><polygon points="404.21,920.94 412.82,909.37 407.89,913.86 399.28,925.43" class="mf-surface-face" fill-opacity=".08"/><polygon points="346.40,966.93 355.00,963.76 350.08,968.12 341.47,971.29" class="mf-surface-face" fill-opacity=".08"/><polygon points="426.35,891.60 434.96,876.67 430.03,881.20 421.42,896.12" class="mf-surface-face" fill-opacity=".08"/><polygon points="288.59,970.58 297.19,975.80 292.27,980.03 283.66,974.81" class="mf-surface-face" fill-opacity=".08"/><polygon points="368.54,954.50 377.14,947.97 372.22,952.37 363.61,958.90" class="mf-surface-face" fill-opacity=".08"/><polygon points="310.73,975.06 319.33,976.92 314.40,981.20 305.80,979.34" class="mf-surface-face" fill-opacity=".08"/><polygon points="390.68,935.32 399.28,925.43 394.36,929.87 385.75,939.76" class="mf-surface-face" fill-opacity=".08"/><polygon points="332.87,972.79 341.47,971.29 336.54,975.61 327.94,977.11" class="mf-surface-face" fill-opacity=".08"/><polygon points="412.82,909.37 421.42,896.12 416.49,900.61 407.89,913.86" class="mf-surface-face" fill-opacity=".08"/><polygon points="355.00,963.76 363.61,958.90 358.68,963.26 350.08,968.12" class="mf-surface-face" fill-opacity=".08"/><polygon points="434.96,876.67 443.56,860.06 438.63,864.59 430.03,881.20" class="mf-surface-face" fill-opacity=".08"/><polygon points="297.19,975.80 305.80,979.34 300.87,983.57 292.27,980.03" class="mf-surface-face" fill-opacity=".08"/><polygon points="377.14,947.97 385.75,939.76 380.82,944.16 372.22,952.37" class="mf-surface-face" fill-opacity=".08"/><polygon points="319.33,976.92 327.94,977.11 323.01,981.38 314.40,981.20" class="mf-surface-face" fill-opacity=".08"/><polygon points="399.28,925.43 407.89,913.86 402.96,918.30 394.36,929.87" class="mf-surface-face" fill-opacity=".08"/><polygon points="341.47,971.29 350.08,968.12 345.15,972.44 336.54,975.61" class="mf-surface-face" fill-opacity=".08"/><polygon points="421.42,896.12 430.03,881.20 425.10,885.68 416.49,900.61" class="mf-surface-face" fill-opacity=".08"/><polygon points="363.61,958.90 372.22,952.37 367.29,956.73 358.68,963.26" class="mf-surface-face" fill-opacity=".08"/><polygon points="305.80,979.34 314.40,981.20 309.48,985.43 300.87,983.57" class="mf-surface-face" fill-opacity=".08"/><polygon points="385.75,939.76 394.36,929.87 389.43,934.27 380.82,944.16" class="mf-surface-face" fill-opacity=".08"/><polygon points="327.94,977.11 336.54,975.61 331.62,979.89 323.01,981.38" class="mf-surface-face" fill-opacity=".08"/><polygon points="407.89,913.86 416.49,900.61 411.57,905.05 402.96,918.30" class="mf-surface-face" fill-opacity=".08"/><polygon points="350.08,968.12 358.68,963.26 353.76,967.58 345.15,972.44" class="mf-surface-face" fill-opacity=".08"/><polygon points="430.03,881.20 438.63,864.59 433.71,869.08 425.10,885.68" class="mf-surface-face" fill-opacity=".08"/><polygon points="372.22,952.37 380.82,944.16 375.89,948.52 367.29,956.73" class="mf-surface-face" fill-opacity=".08"/><polygon points="314.40,981.20 323.01,981.38 318.08,985.62 309.48,985.43" class="mf-surface-face" fill-opacity=".08"/><polygon points="394.36,929.87 402.96,918.30 398.03,922.70 389.43,934.27" class="mf-surface-face" fill-opacity=".08"/><polygon points="336.54,975.61 345.15,972.44 340.22,976.71 331.62,979.89" class="mf-surface-face" fill-opacity=".08"/><polygon points="416.49,900.61 425.10,885.68 420.17,890.13 411.57,905.05" class="mf-surface-face" fill-opacity=".08"/><polygon points="358.68,963.26 367.29,956.73 362.36,961.05 353.76,967.58" class="mf-surface-face" fill-opacity=".08"/><polygon points="380.82,944.16 389.43,934.27 384.50,938.63 375.89,948.52" class="mf-surface-face" fill-opacity=".08"/><polygon points="323.01,981.38 331.62,979.89 326.69,984.12 318.08,985.62" class="mf-surface-face" fill-opacity=".08"/><polygon points="402.96,918.30 411.57,905.05 406.64,909.45 398.03,922.70" class="mf-surface-face" fill-opacity=".08"/><polygon points="345.15,972.44 353.76,967.58 348.83,971.86 340.22,976.71" class="mf-surface-face" fill-opacity=".08"/><polygon points="425.10,885.68 433.71,869.08 428.78,873.52 420.17,890.13" class="mf-surface-face" fill-opacity=".08"/><polygon points="367.29,956.73 375.89,948.52 370.97,952.84 362.36,961.05" class="mf-surface-face" fill-opacity=".08"/><polygon points="389.43,934.27 398.03,922.70 393.11,927.06 384.50,938.63" class="mf-surface-face" fill-opacity=".08"/><polygon points="331.62,979.89 340.22,976.71 335.29,980.94 326.69,984.12" class="mf-surface-face" fill-opacity=".08"/><polygon points="411.57,905.05 420.17,890.13 415.25,894.53 406.64,909.45" class="mf-surface-face" fill-opacity=".08"/><polygon points="353.76,967.58 362.36,961.05 357.43,965.32 348.83,971.86" class="mf-surface-face" fill-opacity=".08"/><polygon points="375.89,948.52 384.50,938.63 379.57,942.95 370.97,952.84" class="mf-surface-face" fill-opacity=".08"/><polygon points="398.03,922.70 406.64,909.45 401.71,913.81 393.11,927.06" class="mf-surface-face" fill-opacity=".08"/><polygon points="340.22,976.71 348.83,971.86 343.90,976.09 335.29,980.94" class="mf-surface-face" fill-opacity=".08"/><polygon points="420.17,890.13 428.78,873.52 423.85,877.92 415.25,894.53" class="mf-surface-face" fill-opacity=".08"/><polygon points="362.36,961.05 370.97,952.84 366.04,957.11 357.43,965.32" class="mf-surface-face" fill-opacity=".08"/><polygon points="384.50,938.63 393.11,927.06 388.18,931.38 379.57,942.95" class="mf-surface-face" fill-opacity=".08"/><polygon points="406.64,909.45 415.25,894.53 410.32,898.89 401.71,913.81" class="mf-surface-face" fill-opacity=".08"/><polygon points="348.83,971.86 357.43,965.32 352.51,969.56 343.90,976.09" class="mf-surface-face" fill-opacity=".08"/><polygon points="370.97,952.84 379.57,942.95 374.65,947.22 366.04,957.11" class="mf-surface-face" fill-opacity=".08"/><polygon points="393.11,927.06 401.71,913.81 396.78,918.13 388.18,931.38" class="mf-surface-face" fill-opacity=".08"/><polygon points="415.25,894.53 423.85,877.92 418.92,882.28 410.32,898.89" class="mf-surface-face" fill-opacity=".08"/><polygon points="357.43,965.32 366.04,957.11 361.11,961.35 352.51,969.56" class="mf-surface-face" fill-opacity=".08"/><polygon points="379.57,942.95 388.18,931.38 383.25,935.65 374.65,947.22" class="mf-surface-face" fill-opacity=".08"/><polygon points="401.71,913.81 410.32,898.89 405.39,903.20 396.78,918.13" class="mf-surface-face" fill-opacity=".08"/><polygon points="366.04,957.11 374.65,947.22 369.72,951.46 361.11,961.35" class="mf-surface-face" fill-opacity=".08"/><polygon points="388.18,931.38 396.78,918.13 391.86,922.41 383.25,935.65" class="mf-surface-face" fill-opacity=".08"/><polygon points="410.32,898.89 418.92,882.28 414.00,886.60 405.39,903.20" class="mf-surface-face" fill-opacity=".08"/><polygon points="374.65,947.22 383.25,935.65 378.32,939.89 369.72,951.46" class="mf-surface-face" fill-opacity=".08"/><polygon points="396.78,918.13 405.39,903.20 400.46,907.48 391.86,922.41" class="mf-surface-face" fill-opacity=".08"/><polygon points="383.25,935.65 391.86,922.41 386.93,926.64 378.32,939.89" class="mf-surface-face" fill-opacity=".08"/><polygon points="405.39,903.20 414.00,886.60 409.07,890.87 400.46,907.48" class="mf-surface-face" fill-opacity=".08"/><polygon points="391.86,922.41 400.46,907.48 395.54,911.71 386.93,926.64" class="mf-surface-face" fill-opacity=".08"/><polygon points="400.46,907.48 409.07,890.87 404.14,895.11 395.54,911.71" class="mf-surface-face" fill-opacity=".08"/><polyline fill="none" points="398.95,912.07 380.99,940.01 363.02,960.41 345.06,973.29 327.10,978.63 309.13,976.45 291.17,966.74 273.21,949.50 255.24,924.74 266.42,940.14 277.60,952.84 288.79,962.83 299.97,970.10 311.15,974.67 322.33,976.54 333.51,975.69 344.69,972.13 338.38,974.25 332.08,975.39 325.77,975.56 319.47,974.76 313.16,972.99 306.86,970.24 300.55,966.53 294.25,961.84 298.38,964.43 302.52,966.67 306.65,968.56 310.79,970.11 314.93,971.31 319.06,972.17 323.20,972.68 327.34,972.84 325.24,972.47 323.14,971.98 321.04,971.37 318.94,970.63 316.85,969.77 314.75,968.79 312.65,967.69 310.55,966.47 312.13,966.90 313.71,967.30 315.28,967.65 316.86,967.95 318.44,968.22 320.01,968.44 321.59,968.62 323.17,968.76 322.57,968.39 321.98,968.02 321.38,967.62 320.78,967.22 320.19,966.80 319.59,966.36 319.00,965.91 318.40,965.44 319.05,965.44 319.71,965.43 320.36,965.41 321.02,965.40 321.67,965.37 322.32,965.34 322.98,965.31 323.63,965.27 323.55,965.03 323.47,964.79 323.40,964.54 323.32,964.30 323.24,964.05 323.16,963.81 323.08,963.56 323.00,963.30 323.33,963.20 323.65,963.09 323.98,962.98 324.30,962.87 324.62,962.75 324.95,962.64 325.27,962.53 325.59,962.42 325.68,962.24 325.77,962.07 325.85,961.89 325.94,961.71 326.03,961.54 326.11,961.36 326.20,961.18 326.29,961.01 326.49,960.88 326.70,960.75 326.90,960.61 327.11,960.48 327.31,960.35 327.51,960.22 327.72,960.09 327.92,959.96 328.05,959.82 328.18,959.67 328.31,959.53 328.44,959.38 328.57,959.23 328.70,959.09 328.83,958.94 328.96,958.80 329.12,958.67 329.28,958.54 329.44,958.41 329.59,958.28 329.75,958.16 329.91,958.03 330.07,957.90 330.23,957.77 330.36,957.64 330.49,957.52 330.63,957.39 330.76,957.26 330.89,957.13 331.02,957.00 331.16,956.87 331.29,956.75 331.43,956.63 331.56,956.51 331.70,956.39 331.83,956.27 331.97,956.15 332.10,956.03 332.24,955.91 332.38,955.79 332.50,955.68 332.63,955.56 332.75,955.44 332.87,955.33 333.00,955.21 333.12,955.10 333.25,954.98 333.37,954.87 333.50,954.76 333.62,954.65 333.74,954.54 333.86,954.43 333.98,954.32 334.10,954.21 334.22,954.10 334.34,953.99 334.46,953.89 334.57,953.78 334.68,953.68 334.80,953.57 334.91,953.47 335.03,953.36 335.14,953.26 335.26,953.15 335.36,953.05 335.47,952.96 335.58,952.86 335.69,952.76 335.80,952.66 335.91,952.56 336.02,952.46 336.13,952.36 336.23,952.26 336.33,952.17 336.44,952.07 336.54,951.98 336.65,951.88 336.75,951.79 336.85,951.69 336.96,951.60 337.05,951.51 337.15,951.42 337.25,951.33 337.35,951.24 337.45,951.14 337.55,951.05 337.65,950.96 337.74,950.87 337.84,950.79 337.93,950.70 338.03,950.61 338.12,950.53 338.21,950.44 338.31,950.36 338.40,950.27 338.49,950.18 338.58,950.10 338.67,950.02 338.76,949.94 338.85,949.86 338.94,949.77 339.03,949.69 339.12,949.61 339.21,949.53 339.29,949.45 339.38,949.37 339.46,949.29 339.55,949.22 339.63,949.14 339.72,949.06 339.80,948.98 339.88,948.90 339.97,948.83 340.05,948.75 340.13,948.68 340.21,948.61 340.29,948.53 340.37,948.46 340.45,948.38 340.53,948.31 340.60,948.24 340.68,948.17 340.76,948.10 340.83,948.03 340.91,947.96 340.99,947.89 341.06,947.81 341.14,947.74 341.21,947.68 341.29,947.61 341.36,947.54 341.43,947.48 341.50,947.41 341.58,947.34 341.65,947.27 341.72,947.21 341.79,947.14 341.86,947.08 341.93,947.02 342.00,946.95 342.07,946.89 342.13,946.82 342.20,946.76 342.27,946.70 342.34,946.64 342.40,946.58 342.47,946.51 342.53,946.45 342.60,946.39 342.66,946.33 342.73,946.27 342.80,946.21 342.86,946.15 342.92,946.10 342.98,946.04 343.04,945.98 343.11,945.92 343.17,945.87 343.23,945.81 343.29,945.75 343.35,945.70 343.41,945.64 343.47,945.59 343.53,945.53 343.59,945.48 343.65,945.42 343.71,945.37 343.76,945.31 343.82,945.26 343.88,945.21 343.93,945.16 343.99,945.10 344.04,945.05 344.10,945.00 344.16,944.95 344.21,944.90 344.27,944.85 344.32,944.80 344.37,944.75 344.42,944.70 344.48,944.65 344.53,944.60 344.58,944.55 344.64,944.50 344.69,944.45 344.74,944.41 344.79,944.36 344.84,944.31 344.89,944.27 344.94,944.22 344.99,944.17 345.04,944.13 345.09,944.08 345.13,944.04 345.18,943.99 345.23,943.95 345.28,943.90 345.33,943.86 345.37,943.82 345.42,943.77 345.47,943.73 345.51,943.69 345.56,943.64 345.60,943.60 345.65,943.56 345.69,943.52 345.74,943.48 345.78,943.43 345.83,943.39 345.87,943.35 345.91,943.31 345.95,943.27 346.00,943.23 346.04,943.19 346.08,943.15 346.13,943.11 346.17,943.08 346.21,943.04 346.25,943.00 346.29,942.96 346.33,942.92 346.37,942.89 346.41,942.85 346.45,942.81 346.49,942.77 346.53,942.74 346.57,942.70 346.60,942.67 346.64,942.63 346.68,942.59 346.72,942.56 346.76,942.52 346.79,942.49 346.83,942.45 346.87,942.42 346.90,942.39 346.94,942.35 346.98,942.32 347.01,942.28 347.05,942.25 347.08,942.22 347.12,942.19 347.15,942.15 347.19,942.12 347.22,942.09 347.26,942.06 347.29,942.03 347.32,941.99 347.36,941.96 347.39,941.93 347.42,941.90 347.46,941.87 347.49,941.84 347.52,941.81 347.55,941.78 347.59,941.75 347.62,941.72 347.65,941.69 347.68,941.66 347.71,941.63 347.74,941.60 347.77,941.58 347.80,941.55 347.83,941.52 347.86,941.49 347.89,941.46 347.92,941.44 347.95,941.41 347.98,941.38 348.01,941.35 348.04,941.33 348.07,941.30 348.09,941.27 348.12,941.25 348.15,941.22 348.18,941.20 348.20,941.17 348.23,941.14 348.26,941.12 348.29,941.09 348.31,941.07 348.34,941.04 348.37,941.02 348.39,940.99 348.42,940.97 348.44,940.95 348.47,940.92 348.50,940.90 348.52,940.87 348.54,940.85 348.57,940.83 348.59,940.80 348.62,940.78 348.64,940.76 348.67,940.74 348.69,940.71 348.72,940.69 348.74,940.67 348.76,940.65 348.79,940.63 348.81,940.60 348.83,940.58 348.85,940.56 348.88,940.54 348.90,940.52 348.92,940.50 348.94,940.48 348.97,940.46 348.99,940.44 349.01,940.41 349.03,940.39 349.05,940.37 349.07,940.35 349.09,940.34 349.12,940.32 349.14,940.30 349.16,940.28 349.18,940.26 349.20,940.24 349.22,940.22 349.24,940.20 349.26,940.18 349.28,940.16 349.30,940.15 349.32,940.13 349.34,940.11 349.36,940.09 349.37,940.07 349.39,940.06 349.41,940.04 349.43,940.02 349.45,940.00 349.47,939.99 349.49,939.97 349.50,939.95 349.52,939.93 349.54,939.92 349.56,939.90 349.57,939.89 349.59,939.87 349.61,939.85 349.63,939.84 349.64,939.82 349.66,939.80 349.68,939.79 349.69,939.77 349.71,939.76 349.73,939.74 349.74,939.73 349.76,939.71 349.77,939.70 349.79,939.68 349.81,939.67 349.82,939.65 349.84,939.64 349.85,939.62 349.87,939.61 349.88,939.60 349.90,939.58 349.91,939.57 349.93,939.55 349.94,939.54 349.96,939.53 349.97,939.51 349.98,939.50 350.00,939.49 350.01,939.47 350.03,939.46 350.04,939.45 350.06,939.43 350.07,939.42 350.08,939.41 350.10,939.40 350.11,939.38 350.12,939.37 350.14,939.36 350.15,939.34 350.16,939.33 350.17,939.32 350.19,939.31 350.20,939.30 350.21,939.29 350.23,939.27 350.24,939.26 350.25,939.25 350.26,939.24 350.27,939.23 350.29,939.22 350.30,939.21 350.31,939.19 350.32,939.18 350.33,939.17 350.34,939.16 350.36,939.15 350.37,939.14 350.38,939.13 350.39,939.12 350.40,939.11 350.41,939.10 350.42,939.09 350.43,939.08 350.44,939.07 350.45,939.06 350.47,939.05 350.48,939.04 350.49,939.03 350.50,939.02 350.51,939.01 350.52,939.00 350.53,938.99 350.54,938.98 350.55,938.97 350.56,938.96 350.57,938.95 350.58,938.94 350.59,938.93 350.60,938.93 350.60,938.92 350.61,938.91 350.62,938.90 350.63,938.89 350.64,938.88 350.65,938.87 350.66,938.86 350.67,938.86 350.68,938.85 350.69,938.84 350.69,938.83 350.70,938.82 350.71,938.82 350.72,938.81 350.73,938.80 350.74,938.79 350.75,938.78 350.75,938.78 350.76,938.77 350.77,938.76 350.78,938.75 350.79,938.75 350.79,938.74 350.80,938.73 350.81,938.72 350.82,938.72 350.83,938.71 350.83,938.70 350.84,938.69 350.85,938.69 350.86,938.68 350.86,938.67 350.87,938.67 350.88,938.66 350.88,938.65 350.89,938.65 350.90,938.64 350.91,938.63 350.91,938.63 350.92,938.62 350.93,938.61 350.93,938.61 350.94,938.60 350.95,938.59 350.95,938.59 350.96,938.58 350.97,938.57 350.97,938.57 350.98,938.56 350.99,938.56 350.99,938.55 351.00,938.54 351.01,938.54 351.01,938.53 351.02,938.53 351.02,938.52 351.03,938.52 351.04,938.51 351.04,938.50 351.05,938.50 351.06,938.49 351.06,938.49 351.07,938.48 351.07,938.48 351.08,938.47 351.08,938.46 351.09,938.46 351.10,938.45 351.10,938.45 351.11,938.44 351.11,938.44 351.12,938.43 351.12,938.43 351.13,938.42 351.13,938.42 351.14,938.41 351.15,938.41 351.15,938.40 351.16,938.40 351.16,938.39 351.17,938.39 351.17,938.38 351.18,938.38 351.18,938.37 351.19,938.37 351.19,938.36 351.20,938.36 351.20,938.35 351.21,938.35 351.21,938.34 351.22,938.34 351.22,938.33 351.23,938.33 351.23,938.33 351.24,938.32 351.24,938.32 351.25,938.31 351.25,938.31 351.26,938.30 351.26,938.30 351.27,938.29 351.27,938.29 351.28,938.29 351.28,938.28 351.28,938.28 351.29,938.27 351.29,938.27 351.30,938.26 351.30,938.26 351.31,938.25 351.31,938.25 351.32,938.25 351.32,938.24 351.33,938.24 351.33,938.23 351.33,938.23 351.34,938.23 351.34,938.22 351.35,938.22 351.35,938.21 351.36,938.21 351.36,938.20 351.37,938.20 351.37,938.20 351.37,938.19 351.38,938.19 351.38,938.18 351.39,938.18 351.39,938.18 351.40,938.17 351.40,938.17 351.40,938.16 351.41,938.16 351.41,938.16 351.42,938.15" class="mf-sgd"/><circle cx="351.4175233903233" cy="938.1510009177879" r="5" class="mf-sgd-dot"/><polyline fill="none" points="398.95,912.07 397.73,914.19 396.52,916.26 395.30,918.31 394.09,920.32 392.87,922.30 391.66,924.24 390.44,926.15 389.23,928.03 388.02,929.86 386.81,931.66 385.60,933.43 384.40,935.17 383.19,936.87 381.98,938.54 380.77,940.17 379.56,941.77 378.37,943.33 377.17,944.85 375.97,946.34 374.78,947.79 373.58,949.22 372.39,950.61 371.19,951.97 369.99,953.29 368.82,954.56 367.64,955.80 366.47,957.01 365.29,958.19 364.11,959.34 362.94,960.46 361.76,961.54 360.59,962.59 359.44,963.59 358.29,964.56 357.14,965.49 355.99,966.40 354.85,967.28 353.70,968.13 352.55,968.94 351.40,969.73 350.29,970.47 349.18,971.17 348.08,971.85 346.97,972.49 345.86,973.12 344.75,973.71 343.64,974.27 342.53,974.81 341.47,975.29 340.41,975.75 339.35,976.19 338.29,976.60 337.23,976.98 336.18,977.34 335.12,977.67 334.06,977.97 333.06,978.24 332.07,978.48 331.08,978.69 330.08,978.89 329.09,979.06 328.09,979.21 327.10,979.34 326.10,979.44 325.19,979.51 324.28,979.57 323.36,979.60 322.45,979.61 321.53,979.61 320.62,979.59 319.70,979.54 318.79,979.48 317.97,979.40 317.16,979.31 316.34,979.21 315.52,979.08 314.71,978.94 313.89,978.79 313.07,978.62 312.26,978.43 311.56,978.25 310.85,978.06 310.15,977.86 309.45,977.65 308.75,977.42 308.05,977.18 307.35,976.93 306.65,976.67 306.07,976.44 305.50,976.20 304.93,975.96 304.36,975.70 303.79,975.44 303.22,975.17 302.65,974.89 302.08,974.60 301.65,974.36 301.22,974.12 300.79,973.87 300.36,973.62 299.93,973.37 299.51,973.11 299.08,972.84 298.65,972.57 298.37,972.37 298.08,972.17 297.80,971.96 297.52,971.76 297.24,971.55 296.96,971.33 296.68,971.12 296.40,970.90 296.26,970.76 296.12,970.62 295.98,970.48 295.85,970.34 295.71,970.19 295.57,970.05 295.44,969.91 295.30,969.76 295.30,969.69 295.29,969.63 295.29,969.56 295.29,969.49 295.28,969.42 295.28,969.35 295.28,969.29 295.27,969.22 295.39,969.22 295.50,969.22 295.61,969.22 295.73,969.22 295.84,969.23 295.95,969.23 296.07,969.23 296.18,969.23 296.39,969.29 296.60,969.34 296.81,969.40 297.02,969.45 297.22,969.51 297.43,969.56 297.64,969.62 297.85,969.67 298.13,969.76 298.41,969.85 298.70,969.94 298.98,970.03 299.26,970.12 299.54,970.21 299.82,970.29 300.10,970.38 300.43,970.48 300.76,970.59 301.09,970.69 301.42,970.80 301.75,970.90 302.08,970.99 302.41,971.09 302.74,971.19 303.09,971.29 303.45,971.39 303.80,971.49 304.16,971.59 304.51,971.69 304.86,971.78 305.22,971.88 305.57,971.97 305.93,972.05 306.29,972.14 306.65,972.22 307.01,972.30 307.36,972.38 307.72,972.46 308.08,972.54 308.44,972.61 308.78,972.67 309.12,972.73 309.46,972.79 309.80,972.85 310.14,972.90 310.49,972.96 310.83,973.01 311.17,973.06 311.48,973.09 311.79,973.13 312.09,973.16 312.40,973.19 312.71,973.22 313.02,973.25 313.32,973.27 313.63,973.30 313.89,973.30 314.16,973.31 314.42,973.31 314.68,973.32 314.94,973.32 315.20,973.33 315.46,973.33 315.72,973.33 315.93,973.31 316.13,973.30 316.34,973.28 316.55,973.26 316.75,973.24 316.96,973.22 317.16,973.20 317.37,973.18 317.52,973.15 317.66,973.11 317.81,973.08 317.96,973.04 318.10,973.00 318.25,972.97 318.40,972.93 318.54,972.89 318.63,972.84 318.72,972.79 318.81,972.74 318.90,972.69 318.99,972.64 319.08,972.59 319.17,972.54 319.26,972.48 319.30,972.42 319.34,972.36 319.37,972.29 319.41,972.23 319.45,972.17 319.49,972.10 319.53,972.04 319.57,971.98 319.56,971.90 319.56,971.83 319.56,971.76 319.56,971.68 319.56,971.61 319.55,971.53 319.55,971.46 319.55,971.38 319.52,971.30 319.49,971.22 319.46,971.14 319.43,971.05 319.40,970.97 319.37,970.89 319.33,970.80 319.30,970.72 319.26,970.63 319.21,970.54 319.17,970.45 319.12,970.36 319.08,970.27 319.03,970.18 318.99,970.09 318.94,970.00 318.90,969.91 318.85,969.82 318.80,969.72 318.76,969.63 318.71,969.54 318.66,969.44 318.62,969.35 318.57,969.25 318.53,969.16 318.50,969.07 318.46,968.97 318.43,968.88 318.39,968.78 318.35,968.69 318.32,968.59 318.28,968.50 318.27,968.41 318.25,968.32 318.24,968.23 318.22,968.13 318.20,968.04 318.19,967.95 318.17,967.86 318.16,967.77 318.17,967.68 318.18,967.60 318.19,967.51 318.20,967.42 318.21,967.34 318.22,967.25 318.23,967.17 318.24,967.08 318.28,967.00 318.32,966.92 318.36,966.85 318.40,966.77 318.44,966.69 318.48,966.61 318.51,966.53 318.55,966.46 318.62,966.39 318.69,966.32 318.76,966.25 318.82,966.18 318.89,966.11 318.96,966.04 319.03,965.97 319.09,965.90 319.18,965.84 319.28,965.77 319.37,965.71 319.46,965.65 319.55,965.59 319.64,965.52 319.73,965.46 319.82,965.40 319.93,965.34 320.04,965.28 320.15,965.23 320.26,965.17 320.37,965.11 320.48,965.05 320.59,965.00 320.70,964.94 320.82,964.89 320.94,964.83 321.06,964.78 321.18,964.72 321.30,964.67 321.42,964.61 321.55,964.56 321.67,964.51 321.79,964.45 321.92,964.40 322.04,964.34 322.16,964.29 322.29,964.24 322.41,964.18 322.54,964.13 322.66,964.08 322.78,964.02 322.91,963.96 323.03,963.91 323.15,963.85 323.27,963.80 323.39,963.74 323.52,963.69 323.64,963.63 323.75,963.58 323.87,963.52 323.98,963.46 324.10,963.40 324.21,963.34 324.32,963.28 324.44,963.23 324.55,963.17 324.66,963.11 324.76,963.05 324.86,962.98 324.97,962.92 325.07,962.86 325.17,962.80 325.28,962.74 325.38,962.68 325.47,962.61 325.56,962.54 325.65,962.48 325.74,962.41 325.83,962.35 325.92,962.28 326.01,962.22 326.10,962.15 326.18,962.08 326.26,962.02 326.34,961.95 326.42,961.88 326.50,961.81 326.58,961.74 326.65,961.67 326.73,961.60 326.80,961.53 326.87,961.46 326.94,961.39 327.01,961.32 327.07,961.25 327.14,961.18 327.21,961.11 327.28,961.04 327.34,960.96 327.40,960.89 327.46,960.82 327.52,960.75 327.58,960.67 327.64,960.60 327.70,960.53 327.76,960.46 327.82,960.38 327.88,960.31 327.93,960.24 327.99,960.16 328.05,960.09 328.10,960.02 328.16,959.94 328.22,959.87 328.27,959.80 328.33,959.72 328.38,959.65 328.44,959.58 328.49,959.51 328.55,959.43 328.60,959.36 328.66,959.29 328.71,959.22 328.77,959.15 328.83,959.07 328.88,959.00 328.94,958.93 329.00,958.86 329.05,958.79 329.11,958.72 329.17,958.65 329.23,958.58 329.29,958.51 329.35,958.44 329.41,958.37 329.47,958.30 329.53,958.23 329.59,958.16 329.65,958.10 329.72,958.03 329.78,957.96 329.84,957.90 329.91,957.83 329.97,957.76 330.03,957.70 330.10,957.63 330.16,957.56 330.23,957.50 330.30,957.44 330.37,957.37 330.43,957.31 330.50,957.24 330.57,957.18 330.63,957.11 330.71,957.05 330.78,956.99 330.85,956.93 330.92,956.87 330.99,956.80 331.06,956.74 331.13,956.68 331.20,956.62 331.27,956.56 331.34,956.50 331.41,956.44 331.49,956.38 331.56,956.32 331.63,956.26 331.70,956.20 331.77,956.14 331.85,956.08 331.92,956.03 331.99,955.97 332.06,955.91 332.14,955.85 332.21,955.79 332.28,955.74 332.35,955.68 332.43,955.62 332.50,955.57 332.57,955.51 332.64,955.45 332.71,955.40 332.78,955.34 332.85,955.28 332.93,955.23 333.00,955.17 333.07,955.12 333.13,955.06 333.20,955.01 333.27,954.95 333.34,954.90 333.41,954.84 333.48,954.79 333.55,954.73 333.61,954.68 333.68,954.62 333.75,954.57 333.81,954.51 333.88,954.46 333.95,954.41 334.01,954.35 334.08,954.30 334.14,954.24 334.20,954.19 334.27,954.14 334.33,954.08 334.39,954.03 334.46,953.98 334.52,953.92 334.58,953.87 334.64,953.82 334.70,953.77 334.76,953.71 334.82,953.66 334.88,953.61 334.94,953.56 335.00,953.51 335.06,953.45 335.11,953.40 335.17,953.35 335.22,953.30 335.28,953.25 335.34,953.20 335.39,953.14 335.45,953.09 335.50,953.04 335.56,952.99 335.61,952.94 335.67,952.89 335.72,952.84 335.77,952.79 335.83,952.74 335.88,952.69 335.93,952.64 335.98,952.59 336.03,952.54 336.08,952.49 336.14,952.44 336.19,952.39 336.24,952.35 336.29,952.30 336.34,952.25 336.39,952.20 336.44,952.15 336.49,952.10 336.54,952.06 336.59,952.01 336.63,951.96 336.68,951.91 336.73,951.87 336.78,951.82 336.83,951.77 336.87,951.73 336.92,951.68 336.97,951.63 337.02,951.59 337.06,951.54 337.11,951.49 337.16,951.45 337.20,951.40 337.25,951.36 337.30,951.31 337.34,951.27 337.39,951.22 337.44,951.18 337.48,951.13 337.53,951.09 337.57,951.05 337.62,951.00 337.66,950.96 337.71,950.91 337.76,950.87 337.80,950.83 337.85,950.78 337.89,950.74 337.94,950.70 337.98,950.66 338.03,950.61 338.07,950.57 338.12,950.53 338.16,950.49 338.20,950.44 338.25,950.40 338.29,950.36 338.34,950.32 338.38,950.28 338.43,950.24 338.47,950.20 338.51,950.15 338.56,950.11 338.60,950.07 338.65,950.03 338.69,949.99 338.73,949.95 338.78,949.91 338.82,949.87 338.86,949.83 338.91,949.79 338.95,949.75 338.99,949.71 339.04,949.67 339.08,949.63 339.12,949.59 339.17,949.55 339.21,949.51 339.25,949.48 339.30,949.44 339.34,949.40 339.38,949.36 339.42,949.32 339.47,949.28 339.51,949.24 339.55,949.20 339.59,949.17 339.64,949.13 339.68,949.09 339.72,949.05 339.76,949.01 339.81,948.97 339.85,948.93 339.89,948.90 339.93,948.86 339.98,948.82 340.02,948.78 340.06,948.74 340.10,948.71 340.15,948.67 340.19,948.63 340.23,948.59 340.27,948.55 340.31,948.52 340.36,948.48 340.40,948.44 340.44,948.40 340.48,948.36 340.52,948.33 340.57,948.29 340.61,948.25 340.65,948.21 340.69,948.17 340.73,948.13 340.78,948.10 340.82,948.06 340.86,948.02 340.90,947.98 340.95,947.94 340.99,947.90 341.03,947.87 341.07,947.83 341.12,947.79 341.16,947.75 341.20,947.71 341.24,947.67" class="mf-memory-arrow mf-dashed"/><circle cx="341.24227313182536" cy="947.6718721077226" r="5" class="mf-blue-dot"/><polyline fill="none" points="398.95,912.07 398.85,912.53 398.75,912.99 398.65,913.44 398.55,913.88 398.45,914.32 398.36,914.76 398.26,915.19 398.16,915.62 398.05,916.05 397.95,916.47 397.85,916.89 397.75,917.30 397.64,917.71 397.54,918.12 397.44,918.52 397.34,918.92 397.23,919.32 397.12,919.71 397.01,920.10 396.91,920.48 396.80,920.86 396.69,921.24 396.59,921.61 396.48,921.98 396.37,922.34 396.26,922.71 396.14,923.06 396.03,923.42 395.92,923.77 395.81,924.11 395.70,924.46 395.59,924.79 395.47,925.13 395.35,925.46 395.24,925.79 395.12,926.12 395.00,926.44 394.89,926.75 394.77,927.06 394.65,927.37 394.53,927.68 394.41,927.98 394.29,928.28 394.17,928.58 394.05,928.87 393.93,929.15 393.80,929.44 393.68,929.71 393.56,929.99 393.43,930.27 393.30,930.54 393.18,930.80 393.05,931.06 392.92,931.32 392.79,931.57 392.67,931.82 392.54,932.07 392.40,932.32 392.27,932.56 392.14,932.80 392.01,933.03 391.88,933.26 391.74,933.49 391.61,933.71 391.47,933.93 391.34,934.15 391.20,934.36 391.06,934.57 390.92,934.77 390.79,934.98 390.65,935.17 390.51,935.37 390.37,935.56 390.22,935.75 390.08,935.94 389.94,936.12 389.80,936.30 389.65,936.47 389.51,936.64 389.37,936.81 389.22,936.97 389.07,937.14 388.92,937.29 388.78,937.45 388.63,937.60 388.48,937.75 388.33,937.89 388.18,938.03 388.03,938.17 387.88,938.30 387.73,938.44 387.57,938.56 387.42,938.69 387.27,938.81 387.11,938.93 386.96,939.04 386.80,939.15 386.65,939.26 386.49,939.37 386.33,939.47 386.18,939.57 386.02,939.66 385.86,939.75 385.70,939.84 385.54,939.93 385.38,940.01 385.22,940.09 385.06,940.17 384.90,940.24 384.74,940.31 384.58,940.37 384.42,940.43 384.25,940.49 384.09,940.55 383.92,940.60 383.76,940.65 383.60,940.70 383.43,940.74 383.27,940.78 383.10,940.82 382.94,940.85 382.77,940.89 382.61,940.91 382.44,940.94 382.27,940.96 382.11,940.98 381.94,940.99 381.77,941.00 381.61,941.01 381.44,941.02 381.27,941.02 381.10,941.02 380.94,941.02 380.77,941.01 380.60,941.00 380.44,940.98 380.27,940.97 380.10,940.95 379.93,940.92 379.77,940.90 379.60,940.87 379.43,940.83 379.26,940.80 379.10,940.76 378.93,940.72 378.76,940.67 378.60,940.62 378.43,940.57 378.27,940.52 378.10,940.46 377.93,940.39 377.77,940.33 377.61,940.26 377.44,940.19 377.28,940.11 377.12,940.04 376.95,939.95 376.79,939.87 376.63,939.78 376.47,939.69 376.31,939.60 376.15,939.50 375.99,939.39 375.84,939.29 375.68,939.18 375.52,939.07 375.36,938.96 375.20,938.84 375.06,938.71 374.91,938.59 374.76,938.45 374.61,938.32 374.46,938.18 374.31,938.04 374.16,937.90 374.01,937.76 373.87,937.60 373.73,937.44 373.60,937.28 373.46,937.11 373.32,936.95 373.18,936.78 373.05,936.60 372.91,936.43 372.79,936.24 372.67,936.04 372.55,935.85 372.43,935.65 372.31,935.44 372.19,935.24 372.07,935.03 371.95,934.82 371.85,934.59 371.75,934.36 371.65,934.13 371.55,933.89 371.45,933.65 371.36,933.41 371.26,933.16 371.16,932.91 371.08,932.65 371.00,932.38 370.93,932.11 370.85,931.83 370.77,931.56 370.69,931.28 370.62,931.00 370.54,930.72 370.45,930.44 370.37,930.16 370.29,929.88 370.21,929.60 370.12,929.32 370.04,929.03 369.96,928.74 369.87,928.44 369.74,928.20 369.61,927.96 369.47,927.72 369.34,927.47 369.21,927.22 369.07,926.97 368.94,926.71 368.81,926.46 368.71,926.16 368.62,925.87 368.53,925.58 368.43,925.28 368.34,924.98 368.25,924.67 368.16,924.37 368.06,924.06 367.98,923.75 367.90,923.43 367.82,923.11 367.74,922.79 367.66,922.47 367.58,922.14 367.50,921.81 367.42,921.48 366.84,921.65 366.26,921.81 365.68,921.97 365.10,922.12 364.52,922.28 363.94,922.43 363.36,922.58 362.78,922.72 362.25,922.83 361.72,922.93 361.19,923.03 360.66,923.13 360.13,923.23 359.60,923.33 359.07,923.42 358.54,923.51 358.00,923.61 357.47,923.71 356.94,923.81 356.40,923.91 355.87,924.00 355.34,924.09 354.80,924.18 354.27,924.27 353.74,924.36 353.22,924.44 352.70,924.53 352.17,924.61 351.65,924.68 351.12,924.76 350.60,924.84 350.07,924.91 350.12,925.29 350.17,925.67 350.22,926.05 350.26,926.43 350.31,926.80 350.36,927.17 350.41,927.54 350.45,927.91 350.47,928.29 350.49,928.66 350.51,929.03 350.53,929.40 350.55,929.77 350.57,930.13 350.58,930.49 350.60,930.86 350.71,931.12 350.81,931.39 350.92,931.65 351.02,931.92 351.13,932.18 351.23,932.44 351.34,932.69 351.45,932.95 351.89,932.87 352.33,932.79 352.78,932.71 353.22,932.63 353.66,932.55 354.11,932.47 354.55,932.38 354.99,932.29 355.43,932.20 355.86,932.11 356.30,932.01 356.74,931.92 357.17,931.82 357.61,931.72 358.04,931.62 358.48,931.52 358.86,931.46 359.24,931.40 359.62,931.34 360.00,931.28 360.38,931.22 360.76,931.15 361.14,931.08 361.52,931.02 361.96,930.87 362.41,930.73 362.86,930.58 363.31,930.44 363.75,930.29 364.20,930.14 364.65,929.99 365.09,929.83 365.51,929.70 365.93,929.57 366.35,929.43 366.76,929.29 367.18,929.16 367.60,929.02 368.02,928.88 368.44,928.73 368.06,928.85 367.68,928.96 367.30,929.07 366.92,929.18 366.55,929.29 366.17,929.40 365.79,929.50 365.41,929.61 365.05,929.70 364.69,929.80 364.33,929.89 363.97,929.99 363.61,930.08 363.25,930.17 362.89,930.26 362.53,930.35 362.20,930.41 361.88,930.47 361.55,930.53 361.23,930.59 360.91,930.65 360.58,930.71 360.26,930.76 359.93,930.82 359.56,930.93 359.19,931.04 358.81,931.15 358.44,931.25 358.07,931.36 357.70,931.47 357.32,931.57 356.95,931.67 356.91,931.47 356.86,931.27 356.81,931.07 356.77,930.87 356.72,930.67 356.68,930.46 356.63,930.26 356.59,930.06 356.57,929.83 356.55,929.60 356.53,929.38 356.52,929.15 356.50,928.92 356.48,928.69 356.47,928.46 356.45,928.23 356.73,928.20 357.00,928.18 357.28,928.15 357.55,928.12 357.83,928.09 358.10,928.05 358.38,928.02 358.66,927.99 358.72,928.15 358.79,928.30 358.86,928.46 358.92,928.62 358.99,928.77 359.06,928.93 359.12,929.08 359.19,929.23 359.19,929.44 359.20,929.64 359.20,929.84 359.20,930.04 359.21,930.25 359.21,930.45 359.21,930.65 359.22,930.85 359.52,930.75 359.82,930.66 360.12,930.56 360.42,930.46 360.73,930.37 361.03,930.27 361.33,930.17 361.63,930.07 361.80,930.10 361.96,930.12 362.13,930.14 362.29,930.16 362.46,930.19 362.62,930.21 362.78,930.23 362.95,930.25 362.73,930.29 362.50,930.33 362.28,930.38 362.06,930.42 361.84,930.46 361.61,930.50 361.39,930.54 361.17,930.58 360.90,930.67 360.64,930.76 360.37,930.84 360.11,930.93 359.84,931.02 359.58,931.10 359.32,931.19 359.05,931.27 359.01,931.15 358.98,931.02 358.94,930.89 358.91,930.77 358.87,930.64 358.83,930.51 358.80,930.38 358.76,930.25 358.75,930.11 358.74,929.96 358.74,929.81 358.73,929.66 358.72,929.51 358.71,929.36 358.70,929.21 358.69,929.06 358.91,929.00 359.13,928.94 359.35,928.88 359.58,928.81 359.80,928.75 360.02,928.69 360.24,928.62 360.46,928.56 360.51,928.66 360.55,928.76 360.59,928.85 360.64,928.95 360.68,929.05 360.72,929.15 360.77,929.24 360.81,929.34 360.85,929.44 360.89,929.53 360.93,929.63 360.96,929.72 361.00,929.81 361.04,929.91 361.08,930.00 361.12,930.09 361.21,930.19 361.30,930.29 361.40,930.39 361.49,930.49 361.59,930.58 361.68,930.68 361.77,930.77 361.87,930.87 361.70,930.91 361.54,930.96 361.37,931.00 361.21,931.05 361.04,931.09 360.87,931.13 360.71,931.18 360.54,931.22 360.54,931.11 360.54,931.00 360.54,930.89 360.54,930.79 360.54,930.68 360.54,930.57 360.54,930.46 360.54,930.35 360.53,930.25 360.52,930.15 360.52,930.05 360.51,929.95 360.51,929.85 360.50,929.75 360.50,929.65 360.49,929.55 360.34,929.60 360.19,929.64 360.04,929.68 359.89,929.73 359.74,929.77 359.59,929.81 359.44,929.85 359.29,929.90 359.18,929.91 359.07,929.91 358.97,929.92 358.86,929.93 358.75,929.94 358.64,929.94 358.53,929.95 358.42,929.96 358.54,929.94 358.66,929.92 358.79,929.90 358.91,929.87 359.03,929.85 359.15,929.83 359.27,929.81 359.39,929.79 359.50,929.76 359.62,929.74 359.73,929.72 359.84,929.69 359.96,929.67 360.07,929.65 360.18,929.62 360.30,929.60 360.31,929.66 360.33,929.73 360.35,929.79 360.37,929.85 360.38,929.92 360.40,929.98 360.42,930.04 360.44,930.11 360.44,930.18 360.45,930.24 360.46,930.31 360.47,930.38 360.47,930.45 360.48,930.52 360.49,930.58 360.50,930.65 360.48,930.59 360.47,930.53 360.46,930.48 360.45,930.42 360.43,930.36 360.42,930.30 360.41,930.24 360.40,930.18 360.37,930.13 360.35,930.08 360.33,930.04 360.31,929.99 360.28,929.94 360.26,929.90 360.24,929.85 360.21,929.80 360.16,929.79 360.10,929.78 360.05,929.76 359.99,929.75 359.94,929.74 359.88,929.73 359.83,929.71 359.77,929.70 359.68,929.72 359.59,929.75 359.50,929.77 359.41,929.79 359.32,929.82 359.23,929.84 359.14,929.86 359.05,929.89 359.10,929.89 359.16,929.90 359.22,929.91 359.28,929.91 359.33,929.92 359.39,929.92 359.45,929.93 359.51,929.93 359.60,929.91 359.69,929.88 359.78,929.85 359.87,929.82 359.96,929.79 360.05,929.76 360.15,929.73 360.24,929.71 360.25,929.75 360.26,929.80 360.27,929.85 360.28,929.89 360.29,929.94 360.30,929.98 360.31,930.03 360.32,930.08 360.33,930.13 360.33,930.18 360.33,930.23 360.34,930.28 360.34,930.34 360.34,930.39 360.35,930.44 360.35,930.49 360.34,930.44 360.33,930.40 360.32,930.36 360.31,930.31 360.30,930.27 360.29,930.22 360.28,930.18 360.27,930.13 360.25,930.10 360.24,930.06 360.22,930.02 360.20,929.98 360.18,929.95 360.17,929.91 360.15,929.87 360.13,929.84" class="mf-orange"/><circle cx="360.13184727398885" cy="929.8358535865596" r="5" class="mf-dot"/><circle cx="360" cy="930" r="5" class="mf-open"/><text x="369" y="948" class="mf-small" text-anchor="start">minimum</text></g><line x1="24" y1="1070" x2="46" y2="1070" class="mf-sgd" /><text x="54" y="1076" class="mf-small" text-anchor="start">SGD</text><line x1="248" y1="1070" x2="270" y2="1070" class="mf-memory-arrow mf-dashed" /><text x="278" y="1076" class="mf-small" text-anchor="start">AdamW</text><line x1="472" y1="1070" x2="494" y2="1070" class="mf-orange" /><text x="502" y="1076" class="mf-small" text-anchor="start">Muon</text><text x="24" y="1124" class="mf-strong" text-anchor="start">Actual weight matrices at step 80</text><text x="120" y="1160" class="mf-small" text-anchor="middle">SGD</text><g transform="translate(120 1213) scale(0.85)"><polyline fill="none" points="-77.00,-35.00 -84.00,-35.00 -84.00,35.00 -77.00,35.00" class="mf-ink"/><polyline fill="none" points="77.00,-35.00 84.00,-35.00 84.00,35.00 77.00,35.00" class="mf-ink"/><text x="-43" y="-8" class="mf-matrix-number " text-anchor="middle">0.123</text><text x="43" y="-8" class="mf-matrix-number " text-anchor="middle">−0.123</text><text x="-43" y="27" class="mf-matrix-number " text-anchor="middle">−0.123</text><text x="43" y="27" class="mf-matrix-number " text-anchor="middle">0.123</text></g><text x="360" y="1160" class="mf-small" text-anchor="middle">AdamW</text><g transform="translate(360 1213) scale(0.85)"><polyline fill="none" points="-77.00,-35.00 -84.00,-35.00 -84.00,35.00 -77.00,35.00" class="mf-ink"/><polyline fill="none" points="77.00,-35.00 84.00,-35.00 84.00,35.00 77.00,35.00" class="mf-ink"/><text x="-43" y="-8" class="mf-matrix-number " text-anchor="middle">0.270</text><text x="43" y="-8" class="mf-matrix-number " text-anchor="middle">−0.270</text><text x="-43" y="27" class="mf-matrix-number " text-anchor="middle">−0.270</text><text x="43" y="27" class="mf-matrix-number " text-anchor="middle">0.270</text></g><text x="600" y="1160" class="mf-small" text-anchor="middle">Muon</text><g transform="translate(600 1213) scale(0.85)"><polyline fill="none" points="-77.00,-35.00 -84.00,-35.00 -84.00,35.00 -77.00,35.00" class="mf-ink"/><polyline fill="none" points="77.00,-35.00 84.00,-35.00 84.00,35.00 77.00,35.00" class="mf-ink"/><text x="-43" y="-8" class="mf-matrix-number " text-anchor="middle">−0.003</text><text x="43" y="-8" class="mf-matrix-number " text-anchor="middle">0.002</text><text x="-43" y="27" class="mf-matrix-number " text-anchor="middle">0.002</text><text x="43" y="27" class="mf-matrix-number " text-anchor="middle">−0.003</text></g></g></svg>
<figcaption>The left plot shows paths over equal-loss contours. The right plot tracks the actual loss on a logarithmic scale, so small values remain visible. Every point uses the same loss function shown above. Play the run, then try separating the two directions into different matrix entries or raising AdamW’s initial learning rate. Both changes can reverse the ranking. The third plot lifts these same paths onto the loss surface; height is the actual loss. Drag to rotate it, or use the arrow keys. Smooth motion connects computed training steps.</figcaption></figure>
<div class="muon-controls" data-animation="valley"><button data-action="play" disabled>Play animation</button><button data-action="restart" disabled>Restart</button><button data-action="previous-step" disabled>← Back</button><button data-action="next-step" disabled>Next →</button><button data-action="toggle-basis" disabled>Use separate entries for a and b</button><button data-action="adam-rate" disabled>Try AdamW η = 0.32</button><button data-action="zoom-in" disabled>Zoom +</button><button data-action="zoom-out" disabled>Zoom −</button><button data-action="reset-view" disabled>Reset view</button><span data-status>Follow three optimizers. Drag the surface to rotate.</span></div>

<p>Now press <strong>Use separate entries for a and b</strong>. The valley has the same shape, but its directions line up with the individual entries AdamW rescales. AdamW becomes much faster; SGD and Muon follow the same paths as before. Or keep the mixed basis and raise AdamW&#39;s learning rate to <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0.32</mn></mrow><annotation encoding="application/x-tex">0.32</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.32</span></span></span></span>.</span> It catches up and finishes below Muon. AdamW has declined our invitation to be deprecated.</p>
<p>Muon responds to the matrix&#39;s coupled directions, so rotating this example does not change its path in valley coordinates. That is a precise sense in which its update follows the matrix geometry. Calling it &quot;more natural&quot; is less useful than seeing which changes of coordinates leave its behavior intact.</p>
<p>There is only one minimum in this quadratic bowl. None of these paths demonstrates escaping a local minimum. At a point with zero gradient and no stored momentum, Muon also has no direction to follow. Momentum can carry an optimizer through a flat or turning region, but replacing singular values by one does not by itself guarantee escape.</p>
<p>The test answers the question we started with. Here, changing how the two movements are distributed across matrix entries changes AdamW&#39;s path, while SGD and Muon keep the same paths in the valley. AdamW scales those entries separately; Muon rescales the singular directions that combine them. The learning-rate control also shows that this difference does not establish a universal winner. We count training steps here; a Muon step does more work, so these curves do not measure wall-clock speed.</p>
<details class="muon-aside" id="valley-settings">
<summary>The matrix loss, gradients, and exact settings</summary>

<p>The full problem has a <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>2</mn><mo>×</mo><mn>2</mn></mrow><annotation encoding="application/x-tex">2\times2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7278em;vertical-align:-0.0833em;"></span><span class="mord">2</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">×</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">2</span></span></span></span></span> weight matrix:</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>L</mi><mo stretchy="false">(</mo><mi>W</mi><mo stretchy="false">)</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mstyle scriptlevel="0" displaystyle="false"><mfrac><mn>1</mn><mn>2</mn></mfrac></mstyle><mi mathvariant="normal">tr</mi><mo>⁡</mo><mo stretchy="false">(</mo><msup><mi>W</mi><mi mathvariant="normal">⊤</mi></msup><mi>H</mi><mi>W</mi><mo stretchy="false">)</mo><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mi>G</mi></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mi>H</mi><mi>W</mi><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mi>H</mi></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mi>B</mi><mrow><mo fence="true">[</mo><mtable rowspacing="0.16em" columnalign="center center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>40</mn></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0</mn></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0</mn></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>1</mn></mstyle></mtd></mtr></mtable><mo fence="true">]</mo></mrow><msup><mi>B</mi><mi mathvariant="normal">⊤</mi></msup><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}
L(W)&amp;=\tfrac12\operatorname{tr}(W^\top H W),\\[10pt]
G&amp;=HW,\\[10pt]
H&amp;=B\begin{bmatrix}40&amp;0\\0&amp;1\end{bmatrix}B^\top.
\end{aligned}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:7.4591em;vertical-align:-3.4796em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:3.9796em;"><span style="top:-6.5305em;"><span class="pstrut" style="height:3.45em;"></span><span class="mord"><span class="mord mathnormal">L</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="mclose">)</span></span></span><span style="top:-4.0305em;"><span class="pstrut" style="height:3.45em;"></span><span class="mord"><span class="mord mathnormal">G</span></span></span><span style="top:-0.9205em;"><span class="pstrut" style="height:3.45em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0813em;">H</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:3.4796em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:3.9796em;"><span style="top:-6.5305em;"><span class="pstrut" style="height:3.45em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8451em;"><span style="top:-2.655em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">2</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.345em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop"><span class="mord mathrm">tr</span></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.0813em;">H</span><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="mclose">)</span><span class="mpunct">,</span></span></span><span style="top:-4.0305em;"><span class="pstrut" style="height:3.45em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord mathnormal" style="margin-right:0.0813em;">H</span><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="mpunct">,</span></span></span><span style="top:-0.9205em;"><span class="pstrut" style="height:3.45em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">[</span></span><span class="mord"><span class="mtable"><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">40</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span><span class="arraycolsep" style="width:0.5em;"></span><span class="arraycolsep" style="width:0.5em;"></span><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">0</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">]</span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span></span></span></span></span><span class="mord">.</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:3.4796em;"><span></span></span></span></span></span></span></span></span></span></span></span></div>
<p>The mixed basis uses <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi><mo>=</mo><mstyle scriptlevel="0" displaystyle="false"><mfrac><mn>1</mn><msqrt><mn>2</mn></msqrt></mfrac></mstyle><mrow><mo fence="true">[</mo><mtable rowspacing="0.16em" columnalign="center center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>1</mn></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mo>−</mo><mn>1</mn></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>1</mn></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>1</mn></mstyle></mtd></mtr></mtable><mo fence="true">]</mo></mrow></mrow><annotation encoding="application/x-tex">B=\tfrac1{\sqrt2}\begin{bmatrix}1&amp;-1\\1&amp;1\end{bmatrix}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:2.4em;vertical-align:-0.95em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8451em;"><span style="top:-2.551em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord sqrt mtight"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.9128em;"><span class="svg-align" style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord mtight" style="padding-left:0.833em;">2</span></span><span style="top:-2.8728em;"><span class="pstrut" style="height:3em;"></span><span class="hide-tail mtight" style="min-width:0.853em;height:1.08em;"><svg xmlns="http://www.w3.org/2000/svg" width="400em" height="1.08em" viewBox="0 0 400000 1080" preserveAspectRatio="xMinYMin slice"><path d="M95,702
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l0 -0
c5.3,-9.3,12,-14,20,-14
H400000v40H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M834 80h400000v40h-400000z"/></svg></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.1272em;"><span></span></span></span></span></span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.538em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">[</span></span><span class="mord"><span class="mtable"><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">1</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span><span class="arraycolsep" style="width:0.5em;"></span><span class="arraycolsep" style="width:0.5em;"></span><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">−</span><span class="mord">1</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">]</span></span></span></span></span></span>;</span> the aligned basis uses <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi><mo>=</mo><mi>I</mi></mrow><annotation encoding="application/x-tex">B=I</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0785em;">I</span></span></span></span>.</span> All methods start at <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>W</mi><mn>0</mn></msub><mo>=</mo><mn>1.5</mn><mi>I</mi></mrow><annotation encoding="application/x-tex">W_0=1.5I</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">0</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord">1.5</span><span class="mord mathnormal" style="margin-right:0.0785em;">I</span></span></span></span>.</span> For these two choices of <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi></mrow><annotation encoding="application/x-tex">B</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span></span></span></span>,</span> their iterates stay in the slice <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>W</mi><mo>=</mo><mi>B</mi><mi mathvariant="normal">diag</mi><mo>⁡</mo><mo stretchy="false">(</mo><mi>a</mi><mo separator="true">,</mo><mi>b</mi><mo stretchy="false">)</mo><msup><mi>B</mi><mi mathvariant="normal">⊤</mi></msup></mrow><annotation encoding="application/x-tex">W=B\operatorname{diag}(a,b)B^\top</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.0991em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop"><span class="mord mathrm" style="margin-right:0.0139em;">diag</span></span><span class="mopen">(</span><span class="mord mathnormal">a</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal">b</span><span class="mclose">)</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">⊤</span></span></span></span></span></span></span></span></span></span></span>.</span> Substitution gives the two-dimensional loss plotted above. The code updates all four matrix entries, then reads off <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi></mrow><annotation encoding="application/x-tex">a</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">a</span></span></span></span></span> and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>b</mi></mrow><annotation encoding="application/x-tex">b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">b</span></span></span></span>.</span></p>
<p>SGD has no momentum and starts with learning rate <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0.04</mn></mrow><annotation encoding="application/x-tex">0.04</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.04</span></span></span></span>.</span> AdamW starts at <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0.08</mn></mrow><annotation encoding="application/x-tex">0.08</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.08</span></span></span></span></span> or <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0.32</mn></mrow><annotation encoding="application/x-tex">0.32</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.32</span></span></span></span>,</span> with <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>β</mi><mn>1</mn></msub><mo>=</mo><mn>0.8</mn></mrow><annotation encoding="application/x-tex">\beta_1=0.8</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0528em;">β</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0528em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.8</span></span></span></span>,</span> <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>β</mi><mn>2</mn></msub><mo>=</mo><mn>0.9</mn></mrow><annotation encoding="application/x-tex">\beta_2=0.9</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0528em;">β</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0528em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.9</span></span></span></span></span> and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ε</mi><mo>=</mo><msup><mn>10</mn><mrow><mo>−</mo><mn>8</mn></mrow></msup></mrow><annotation encoding="application/x-tex">\varepsilon=10^{-8}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">ε</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8141em;"></span><span class="mord">1</span><span class="mord"><span class="mord">0</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">−</span><span class="mord mtight">8</span></span></span></span></span></span></span></span></span></span></span></span>.</span> Muon starts at <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0.08</mn></mrow><annotation encoding="application/x-tex">0.08</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.08</span></span></span></span>,</span> with <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>=</mo><mn>0.8</mn></mrow><annotation encoding="application/x-tex">\beta=0.8</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.0528em;">β</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">0.8</span></span></span></span>,</span> five quintic iterations and <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ε</mi><mo>=</mo><msup><mn>10</mn><mrow><mo>−</mo><mn>7</mn></mrow></msup></mrow><annotation encoding="application/x-tex">\varepsilon=10^{-7}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">ε</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8141em;"></span><span class="mord">1</span><span class="mord"><span class="mord">0</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">−</span><span class="mord mtight">7</span></span></span></span></span></span></span></span></span></span></span></span>,</span> without Nesterov or a shape multiplier. Every method has zero weight decay, so AdamW is equivalent to Adam in this example. Momentum histories start at zero; AdamW applies bias correction.</p>
<p>Each method scales its initial rate by the same schedule over 80 training steps:</p>
<div class="math-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>η</mi><mi>t</mi></msub><mo>=</mo><msub><mi>η</mi><mn>0</mn></msub><mrow><mo fence="true">[</mo><mn>0.1</mn><mo>+</mo><mn>0.45</mn><mrow><mo fence="true">(</mo><mn>1</mn><mo>+</mo><mi>cos</mi><mo>⁡</mo><mfrac><mrow><mi>π</mi><mi>t</mi></mrow><mn>80</mn></mfrac><mo fence="true">)</mo></mrow><mo fence="true">]</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\eta_t=\eta_0\left[0.1+0.45\left(1+\cos\frac{\pi t}{80}\right)\right].</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">η</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:2.4em;vertical-align:-0.95em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">η</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">0</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">[</span></span><span class="mord">0.1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord">0.45</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">(</span></span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mop">cos</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.2921em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">80</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">π</span><span class="mord mathnormal">t</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.686em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">)</span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">]</span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">.</span></span></span></span></span></div>
<p>Here <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>t</mi><mo>=</mo><mn>0</mn><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><mn>79</mn></mrow><annotation encoding="application/x-tex">t=0,\ldots,79</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6151em;"></span><span class="mord mathnormal">t</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8389em;vertical-align:-0.1944em;"></span><span class="mord">0</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner">…</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">79</span></span></span></span>.</span> These settings make the geometric effect visible. The basis and learning-rate controls let us test how fragile any claim about the winner would be. The five inner polynomial iterations belong to each Muon training step; they are a different count from the 80 steps on the horizontal axis.</p>
</details>

<p>That is the optimizer we set out to invent. Use the local loss prediction to choose a direction, decide what &quot;small&quot; means for a matrix, remember recent gradients, and approximate the resulting polar transform cheaply. The remaining question is how well those choices work on the model we actually want to train.</p>
<div id="what-we-just-built-and-where-to-go-next" class="section-alias" aria-hidden="true"></div>

<h2 id="where-these-choices-came-from"><a class="anchor" href="#where-these-choices-came-from" aria-label="Permalink">§</a>Where these choices came from</h2>
<p>We reconstructed the update by choosing a loss prediction, an output-change budget, a gradient average, and a short polynomial calculation. That is a route to understanding the method. For its historical development and experimental results:</p>
<ul>
<li><a href="https://kellerjordan.github.io/posts/muon/" target="_blank" rel="noopener noreferrer" class="external">Keller Jordan&#39;s original Muon writeup</a> describes the optimizer and its early experiments. Start here for the original account.</li>
<li><a href="https://proceedings.mlr.press/v267/bernstein25a.html" target="_blank" rel="noopener noreferrer" class="external">Modular Duality in Deep Learning</a>, by Bernstein and Newhouse, develops the broader norm-based framework and matrix iterations behind this route.</li>
<li><a href="https://arxiv.org/abs/2502.16982" target="_blank" rel="noopener noreferrer" class="external">Muon is Scalable for LLM Training</a>, by Liu and collaborators, studies weight decay, update scaling, distributed implementation, and the Moonlight models.</li>
<li><a href="https://arxiv.org/abs/2505.02222" target="_blank" rel="noopener noreferrer" class="external">Practical Efficiency of Muon for Pretraining</a>, by Essential AI, examines compute versus wall-clock time, large batches, and hyperparameter transfer with μP.</li>
<li><a href="https://arxiv.org/abs/2505.16932" target="_blank" rel="noopener noreferrer" class="external">The Polar Express</a>, by Amsel and collaborators, designs iteration-dependent polynomials for faster polar approximation and addresses low-precision computation.</li>
</ul>
<p>If I had to rebuild the argument, I&#39;d start with <span class="math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi><mi>x</mi></mrow><annotation encoding="application/x-tex">Dx</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="mord mathnormal">x</span></span></span></span>:</span> how much should one update be allowed to change the layer&#39;s output?</p>
<script src="/vendor/katex/katex.min.js"></script>
<script type="module" src="/muon-animations.js"></script>]]></content:encoded>
    </item>
    <item>
      <title>after the white rabbit: an Unlock! adventure from tabletop to 3D</title>
      <link>https://lucastononro.github.io/after-the-white-rabbit/</link>
      <guid isPermaLink="true">https://lucastononro.github.io/after-the-white-rabbit/</guid>
      <pubDate>Sat, 05 Sep 2026 12:00:00 GMT</pubDate>
      <description>A browser adventure inspired by Unlock!, built with Codex, Blender and Three.js. How we adapted the puzzles and fixed the models that got in their way.</description>
      <category>agents</category>
      <content:encoded><![CDATA[<p>I wanted a version of this game I could walk around in. Follow the rabbit through Wonderland, explore between puzzles and get close enough to inspect a clue. A room was fine when it fit the story. I just didn&#39;t want the whole thing stuck in one.</p>
<figure id="gameplay-recording" class="video"><video class="video-file" aria-label="New gameplay recording with continuous diagonal walking" controls playsinline preload="metadata" poster="/images/white-rabbit-gameplay.jpg" width="1280" height="720"><source src="https://github.com/lucastononro/lucastononro.github.io/releases/download/white-rabbit-diagonal-gameplay/after-the-white-rabbit-gameplay.mp4" type="video/mp4"></video><figcaption>Fresh gameplay at normal speed, with game audio and continuous diagonal walking. Recorded from chapter checkpoints; pop-up menus are omitted. Contains puzzle spoilers. <a href="https://github.com/lucastononro/lucastononro.github.io/releases/download/white-rabbit-diagonal-gameplay/after-the-white-rabbit-gameplay.mp4">Download the MP4 to share.</a></figcaption></figure>

<h2 id="what-is-unlock"><a class="anchor" href="#what-is-unlock" aria-label="Permalink">§</a>What is Unlock!?</h2>
<p><a href="https://www.spacecowboys-games.com/game/unlock/" target="_blank" rel="noopener noreferrer" class="external">Unlock!</a> is a series of cooperative escape-room card games from Space Cowboys. You play alone or with other people around a table, using a deck and a free companion app. The cards show locations, objects and clues. You look for hidden details, work out which objects belong together and solve puzzles to advance the story. The app checks codes, runs interactive puzzles and gives you hints. It also keeps time, with adventures usually designed for about an hour.</p>
<p><em>In Pursuit of the White Rabbit</em> is one of the three adventures in <a href="https://store.asmodee.com/products/unlock-heroic-adventures" target="_blank" rel="noopener noreferrer" class="external">Unlock! Heroic Adventures</a>. It takes Alice through Wonderland and its strange inhabitants. That gave this project both its story and its puzzle progression. I wanted to keep the deductions, then give you a world where you could make them by looking around and handling objects.</p>
<p>I worked with Codex from the <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf" target="_blank" rel="noopener noreferrer" class="external">French solution booklet</a>. Save that link for after playing. It contains the answers. We made original environments, models and an interface for a single-player, first-person browser game. The puzzle logic follows the tabletop adventure closely. This is an independent fan adaptation with no affiliation to Space Cowboys.</p>
<h2 id="a-place-between-the-puzzles"><a class="anchor" href="#a-place-between-the-puzzles" aria-label="Permalink">§</a>A place between the puzzles</h2>
<p>The hall stays indoors because its puzzles depend on scale. A table can be out of reach, and a door can be too small. Beyond it, you follow paths through a wooded valley to the bridges, the pepper-filled cottage and the tea clearing. The Queen&#39;s grounds have separate areas to explore before you reach the final construction.</p>
<p>I wanted a reason to walk somewhere. Small objects become discoverable when you get close, and some clues need a different viewing angle. The Explore menu helps you return to landmarks, while the journal records what you&#39;ve found. I also wanted time to look around, so this version has no countdown or penalty for a wrong answer.</p>
<h2 id="the-rabbit-had-to-behave-like-a-rabbit"><a class="anchor" href="#the-rabbit-had-to-behave-like-a-rabbit" aria-label="Permalink">§</a>The rabbit had to behave like a rabbit</h2>
<p>The rabbit was one of my first complaints. Bouncing the whole model up and down wasn&#39;t enough. We made separate animations in Blender for standing idle, hopping and checking his watch. His ears move with his head, and the pocket watch stays attached to his paw. He follows a route and waits when you fall behind.</p>
<p>The model is stylized, but the movement still has to make sense. Getting the ears and watch to follow the right body parts took attention.</p>
<h2 id="the-first-fidelity-pass"><a class="anchor" href="#the-first-fidelity-pass" aria-label="Permalink">§</a>The first fidelity pass</h2>
<p>When we checked the puzzles against the original, some were giving too much away. An early sign diagram drew most of its own solution. The journal explained the clock puzzle before you had to make the connection. We removed those explanations and revised the clues so you have to compare the messages and clocks yourself. The sign puzzle now asks you to trace its colored arrows.</p>
<p>The croquet puzzle had a different problem. It accepted the intended sequence even though the hedgehog rolled through an obstacle. We changed the lawn and made the shot checks use the visible geometry. A blocked shot now stops at the obstacle.</p>
<p>The guards were harder to model than they looked. An accidental difference between their uniforms became an extra clue, so we had to check every variation. At the tart, the pastry hid part of the crumb outline you needed to recognize. We cut the missing slice into the model and moved the crumbs into view. A sign also covered the gardeners&#39; tunic numbers. These were small modeling mistakes that made the puzzles unfair.</p>
<p>For the final house, we replaced a list of selected pieces with a construction you assemble. You place each part, turn the bridges over, remove mistakes and test whether it holds. This version of the puzzle needed another pass, described in the study below.</p>
<h2 id="the-first-release-still-had-bugs"><a class="anchor" href="#the-first-release-still-had-bugs" aria-label="Permalink">§</a>The first release still had bugs</h2>
<p>We published too early. Codex reported passing checks, and I still ran into overlapping doors before leaving the opening hall. I hadn&#39;t solved the game yet. The earlier review checked answers and selected checkpoints, but missed problems in the route between them.</p>
<p>The doors made that gap obvious. Their panels overlapped, and parts of the arches looked broken. Door 6 looked big enough to walk through at a size the game refused. Its triangular lock was a tiny symbol, and a separate height condition could stop a collected key from working. Knowing the intended solution wasn&#39;t enough to tell whether I was stuck on a puzzle or a bug.</p>
<figure><img src="/images/white-rabbit-repairs/doors-before.png" alt="The first release, with overlapping door panels and broken-looking arches." loading="lazy" width="1280" height="720"><figcaption>The first release, with overlapping door panels and broken-looking arches.</figcaption></figure>

<p><em>Before. This is the original published build, captured again without changing its models.</em></p>
<p>The original adventure asks Alice to shrink for this passage. The size rule was faithful, but our model gave the wrong evidence. We separated the doors and rebuilt the small opening to match the player&#39;s body. The triangular keyway is now part of a brass plate attached to the door. Once unlocked, the leaf swings open and you walk into the passage to leave the hall. The geometry and the interaction need to agree.</p>
<figure><img src="/images/white-rabbit-repairs/doors-after.png" alt="The repaired hall doors, with separate frames and a small passage at floor level." loading="lazy" width="1280" height="720"><figcaption>The repaired hall doors, with separate frames and a small passage at floor level.</figcaption></figure>

<p><em>After. The opening has to explain why shrinking helps before the game asks you to do it.</em></p>
<h3 id="the-wall-gave-away-the-answer"><a class="anchor" href="#the-wall-gave-away-the-answer" aria-label="Permalink">§</a>The wall gave away the answer</h3>
<p>Then I noticed something even simpler. Door 6 had a hole behind it. Door 9 had a solid wall. I could pick the right door by looking at the unfinished geometry, without comparing the key and locks at all.</p>
<div class="study-images">
<figure><img src="/images/white-rabbit-repairs/door-hole-reported.png" alt="My screenshot of Door 6, with the rectangular wall opening visible above and behind its arch." loading="lazy" width="840" height="876"><figcaption>My bug report. The gap behind Door 6 gives away which door leads somewhere.</figcaption></figure>
<figure><img src="/images/white-rabbit-repairs/door-solid-reported.png" alt="My comparison screenshot of Door 9 against an uninterrupted wall." loading="lazy" width="846" height="942"><figcaption>Door 9 has no matching gap. Comparing the scenery was enough to skip the deduction.</figcaption></figure>
</div>

<p>We rebuilt the casings in Blender. All five doors now have the same fitted jambs and arched interior, with solid wood covering the corners of the rectangular opening. Door 6 still opens into a passage after you unlock it.</p>
<figure><img src="/images/white-rabbit-repairs/door-reveal-after.png" alt="The repaired Door 6 viewed from above and to one side, with a solid casing covering the wall cutout." loading="lazy" width="1280" height="720"><figcaption>The repaired model in the game, viewed from above and to one side. The casing covers the cutout while the leaf remains hinged.</figcaption></figure>

<p>This was another accidental clue we had introduced. A correct answer check cannot catch that. We added checks from several player heights and side angles, including one through the passage after the leaf opens. The screenshots belong in the bug log too, because the first repair had left this problem behind.</p>
<p>The cake and bottle had another basic mistake. Both menus offered every size, so cake could shrink you and a drink could make you grow. Cake now offers larger sizes; the bottle offers smaller ones. Both stay available, so choosing the wrong size doesn&#39;t leave you stuck. This went into the <a href="https://github.com/lucastononro/lucastononro.github.io/blob/main/games/white-rabbit/docs/BUGS.md" target="_blank" rel="noopener noreferrer" class="external">bug log</a> with the door failures and the rest of the repair pass.</p>
<h2 id="reading-and-moving-on-a-phone"><a class="anchor" href="#reading-and-moving-on-a-phone" aria-label="Permalink">§</a>Reading and moving on a phone</h2>
<p>The first phone layout was hard to read and use. The book had small controls and a scrollable list inside a scrollable popup. That cost space in landscape and made it easy to scroll the wrong part of the page.</p>
<figure><img src="/images/white-rabbit-repairs/phone-before.png" alt="The first phone popup, with a narrow reading panel and small book controls." loading="lazy" width="1280" height="720"><figcaption>The first phone popup, with a narrow reading panel and small book controls.</figcaption></figure>

<p><em>Before, in the browser&#39;s 844 by 390 phone layout.</em></p>
<p>We gave phone puzzles the full width, enlarged the buttons and removed the extra scroll region. Close stays in a pinned toolbar. A separate Look at the clue button lets you switch back to the scene without losing your place in the puzzle.</p>
<figure><img src="/images/white-rabbit-repairs/phone-after.png" alt="The revised phone popup, with a pinned toolbar and larger book controls." loading="lazy" width="1280" height="720"><figcaption>The revised phone popup, with a pinned toolbar and larger book controls.</figcaption></figure>

<p><em>After, at the same game viewport size.</em></p>
<p>The keyboard needs room too. We added a check with the available height reduced to 210 pixels, then made the answer field and submit button reachable in that space. This is a browser layout check, not evidence from a physical phone.</p>
<figure><img src="/images/white-rabbit-repairs/phone-keyboard-space.png" alt="The answer field and submit button visible in a shortened phone viewport." loading="lazy" width="1280" height="720"><figcaption>The answer field and submit button visible in a shortened phone viewport.</figcaption></figure>

<p><em>Reduced-height check with sample input. The keyboard itself is not being emulated.</em></p>
<p>Walking also felt twitchy and slow. We smoothed the joystick response, reduced look sensitivity and added a Run toggle. Small Alice still enters the second chapter because that follows the source, and the mushroom belongs to that part of the story. We removed the outdoor speed penalty. Looking small shouldn&#39;t turn the trip to the next clue into a crawl.</p>
<p>The residents needed another Blender pass as well. The frog and caterpillar were mostly static shapes, and the caterpillar got in the way of its appointment clock. The new characters have moving joints and facial animation. The cook&#39;s spoon stays in the cauldron, the Hatter raises his cup, and the Queen gestures while holding her scepter. We preserved the clue props and left the gardeners&#39; numbers and guards&#39; uniform differences alone.</p>
<p>The cook was a useful lesson in checking animation inside the scene. Her new face sat behind the old kitchen sign, and her stirring hand dipped below the pot&#39;s solid top. We moved the sign onto the counter front, raised the hand and lengthened the spoon. A spare hat also hid the Hatter&#39;s face. We moved that prop to the other end of the table and kept its price tag.</p>
<figure><img src="/images/white-rabbit-repairs/frog.png" alt="The frog messenger rebuilt in Blender, with separate limbs and facial features." loading="lazy" width="900" height="900"><figcaption>The frog messenger rebuilt in Blender, with separate limbs and facial features.</figcaption></figure>

<p><em>Blender model view of the revised frog. His speaking motion uses the mouth and throat; his body no longer has to bounce to suggest life.</em></p>
<figure><img src="/images/white-rabbit-repairs/cook-blender.png" alt="The cook&#x27;s raised stirring hand and face clear the cauldron in the Blender inspection render." loading="lazy" width="1280" height="720"><figcaption>The cook&#x27;s raised stirring hand and face clear the cauldron in the Blender inspection render.</figcaption></figure>

<p><em>Blender inspection render. The spoon still reaches inside the pot while the hand stays above its rim.</em></p>
<h2 id="what-the-recorded-run-caught"><a class="anchor" href="#what-the-recorded-run-caught" aria-label="Permalink">§</a>What the recorded run caught</h2>
<p>Recording the solution became another test. The fan could clear smoke while I stood beside a solid kitchen wall. We restricted it to the open front and made assisted walking approach that entrance. Closing the little passage&#39;s popup also used to reopen it immediately. It now responds when you enter, so closing it lets you move again.</p>
<p>Slow rendering exposed a separate walking bug. The game counted at most 50 milliseconds per frame, so a slow frame also slowed the player&#39;s travel. We corrected the timing and split movement into short collision steps. Assisted walking now keeps its remaining movement when it reaches a waypoint. This fixes lost travel time; it doesn&#39;t promise a particular frame rate on a phone.</p>
<p>The court&#39;s approach had a wall across part of the road. We pulled that wall back and widened the hedge opening. The source of this one was embarrassingly familiar. The visible world and the walking rules had been built separately.</p>
<figure><img src="/images/white-rabbit-repairs/court-road-before.png" alt="A castle wall covering part of the road into the court during the repair playthrough." loading="lazy" width="1280" height="720"><figcaption>A castle wall covering part of the road into the court during the repair playthrough.</figcaption></figure>

<p><em>Caught during the recording. This is an intermediate build in the repair pass, not the first published release.</em></p>
<figure><img src="/images/white-rabbit-repairs/court-road-after.png" alt="The repaired approach, with the road visible through the court entrance." loading="lazy" width="1280" height="720"><figcaption>The repaired approach, with the road visible through the court entrance.</figcaption></figure>

<p><em>The final entrance checked in the game. The path continues around the low maze.</em></p>
<p>The earlier repair run reaches the ending through all 25 puzzles. It uses known answers and resumes ordinary saved progress after the fixes found along the way. I kept the video and solution screenshots in the <a href="#full-walkthrough">walkthrough below</a>. It is useful evidence that the route works, but a first-time player may still find a clue confusing in a way this run couldn&#39;t reveal.</p>
<p>I put too much weight on the answer checks. A player also has to recognize the opening, turn the key, reach the input field and walk to the next scene. Those actions need a playthrough with the actual controls. The first release hadn&#39;t earned the confidence we gave it.</p>
<h2 id="keeping-the-game-while-changing-the-medium"><a class="anchor" href="#keeping-the-game-while-changing-the-medium" aria-label="Permalink">§</a>Keeping the game while changing the medium</h2>
<p>Changing your height and comparing uniforms both work in 3D. Other puzzles rely on the cards themselves, so we had to adapt them. Matching the gardeners becomes a tool chest with matching seals. Recoloring a card header becomes painting the roses in front of you. French sound puzzles have English equivalents.</p>
<p>The <a href="https://github.com/lucastononro/lucastononro.github.io/blob/main/games/white-rabbit/docs/FIDELITY-AUDIT.md" target="_blank" rel="noopener noreferrer" class="external">fidelity audit</a> records those changes and compares the puzzles with the original. It contains spoilers too.</p>
<p>On a phone, turn it sideways. Walk with the left joystick and look around with the right pad. Interact and Explore sit beside it, and both thumbs can work at once. Phone mode starts with reduced graphics. Your progress saves in the browser.</p>
<p>The automated checks cover puzzle answers, progression, saves, walking routes, animation attachments, construction rules and touch input. They missed the first-release failures above. The repair log records what we found and the checks for each fix. We still haven&#39;t tested on a physical phone.</p>
<p><a href="/games/white-rabbit/">Play After the White Rabbit</a>. The study and walkthrough below contain the solutions.</p>
<section class="spoiler-notice" aria-label="Spoilers ahead"><strong>Solutions from here onward.</strong><p>The study compares every deduction with the original. The full walkthrough follows it on this page. <a href="#full-walkthrough">Jump to the walkthrough</a> or <a href="/games/white-rabbit/">return to the game</a>.</p></section>

<h2 id="study-appendix-puzzle-by-puzzle"><a class="anchor" href="#study-appendix-puzzle-by-puzzle" aria-label="Permalink">§</a>Study appendix: puzzle by puzzle</h2>
<p>The last puzzle made the limits of our first adaptation obvious. Clicking a floor ring moved the camera to an exact view and recorded its number. A separate set of painted strips appeared after construction. You could finish without doing much looking.</p>
<figure><img src="/images/white-rabbit-walkthrough/amber.png" alt="The earlier final puzzle, with a floating amber number and an automatic viewpoint." loading="lazy" width="1280" height="720"><figcaption>The earlier final puzzle, with a floating amber number and an automatic viewpoint.</figcaption></figure>

<p><em>Before. Captured from the earlier repair build. The ring supplied the view and recorded the answer without asking you to read it.</em></p>
<p>We rebuilt the house in Blender with folded, ribbed surfaces and put the paint directly on those surfaces. Moving a piece now moves its part of the image. You choose a piece and a socket, swap mistakes, turn the bridges over, then adjust your viewing angle and eye height. Nothing records a sightline until you enter the number you read.</p>
<p>Our first attempt at the replacement used flatter folds. The number stayed too readable from an oblique view, so we added depth to break the strokes apart. We also had to give each fold an unpainted underside. Otherwise the opposite color showed through from behind.</p>
<p>The ribs are our own architectural choice. They give the paint changes in depth and let it break apart as you move. We still use fixed sockets, so this does not reproduce the dexterity of balancing paper. The booklet&#39;s written sequence has nine items while its numbered diagram has eight; we follow the written sequence.</p>
<div class="study-images">
<figure><img src="/images/white-rabbit-study/source-perspective.png" alt="The original solution's two views of the folded house." loading="lazy" width="568" height="310"><figcaption>Original perspective diagram, cropped from <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf#page=7">the supplied solution, PDF page 7</a>. Artwork credited to Space Cowboys.</figcaption></figure>
<figure><img src="/images/white-rabbit-study/amber-aligned.png" alt="The rebuilt house with its amber paint aligned by the player." loading="lazy" width="1280" height="720"><figcaption>Our rebuilt surfaces in the browser. The paint belongs to the pieces and obeys the scene's depth.</figcaption></figure>
</div>

<figure><img src="/images/white-rabbit-study/amber-offset.png" alt="The painted surfaces viewed before alignment." loading="lazy" width="1280" height="720"><figcaption>The painted surfaces viewed before alignment.</figcaption></figure>

<p><em>Before adjusting the viewpoint. Dragging the scene or using the two sliders changes where you look from.</em></p>
<p>These comparisons are grouped by deduction and interaction, so their count differs from the game&#39;s completion counter. Each pair shows a crop from the original solution beside a screenshot of our adaptation. Click either image to enlarge it. The PDF links open the source page. Original artwork is credited to Space Cowboys; the browser screenshots come from our recorded playthroughs and repair checks. The house images show the latest rebuild.</p>
<p>Some original tasks run in the companion app. For those, the crop shows the relevant card or instruction in the solution booklet, rather than an app screen. The notes describe where our version changes the task.</p>
<section class="puzzle-study" id="puzzle-study-1"><h4>01. The storybook</h4><div class="puzzle-compare"><div><h5>Original · <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf#page=1">PDF p. 1</a></h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/original-01.webp" aria-label="Enlarge original image for puzzle 1"><img src="/images/white-rabbit-study/original-01.webp" alt="The torn story fragments in the solution booklet." loading="lazy" decoding="async" width="390" height="375"></a><figcaption>The torn story fragments in the solution booklet.</figcaption></figure><p>Order ten memories; read highlighted numbers.</p></div><div><h5>Our 3D adaptation</h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/adapted-01.webp" aria-label="Enlarge adapted image for puzzle 1"><img src="/images/white-rabbit-study/adapted-01.webp" alt="The story fragments in our book interface." loading="lazy" decoding="async" width="1280" height="720"></a><figcaption>The story fragments in our book interface.</figcaption></figure><p>We kept the chronological deduction in a book on the hall table. Dragging fragments is close to the paper task; the arrow buttons make it possible on a phone. The scene gives the book a place, but this is still mostly a reading puzzle.</p></div></div></section>

<section class="puzzle-study" id="puzzle-study-2"><h4>02. The sideways letter and its shadow</h4><div class="puzzle-compare"><div><h5>Original · <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf#page=1">PDF p. 1</a></h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/original-02.webp" aria-label="Enlarge original image for puzzle 2"><img src="/images/white-rabbit-study/original-02.webp" alt="The rotated M and its second shape." loading="lazy" decoding="async" width="647" height="207"></a><figcaption>The rotated M and its second shape.</figcaption></figure><p>Rotate M; include its shadow.</p></div><div><h5>Our 3D adaptation</h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/adapted-02.webp" aria-label="Enlarge adapted image for puzzle 2"><img src="/images/white-rabbit-study/adapted-02.webp" alt="The brass letter after rotation, with the second shape behind it." loading="lazy" decoding="async" width="1280" height="720"></a><figcaption>The brass letter after rotation, with the second shape behind it.</figcaption></figure><p>A brass shape rotates in the room, with a second shape behind it. This transfers well because the player changes an object&#x27;s orientation and looks again. The second shape is deliberately modeled; it is not a physically simulated shadow.</p></div></div></section>

<section class="puzzle-study" id="puzzle-study-3"><h4>03. The cat&#x27;s arithmetic</h4><div class="puzzle-compare"><div><h5>Original · <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf#page=2">PDF p. 2</a></h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/original-03.webp" aria-label="Enlarge original image for puzzle 3"><img src="/images/white-rabbit-study/original-03.webp" alt="The cat and the multiplication clue." loading="lazy" decoding="async" width="195" height="366"></a><figcaption>The cat and the multiplication clue.</figcaption></figure><p>Continue the unusual multiplication sequence.</p></div><div><h5>Our 3D adaptation</h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/adapted-03.webp" aria-label="Enlarge adapted image for puzzle 3"><img src="/images/white-rabbit-study/adapted-03.webp" alt="The same sequence on the hall blackboard." loading="lazy" decoding="async" width="1280" height="720"></a><figcaption>The same sequence on the hall blackboard.</figcaption></figure><p>The equations live on a blackboard. The reasoning is almost unchanged. Giving a written puzzle a 3D wall does not add much by itself, so the board stays a short stop within the hall.</p></div></div></section>

<section class="puzzle-study" id="puzzle-study-4"><h4>04. The missing letter</h4><div class="puzzle-compare"><div><h5>Original · <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf#page=2">PDF p. 2</a></h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/original-04.webp" aria-label="Enlarge original image for puzzle 4"><img src="/images/white-rabbit-study/original-04.webp" alt="The doors form the missing A." loading="lazy" decoding="async" width="195" height="211"></a><figcaption>The doors form the missing A.</figcaption></figure><p>Door arrangement completes LICE.</p></div><div><h5>Our 3D adaptation</h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/adapted-04.webp" aria-label="Enlarge adapted image for puzzle 4"><img src="/images/white-rabbit-study/adapted-04.webp" alt="The repaired doors viewed together across the hall." loading="lazy" decoding="async" width="1280" height="720"></a><figcaption>The repaired doors viewed together across the hall.</figcaption></figure><p>The doors form the visual clue together. Our first frames overlapped and obscured it. Separating the openings mattered more than adding decoration, and examination now includes the whole wall.</p></div></div></section>

<section class="puzzle-study" id="puzzle-study-5"><h4>05. Growing to the key</h4><div class="puzzle-compare"><div><h5>Original · <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf#page=2">PDF p. 2</a></h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/original-05.webp" aria-label="Enlarge original image for puzzle 5"><img src="/images/white-rabbit-study/original-05.webp" alt="The scale, table and cake explain how to reach the key." loading="lazy" decoding="async" width="600" height="266"></a><figcaption>The scale, table and cake explain how to reach the key.</figcaption></figure><p>Compare Alice&#x27;s height with the table.</p></div><div><h5>Our 3D adaptation</h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/adapted-05.webp" aria-label="Enlarge adapted image for puzzle 5"><img src="/images/white-rabbit-study/adapted-05.webp" alt="Alice at the high table after eating cake." loading="lazy" decoding="async" width="1280" height="720"></a><figcaption>Alice at the high table after eating cake.</figcaption></figure><p>The high table, height scale and key share a room. Eating raises the camera and makes the key reachable. This replaces card-number arithmetic with a physical reach requirement. Cake can no longer shrink Alice.</p></div></div></section>

<section class="puzzle-study" id="puzzle-study-6"><h4>06. The triangular lock</h4><div class="puzzle-compare"><div><h5>Original · <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf#page=2">PDF p. 2</a></h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/original-06.webp" aria-label="Enlarge original image for puzzle 6"><img src="/images/white-rabbit-study/original-06.webp" alt="The triangular key combines with door 6." loading="lazy" decoding="async" width="413" height="148"></a><figcaption>The triangular key combines with door 6.</figcaption></figure><p>Match the key to door six.</p></div><div><h5>Our 3D adaptation</h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/adapted-06.webp" aria-label="Enlarge adapted image for puzzle 6"><img src="/images/white-rabbit-study/adapted-06.webp" alt="The matching triangular keyway in the door." loading="lazy" decoding="async" width="1280" height="720"></a><figcaption>The matching triangular keyway in the door.</figcaption></figure><p>You compare the tooth with a brass keyway and turn the key in a hinged door. A previous extra height check blocked a key already in the satchel. Removing that check lets the visible lock explain the interaction.</p></div></div></section>

<section class="puzzle-study" id="puzzle-study-7"><h4>07. Shrinking through the opening</h4><div class="puzzle-compare"><div><h5>Original · <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf#page=2">PDF p. 2</a></h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/original-07.webp" aria-label="Enlarge original image for puzzle 7"><img src="/images/white-rabbit-study/original-07.webp" alt="The bottle and height scale show the small-door clearance." loading="lazy" decoding="async" width="582" height="203"></a><figcaption>The bottle and height scale show the small-door clearance.</figcaption></figure><p>Drink to fit the small door.</p></div><div><h5>Our 3D adaptation</h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/adapted-07.webp" aria-label="Enlarge adapted image for puzzle 7"><img src="/images/white-rabbit-study/adapted-07.webp" alt="The opening at the smaller player size." loading="lazy" decoding="async" width="1280" height="720"></a><figcaption>The opening at the smaller player size.</figcaption></figure><p>The bottle lowers Alice&#x27;s size and the player crosses a real opening. We rebuilt its dimensions after the first doorway looked passable at sizes the code refused. The bottle remains reusable.</p></div></div></section>

<section class="puzzle-study" id="puzzle-study-8"><h4>08. The missing feet</h4><div class="puzzle-compare"><div><h5>Original · <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf#page=3">PDF p. 3</a></h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/original-08.webp" aria-label="Enlarge original image for puzzle 8"><img src="/images/white-rabbit-study/original-08.webp" alt="The two sides of the card give 89 and 12." loading="lazy" decoding="async" width="369" height="144"></a><figcaption>The two sides of the card give 89 and 12.</figcaption></figure><p>Subtract the visible measure from 89.</p></div><div><h5>Our 3D adaptation</h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/adapted-08.webp" aria-label="Enlarge adapted image for puzzle 8"><img src="/images/white-rabbit-study/adapted-08.webp" alt="The missing-feet subtraction inside the passage." loading="lazy" decoding="async" width="1280" height="720"></a><figcaption>The missing-feet subtraction inside the passage.</figcaption></figure><p>The small passage presents the same subtraction. The act of crossing replaces combining cards. The popup now waits for a new entry instead of reopening every frame after being closed.</p></div></div></section>

<section class="puzzle-study" id="puzzle-study-9"><h4>09. Looking up</h4><div class="puzzle-compare"><div><h5>Original · <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf#page=3">PDF p. 3</a></h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/original-09.webp" aria-label="Enlarge original image for puzzle 9"><img src="/images/white-rabbit-study/original-09.webp" alt="The booklet tells the player to point the device upward." loading="lazy" decoding="async" width="705" height="152"></a><figcaption>The booklet tells the player to point the device upward.</figcaption></figure><p>Point the phone toward the ceiling.</p></div><div><h5>Our 3D adaptation</h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/adapted-09.webp" aria-label="Enlarge adapted image for puzzle 9"><img src="/images/white-rabbit-study/adapted-09.webp" alt="Looking upward inside the passage triggers the move to the woods." loading="lazy" decoding="async" width="1280" height="720"></a><figcaption>Looking upward inside the passage triggers the move to the woods.</figcaption></figure><p>We use the camera&#x27;s upward look to leave the hall. That preserves the change in attention but replaces the original device gesture. Desktop dragging and the phone look pad both work without motion-sensor permission.</p></div></div></section>

<section class="puzzle-study" id="puzzle-study-10"><h4>10. The caterpillar&#x27;s smoke</h4><div class="puzzle-compare"><div><h5>Original · <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf#page=3">PDF p. 3</a></h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/original-10.webp" aria-label="Enlarge original image for puzzle 10"><img src="/images/white-rabbit-study/original-10.webp" alt="The caterpillar hides two digits in smoke." loading="lazy" decoding="async" width="316" height="145"></a><figcaption>The caterpillar hides two digits in smoke.</figcaption></figure><p>Find the digits in smoke.</p></div><div><h5>Our 3D adaptation</h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/adapted-10.webp" aria-label="Enlarge adapted image for puzzle 10"><img src="/images/white-rabbit-study/adapted-10.webp" alt="The smoke rings above our caterpillar." loading="lazy" decoding="async" width="1280" height="720"></a><figcaption>The smoke rings above our caterpillar.</figcaption></figure><p>Smoke rings form the visual clue above the caterpillar. We had to include them in the examination frame and keep the animated body clear of the clock. A good character animation can still ruin a puzzle if it hides the evidence.</p></div></div></section>

<section class="puzzle-study" id="puzzle-study-11"><h4>11. The solitary mushroom</h4><div class="puzzle-compare"><div><h5>Original · <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf#page=3">PDF p. 3</a></h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/original-11.webp" aria-label="Enlarge original image for puzzle 11"><img src="/images/white-rabbit-study/original-11.webp" alt="The unique mushroom on a card back." loading="lazy" decoding="async" width="326" height="195"></a><figcaption>The unique mushroom on a card back.</figcaption></figure><p>Find the unique mushroom; recover scale.</p></div><div><h5>Our 3D adaptation</h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/adapted-11.webp" aria-label="Enlarge adapted image for puzzle 11"><img src="/images/white-rabbit-study/adapted-11.webp" alt="The spotted mushroom among the trees." loading="lazy" decoding="async" width="1280" height="720"></a><figcaption>The spotted mushroom among the trees.</figcaption></figure><p>A separate mushroom sits among roots, with countable spots. Alice reaches the woods small and regains normal size here. We removed the outdoor speed penalty so this story beat does not make exploration drag.</p></div></div></section>

<section class="puzzle-study" id="puzzle-study-12"><h4>12. The messenger</h4><div class="puzzle-compare"><div><h5>Original · <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf#page=4">PDF p. 4</a></h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/original-12.webp" aria-label="Enlarge original image for puzzle 12"><img src="/images/white-rabbit-study/original-12.webp" alt="The frog appointment and its message." loading="lazy" decoding="async" width="373" height="144"></a><figcaption>The frog appointment and its message.</figcaption></figure><p>Hear the repeated number homophone.</p></div><div><h5>Our 3D adaptation</h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/adapted-12.webp" aria-label="Enlarge adapted image for puzzle 12"><img src="/images/white-rabbit-study/adapted-12.webp" alt="Our frog with the English dialogue and transcript." loading="lazy" decoding="async" width="1280" height="720"></a><figcaption>Our frog with the English dialogue and transcript.</figcaption></figure><p>The frog uses won/one in English, with optional speech and a transcript. This preserves listening for a repeated sound rather than translating the French dialogue word for word. His mouth and throat now move during speech.</p></div></div></section>

<section class="puzzle-study" id="puzzle-study-13"><h4>13. The fan and pepper kitchen</h4><div class="puzzle-compare"><div><h5>Original · <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf#page=4">PDF p. 4</a></h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/original-13.webp" aria-label="Enlarge original image for puzzle 13"><img src="/images/white-rabbit-study/original-13.webp" alt="The fan clears the smoke from the kitchen card." loading="lazy" decoding="async" width="461" height="144"></a><figcaption>The fan clears the smoke from the kitchen card.</figcaption></figure><p>Find the fan; clear the smoke.</p></div><div><h5>Our 3D adaptation</h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/adapted-13.webp" aria-label="Enlarge adapted image for puzzle 13"><img src="/images/white-rabbit-study/adapted-13.webp" alt="Using the fan at the open kitchen front." loading="lazy" decoding="async" width="1280" height="720"></a><figcaption>Using the fan at the open kitchen front.</figcaption></figure><p>You collect a fan in the valley and sweep it at the cottage&#x27;s open front. Card combination becomes a tool action. The first version accepted the side wall as an approach, which broke the scene&#x27;s logic even though progression worked.</p></div></div></section>

<section class="puzzle-study" id="puzzle-study-14"><h4>14. Tea with the Hatter</h4><div class="puzzle-compare"><div><h5>Original · <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf#page=4">PDF p. 4</a></h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/original-14.webp" aria-label="Enlarge original image for puzzle 14"><img src="/images/white-rabbit-study/original-14.webp" alt="The hat distraction and the tea-to-T deduction." loading="lazy" decoding="async" width="507" height="279"></a><figcaption>The hat distraction and the tea-to-T deduction.</figcaption></figure><p>Ignore the hat; hear tea/T.</p></div><div><h5>Our 3D adaptation</h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/adapted-14.webp" aria-label="Enlarge adapted image for puzzle 14"><img src="/images/white-rabbit-study/adapted-14.webp" alt="The Hatter, his price tag and the tea table." loading="lazy" decoding="async" width="1280" height="720"></a><figcaption>The Hatter, his price tag and the tea table.</figcaption></figure><p>The tea-to-letter deduction survives in English. The price tag stays visible as a distraction. We moved the spare hat because it concealed the new Hatter&#x27;s face, while keeping the clue props.</p></div></div></section>

<section class="puzzle-study" id="puzzle-study-15"><h4>15. The four appointments</h4><div class="puzzle-compare"><div><h5>Original · <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf#page=4">PDF p. 4</a></h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/original-15.webp" aria-label="Enlarge original image for puzzle 15"><img src="/images/white-rabbit-study/original-15.webp" alt="Four messages above their appointment clocks." loading="lazy" decoding="async" width="472" height="241"></a><figcaption>Four messages above their appointment clocks.</figcaption></figure><p>Order messages; read minute hands.</p></div><div><h5>Our 3D adaptation</h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/adapted-15.webp" aria-label="Enlarge adapted image for puzzle 15"><img src="/images/white-rabbit-study/adapted-15.webp" alt="The ordered messages beside our clock faces." loading="lazy" decoding="async" width="1280" height="720"></a><figcaption>The ordered messages beside our clock faces.</figcaption></figure><p>Four visits give messages, and the player orders them beside the clocks. This keeps the cross-reference between text and hands. An early journal entry explained that connection too soon; we removed it.</p></div></div></section>

<section class="puzzle-study" id="puzzle-study-16"><h4>16. The colored crossing</h4><div class="puzzle-compare"><div><h5>Original · <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf#page=5">PDF p. 5</a></h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/original-16.webp" aria-label="Enlarge original image for puzzle 16"><img src="/images/white-rabbit-study/original-16.webp" alt="The four traced paths in the solution." loading="lazy" decoding="async" width="593" height="336"></a><figcaption>The four traced paths in the solution.</figcaption></figure><p>Trace arrows in EXIT color order.</p></div><div><h5>Our 3D adaptation</h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/adapted-16.webp" aria-label="Enlarge adapted image for puzzle 16"><img src="/images/white-rabbit-study/adapted-16.webp" alt="Tracing one colored route on our sign table." loading="lazy" decoding="async" width="1280" height="720"></a><figcaption>Tracing one colored route on our sign table.</figcaption></figure><p>The mixed signs occupy a table and draw trails only as you trace them. A previous diagram showed the completed shapes before any deduction. The revised table preserves the tracing task but uses a new layout.</p></div></div></section>

<section class="puzzle-study" id="puzzle-study-17"><h4>17. The three hedge paths</h4><div class="puzzle-compare"><div><h5>Original · <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf#page=5">PDF p. 5-6</a></h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/original-17.webp" aria-label="Enlarge original image for puzzle 17"><img src="/images/white-rabbit-study/original-17.webp" alt="The hedge map and its three size modifiers." loading="lazy" decoding="async" width="298" height="299"></a><figcaption>The hedge map and its three size modifiers.</figcaption></figure><p>Apply three operations to Alice&#x27;s size.</p></div><div><h5>Our 3D adaptation</h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/adapted-17.webp" aria-label="Enlarge adapted image for puzzle 17"><img src="/images/white-rabbit-study/adapted-17.webp" alt="The three paths and their arithmetic controls." loading="lazy" decoding="async" width="1280" height="720"></a><figcaption>The three paths and their arithmetic controls.</figcaption></figure><p>The same calculations open gates to the garden, tribunal and croquet lawn. Separate paths make the court explorable. We also repaired a wall across its approach; correct gate arithmetic was not enough to make the route work.</p></div></div></section>

<section class="puzzle-study" id="puzzle-study-18"><h4>18. Recognizing the gardeners</h4><div class="puzzle-compare"><div><h5>Original · <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf#page=5">PDF p. 5</a></h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/original-18.webp" aria-label="Enlarge original image for puzzle 18"><img src="/images/white-rabbit-study/original-18.webp" alt="The gardeners match symbols on a card back." loading="lazy" decoding="async" width="251" height="176"></a><figcaption>The gardeners match symbols on a card back.</figcaption></figure><p>Match gardeners with their card-back symbols.</p></div><div><h5>Our 3D adaptation</h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/adapted-18.webp" aria-label="Enlarge adapted image for puzzle 18"><img src="/images/white-rabbit-study/adapted-18.webp" alt="The numbered gardeners beside the tool chest." loading="lazy" decoding="async" width="1280" height="720"></a><figcaption>The numbered gardeners beside the tool chest.</figcaption></figure><p>Their tunic numbers identify seals on a tool chest. This is a larger translation because there is no deck to search. The chest gives the observation a use, but loses the original familiarity of noticing a previously seen card back.</p></div></div></section>

<section class="puzzle-study" id="puzzle-study-19"><h4>19. Painting the roses</h4><div class="puzzle-compare"><div><h5>Original · <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf#page=5">PDF p. 5</a></h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/original-19.webp" aria-label="Enlarge original image for puzzle 19"><img src="/images/white-rabbit-study/original-19.webp" alt="Painting the white card header makes a new combination." loading="lazy" decoding="async" width="373" height="153"></a><figcaption>Painting the white card header makes a new combination.</figcaption></figure><p>Recolor the white card header.</p></div><div><h5>Our 3D adaptation</h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/adapted-19.webp" aria-label="Enlarge adapted image for puzzle 19"><img src="/images/white-rabbit-study/adapted-19.webp" alt="The brush applies red paint to the white blooms." loading="lazy" decoding="async" width="1280" height="720"></a><figcaption>The brush applies red paint to the white blooms.</figcaption></figure><p>We turn the card-header trick into painting five roses. The story action fits the garden and gives the player a tool, but it changes the deduction substantially. This is an adaptation choice, not an equivalent mechanism.</p></div></div></section>

<section class="puzzle-study" id="puzzle-study-20"><h4>20. The stolen tart</h4><div class="puzzle-compare"><div><h5>Original · <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf#page=6">PDF p. 6</a></h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/original-20.webp" aria-label="Enlarge original image for puzzle 20"><img src="/images/white-rabbit-study/original-20.webp" alt="The crumb outline points to the heart suit." loading="lazy" decoding="async" width="270" height="258"></a><figcaption>The crumb outline points to the heart suit.</figcaption></figure><p>Recognize the suit in crumbs.</p></div><div><h5>Our 3D adaptation</h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/adapted-20.webp" aria-label="Enlarge adapted image for puzzle 20"><img src="/images/white-rabbit-study/adapted-20.webp" alt="The cut pastry and its visible crumb trail." loading="lazy" decoding="async" width="1280" height="720"></a><figcaption>The cut pastry and its visible crumb trail.</figcaption></figure><p>The missing pastry wedge and crumbs sit together in the world. We cut the slice from the actual model and moved crumbs out from under it. The player should be able to see the shape without guessing what the artist intended.</p></div></div></section>

<section class="puzzle-study" id="puzzle-study-21"><h4>21. The guards&#x27; disguise</h4><div class="puzzle-compare"><div><h5>Original · <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf#page=6">PDF p. 6</a></h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/original-21.webp" aria-label="Enlarge original image for puzzle 21"><img src="/images/white-rabbit-study/original-21.webp" alt="The two guards and seven annotated differences." loading="lazy" decoding="async" width="584" height="255"></a><figcaption>The two guards and seven annotated differences.</figcaption></figure><p>Find seven differences between guards.</p></div><div><h5>Our 3D adaptation</h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/adapted-21.webp" aria-label="Enlarge adapted image for puzzle 21"><img src="/images/white-rabbit-study/adapted-21.webp" alt="Two cropped examination views, with the guard on duty at left and the disguised guard at right." loading="lazy" decoding="async" width="760" height="660"></a><figcaption>Two cropped examination views, with the guard on duty at left and the disguised guard at right.</figcaption></figure><p>Two inspectable uniforms retain seven deliberate differences. We removed an accidental eighth change. This puzzle needs a controlled comparison more than character variety; even a decorative change can become false evidence.</p></div></div></section>

<section class="puzzle-study" id="puzzle-study-22"><h4>22. The Queen&#x27;s hearing</h4><div class="puzzle-compare"><div><h5>Original · <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf#page=6">PDF p. 6</a></h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/original-22.webp" aria-label="Enlarge original image for puzzle 22"><img src="/images/white-rabbit-study/original-22.webp" alt="The hearing questions and the Queen in the solution." loading="lazy" decoding="async" width="1072" height="471"></a><figcaption>The hearing questions and the Queen in the solution.</figcaption></figure><p>Answer questions; remember the second one.</p></div><div><h5>Our 3D adaptation</h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/adapted-22.webp" aria-label="Enlarge adapted image for puzzle 22"><img src="/images/white-rabbit-study/adapted-22.webp" alt="The Queen asks about the evidence gathered earlier." loading="lazy" decoding="async" width="1280" height="720"></a><figcaption>The Queen asks about the evidence gathered earlier.</figcaption></figure><p>The hearing uses evidence gathered at the kitchen, tart and guards. The memory trick remains. The Queen&#x27;s gestures add performance, while the response choices keep the questions usable on a phone.</p></div></div></section>

<section class="puzzle-study" id="puzzle-study-23"><h4>23. Croquet</h4><div class="puzzle-compare"><div><h5>Original · <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf#page=6">PDF p. 6</a></h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/original-23.webp" aria-label="Enlarge original image for puzzle 23"><img src="/images/white-rabbit-study/original-23.webp" alt="The three rebound cards and the flag." loading="lazy" decoding="async" width="515" height="206"></a><figcaption>The three rebound cards and the flag.</figcaption></figure><p>Find three rebounds and the flag.</p></div><div><h5>Our 3D adaptation</h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/adapted-23.webp" aria-label="Enlarge adapted image for puzzle 23"><img src="/images/white-rabbit-study/adapted-23.webp" alt="The hedgehog on our lawn after the first rebound." loading="lazy" decoding="async" width="1280" height="720"></a><figcaption>The hedgehog on our lawn after the first rebound.</figcaption></figure><p>An animated hedgehog follows individual shots across a lawn. We test those segments against the visible obstacles. Earlier code accepted the intended answer while the hedgehog crossed a block, so we rebuilt the route and collision checks together.</p></div></div></section>

<section class="puzzle-study" id="puzzle-study-24"><h4>24. The wooden witnesses</h4><div class="puzzle-compare"><div><h5>Original · <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf#page=7">PDF p. 7</a></h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/original-24.webp" aria-label="Enlarge original image for puzzle 24"><img src="/images/white-rabbit-study/original-24.webp" alt="Overlapping the figures joins their markings." loading="lazy" decoding="async" width="608" height="417"></a><figcaption>Overlapping the figures joins their markings.</figcaption></figure><p>Overlap figures; remove their heads.</p></div><div><h5>Our 3D adaptation</h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/adapted-24.webp" aria-label="Enlarge adapted image for puzzle 24"><img src="/images/white-rabbit-study/adapted-24.webp" alt="The wooden figures overlap with their heads lowered." loading="lazy" decoding="async" width="1280" height="720"></a><figcaption>The wooden figures overlap with their heads lowered.</figcaption></figure><p>Three wooden rewards can be stacked, then their heads lowered. Their permanent paint joins into a number. We removed an unrelated number overlay so the answer comes from the objects the player rearranged.</p></div></div></section>

<section class="puzzle-study" id="puzzle-study-25"><h4>25. The Queen&#x27;s decree</h4><div class="puzzle-compare"><div><h5>Original · <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf#page=7">PDF p. 7</a></h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/original-25.webp" aria-label="Enlarge original image for puzzle 25"><img src="/images/white-rabbit-study/original-25.webp" alt="The decree and the missing-letter cards." loading="lazy" decoding="async" width="707" height="258"></a><figcaption>The decree and the missing-letter cards.</figcaption></figure><p>Identify three unused letters.</p></div><div><h5>Our 3D adaptation</h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/adapted-25.webp" aria-label="Enlarge adapted image for puzzle 25"><img src="/images/white-rabbit-study/adapted-25.webp" alt="Our English decree with the letter-marking tool." loading="lazy" decoding="async" width="1280" height="720"></a><figcaption>Our English decree with the letter-marking tool.</figcaption></figure><p>The English decree has the required missing letters and a letter-marking tool. This changes the writing while retaining the letter-coverage puzzle. A literal translation would not preserve the constraint.</p></div></div></section>

<section class="puzzle-study" id="puzzle-study-26"><h4>26. The kings&#x27; construction</h4><div class="puzzle-compare"><div><h5>Original · <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf#page=7">PDF p. 7</a></h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/original-26.webp" aria-label="Enlarge original image for puzzle 26"><img src="/images/white-rabbit-study/original-26.webp" alt="The numbered folded house and the marked construction pieces." loading="lazy" decoding="async" width="599" height="315"></a><figcaption>The numbered folded house and the marked construction pieces.</figcaption></figure><p>Fold and arrange the marked pieces.</p></div><div><h5>Our 3D adaptation</h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/adapted-26.webp" aria-label="Enlarge adapted image for puzzle 26"><img src="/images/white-rabbit-study/adapted-26.webp" alt="The rebuilt bench with physical pieces and selectable sockets." loading="lazy" decoding="async" width="1280" height="720"></a><figcaption>The rebuilt bench with physical pieces and selectable sockets.</figcaption></figure><p>The rebuilt bench lets you select actual painted pieces and choose their sockets, in any order. Occupied slots can be swapped and pieces returned. The two engraved bridges turn over. This keeps a structured placement puzzle while replacing paper balancing with fixed supports.</p></div></div></section>

<section class="puzzle-study" id="puzzle-study-27"><h4>27. Reading the finished house</h4><div class="puzzle-compare"><div><h5>Original · <a href="https://www.nos-jeux-de-societe.fr/wp-content/uploads/2023/08/Solution-Unlock-heroic-adventure-a-la-poursuite-du-lapin-blanc.pdf#page=7">PDF p. 7</a></h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/original-27.webp" aria-label="Enlarge original image for puzzle 27"><img src="/images/white-rabbit-study/original-27.webp" alt="Both viewing angles and the cat&#x27;s eye-color clue." loading="lazy" decoding="async" width="521" height="476"></a><figcaption>Both viewing angles and the cat&#x27;s eye-color clue.</figcaption></figure><p>Align both sides; order by eye color.</p></div><div><h5>Our 3D adaptation</h5><figure class="comparison-shot"><a href="/images/white-rabbit-study/adapted-27.webp" aria-label="Enlarge adapted image for puzzle 27"><img src="/images/white-rabbit-study/adapted-27.webp" alt="The amber strokes align across our folded surfaces." loading="lazy" decoding="async" width="1280" height="720"></a><figcaption>The amber strokes align across our folded surfaces.</figcaption></figure><p>The old rings moved the camera to the answer and recorded it. The rebuild puts paint on the folded, ribbed surfaces themselves. You adjust your viewpoint and eye height, then enter your reading. The ribs make our architectural object differ from folded paper; they give its paint depth instead of a floating overlay.</p></div></div></section>

<h2 id="getting-the-recording-wrong-twice"><a class="anchor" href="#getting-the-recording-wrong-twice" aria-label="Permalink">§</a>Getting the recording wrong, twice</h2>
<p>The first short video was laggy. It came from a 15 FPS recording made in a software-rendered browser. Exporting it at 30 FPS repeated the existing frames, so the movement still looked choppy.</p>
<p>We recorded again in a native browser at 60 FPS. Resizing the browser panel changed the video&#39;s dimensions halfway through a take, so we fixed the capture at 1280 by 720 and let only the preview resize. That solved a recording problem. The next video still looked wrong.</p>
<h3 id="gpt-6-astra-could-finish-a-recording-and-miss-how-bad-the-wa"><a class="anchor" href="#gpt-6-astra-could-finish-a-recording-and-miss-how-bad-the-wa" aria-label="Permalink">§</a>GPT-6 Astra could finish a recording and miss how bad the walking looked</h3>
<p>I asked for something I could share. GPT-6 Astra used the Explore menu&#39;s assisted walking, then treated the frame-rate and playback checks as evidence that the video was ready. The camera kept zigzagging. I rejected it.</p>
<p>The route planner only moved between four grid neighbors, alternating short forward and sideways steps. The camera turned toward each step. The game already accepted W and D together, but the agent had chosen assisted travel for filming instead of holding both directions. It also failed to catch the result in its review. Smoothly playing a bad route was still a bad video.</p>
<figure id="navigation-failure" class="video"><video class="video-file" aria-label="Rejected one-minute recording showing zigzag assisted walking" controls playsinline preload="none" poster="/images/white-rabbit-smooth-gameplay.jpg" width="1280" height="720"><source src="https://github.com/lucastononro/lucastononro.github.io/releases/download/white-rabbit-smooth-gameplay/after-the-white-rabbit-smooth-gameplay.mp4" type="video/mp4"></video><figcaption>Rejected 62-second recording. Watch the opening walk and the later outdoor approach for the repeated changes of direction. Kept here as an example of GPT-6 Astra choosing the wrong controls for the recording and accepting its own result too soon.</figcaption></figure>

<p>We changed assisted walking to allow diagonals and join visible stretches into straight paths, while checking the route against obstacles. Turning also takes the shorter direction when an angle crosses the wraparound point.</p>
<p>For the replacement at the top of this post, the agent used visible local recording buttons that hold movement keys together through the game&#39;s normal input handlers. These are synthetic key events, not a human playthrough. The outdoor takes use those held keys; puzzle shots use the game&#39;s interaction controls. Chapter checkpoints set up each take. No camera positions were scripted during the walks.</p>
<p>The replacement keeps the original pace and game sound. We checked the actual movement as well as the video: both keys remain down throughout the diagonal, both position coordinates change together, and the camera holds its direction until the deliberate turn. The old clip stays here because it shows a failure that passing frame-rate checks did not catch.</p>
<h2 id="full-walkthrough"><a class="anchor" href="#full-walkthrough" aria-label="Permalink">§</a>Full walkthrough</h2>
<p>The 24-minute repair playthrough and every chapter&#39;s written solution are here on the same page. The recording documents that earlier repair pass.</p>
<h4 id="earlier-full-repair-playthrough"><a class="anchor" href="#earlier-full-repair-playthrough" aria-label="Permalink">§</a>Earlier full repair playthrough</h4>
<figure class="video">
<video class="video-file" controls playsinline preload="none" poster="/images/white-rabbit-repairs/doors-after.png" aria-label="Full solution walkthrough of After the White Rabbit">
<source src="https://github.com/lucastononro/lucastononro.github.io/releases/download/white-rabbit-repair-walkthrough/walkthrough.mp4" type="video/mp4">
</video>
<figcaption>Recorded desktop playthrough with on-screen captions and no audio. Pauses and repeated travel are cut. <a href="https://github.com/lucastononro/lucastononro.github.io/releases/download/white-rabbit-repair-walkthrough/walkthrough.mp4">Open the video</a>.</figcaption>
</figure>

<p>We started with a fresh save and played every puzzle through the ordinary controls. The run found more bugs, so we repaired them and resumed that saved game after rebuilding. This is an edited demonstration across that repair pass. The kitchen, Hatter and court entrance received further visual fixes after their first appearances in the video. This video predates the visual finale rebuild. Its last chapter shows the earlier interaction. The written steps below cover the current version of the finale.</p>
<p>The recording uses Low graphics and software rendering. It is not a phone performance test or a timed first attempt. The written steps below explain each deduction; read the chapter you need.</p>
<p>On a phone, play sideways. The left stick moves; the right pad turns the camera. Tap Interact to use the object in front of you, or Explore to choose something nearby. Run off switches to Run on for longer walks. In a puzzle, Look at the clue reveals the world and Back to the puzzle returns to the answer. The fan and paintbrush have a Hide instructions button so their panel can leave your view clear.</p>
<h3 id="chapter-i-down-the-rabbit-hole"><a class="anchor" href="#chapter-i-down-the-rabbit-hole" aria-label="Permalink">§</a>Chapter I · Down the rabbit hole</h3>
<h4 id="put-the-story-back-together"><a class="anchor" href="#put-the-story-back-together" aria-label="Permalink">§</a>Put the story back together</h4>
<p>Inspect the open book on the low table near the entrance. Use the arrows to put its ten memories in this order:</p>
<ol>
<li>By the river, you glance at your sister&#39;s book <strong>TWO</strong> times.</li>
<li>A white rabbit interrupts the quiet afternoon.</li>
<li>Nothing about a passing rabbit seems very strange.</li>
<li>Until he cries, &quot;<strong>ONE</strong> moment late! Oh, my ears!&quot;</li>
<li>He draws a little watch from his waistcoat.</li>
<li>Its hands show <strong>THREE</strong> o&#39;clock.</li>
<li>You follow him through the brambles.</li>
<li>He disappears into a hole beneath a tree.</li>
<li>After <strong>FIVE</strong> metres, the tunnel drops straight down.</li>
<li>You land beside a book. Your story is waiting inside.</li>
</ol>
<p>Read the highlighted number words in that order and enter <strong>2135</strong>.</p>
<h4 id="turn-the-brass-letter"><a class="anchor" href="#turn-the-brass-letter" aria-label="Permalink">§</a>Turn the brass letter</h4>
<p>Inspect the brass M and turn it a quarter turn with Turn left or Turn right. The sideways letter reads as a 3, and its shadow supplies another 3. Choose Read the lock and enter <strong>33</strong>. Entering only 3 leaves out the shadow.</p>
<h4 id="continue-the-cat39s-multiplication-table"><a class="anchor" href="#continue-the-cat39s-multiplication-table" aria-label="Permalink">§</a>Continue the cat&#39;s multiplication table</h4>
<p>The blackboard reads <code>4 × 5 = 12</code>, <code>4 × 6 = 13</code>, then <code>4 × 7 = 14</code>. Each step raises the second number and the result by one. Six more steps take the result from 14 to 20 and the second number from 7 to <strong>13</strong>. Enter <strong>13</strong>.</p>
<h4 id="recover-the-missing-letter"><a class="anchor" href="#recover-the-missing-letter" aria-label="Permalink">§</a>Recover the missing letter</h4>
<p>Look at the doors together. Their arrangement forms an <strong>A</strong>. Add it to the plaque&#39;s LICE and enter <strong>A</strong> at The incomplete name. The recovered instruction tells you that eating makes you grow and drinking makes you shrink.</p>
<h4 id="reach-the-key-and-open-door-6"><a class="anchor" href="#reach-the-key-and-open-door-6" aria-label="Permalink">§</a>Reach the key and open door 6</h4>
<ol>
<li>Inspect the cake, listed as The biscuit in Explore. Choose <strong>55</strong> to grow to the highest mark.</li>
<li>Walk to the high table and collect the triangular key. Growing alone does not collect it.</li>
<li>Find <strong>door 6</strong>, whose lock has a triangular opening. Inspect it and choose <strong>Turn the triangular key</strong>. The leaf swings open.</li>
<li>Return to the blue bottle and choose <strong>11</strong> to shrink.</li>
<li>Go back to door 6. Walk through the opening, or inspect it and choose <strong>Walk through door 6</strong>.</li>
</ol>
<p>The key opens the lock; the bottle gives you enough clearance to pass through. Only size 11 fits this doorway. The cake can only raise your size and the bottle can only lower it. You can revisit both if you choose an intermediate mark by mistake.</p>
<figure><img src="/images/white-rabbit-walkthrough/triangle.png" alt="The repaired door with its triangular keyway." loading="lazy" width="1280" height="720"><figcaption>The repaired door with its triangular keyway.</figcaption></figure>

<figure><img src="/images/white-rabbit-walkthrough/passage.png" alt="Alice at the small opening after shrinking." loading="lazy" width="1280" height="720"><figcaption>Alice at the small opening after shrinking.</figcaption></figure>

<h4 id="find-your-missing-measure"><a class="anchor" href="#find-your-missing-measure" aria-label="Permalink">§</a>Find your missing measure</h4>
<p>After you pass through the doorway, the full measure is 89 and the dial by your head is 12. Subtract <code>89 − 12</code> and enter <strong>77</strong>. Close the puzzle and tilt the camera upward toward the ceiling opening. That takes you into the woods.</p>
<h3 id="chapter-ii-an-afternoon-out-of-time"><a class="anchor" href="#chapter-ii-an-afternoon-out-of-time" aria-label="Permalink">§</a>Chapter II · An afternoon out of time</h3>
<h4 id="the-caterpillar-and-the-mushroom"><a class="anchor" href="#the-caterpillar-and-the-mushroom" aria-label="Permalink">§</a>The caterpillar and the mushroom</h4>
<p>Keep the <strong>3:10</strong> appointment with the caterpillar. The smoke forms two pairs of stacked rings. Enter <strong>88</strong>.</p>
<figure><img src="/images/white-rabbit-repairs/caterpillar-framing-after.png" alt="The caterpillar examination includes the stacked smoke rings." loading="lazy" width="1280" height="720"><figcaption>The caterpillar examination includes the stacked smoke rings.</figcaption></figure>

<p>Follow his advice to the solitary violet mushroom among the roots west of his grove. Inspect it and choose <strong>Taste both sides of the mushroom</strong>. This restores your size to <strong>33</strong> and gives you the first message. You arrive in the woods small because this discovery completes the size puzzle.</p>
<h4 id="the-messenger39s-invitation"><a class="anchor" href="#the-messenger39s-invitation" aria-label="Permalink">§</a>The messenger&#39;s invitation</h4>
<p>At the <strong>4:25</strong> appointment, listen to the frog messenger or open Read the conversation. He repeats &quot;won,&quot; which sounds like &quot;one.&quot; Enter <strong>1</strong>. Keep the message from his invitation.</p>
<h4 id="clear-the-pepper-kitchen"><a class="anchor" href="#clear-the-pepper-kitchen" aria-label="Permalink">§</a>Clear the pepper kitchen</h4>
<p>Find the blue silk fan near the ruins and the garden entrance. Approach it and inspect it to put it in your satchel. Cross to the pepper cottage for the <strong>5:40</strong> appointment.</p>
<p>With the fan collected, inspect the kitchen. Stand at the <strong>open front of the cottage</strong>, then press <strong>Sweep the fan</strong> three times. If you approach a side or back wall, the game walks you around to the entrance. On a phone, the right-hand Interact button also sweeps the fan. Hide instructions clears the middle of the screen while you work.</p>
<p>The smoke clears and the cook gives you the next message. Remember that <strong>the cook bakes the Queen&#39;s tarts</strong>. You will need that evidence later.</p>
<figure><img src="/images/white-rabbit-walkthrough/kitchen-after.png" alt="The final cook model after clearing the kitchen." loading="lazy" width="1280" height="720"><figcaption>The final cook model after clearing the kitchen.</figcaption></figure>

<h4 id="take-tea-with-the-hatter"><a class="anchor" href="#take-tea-with-the-hatter" aria-label="Permalink">§</a>Take tea with the Hatter</h4>
<p>Go to the <strong>6:00</strong> appointment. The cup accepts one letter. Say &quot;tea&quot; aloud and enter <strong>T</strong>. The hat&#39;s 10/6 price tag is a distraction. Take the last message.</p>
<figure><img src="/images/white-rabbit-repairs/hatter-after.png" alt="The revised Hatter, with his face and cup visible." loading="lazy" width="1280" height="720"><figcaption>The revised Hatter, with his face and cup visible.</figcaption></figure>

<h4 id="read-the-four-clock-hands"><a class="anchor" href="#read-the-four-clock-hands" aria-label="Permalink">§</a>Read the four clock hands</h4>
<p>After all four meetings, inspect The rabbit&#39;s lost minutes. Arrange the messages as follows:</p>
<div class="table-scroll"><table><thead><tr><th align="left">Order</th><th align="left">Message</th><th align="left">Appointment</th><th align="left">Long hand points to</th></tr></thead><tbody>
<tr><td align="left">1</td><td align="left">The hours follow each other…</td><td align="left">3:10</td><td align="left">2</td></tr>
<tr><td align="left">2</td><td align="left">…but only the numeral on the clock…</td><td align="left">4:25</td><td align="left">5</td></tr>
<tr><td align="left">3</td><td align="left">…where the minute hand points…</td><td align="left">5:40</td><td align="left">8</td></tr>
<tr><td align="left">4</td><td align="left">…at each appointment, counts.</td><td align="left">6:00</td><td align="left">0</td></tr>
</tbody></table></div>
<p>The sentence tells you to read the numeral under the minute hand at each appointment. On these clocks the top mark is 0. Enter <strong>2580</strong>.</p>
<figure><img src="/images/white-rabbit-walkthrough/clocks.png" alt="The four messages in appointment order." loading="lazy" width="1280" height="720"><figcaption>The four messages in appointment order.</figcaption></figure>

<h4 id="trace-the-cheshire-crossing"><a class="anchor" href="#trace-the-cheshire-crossing" aria-label="Permalink">§</a>Trace the Cheshire crossing</h4>
<p>At the crossing, select one color and start at its ring. Follow the next arrow of that same color. You can click the signs in the world or use the position buttons in the panel.</p>
<p>The complete button routes are:</p>
<div class="table-scroll"><table><thead><tr><th align="left">Color</th><th align="left">Route through its signs</th><th align="left">Shape</th></tr></thead><tbody>
<tr><td align="left">Green · E</td><td align="left">Start sign → Upper left → Middle left → Middle right → Lower right → Lower left</td><td align="left">5</td></tr>
<tr><td align="left">Brown · X</td><td align="left">Start sign → Upper right → Middle right → Middle left → Lower left → Lower right</td><td align="left">2</td></tr>
<tr><td align="left">Amber · I</td><td align="left">Start sign → Lower center</td><td align="left">1</td></tr>
<tr><td align="left">Pink · T</td><td align="left">Start sign → Upper right → Lower right → Lower left → Start sign</td><td align="left">0</td></tr>
</tbody></table></div>
<p>Pink returns to its starting ring to close the loop. Read the shapes in the colored <strong>E X I T</strong> order: green, brown, amber, pink. Choose Read the crossing lock and enter <strong>5210</strong>.</p>
<figure><img src="/images/white-rabbit-walkthrough/green-trail.png" alt="The completed green trail draws a five." loading="lazy" width="1280" height="720"><figcaption>The completed green trail draws a five.</figcaption></figure>

<p>The Queen&#39;s road is open. Follow the path east to her grounds.</p>
<h3 id="chapter-iii-her-majesty39s-peculiar-justice"><a class="anchor" href="#chapter-iii-her-majesty39s-peculiar-justice" aria-label="Permalink">§</a>Chapter III · Her Majesty&#39;s peculiar justice</h3>
<h4 id="open-the-three-hedge-paths"><a class="anchor" href="#open-the-three-hedge-paths" aria-label="Permalink">§</a>Open the three hedge paths</h4>
<p>Inspect The three hedge paths. Each gate applies its operation to your normal size, 33:</p>
<div class="table-scroll"><table><thead><tr><th align="left">Path</th><th align="left">Calculation</th><th align="left">Answer</th></tr></thead><tbody>
<tr><td align="left">Garden</td><td align="left">33 − 4</td><td align="left"><strong>29</strong></td></tr>
<tr><td align="left">Tribunal</td><td align="left">33 × 3</td><td align="left"><strong>99</strong></td></tr>
<tr><td align="left">Croquet</td><td align="left">33 + 16</td><td align="left"><strong>49</strong></td></tr>
</tbody></table></div>
<p>Open all three paths. You can visit their activities in any order.</p>
<h4 id="help-the-gardeners"><a class="anchor" href="#help-the-gardeners" aria-label="Permalink">§</a>Help the gardeners</h4>
<p>Inspect the three gardeners and read their tunic numbers: <strong>2, 5 and 7</strong>. Go to their tool chest, select spade seals <strong>♠ 2</strong>, <strong>♠ 5</strong> and <strong>♠ 7</strong>, then choose Open the tool chest. This collects the red paint and brush.</p>
<p>Return to the rose bed. Paint <strong>all five white blooms red</strong>. Walk around the bed as needed and use the brush on each white rose. Interact and Paint nearest white rose both work while the brush is equipped. The remaining count tells you how many are left.</p>
<p>The gardener gives you a wooden effigy when every white bloom is red.</p>
<h4 id="examine-the-tart-and-both-guards"><a class="anchor" href="#examine-the-tart-and-both-guards" aria-label="Permalink">§</a>Examine the tart and both guards</h4>
<p>On the tribunal path, inspect the tart. The missing slice and crumbs outline a <strong>heart</strong>. Choose <strong>Hearts ♥</strong> to record the clue.</p>
<p>Compare Guard on duty with Suspicious guard. There are <strong>seven differences</strong>:</p>
<div class="table-scroll"><table><thead><tr><th align="left">Detail</th><th align="left">Guard on duty</th><th align="left">Suspicious guard</th></tr></thead><tbody>
<tr><td align="left">Hat band</td><td align="left">Red</td><td align="left">Gold</td></tr>
<tr><td align="left">Halberd blade</td><td align="left">Deeply notched edge</td><td align="left">Straighter edge</td></tr>
<tr><td align="left">Moustache</td><td align="left">Absent</td><td align="left">Present</td></tr>
<tr><td align="left">Gloves</td><td align="left">White</td><td align="left">Gold</td></tr>
<tr><td align="left">Heart emblem color</td><td align="left">Red</td><td align="left">Gold</td></tr>
<tr><td align="left">Heart emblem direction</td><td align="left">Upright</td><td align="left">Inverted</td></tr>
<tr><td align="left">Bottom jacket trim</td><td align="left">Red</td><td align="left">Gold</td></tr>
</tbody></table></div>
<figure><img src="/images/white-rabbit-walkthrough/guard.png" alt="The original guard." loading="lazy" width="1280" height="720"><figcaption>The original guard.</figcaption></figure>

<figure><img src="/images/white-rabbit-walkthrough/impostor.png" alt="The disguised guard, with seven altered details." loading="lazy" width="1280" height="720"><figcaption>The disguised guard, with seven altered details.</figcaption></figure>

<p>Choose <strong>I have compared them</strong> when you finish. The game needs both the tart observation and the uniform inspection before the hearing.</p>
<figure><img src="/images/white-rabbit-walkthrough/tart.png" alt="The tart and heart-shaped trail of crumbs." loading="lazy" width="1280" height="720"><figcaption>The tart and heart-shaped trail of crumbs.</figcaption></figure>

<h4 id="answer-the-queen"><a class="anchor" href="#answer-the-queen" aria-label="Permalink">§</a>Answer the Queen</h4>
<p>Give these four answers in order:</p>
<ol>
<li>Who bakes the Queen&#39;s tarts? <strong>The cook.</strong></li>
<li>Who stole the tarts? <strong>The Knave of Hearts.</strong></li>
<li>How many differences expose the disguise? <strong>Seven.</strong></li>
<li>What was my second question? <strong>Who stole the tarts?</strong></li>
</ol>
<p>The last answer is the wording of her earlier question. The hearing gives you the knave&#39;s wooden effigy.</p>
<h4 id="win-at-croquet"><a class="anchor" href="#win-at-croquet" aria-label="Permalink">§</a>Win at croquet</h4>
<p>Inspect the croquet lawn. Choose <strong>Cushion 4</strong>, wait for the hedgehog to stop, then <strong>Cushion 7</strong>, <strong>Cushion 6</strong>, and finally <strong>Flag 1</strong>. The route is <strong>4 → 7 → 6 → 1</strong>, or <strong>4761</strong>.</p>
<p>Those straight shots avoid the orange obstacles and use exactly three rebounds. If you hit a block, start the sequence again. Choose Collect your prize after reaching the flag to receive your own wooden effigy.</p>
<figure><img src="/images/white-rabbit-walkthrough/croquet.png" alt="The hedgehog at the flag after three rebounds." loading="lazy" width="1280" height="720"><figcaption>The hedgehog at the flag after three rebounds.</figcaption></figure>

<h4 id="join-the-three-wooden-figures"><a class="anchor" href="#join-the-three-wooden-figures" aria-label="Permalink">§</a>Join the three wooden figures</h4>
<p>Bring all three rewards to The wooden witnesses. Stack the figures from top to bottom by selecting:</p>
<ol>
<li><strong>You</strong></li>
<li><strong>Knave</strong></li>
<li><strong>Gardener</strong></li>
</ol>
<p>Choose <strong>Lower the heads</strong>. With the heads out of the way, the painted fragments join into <strong>54</strong>. Choose Read the joined number and enter <strong>54</strong>.</p>
<figure><img src="/images/white-rabbit-walkthrough/figures.png" alt="The stacked figures after lowering their heads." loading="lazy" width="1280" height="720"><figcaption>The stacked figures after lowering their heads.</figcaption></figure>

<h4 id="find-the-letters-missing-from-the-decree"><a class="anchor" href="#find-the-letters-missing-from-the-decree" aria-label="Permalink">§</a>Find the letters missing from the decree</h4>
<p>Read the Queen&#39;s decree and mark each letter that appears. The three unused letters are <strong>R, K and Z</strong>. Enter <strong>RKZ</strong>. Their order does not matter.</p>
<p>The route behind the thrones opens. Follow it north to the impossible house.</p>
<h3 id="chapter-iv-the-house-of-impossible-things"><a class="anchor" href="#chapter-iv-the-house-of-impossible-things" aria-label="Permalink">§</a>Chapter IV · The house of impossible things</h3>
<h4 id="build-the-kings39-house"><a class="anchor" href="#build-the-kings39-house" aria-label="Permalink">§</a>Build the kings&#39; house</h4>
<p>Inspect the kings&#39; instructions. Select a piece from the physical bench or its button, then choose a socket on the model or its position button. You can build in any order. Place the pieces as follows:</p>
<div class="table-scroll"><table><thead><tr><th align="left">Position</th><th align="left">Piece</th></tr></thead><tbody>
<tr><td align="left">Lower left</td><td align="left"><strong>♠ 6</strong></td></tr>
<tr><td align="left">Lower middle</td><td align="left"><strong>♠ 4</strong></td></tr>
<tr><td align="left">Lower right</td><td align="left"><strong>♥ 6</strong></td></tr>
<tr><td align="left">Lower bridge</td><td align="left"><strong>Black bridge, face down</strong></td></tr>
<tr><td align="left">Middle left</td><td align="left"><strong>♥ 4</strong></td></tr>
<tr><td align="left">Middle right</td><td align="left"><strong>♥ 2</strong></td></tr>
<tr><td align="left">Upper bridge</td><td align="left"><strong>Red bridge, face down</strong></td></tr>
<tr><td align="left">Top left</td><td align="left"><strong>♥ 5</strong></td></tr>
<tr><td align="left">Top right</td><td align="left"><strong>♥ 7</strong></td></tr>
</tbody></table></div>
<p>Select each bridge and turn it until its engraved face points down. Selecting a placed piece and choosing an occupied socket swaps the two pieces. Return a selected piece to the bench if needed. Choose <strong>Test the structure</strong> when the arrangement is ready.</p>
<figure><img src="/images/white-rabbit-study/assembly-new.png" alt="The new construction bench and position controls." loading="lazy" width="1280" height="720"><figcaption>The new construction bench and position controls.</figcaption></figure>

<h4 id="find-the-two-viewing-angles"><a class="anchor" href="#find-the-two-viewing-angles" aria-label="Permalink">§</a>Find the two viewing angles</h4>
<p>Approach the amber floor mark and inspect that side. The camera begins away from the aligned view. Drag across the visible house, or use <strong>Move around the house</strong> and <strong>Raise or lower your eye</strong>. Bring the horizontal control near its middle, then lower your eye until the colored strokes join across the folded surfaces.</p>
<p>Read the upper digit before the lower digit. The amber side reads <strong>78</strong>. Enter it and choose <strong>Record this reading</strong>. Merely opening this view does not record an answer.</p>
<figure><img src="/images/white-rabbit-study/amber-aligned.png" alt="The amber side aligned by adjusting the viewing position." loading="lazy" width="1280" height="720"><figcaption>The amber side aligned by adjusting the viewing position.</figcaption></figure>

<p>Repeat from the ivory side. Its upper and lower digits read <strong>32</strong>. Record <strong>32</strong>.</p>
<figure><img src="/images/white-rabbit-study/ivory-aligned.png" alt="The ivory side after alignment." loading="lazy" width="1280" height="720"><figcaption>The ivory side after alignment.</figcaption></figure>

<p>The cat&#39;s left eye is amber. Use that color&#39;s reading first. Go to <strong>The way home</strong> and enter <strong>7832</strong> to finish.</p>
<figure><img src="/images/white-rabbit-walkthrough/ending.png" alt="The ending after all 25 puzzles." loading="lazy" width="1280" height="720"><figcaption>The ending after all 25 puzzles.</figcaption></figure>

<p>The recorded ending shows 25 puzzles solved. Its in-game minutes are not a wall-clock benchmark.</p>
]]></content:encoded>
    </item>
    <item>
      <title>pr-review-evidence: a desktop nobody can see</title>
      <link>https://lucastononro.github.io/pr-review-evidence/</link>
      <guid isPermaLink="true">https://lucastononro.github.io/pr-review-evidence/</guid>
      <pubDate>Wed, 29 Jul 2026 12:00:00 GMT</pubDate>
      <description>Agents can describe a change but never show it working. So give one its own screen and record it.</description>
      <category>skill</category>
      <content:encoded><![CDATA[<p>Start with the output, because the output is the argument (you&#39;d have skipped to it anyway). This is a pull request on my own repo, and everything under the <strong>Evidence</strong> heading was produced and posted by an agent:</p>
<figure><img src="/images/pr-12-pr-body.jpg" alt="PR #12&#39;s evidence section: the release-asset links the uploader printed, then the stills rendering inline" loading="lazy"><figcaption>PR #12's evidence section: the release-asset links the uploader printed, then the stills rendering inline</figcaption></figure>
<p>And this is the video it attached — 72 seconds, three chapters, served here from the same file GitHub is serving there:</p>
<figure class="video">
  <video class="video-file" src="/video/pr-12-evidence.mp4" poster="/video/pr-12-evidence.jpg"
         controls preload="none" playsinline width="1280" height="720"></video>
  <figcaption>The evidence on PR #12. A real cursor, real keystrokes, a desktop that never existed.</figcaption>
</figure>
<p>Watch the cursor. It travels, it hovers, the badge renders, a filter chip highlights. That&#39;s not a screencast of a browser tab. It&#39;s a recording of a whole desktop that came into existence for seventy-two seconds inside a container. It never touched my screen.</p>
<h2 id="why-this-is-worth-having"><a class="anchor" href="#why-this-is-worth-having" aria-label="Permalink">§</a>Why this is worth having</h2>
<p>A good engineer does two things in a PR: describes the change, and shows it working. Agents have always been fine at the first and structurally incapable of the second, for the dull reason that they have no screen. So the second half arrived as prose — <em>&quot;I verified the modal comes up clean&quot;</em> — and I either took that on faith or opened the browser and repeated the work myself. At that point the claim had bought me nothing.</p>
<p><a href="https://github.com/lucastononro/pr-review-evidence" target="_blank" rel="noopener noreferrer" class="external">pr-review-evidence</a> closes that specific gap. It gives an agent a real X11 desktop in a container, lets it drive the thing computer-use style, and records the framebuffer while it works. Out comes <code>evidence.mp4</code>, <code>shots/*.png</code>, and a <code>manifest.json</code> carrying provenance you can check against the repo. Seven bash scripts, 541 lines, and Docker.</p>
<p>The video <em>is</em> the check, not a description of one. Nothing in the loop lets the agent narrate a step it didn&#39;t take. <code>click</code> and <code>type</code> print nothing at all, so the only way it learns what happened is to take another screenshot — the same frame a reviewer ends up looking at. The chapter titles aren&#39;t authored either; they&#39;re read back out of the log of commands actually sent to the desktop. An agent using this can&#39;t tell you about a click it never looked at.</p>
<figure class="diagram"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 330" role="img"
     aria-label="The agent on the host drives xdotool inside a container, an Xvfb framebuffer is captured by scrot and recorded by ffmpeg, and artifacts land back on the host">
  <!-- Hand-drawn on purpose: every box is a wobbly path, not a rect, and every
       edge overshoots slightly. Colours come from the page via CSS classes. -->
  <g stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7">

    <!-- container boundary: dashed, because nothing crosses it except files -->
    <path class="dg-stroke" stroke-dasharray="6 7" d="M174 24 L612 21 Q618 22 617 28 L619 274 Q618 282 611 281 L176 283 Q169 282 170 274 L171 29 Q171 24 174 24 Z"/>
    <text class="dg-note" x="188" y="42">docker container — never on your screen</text>

    <!-- the agent, on the host -->
    <path class="dg-fill" d="M22 98 L148 95 Q154 96 153 102 L155 146 Q154 153 147 152 L24 154 Q17 153 18 146 L19 103 Q19 98 22 98 Z"/>
    <text class="dg-text" x="40" y="121">the agent</text>
    <text class="dg-note" x="40" y="138">on your host</text>

    <!-- input -->
    <path class="dg-fill" d="M198 60 L322 57 Q328 58 327 64 L329 108 Q328 115 321 114 L200 116 Q193 115 194 108 L195 65 Q195 60 198 60 Z"/>
    <text class="dg-text" x="214" y="83">xdotool</text>
    <text class="dg-note" x="214" y="100">moves the cursor</text>

    <!-- the framebuffer itself -->
    <path class="dg-fill" d="M374 110 L538 107 Q544 108 543 114 L545 164 Q544 171 537 170 L376 172 Q369 171 370 164 L371 115 Q371 110 374 110 Z"/>
    <text class="dg-text" x="392" y="134">Xvfb :99</text>
    <text class="dg-note" x="392" y="151">1280x720 framebuffer</text>

    <!-- perception -->
    <path class="dg-fill" d="M198 202 L322 199 Q328 200 327 206 L329 250 Q328 257 321 256 L200 258 Q193 257 194 250 L195 207 Q195 202 198 202 Z"/>
    <text class="dg-text" x="214" y="225">scrot</text>
    <text class="dg-note" x="214" y="242">shots/*.png</text>

    <!-- the recorder -->
    <path class="dg-fill" d="M402 202 L568 199 Q574 200 573 206 L575 250 Q574 257 567 256 L404 258 Q397 257 398 250 L399 207 Q399 202 402 202 Z"/>
    <text class="dg-text" x="420" y="225">ffmpeg x11grab</text>
    <text class="dg-note" x="420" y="242">15 fps, real time</text>

    <!-- artifacts, back on the host -->
    <path class="dg-fill" d="M634 202 L736 199 Q742 200 741 206 L743 250 Q742 257 735 256 L636 258 Q629 257 630 250 L631 207 Q631 202 634 202 Z"/>
    <text class="dg-text" x="650" y="225">evidence/</text>
    <text class="dg-note" x="650" y="242">mp4 · shots</text>
    <text class="dg-note" x="634" y="276">bind mount</text>

    <!-- arrows, drawn with a little sag -->
    <path class="dg-accent" d="M157 118 Q178 116 192 88"/>
    <path class="dg-accent" d="M192 88 l-3 10 m3 -10 l-10 2"/>

    <path class="dg-accent" d="M329 88 Q356 96 368 128"/>
    <path class="dg-accent" d="M368 128 l-10 -3 m10 3 l-3 -10"/>

    <path class="dg-accent" d="M388 173 Q352 178 318 198"/>
    <path class="dg-accent" d="M318 198 l6 -8 m-6 8 l10 2"/>

    <!-- the framebuffer is recorded whatever else is happening -->
    <path class="dg-accent" d="M462 173 Q466 185 462 196"/>
    <path class="dg-accent" d="M462 196 l-5 -8 m5 8 l5 -8"/>
    <text class="dg-note" x="474" y="190">records everything</text>

    <path class="dg-accent" d="M577 228 Q600 233 626 228"/>
    <path class="dg-accent" d="M626 228 l-9 -4 m9 4 l-9 5"/>

    <!-- the look edge: the only thing the agent gets back is a PNG -->
    <path class="dg-accent" stroke-dasharray="5 6" d="M192 228 Q120 232 86 158"/>
    <path class="dg-accent" d="M86 158 l8 6 m-8 -6 l-1 10"/>

    <text class="dg-note" x="22" y="306">screenshot → look → move a real cursor → screenshot; the actions themselves print nothing</text>
  </g>
</svg>
<figcaption>The only thing that crosses back out of the container is files.</figcaption></figure>
<h2 id="the-loop"><a class="anchor" href="#the-loop" aria-label="Permalink">§</a>The loop</h2>
<p>One beat of a real session — bring up the scene, mark the chapter, look, act, look again:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665">evidence-start.sh</span><span style="--shiki-light:#A0ADA0;--shiki-dark:#758575DD">                      # → live view: http://localhost:6080/vnc.html</span></span>
<span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665">evidence-exec.sh</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> launch-browser</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> http://host.docker.internal:3000</span></span>
<span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665">evidence-exec.sh</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> record-start</span><span style="--shiki-light:#A0ADA0;--shiki-dark:#758575DD">          # → recording to raw/desktop-141207.mp4</span></span>
<span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665">evidence-exec.sh</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> chapter</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">2. Archive a task</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span></span>
<span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665">evidence-exec.sh</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> screenshot</span><span style="--shiki-light:#A0ADA0;--shiki-dark:#758575DD">            # → …/shots/shot-141219.png  ← view this</span></span>
<span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665">evidence-exec.sh</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> mousemove</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 1042</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 318</span></span>
<span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665">evidence-exec.sh</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> click</span></span>
<span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665">evidence-exec.sh</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> screenshot</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> archived</span><span style="--shiki-light:#A0ADA0;--shiki-dark:#758575DD">   # → …/shots/archived.png</span></span>
<span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665">evidence-finalize.sh</span><span style="--shiki-light:#A0ADA0;--shiki-dark:#758575DD">                   # → …/evidence.mp4 + manifest.json</span></span></code></pre><p><code>screenshot</code> runs <code>scrot -o /evidence/shots/&lt;name&gt;.png</code> inside the container and then prints the <em>host</em> path, because <code>/evidence</code> is a bind mount of the session directory. The agent reads the PNG off its own filesystem with the tool it already has; no image travels over a protocol. Everything else in that list prints nothing at all. <code>mousemove</code>, <code>click</code> and <code>type</code> are silent, so the only way to learn what happened is the next screenshot. That&#39;s the behavior I wanted.<label class="sn-ref" for="sn-blind" tabindex="0">1</label><input type="checkbox" id="sn-blind" class="sn-toggle" aria-hidden="true"><span class="sidenote" role="note"><span class="sn-num">1</span>The playbook&#39;s phrasing is &quot;never act blind&quot;. Coordinates from an old frame are stale the moment the layout moves, and the failure mode isn&#39;t an error — it&#39;s a click that lands somewhere plausible and wrong, on video.</span></p>
<p>Session state is one file. <code>evidence/.current-session</code> holds an id like <code>fix-archive-modal-20260730T141152Z</code>: the current git branch, slugged and truncated to 40 characters, plus a UTC stamp. Every script resolves it from <code>--session</code>, then <code>$EVIDENCE_SESSION</code>, then that marker. The container is named <code>pre-&lt;session&gt;</code> and holds nothing of value, so <code>evidence-clean.sh</code> removes it and leaves the files behind.</p>
<p>There&#39;s a live noVNC view on <code>:6080</code> unless you start with <code>--no-live</code>, in which case no ports are published at all. You don&#39;t need it. But the first time an agent takes over a desktop and starts moving a cursor with intent, you&#39;ll want to be watching!!<label class="sn-ref" for="sn-open" tabindex="0">2</label><input type="checkbox" id="sn-open" class="sn-toggle" aria-hidden="true"><span class="sidenote" role="note"><span class="sn-num">2</span>It&#39;s an open-format Agent Skill, not a plugin — <code>./install.sh --global</code> drops symlinks into <code>~/.claude/skills</code>, <code>~/.agents/skills</code>, <code>~/.codex/skills</code> and <code>~/.kimi-code/skills</code>, which covers Claude Code, Codex, Kimi Code, Gemini CLI, Cursor, Amp and OpenCode; all of them follow symlinks. Which is exactly why <code>lib.sh</code> resolves its own <em>physical</em> directory with <code>pwd -P</code> before walking up three levels to find the Dockerfile — from the logical path, <code>cd ../../..</code> lands in a completely different tree.</span></p>
<h2 id="nothing-on-your-screen"><a class="anchor" href="#nothing-on-your-screen" aria-label="Permalink">§</a>Nothing on your screen</h2>
<p>The first question everyone asks is whether this thing is going to start moving their cursor while they&#39;re using the laptop. It can&#39;t. The reason is structural, not a promise.</p>
<figure class="diagram"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 400" role="img"
     aria-label="Your display is never addressed: xdotool and ffmpeg both talk to display :99 inside the container, and only files cross back out">
  <g stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7">

    <!-- host boundary -->
    <path class="dg-stroke" stroke-dasharray="6 7"
          d="M16 22 L744 20 Q750 21 749 27 L751 168 Q750 175 743 174 L20 176 Q13 175 14 168 L15 28 Q15 23 16 22 Z"/>
    <text class="dg-note" x="30" y="40">your machine</text>

    <!-- container boundary -->
    <path class="dg-stroke" stroke-dasharray="6 7"
          d="M16 200 L744 198 Q750 199 749 205 L751 378 Q750 385 743 384 L20 386 Q13 385 14 378 L15 206 Q15 201 16 200 Z"/>
    <text class="dg-note" x="30" y="218">container — one docker run, torn down after</text>

    <!-- host: your screen -->
    <path class="dg-fill" d="M34 54 L206 51 Q212 52 211 58 L213 128 Q212 135 205 134 L38 136 Q31 135 32 128 L33 59 Q33 54 34 54 Z"/>
    <text class="dg-text" x="52" y="80">your display :0</text>
    <text class="dg-note" x="52" y="100">keyboard, mouse, monitor</text>
    <text class="dg-note" x="52" y="120">never opened, never grabbed</text>

    <!-- host: the agent -->
    <path class="dg-fill" d="M296 54 L468 51 Q474 52 473 58 L475 128 Q474 135 467 134 L300 136 Q293 135 294 128 L295 59 Q295 54 296 54 Z"/>
    <text class="dg-text" x="314" y="80">the agent</text>
    <text class="dg-note" x="314" y="100">runs evidence-exec.sh</text>
    <text class="dg-note" x="314" y="120">reads the PNGs off disk</text>

    <!-- host: session dir -->
    <path class="dg-fill" d="M556 54 L726 51 Q732 52 731 58 L733 128 Q732 135 725 134 L560 136 Q553 135 554 128 L555 59 Q555 54 556 54 Z"/>
    <text class="dg-text" x="574" y="80">evidence/&lt;session&gt;/</text>
    <text class="dg-note" x="574" y="100">shots/ raw/ logs/</text>
    <text class="dg-note" x="574" y="120">evidence.mp4, manifest.json</text>

    <!-- container: xdotool -->
    <path class="dg-fill" d="M34 246 L206 243 Q212 244 211 250 L213 318 Q212 325 205 324 L38 326 Q31 325 32 318 L33 251 Q33 246 34 246 Z"/>
    <text class="dg-text" x="52" y="272">xdotool</text>
    <text class="dg-note" x="52" y="292">moves, clicks, types</text>
    <text class="dg-note" x="52" y="312">DISPLAY=:99 only</text>

    <!-- container: Xvfb -->
    <path class="dg-fill" d="M296 240 L468 237 Q474 238 473 244 L475 324 Q474 331 467 330 L300 332 Q293 331 294 324 L295 245 Q295 240 296 240 Z"/>
    <text class="dg-text" x="314" y="266">Xvfb :99</text>
    <text class="dg-note" x="314" y="286">1280x720x24 framebuffer</text>
    <text class="dg-note" x="314" y="306">in RAM — no monitor exists</text>
    <text class="dg-note" x="314" y="324">openbox · chromium · xterm</text>

    <!-- container: ffmpeg -->
    <path class="dg-fill" d="M556 246 L726 243 Q732 244 731 250 L733 318 Q732 325 725 324 L560 326 Q553 325 554 318 L555 251 Q555 246 556 246 Z"/>
    <text class="dg-text" x="574" y="272">ffmpeg x11grab</text>
    <text class="dg-note" x="574" y="292">reads :99, 15 fps</text>
    <text class="dg-note" x="574" y="312">writes raw/*.mp4</text>

    <!-- agent -> xdotool (docker exec, crosses down) -->
    <path class="dg-accent" d="M330 140 Q286 190 176 240"/>
    <path class="dg-accent" d="M176 240 l3 -10 m-3 10 l10 -1"/>
    <text class="dg-note" x="196" y="196">docker exec -e DISPLAY=:99</text>

    <!-- xdotool -> Xvfb -->
    <path class="dg-accent" d="M216 286 Q256 281 288 286"/>
    <path class="dg-accent" d="M288 286 l-9 -4 m9 4 l-9 5"/>

    <!-- Xvfb -> ffmpeg -->
    <path class="dg-accent" d="M478 286 Q518 291 548 286"/>
    <path class="dg-accent" d="M548 286 l-9 -4 m9 4 l-9 5"/>

    <!-- ffmpeg -> host files (the only crossing) -->
    <path class="dg-accent" d="M642 240 Q638 190 642 142"/>
    <path class="dg-accent" d="M642 142 l-5 10 m5 -10 l6 9"/>
    <text class="dg-note" x="654" y="196">bind mount</text>
    <text class="dg-note" x="654" y="214">-v dir:/evidence</text>

    <!-- files -> agent (reads) -->
    <path class="dg-accent" stroke-dasharray="5 6" d="M548 96 Q510 101 482 96"/>
    <path class="dg-accent" d="M482 96 l9 -4 m-9 4 l9 5"/>

    <!-- the point: no path to :0 -->
    <path class="dg-stroke" stroke-dasharray="5 6" d="M120 246 Q118 190 120 142"/>
    <path class="dg-accent" d="M108 186 l24 20 m0 -20 l-24 20"/>
    <text class="dg-note" x="30" y="164">no X connection</text>
  </g>
</svg>
<figcaption>Two X displays, no route between them. Only the bind mount crosses.</figcaption></figure>
<p>X11 input goes to a display, and <code>xdotool</code> is given exactly one: every command in <code>evidence-exec.sh</code> is <code>docker exec -e DISPLAY=:99</code>. Display <code>:99</code> is a framebuffer Xvfb allocates in RAM inside the container, with no monitor attached to it. Your session is <code>:0</code>, on the other side of a container boundary. Nothing in the skill ever opens a connection to it: no <code>-v /tmp/.X11-unix</code>, no <code>--net=host</code>, no <code>$DISPLAY</code> passed inward. <code>ffmpeg</code> reads the same <code>:99</code>, so the recording and the input are pointed at the identical fake screen.</p>
<p>What does cross is one bind mount, <code>-v &quot;$dir:/evidence&quot;</code>, and it carries files in one direction: the container writes PNGs and mp4s, the agent reads them off your disk. The optional noVNC view on <code>:6080</code> is the only published port, and with <code>--no-live</code> even that isn&#39;t there.<label class="sn-ref" for="sn-watch" tabindex="0">3</label><input type="checkbox" id="sn-watch" class="sn-toggle" aria-hidden="true"><span class="sidenote" role="note"><span class="sn-num">3</span>noVNC is a viewer, not a control channel in any meaningful sense — but it is a VNC server on localhost, so <code>--no-live</code> is the correct default for anything you&#39;d rather not have listening. The rest of the session works identically without it; you just can&#39;t watch.</span></p>
<h2 id="recording-the-framebuffer"><a class="anchor" href="#recording-the-framebuffer" aria-label="Permalink">§</a>Recording the framebuffer</h2>
<p><code>record-start</code> execs one detached command and keeps its PID at <code>/evidence/.ffmpeg.pid</code>:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665">ffmpeg</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> -y</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> -loglevel</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> error</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> -f</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> x11grab</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> -video_size</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> 1280x720</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> -framerate</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 15</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> -i</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> :99.0</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> \</span></span>
<span class="line"><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076">  -c:v</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> libx264</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> -preset</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> veryfast</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> -crf</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 23</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> -pix_fmt</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> yuv420p</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> '</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">raw/$file</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">'</span></span></code></pre><p><code>:99.0</code> is the display the entrypoint brings up as <code>Xvfb :99 -screen 0 1280x720x24</code> — which is why the same resolution appears in two files and must not drift. Recording starts on demand rather than in the entrypoint, so an idle session costs nothing.</p>
<p>Grabbing the framebuffer is the whole difference. A browser-automation screencast records a page: no cursor, because there is no cursor, and nothing outside the viewport exists. x11grab records whatever was composited into the screen — the software cursor Xvfb draws, native menus, an xterm, a GTK dialog, and any window you forgot was open. Real time at 15 fps also means the video&#39;s clock is the agent&#39;s clock, so a pause while it was thinking is a pause on screen.</p>
<p>That generality is the point, and the repo heads off the objection you&#39;re forming:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span># The base image is used ONLY for its preinstalled Chromium and system</span></span>
<span class="line"><span># libraries — nothing here drives Playwright; input is 100% xdotool.</span></span>
<span class="line"><span>FROM mcr.microsoft.com/playwright:v1.55.0-noble</span></span></code></pre><p><code>launch-browser</code> really does just glob <code>/ms-playwright/chromium-*/chrome-linux/chrome</code> and run the binary with <code>--no-sandbox</code>. Then it spends up to ten seconds polling <code>xdotool search --onlyvisible --class chrom</code> to force the window to 1280x720, because <code>--start-maximized</code> is unreliable under openbox and a browser that opens at the wrong size ruins the take.</p>
<h2 id="pacing-for-a-reviewer"><a class="anchor" href="#pacing-for-a-reviewer" aria-label="Permalink">§</a>Pacing for a reviewer</h2>
<p>The best file in the repo is <code>references/recording-playbook.md</code>, and it exists because of a failure I hadn&#39;t anticipated: an agent will produce a recording that is entirely correct and unwatchable. Nothing for twelve seconds, then everything at once, cursor teleporting between coordinates.</p>
<p>So the playbook is mostly about time. Aim for 20–90 seconds and 3–7 chapters, because &quot;a reviewer gives you about a minute&quot;. Move the mouse toward a target in two or three steps instead of jumping, since the glide is what makes it read as a person. Linger about two seconds on each result so it can actually be read. A <code>sleep 1</code> on the host after navigation is a natural pause in the video for free. Number the chapters, because reviewers write &quot;chapter 3&quot; in comments. Don&#39;t record spinners or deploy waits. Don&#39;t ship a first take with a visible stumble at 0:05 — clean and start over.</p>
<p><code>type</code> is <code>xdotool type --delay 80</code>, slow on purpose so keystrokes are visible; troubleshooting explains how to speed it up to 15 ms and the playbook tells you not to bother for short strings. And the chapter card is <code>zenity --info --no-wrap --timeout 2</code>: a GTK dialog drawn on the desktop, which ends up in the video because everything on the desktop ends up in the video. No overlay, no compositing pass, no burn-in step.</p>
<h2 id="the-manifest"><a class="anchor" href="#the-manifest" aria-label="Permalink">§</a>The manifest</h2>
<p><code>finalize</code> stops the recorder, concatenates the raw segments if <code>record-start</code> ran more than once, probes the duration, warns if it comes back under two seconds<label class="sn-ref" for="sn-mount" tabindex="0">4</label><input type="checkbox" id="sn-mount" class="sn-toggle" aria-hidden="true"><span class="sidenote" role="note"><span class="sn-num">4</span>Which catches my favorite bug. Under colima, <code>$HOME</code> is shared with the VM but <code>/tmp</code> isn&#39;t, so running a session from an unshared path bind-mounts an empty directory in total silence and every capture stays trapped inside the container. It looks exactly like a broken recorder.</span>, and writes the one file a publisher is meant to read. This isn&#39;t an illustration — it&#39;s the manifest published on PR #12, trimmed only of whitespace:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666">{</span></span>
<span class="line"><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">  "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">schema</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">pr-review-evidence/1</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span></span>
<span class="line"><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">  "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">session</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">task-priorities-20260730T144730Z</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span></span>
<span class="line"><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">  "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">created_at</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">2026-07-30T14:56:56Z</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span></span>
<span class="line"><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">  "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">capture</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> {</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577"> "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">mode</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">desktop</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577"> "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">display</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">1280x720</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577"> "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">recorder</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">ffmpeg x11grab</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> },</span></span>
<span class="line"><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">  "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">video</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> {</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577"> "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">file</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">evidence.mp4</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577"> "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">duration_s</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 72</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577"> "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">size_bytes</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 172715</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> },</span></span>
<span class="line"><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">  "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">source</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> {</span></span>
<span class="line"><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">    "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">repo</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">https://github.com/lucastononro/pr-review-evidence.git</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span></span>
<span class="line"><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">    "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">branch</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">examples/task-priorities</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span></span>
<span class="line"><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">    "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">commit</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">fb739417404fbb35755afc9afaccc8dffef8c463</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span></span>
<span class="line"><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">    "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">pr_url</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">https://github.com/lucastononro/pr-review-evidence/pull/12</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span></span>
<span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666">  },</span></span>
<span class="line"><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">  "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">agent</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> {</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577"> "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">harness</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">kimi-code</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577"> "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">model</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">kimi-k2</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> },</span></span>
<span class="line"><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">  "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">chapters</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> [</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">1. Add a normal task, then a HIGH one</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">2. NEW: High priority filter</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span></span>
<span class="line"><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">               "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">3. Complete a task, filter Active</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">]</span></span>
<span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666">}</span></span></code></pre><p>The two halves aren&#39;t equally trustworthy. <code>source</code> is read on the host at finalize time — <code>git remote get-url origin</code>, <code>git branch --show-current</code>, <code>git rev-parse HEAD</code>, <code>gh pr view --json url</code> — so anyone can check that commit against the repo. <code>agent</code> is <code>${EVIDENCE_HARNESS:-unknown}</code> and <code>${EVIDENCE_MODEL:-unknown}</code>: self-declared, and <code>unknown</code> unless the harness exported them. Kimi Code did, which is why that run names itself. Nothing verified it. Read that field as a claim, not a measurement.</p>
<p><code>chapters</code> is the nicest part and the least designed. It isn&#39;t authored anywhere: finalize greps <code>actions.jsonl</code> for <code>&quot;cmd&quot;:&quot;chapter </code> and reads the titles back out of the log of what was actually sent to the desktop. The chapter list can&#39;t disagree with what appeared on screen. Same instinct as the rest of the skill — derive the description from the thing that happened, don&#39;t ask the agent to narrate it.</p>
<h2 id="the-endpoint-that-doesn39t-exist"><a class="anchor" href="#the-endpoint-that-doesn39t-exist" aria-label="Permalink">§</a>The endpoint that doesn&#39;t exist</h2>
<p>Having a video on disk isn&#39;t the same as having it in the pull request. This is where the project spent the most time being wrong.</p>
<p><strong>GitHub has no API for attachments.</strong> None. The drag-and-drop box under a PR comment posts to an internal endpoint that wants browser session cookies; there is no <code>gh api</code> call for it, and there never has been. So an agent holding an authenticated <code>gh</code> and a 2 MB mp4 has no supported way to put the second thing inside the first. In 2026.</p>
<p>The workaround the skill settles on comes from <a href="https://github.com/mrshu/agent-skills/tree/main/plugins/gh-pr-image" target="_blank" rel="noopener noreferrer" class="external">mrshu&#39;s <code>gh-pr-image</code></a>: <strong>release assets are the only fully-CLI upload whose URLs render for anyone with repo access.</strong> One prerelease per PR, tagged from the PR number:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">tag</span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">pr-</span><span style="--shiki-light:#999999;--shiki-dark:#666666">${</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">pr</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">:-</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">$(date -u +</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">%</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">Y</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">%</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">m</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">%</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">dT</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">%</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">H</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">%</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">M</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">%</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">SZ)</span><span style="--shiki-light:#999999;--shiki-dark:#666666">}</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">-evidence</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span></span>
<span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665">gh</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> release</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> view</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">$tag</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> --repo</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">$repo</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676"> ></span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">/dev/null</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676"> 2>&#x26;1</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> \</span></span>
<span class="line"><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">  ||</span><span style="--shiki-light:#59873A;--shiki-dark:#80A665"> gh</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> release</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> create</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">$tag</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> --repo</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">$repo</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> --prerelease</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> \</span></span>
<span class="line"><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076">       --title</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">Evidence ($tag)</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> --notes</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">Uploaded by the pr-review-evidence skill.</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span></span>
<span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665">gh</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> release</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> upload</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">$tag</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#999999;--shiki-dark:#666666">${</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">files</span><span style="--shiki-light:#999999;--shiki-dark:#666666">[</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">@</span><span style="--shiki-light:#999999;--shiki-dark:#666666">]}</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> --repo</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">$repo</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> --clobber</span></span></code></pre><p>Then it prints PR-ready markdown against <code>https://github.com/$repo/releases/download/$tag/</code> — a bare link for <code>evidence.mp4</code>, <code>&lt;img src=… width=&quot;800&quot;&gt;</code> for each still, list items for each <code>logs/*.log</code>. The agent pastes that into the PR body. Access control is the repository&#39;s own permissions, which is the entire appeal: nothing to host, nothing to expire, no password to leak, and <code>--clobber</code> makes a re-record idempotent. The cleanup one-liner goes to stderr as an HTML comment so it lands in the PR body but not in the rendered text.<label class="sn-ref" for="sn-tag" tabindex="0">5</label><input type="checkbox" id="sn-tag" class="sn-toggle" aria-hidden="true"><span class="sidenote" role="note"><span class="sn-num">5</span><code>pr-12-evidence</code> is derived from <code>gh pr view --json number</code>, so it only works from a branch with an open PR; outside one it falls back to a UTC timestamp, which uploads fine and is harder to find later. Deleting the PR&#39;s evidence is <code>gh release delete pr-12-evidence --cleanup-tag --yes</code>.</span></p>
<figure><img src="/images/pr-12-release-assets.jpg" alt="The prerelease behind PR #12: five uploaded assets, plus the two source archives GitHub attaches to any tag" loading="lazy"><figcaption>The prerelease behind PR #12: five uploaded assets, plus the two source archives GitHub attaches to any tag</figcaption></figure>
<p>That is the whole storage layer — a prerelease nobody will ever install, holding 280 KB of evidence, deleted when the PR is.</p>
<p>I know release assets are the right answer because I shipped the wrong one first. Version 1.0.0 had a Cloudflare Worker with R2 behind it — then Workers KV, once R2 declined to store a single byte without a credit card on file — serving password-gated links. PR #7 deleted the whole thing. The links never expired. The password traveled in the URL — a password, in a URL. Revoking one session meant rotating the admin token for all of them. Publishing is bring-your-own now, and the default has no moving parts.</p>
<h2 id="replaying-the-examples"><a class="anchor" href="#replaying-the-examples" aria-label="Permalink">§</a>Replaying the examples</h2>
<p>The repo contains three small apps under <code>examples/</code> whose only job is to be something to record: <code>demo-webpage</code> (a greeting card and a counter), <code>launch-checklist</code> (tick items, watch a progress bar fill), and <code>task-tracker</code> (a small Vite SPA). Every feature added to them landed as a real PR with evidence attached by the skill, so the examples are readable rather than described — the merged PRs are the documentation.</p>
<p><a href="https://github.com/lucastononro/pr-review-evidence/pull/12" target="_blank" rel="noopener noreferrer" class="external">PR #12</a>, the one at the top of this post, is the one I&#39;d read in full. Its three chapters were read back out of the action log rather than typed: <em>&quot;1. Add a normal task, then a HIGH one&quot;</em>, <em>&quot;2. NEW: High priority filter&quot;</em>, <em>&quot;3. Complete a task, filter Active&quot;</em>. Three deliberately named stills — <code>high-badge.png</code>, <code>filter-high.png</code>, <code>active-filter.png</code> — and the manifest beside them. The body also names the local session, <code>evidence/task-priorities-20260730T144730Z/</code>, which is the branch slug and the UTC stamp doing their job.</p>
<p>One discrepancy in that screenshot makes the case better than I can: the body says &quot;<del>40s&quot; and the manifest says <code>&quot;duration_s&quot;: 72</code>. The manifest was derived with <code>ffprobe</code> from the actual file. The &quot;</del>40s&quot; is me, typing an estimate into a text box. Guess which number I&#39;d trust in a review.</p>
<p>That PR also carries a one-line change to <code>vite.config.ts</code> adding <code>allowedHosts</code>, because the dev server refused requests with a <code>host.docker.internal</code> Host header. It&#39;s the container seam biting in the most ordinary way possible. I like that it&#39;s in the diff rather than in a troubleshooting page.</p>
<p>The older ones are worth a look for a less flattering reason. <a href="https://github.com/lucastononro/pr-review-evidence/pull/1" target="_blank" rel="noopener noreferrer" class="external">#1</a>, <a href="https://github.com/lucastononro/pr-review-evidence/pull/5" target="_blank" rel="noopener noreferrer" class="external">#5</a> and <a href="https://github.com/lucastononro/pr-review-evidence/pull/9" target="_blank" rel="noopener noreferrer" class="external">#9</a> were recorded in the browser mode that <a href="https://github.com/lucastononro/pr-review-evidence/pull/10" target="_blank" rel="noopener noreferrer" class="external">#10</a> then deleted — CDP screencasts with no cursor and teleporting actions. Put #5 next to #12 and the argument for grabbing a framebuffer makes itself. One reads as a slideshow of correct states; the other, as somebody using an app.</p>
<p>And not all evidence is visual. <a href="https://github.com/lucastononro/pr-review-evidence/pull/13" target="_blank" rel="noopener noreferrer" class="external">#13</a> added <code>evidence-log.sh</code>, which runs a command <strong>on the host</strong> and captures stdout, stderr and the exit code into <code>logs/&lt;name&gt;.log</code>:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665">evidence-log.sh</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> api-health</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> curl</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> -s</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> http://localhost:3000/health</span></span>
<span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665">evidence-log.sh</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> e2e-tests</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> npm</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> test</span></span></code></pre><p>It works inside a visual session, and standalone with no session and no Docker at all — <code>finalize</code> then writes <code>&quot;video&quot;: null</code> with <code>&quot;capture&quot;: {&quot;mode&quot;: &quot;logs&quot;}</code>, and the uploader ships the log files with markdown links beside the stills. Some changes are proved by an exit code, and pretending otherwise would mean recording a video of a terminal.</p>
<h2 id="what-generalizes-and-what-doesn39t"><a class="anchor" href="#what-generalizes-and-what-doesn39t" aria-label="Permalink">§</a>What generalizes, and what doesn&#39;t</h2>
<p>The transferable idea is duller than the desktop, and it&#39;s the manifest, not the video: keep host-checkable provenance apart from self-declared fields instead of averaging them into one blob a reader has to trust wholesale. <code>source</code> comes from <code>git</code> and <code>gh</code> on your machine; <code>agent</code> is whatever the harness said about itself. Any tool emitting machine-generated evidence has that same split to make. Most of them quietly don&#39;t.</p>
<p>The limits, plainly: a recording shows one path through a UI, and a well-paced one can conceal as much as it proves. Read uncharitably, the playbook&#39;s pacing advice is advice on making a demo look good. A recording tells you the modal opened this once, on this commit, for this agent. That&#39;s much more than prose and much less than a test suite.</p>
<h2 id="what39s-left-and-the-invitation"><a class="anchor" href="#what39s-left-and-the-invitation" aria-label="Permalink">§</a>What&#39;s left, and the invitation</h2>
<p>Short list, in the order I&#39;d do it:</p>
<ul>
<li><strong>Auto-fill <code>agent.harness</code> and <code>agent.model</code></strong> so the manifest stops saying <code>unknown</code> unless someone remembered two env vars.</li>
<li><strong>One place for the display geometry.</strong> <code>1280x720</code> is currently written in the entrypoint and again in the ffmpeg line, and nothing stops them drifting.</li>
<li><strong>Windows and Linux hosts.</strong> In theory it just works — it&#39;s Docker plus a bind mount — but it&#39;s only tested on macOS.</li>
</ul>
<p>That&#39;s the whole roadmap. Better short than invented.</p>
<p>The repo is <strong><a href="https://github.com/lucastononro/pr-review-evidence" target="_blank" rel="noopener noreferrer" class="external">github.com/lucastononro/pr-review-evidence</a></strong> — MIT, seven bash scripts, one Dockerfile. Feedback and PRs welcome. Or just lift the scripts and use them for something else, if that&#39;s easier — nothing in here is clever enough to deserve being a dependency. If you record something with it, put the evidence in the PR. That&#39;s the point.</p>
<hr>
<p>Tests tell you the logic holds; they say nothing about whether the modal opens behind the header.</p>
]]></content:encoded>
    </item>
    <item>
      <title>notify: the agent shouts down the hallway</title>
      <link>https://lucastononro.github.io/notify/</link>
      <guid isPermaLink="true">https://lucastononro.github.io/notify/</guid>
      <pubDate>Wed, 27 May 2026 12:00:00 GMT</pubDate>
      <description>Your machine can already talk; the hard part is stopping the agent from reading file paths aloud.</description>
      <category>skill</category>
      <content:encoded><![CDATA[<p>The problem with an agent that works for eleven minutes is that you don&#39;t watch it for eleven minutes. You leave, and then you either come back too early and hover, or too late and it&#39;s been waiting six minutes for a yes/no.</p>
<p>Every product answer involves a push service, an API key and a phone. <a href="https://github.com/lucastononro/notify" target="_blank" rel="noopener noreferrer" class="external">notify</a> is the unglamorous one: <code>say</code> and <code>afplay</code>, both already on the machine. No key, no network, no telemetry, no vendor waiting for a credit card. On macOS the audio is two <code>subprocess.run</code> calls; everything interesting sits upstream.</p>
<p>Installing it is two lines in Claude Code, and the only prerequisite is <a href="https://docs.astral.sh/uv/" target="_blank" rel="noopener noreferrer" class="external"><code>uv</code></a> on your <code>PATH</code>:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span>/plugin marketplace add lucastononro/notify</span></span>
<span class="line"><span>/plugin install notify@notify-marketplace</span></span></code></pre><p>Codex is the same shape — <code>codex plugin marketplace add lucastononro/notify</code>, then <code>codex plugin add notify@notify-marketplace</code>. Check it works by asking for the smallest possible thing: <code>play a sound</code>, or <code>ping me when the tests pass</code>.</p>
<h2 id="reads-fine-sounds-awful"><a class="anchor" href="#reads-fine-sounds-awful" aria-label="Permalink">§</a>Reads fine, sounds awful</h2>
<p>A message that <em>reads</em> fine is usually unlistenable, and nothing tells the model a sentence must survive being spoken. So the rules live in the <code>notify</code> docstring, the one place the model definitely reads:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span>Speech-friendly rules — the model MUST follow these when composing beats:</span></span>
<span class="line"><span>- Plain English sentences only. No tables, bullets, markdown, code, file</span></span>
<span class="line"><span>  paths, URLs, long numbers, version strings, or punctuation-heavy text.</span></span>
<span class="line"><span>- Each beat should be short and natural — read it out loud mentally first.</span></span>
<span class="line"><span>  Typical beat: one sentence, ~5–20 words. Length follows content.</span></span>
<span class="line"><span>- Split into multiple beats when content has distinct parts …</span></span></code></pre><p>Every prohibition maps to a failure mode. Tables get read column by column and arrive as nonsense. Paths get spelled: <code>src/foo.ts</code> becomes &quot;S R C slash foo dot T S&quot;. Percentages get read literally, so <code>87.4% (+2.1%)</code> is a run of digits you can&#39;t hold in your head. Hashes and version strings are worse.</p>
<p>The skill pairs each with what you want to hear. Not &quot;Tests failing in src/auth/login.test.ts at line 47&quot; but &quot;Auth tests are failing on the login endpoint.&quot; Not &quot;Coverage: 87.4% (+2.1%)&quot; but &quot;Coverage is up two percent.&quot; Not &quot;Blocked. Options: 1) Postgres, 2) Mongo, 3) SQLite&quot; but &quot;Blocked. Need you to choose between Postgres and Mongo.&quot;<label class="sn-ref" for="sn-sql" tabindex="0">1</label><input type="checkbox" id="sn-sql" class="sn-toggle" aria-hidden="true"><span class="sidenote" role="note"><span class="sn-num">1</span>The rules stop short of banning acronyms: <code>API</code> reads acceptably as &quot;A P I&quot;, but <code>SQL</code> comes out as &quot;Sequel&quot; — which the skill flags with &quot;Test if unsure.&quot;</span></p>
<p>That bad column is constructed, not collected — but it&#39;s what a model writes by default, because by default it writes for a screen. Note what the rewrites give up: the line number, the exact figure, the third option. That&#39;s not compression, it&#39;s a change of medium. Detail belongs in the chat.</p>
<h2 id="beats-not-paragraphs"><a class="anchor" href="#beats-not-paragraphs" aria-label="Permalink">§</a>Beats, not paragraphs</h2>
<p>The other half is pacing. One long sentence, spoken, arrives as a wall — you catch the opening clause and miss the verdict. So the tool takes beats, not a string:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">for</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> beat </span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">in</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> beats</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">    text </span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> (</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">beat</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">get</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">text</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">)</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676"> or</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> ""</span><span style="--shiki-light:#999999;--shiki-dark:#666666">).</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">strip</span><span style="--shiki-light:#999999;--shiki-dark:#666666">()</span></span>
<span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">    if</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676"> not</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> text</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span></span>
<span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">        continue</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">    _speak</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">voice</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> text</span><span style="--shiki-light:#999999;--shiki-dark:#666666">)</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">    spoken </span><span style="--shiki-light:#999999;--shiki-dark:#666666">+=</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 1</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">    pause </span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> beat</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">get</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">pause_after</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 0.3</span><span style="--shiki-light:#999999;--shiki-dark:#666666">)</span></span>
<span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">    if</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> pause </span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">and</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> pause </span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">></span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 0</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">        time</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">sleep</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">min</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">float</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">pause</span><span style="--shiki-light:#999999;--shiki-dark:#666666">),</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 5.0</span><span style="--shiki-light:#999999;--shiki-dark:#666666">))</span></span></code></pre><p>Each beat is its own <code>say</code> invocation, so the gap is real silence, not a comma the synthesizer may or may not honor. <code>pause_after</code> defaults to <code>0.3</code> seconds and is clamped by <code>min(float(pause), 5.0)</code> — a model that can pass a float will eventually pass thirty, and a tool that holds the session for half a minute is worse than silence. Empty beats are skipped, same instinct.</p>
<p>The docstring caps the count at three: &quot;1–3 beats is normal; more than 3 means rewrite shorter.&quot; Past three you aren&#39;t notifying, you&#39;re presenting. The return is a plain sentence — <code>Played 2 beat(s) with voice &#39;Ava (Premium)&#39; on mac</code> — so the model sees what it did.</p>
<h2 id="fourteen-sounds-seven-categories"><a class="anchor" href="#fourteen-sounds-seven-categories" aria-label="Permalink">§</a>Fourteen sounds, seven categories</h2>
<p>Sound names are public API and platform-agnostic. The indirection that buys that: one dict from name to semantic category, a second from category to whatever the local system calls it:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076">SOUND_CATEGORY</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> =</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> {</span></span>
<span class="line"><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">    "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">hero</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">success</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">glass</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">neutral</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">sosumi</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">blocked</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">basso</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">error</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span></span>
<span class="line"><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">    "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">funk</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">warning</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">ping</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">fyi</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">tink</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">fyi</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">submarine</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">attention</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">    …</span></span>
<span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666">}</span></span>
<span class="line"><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076">LINUX_CANBERRA_EVENT</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> =</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> {</span></span>
<span class="line"><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">    "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">success</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">complete</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">neutral</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">bell</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">fyi</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">message</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">    …</span></span>
<span class="line"><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">    "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">blocked</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">dialog-warning</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">error</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">dialog-error</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span></span>
<span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666">}</span></span></code></pre><figure class="diagram"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 300" role="img"
     aria-label="The public sound name sosumi maps to the semantic category blocked, which each platform resolves its own way: macOS plays /System/Library/Sounds/Sosumi.aiff with afplay, keyed by the name rather than the category; Linux asks canberra for the dialog-warning event, else plays dialog-warning.oga; Windows tries %WINDIR%\Media\Windows Exclamation.wav, else falls back to MessageBeep with MB_ICONEXCLAMATION. When nothing resolves the tool returns a descriptive string instead of raising.">
  <!-- Hand-drawn on purpose: wobbly paths, not rects. Colours come from the
       page via the dg-* classes so the drawing follows the theme. -->
  <g stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7">

    <!-- the public name -->
    <path class="dg-fill" d="M26 120 L159 117 Q165 118 164 124 L166 170 Q165 177 158 176 L30 178 Q23 177 24 170 L25 125 Q25 120 26 120 Z"/>
    <text class="dg-text" x="44" y="146">sosumi</text>
    <text class="dg-note" x="44" y="166">1 of 14 names</text>

    <!-- the semantic category -->
    <path class="dg-fill" d="M218 120 L369 117 Q375 118 374 124 L376 170 Q375 177 368 176 L222 178 Q215 177 216 170 L217 125 Q217 120 218 120 Z"/>
    <text class="dg-text" x="236" y="146">blocked</text>
    <text class="dg-note" x="236" y="166">1 of 7 categories</text>

    <!-- macOS: straight off the name -->
    <path class="dg-fill" d="M428 34 L739 31 Q745 32 744 38 L746 84 Q745 91 738 90 L432 92 Q425 91 426 84 L427 39 Q427 34 428 34 Z"/>
    <text class="dg-text" x="446" y="58">macOS</text>
    <text class="dg-note" x="446" y="78">afplay /System/Library/Sounds/Sosumi.aiff</text>

    <!-- Linux: freedesktop theme by category -->
    <path class="dg-fill" d="M428 106 L739 103 Q745 104 744 110 L746 170 Q745 177 738 176 L432 178 Q425 177 426 170 L427 111 Q427 106 428 106 Z"/>
    <text class="dg-text" x="446" y="130">Linux</text>
    <text class="dg-note" x="446" y="150">canberra event: dialog-warning</text>
    <text class="dg-note" x="446" y="168">else dialog-warning.oga via paplay</text>

    <!-- Windows: a candidate list, then a beep flag -->
    <path class="dg-fill" d="M428 192 L739 189 Q745 190 744 196 L746 256 Q745 263 738 262 L432 264 Q425 263 426 256 L427 197 Q427 192 428 192 Z"/>
    <text class="dg-text" x="446" y="216">Windows</text>
    <text class="dg-note" x="446" y="236">%WINDIR%\Media\Windows Exclamation.wav</text>
    <text class="dg-note" x="446" y="254">else MessageBeep MB_ICONEXCLAMATION</text>

    <!-- hop 1: name to category -->
    <path class="dg-accent" d="M166 148 Q192 153 214 148"/>
    <path class="dg-accent" d="M214 148 l-9 -4 m9 4 l-9 5"/>
    <text class="dg-note" x="174" y="138">hop 1</text>

    <!-- macOS skips the category entirely -->
    <path class="dg-accent" d="M104 118 Q104 66 160 62 Q288 56 416 61"/>
    <path class="dg-accent" d="M416 61 l-9 -4 m9 4 l-9 5"/>
    <text class="dg-note" x="180" y="46">MAC_SOUNDS is keyed by name</text>

    <!-- hop 2: category to whatever the local system calls it -->
    <path class="dg-accent" d="M376 146 Q398 150 420 142"/>
    <path class="dg-accent" d="M420 142 l-9 -4 m9 4 l-9 5"/>
    <text class="dg-note" x="380" y="134">hop 2</text>

    <path class="dg-accent" d="M350 178 Q378 200 418 222"/>
    <path class="dg-accent" d="M418 222 l-5 -9 m5 9 l-10 0"/>

    <!-- the guard, when every candidate misses -->
    <path class="dg-fill" d="M26 202 L353 199 Q359 200 358 206 L360 268 Q359 275 352 274 L30 276 Q23 275 24 268 L25 207 Q25 202 26 202 Z"/>
    <text class="dg-text" x="44" y="226">nothing resolves</text>
    <text class="dg-note" x="44" y="246">a descriptive string, not an exception</text>
    <text class="dg-note" x="44" y="264">Could not play sound 'sosumi' …</text>

    <path class="dg-accent" stroke-dasharray="5 6" d="M424 250 Q394 256 364 250"/>
    <path class="dg-accent" d="M364 250 l9 -4 m-9 4 l9 5"/>
  </g>
</svg>
<figcaption>One name end to end: two hops off macOS, one on it, and a sentence rather than an exception when every candidate misses.</figcaption></figure>
<p>Fourteen names, seven categories. On macOS the name resolves straight to <code>/System/Library/Sounds/Hero.aiff</code>. Everywhere else the category does the work, so an unfamiliar box degrades instead of failing. Windows walks a list of <code>%WINDIR%\Media</code> candidates, then drops to a <code>winsound.MessageBeep</code> flag for when Microsoft has renamed the WAVs again. Linux asks the freedesktop theme for the event, then hunts <code>.oga</code> files under <code>/usr/share/sounds/freedesktop/stereo</code>.</p>
<p><code>sosumi</code> is the one I care about — <em>blocked</em>, the agent wants a decision. It sounds genuinely unlike <code>basso</code>, which is <em>error</em>. From the next room that difference is the whole product: one means come back, the other means it can wait.</p>
<h2 id="voices-and-guards"><a class="anchor" href="#voices-and-guards" aria-label="Permalink">§</a>Voices and guards</h2>
<p>Voice selection is a preference ladder: <code>VOICE_PRIORITY</code> runs from <code>&quot;Ava (Premium)&quot;</code> down through Premium and Enhanced voices to plain <code>&quot;Samantha&quot;</code>, which ships on every mac. The server runs <code>say -v ?</code> once, takes the first entry installed, and caches it in <code>_voice_cache</code>.<label class="sn-ref" for="sn-regex" tabindex="0">2</label><input type="checkbox" id="sn-regex" class="sn-toggle" aria-hidden="true"><span class="sidenote" role="note"><span class="sn-num">2</span>The check is a regex anchored to a locale code — the name followed by <code>\s+[a-z]{2}_[A-Z]{2}</code> — because <code>say -v ?</code> prints a sample sentence beside each voice, and a substring match hits the sample.</span></p>
<p>Nothing on that path raises. A missing voice, an absent sound file, a Linux box with no <code>paplay</code> — <code>_play</code> returns <code>False</code>, <code>_speak</code> returns quietly, and the tool turns that into a sentence: <code>Could not play sound &#39;hero&#39; on linux (no audio backend available)</code>. A misspelling gets <code>Unknown sound &#39;heroo&#39;. Valid: basso, blow, bottle, …</code>.</p>
<p>That&#39;s deliberate: the caller is a language model, and a descriptive string is something it can act on where an exception is a wall. A crashed attention tool leaves the agent stuck <em>and</em> silent.</p>
<h2 id="one-command-two-harnesses"><a class="anchor" href="#one-command-two-harnesses" aria-label="Permalink">§</a>One command, two harnesses</h2>
<p>The MCP server is a published package, not a bundled script. Both plugins register it with a byte-identical command:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span>uvx --from "git+https://github.com/lucastononro/notify#subdirectory=mcp-server" notify-mcp</span></span></code></pre><p><code>uvx</code> builds and caches it from git on first run with its single dependency, <code>mcp[cli]&gt;=1.2.0</code>, resolved against the <code>notify-mcp</code> console script in <code>pyproject.toml</code>. No path appears in either config — no plugin-root substitution variable, no venv, nothing to break on a clone elsewhere. The only difference is the JSON around it: Claude Code wants <code>{&quot;mcpServers&quot;: {…}}</code>, Codex a bare server map.</p>
<p>The skills diverge more than I expected. Claude Code&#39;s <code>SKILL.md</code> calls the tools <code>mcp__notify__notify</code> and declares <code>allowed-tools: … Bash(afplay:*), Bash(say:*)</code>, so it carries a macOS-only shell fallback re-implementing the voice ladder in <code>sed</code> and <code>grep</code>. Codex&#39;s calls them <code>notify</code> and <code>play_sound</code>, has no <code>allowed-tools</code>, drops the fallback, and keeps its trigger policy in a sibling <code>agents/openai.yaml</code> — <code>allow_implicit_invocation: true</code> plus a declared MCP dependency.<label class="sn-ref" for="sn-desc" tabindex="0">3</label><input type="checkbox" id="sn-desc" class="sn-toggle" aria-hidden="true"><span class="sidenote" role="note"><span class="sn-num">3</span>The descriptions diverge too. Codex&#39;s packs the whole trigger-and-don&#39;t-trigger policy into <code>description</code>; Claude Code&#39;s ends in a keyword list — &quot;Triggers on: notify me, ping me, …&quot;.</span></p>
<p>macOS is tested. Windows and Linux are marked best-effort and untested, and the whole platform layer is one 327-line file — so when it&#39;s wrong, it&#39;s wrong somewhere obvious.</p>
<h2 id="three-ways-i-actually-use-it"><a class="anchor" href="#three-ways-i-actually-use-it" aria-label="Permalink">§</a>Three ways I actually use it</h2>
<p>Here it is talking, so the rest of this is less abstract. Turn your sound on!! The whole artifact is audio, and a silent screenshot of it would be a blank rectangle:</p>
<figure class="video">
  <video class="video-file" src="/video/notify-demo.mp4" poster="/video/notify-demo.jpg"
         controls preload="none" playsinline width="1280" height="720"></video>
  <figcaption>A throwaway demo: I asked it to explain something at random, purely so there is a recording of the thing speaking.</figcaption>
</figure>
<p>That&#39;s a deliberately pointless message. The three below are what I actually ask for, verbatim.</p>
<p><strong>Waiting on an interval.</strong></p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span>loop on this every 15 minutes: check whether the sweep has finished.</span></span>
<span class="line"><span>stay silent while it's still running. when it's done, notify me with the</span></span>
<span class="line"><span>best validation score and whether it beat the baseline.</span></span></code></pre><p>Polling is the thing computers are for, and my attention is the expensive resource. The instruction that earns its place is <em>stay silent while it&#39;s still running</em>. Without it you get a chime every fifteen minutes telling you the thing you already knew, and by the third one you&#39;ve stopped hearing chimes (ask me how I know).</p>
<p><strong>Telling parallel sessions apart.</strong> This is the one that changed how I work.</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span>when you're finished, notify me — and name the repo you were working in and</span></span>
<span class="line"><span>what you actually changed, so I know which window to come back to. don't</span></span>
<span class="line"><span>just say "done".</span></span></code></pre><p>With four cloud sessions running, <em>&quot;done&quot;</em> is a useless notification: it tells me something finished, not which tab to open. What I want is <em>&quot;The billing migration is in. Two tests failed on the retry path&quot;</em> — now I know where to go before I&#39;ve looked at anything. This is where the speech-friendly rules stop being fussy and become the product, because the beat has to name the project in <em>words</em>. A session id read aloud is noise, and four sessions all saying &quot;task complete&quot; is worse than silence.</p>
<p><strong>Being interrupted on purpose.</strong> For a long session pointed at one goal, I ask for two different pings with two different sounds:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span>work through this on your own — I'll be away. play `hero` and notify me</span></span>
<span class="line"><span>when it's green. if you hit a decision that's mine to make, stop and</span></span>
<span class="line"><span>notify me with `sosumi`, and say what the decision is in one sentence.</span></span></code></pre><p>The second half is by far the more valuable. A finished agent costs me a few minutes of latency. A <em>blocked</em> agent that waits silently costs the rest of the session, and there&#39;s no upper bound on how long it will sit there being polite.<label class="sn-ref" for="sn-why" tabindex="0">4</label><input type="checkbox" id="sn-why" class="sn-toggle" aria-hidden="true"><span class="sidenote" role="note"><span class="sn-num">4</span>Naming the sound in the prompt is optional — the skill picks a sensible one from the situation. I name it anyway for the second case, because <em>blocked</em> and <em>broken</em> need to be distinguishable from the next room, and I would rather not trust a judgment call about my own kitchen acoustics.</span></p>
<p>None of that needed a feature. It&#39;s the same two tools with a different sentence in the request, which is about the ratio I&#39;d expect: the tool is trivial, and the discipline is knowing what to ask to be told.</p>
<h2 id="what-the-medium-demands"><a class="anchor" href="#what-the-medium-demands" aria-label="Permalink">§</a>What the medium demands</h2>
<p>Nothing in a model&#39;s training tells it the output will be spoken. Its default target is a screen: a table, a path, a figure to three decimals. So everything in <code>notify</code> that isn&#39;t two <code>subprocess.run</code> calls is a translation layer for that mismatch, written where the model definitely reads it, not in prose it might skim. That&#39;s the transferable part. Move an agent&#39;s output somewhere new — a watch line, a Slack push, an email subject, a sound — and you inherit constraints nobody has written down. The tool has to state them, because the model can&#39;t notice them from the inside.</p>
<p>The honest scope is narrow. This solves one person&#39;s annoyance about hovering over a terminal. The piece I&#39;d actually miss is the smallest one: <code>sosumi</code> against <code>basso</code>, blocked against error, which only means anything once you&#39;ve already left the room. Take away the beats and the sound table and I&#39;m back to checking every two minutes.</p>
<hr>
<p>Side effect I didn&#39;t expect: I now leave the room on purpose.</p>
]]></content:encoded>
    </item>
    <item>
      <title>tiny-claude-recycler: a subscription is an API key now</title>
      <link>https://lucastononro.github.io/tiny-claude-recycler/</link>
      <guid isPermaLink="true">https://lucastononro.github.io/tiny-claude-recycler/</guid>
      <pubDate>Thu, 14 May 2026 12:00:00 GMT</pubDate>
      <description>Anthropic made a Claude subscription programmable. That turns every seat in a company into quota, which is the uncomfortable part.</description>
      <category>skill</category>
      <content:encoded><![CDATA[<p><strong>TL;DR</strong> — <a href="https://github.com/lucastononro/tiny-claude-recycler" target="_blank" rel="noopener noreferrer" class="external">tiny-claude-recycler</a> round-robins a pool of Claude OAuth subscription tokens and falls back to a real API key when they&#39;re all rate-limited. <code>pip install tiny-claude-recycler</code>, zero runtime dependencies. It exists because <code>claude setup-token</code> turned a $200 subscription into something a script can spend.</p>
<p>The change that made it interesting is one command. <code>claude setup-token</code> mints a one-year OAuth token, you export it as <code>CLAUDE_CODE_OAUTH_TOKEN</code>, and the Agent SDK bills your Pro or Max plan instead of API credits:</p>
<figure><img src="/images/claude-setup-token-docs.jpg" alt="Anthropic&#39;s own docs on the long-lived token: one year, subscription-billed, meant for CI" loading="lazy"><figcaption>Anthropic's own docs on the long-lived token: one year, subscription-billed, meant for CI</figcaption></figure>
<p>Read that as a pricing document rather than a CI convenience and it says something else. <a href="https://support.claude.com/en/articles/11049741-what-is-the-max-plan" target="_blank" rel="noopener noreferrer" class="external">Max 20x is $200 a month</a>, flat. Before this, driving a product off inference meant metered API billing. After it, one seat is a fixed-cost quota you can point a script at — and a company with forty seats has forty of them.</p>
<h2 id="what-it-does"><a class="anchor" href="#what-it-does" aria-label="Permalink">§</a>What it does</h2>
<p>Round-robin the pool, retry on failure, fall back to the master key:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">from</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> tcr </span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">import</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> recycler</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> Secret</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">recycler</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">master_key </span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> Secret</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">sk-ant-api03-...</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">)</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">recycler</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">oauth_keys </span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> [</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">Secret</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">sk-ant-oat01-...</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">),</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> Secret</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">sk-ant-oat01-...</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">)]</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666">@</span><span style="--shiki-light:#59873A;--shiki-dark:#80A665">recycler</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#59873A;--shiki-dark:#80A665">cycle</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">retries</span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91">3</span><span style="--shiki-light:#999999;--shiki-dark:#666666">)</span></span>
<span class="line"><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">def</span><span style="--shiki-light:#59873A;--shiki-dark:#80A665"> ask</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">prompt</span><span style="--shiki-light:#999999;--shiki-dark:#666666">):</span></span>
<span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">    return</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> query</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">prompt</span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">prompt</span><span style="--shiki-light:#999999;--shiki-dark:#666666">)</span></span></code></pre><p>The only subtle part is the unsetting. Claude Code&#39;s <a href="https://code.claude.com/docs/en/authentication#authentication-precedence" target="_blank" rel="noopener noreferrer" class="external">authentication precedence</a> puts <code>ANTHROPIC_AUTH_TOKEN</code> and <code>ANTHROPIC_API_KEY</code> <strong>above</strong> <code>CLAUDE_CODE_OAUTH_TOKEN</code>, so a stray API key in your environment silently wins and quietly bills your credit card while you believe you&#39;re spending a subscription. Every cycle clears both before it swaps.<label class="sn-ref" for="sn-client" tabindex="0">1</label><input type="checkbox" id="sn-client" class="sn-toggle" aria-hidden="true"><span class="sidenote" role="note"><span class="sn-num">1</span>The other trap is object lifetime. Construct <code>Anthropic()</code> inside the wrapped function — a long-lived client built before the decorator ran already captured whatever key was set at construction and never sees a swap. <code>Secret</code> redacts itself in <code>repr</code>, so tokens stay out of tracebacks.</span></p>
<h2 id="the-part-i39d-rather-say-out-loud"><a class="anchor" href="#the-part-i39d-rather-say-out-loud" aria-label="Permalink">§</a>The part I&#39;d rather say out loud</h2>
<p>Rotation isn&#39;t clever. Rotation is what you write on the afternoon you notice that N seats is N × $200 of quota with no metering attached, and that nothing in the stack checks whose seat it is. The tool doesn&#39;t ask, either — it takes a list of strings.</p>
<p>Which is where I&#39;ll stop, because there are two very different versions of this. Pooling tokens you own — your Max seat, your CI, your side project — is housekeeping, and that&#39;s what I built it for. Pooling your colleagues&#39; seats to run your product is spending someone else&#39;s subscription under terms they agreed to and you didn&#39;t read, and the fact that it works is not the same as the fact that you may. The mechanism is genuinely interesting. The version of it I keep hearing pitched is a billing exploit with a rotation library in front.</p>
<hr>
<p>Anthropic shipped a convenience for CI and accidentally shipped a price list; the library is just me being tidy about it.</p>
]]></content:encoded>
    </item>
    <item>
      <title>paper-videos: a paper in, an explainer out</title>
      <link>https://lucastononro.github.io/paper-videos/</link>
      <guid isPermaLink="true">https://lucastononro.github.io/paper-videos/</guid>
      <pubDate>Sat, 09 May 2026 12:00:00 GMT</pubDate>
      <description>The explainer nobody has the weeks to animate, assembled beat by beat while you watch.</description>
      <category>agents</category>
      <content:encoded><![CDATA[<p>Start with the output. The first of these came from an arXiv id, the second from a sentence with no paper behind it. Both came out of <a href="https://github.com/lucastononro/paper-videos" target="_blank" rel="noopener noreferrer" class="external">paper-videos</a>, which fills in an editor at <code>localhost:5173</code> while you watch.</p>
<figure class="video">
  <button class="video-embed" type="button" data-yt="kHtdshmZsio" data-start="227"
          aria-label="Play video: “MELT: Letting AI Think Longer Without Bloated Memory” — a paper, explained.">
    <img src="https://i.ytimg.com/vi/kHtdshmZsio/maxresdefault.jpg" alt="" width="1280" height="720" loading="lazy"
         onerror="this.onerror=function(){this.remove()};this.src='https://i.ytimg.com/vi/kHtdshmZsio/hqdefault.jpg'">
    <span class="video-play" aria-hidden="true"></span>
    <span class="video-label" aria-hidden="true">“MELT: Letting AI Think Longer Without Bloated Memory” — a paper, explained.</span>
  </button>
  <figcaption>“MELT: Letting AI Think Longer Without Bloated Memory” — a paper, explained. <a class="video-link" href="https://www.youtube.com/watch?v=kHtdshmZsio&t=227s"
    target="_blank" rel="noopener noreferrer">Watch on YouTube ↗</a></figcaption>
</figure>
<figure class="video">
  <button class="video-embed" type="button" data-yt="ozWnqv_DENI" data-start="490"
          aria-label="Play video: “Évariste Galois — Life and Theory” — the same pipeline, no PDF involved.">
    <img src="https://i.ytimg.com/vi/ozWnqv_DENI/maxresdefault.jpg" alt="" width="1280" height="720" loading="lazy"
         onerror="this.onerror=function(){this.remove()};this.src='https://i.ytimg.com/vi/ozWnqv_DENI/hqdefault.jpg'">
    <span class="video-play" aria-hidden="true"></span>
    <span class="video-label" aria-hidden="true">“Évariste Galois — Life and Theory” — the same pipeline, no PDF involved.</span>
  </button>
  <figcaption>“Évariste Galois — Life and Theory” — the same pipeline, no PDF involved. <a class="video-link" href="https://www.youtube.com/watch?v=ozWnqv_DENI&t=490s"
    target="_blank" rel="noopener noreferrer">Watch on YouTube ↗</a></figcaption>
</figure>
<h2 id="the-part-that-doesn39t-get-made"><a class="anchor" href="#the-part-that-doesn39t-get-made" aria-label="Permalink">§</a>The part that doesn&#39;t get made</h2>
<p>Reading the MELT paper is not the hard part. It&#39;s a clear paper about a real trick — loop the layers, keep one KV cache, stop paying for extra thinking in memory. Plenty of people could read it over a coffee and tell you accurately what it does.</p>
<p>The second craft is not so widely held. Scripting twelve minutes so the first fifteen seconds earn the rest. Deciding which two contributions survive. Narrating it so it sounds like someone who understands it. Animating an equation so the eye lands on the right term as the voice names it. Pacing the thing so attention holds. That&#39;s a different profession, and a slow one: a single 3Blue1Brown video is weeks of animation work, and the people who do it that well are countable. Not a complaint about them — it&#39;s why the skill is scarce in a way that reading the paper is not.</p>
<p>So the explanation mostly doesn&#39;t get made. The knowledge stays in the PDF, read by the few hundred people who were going to read it anyway. The reader who needed twelve good minutes never gets them.</p>
<p>What this pipeline automates is the production, not the understanding. The brief, the beat-by-beat script, the ElevenLabs narration, the Manim scenes, the Remotion assembly — machine work now. The judgment is not: what to explain, what to cut, whether the analogy is honest, whether the voice is bearable. Taste can&#39;t be handed over, so the doctrine stops the producer dead after three narrated beats and makes you listen. The <code>video-qa</code> agent exists because the pipeline isn&#39;t trusted to grade its own output. It&#39;s alpha, and the boundary cuts both ways: a bad script now yields a well-produced bad video faster than it used to yield a bad one. Cheap production doesn&#39;t make the decisions cheap. It stops them being buried under twelve hours of keyframing.</p>
<figure><img src="/images/paper-videos-editor.jpg" alt="The editor mid-Galois: parent chat left, the player above a filmstrip and the visual-blocks / voice-beats lanes, a time crop selected at 10:51→11:44, QA clean across 208 beats." loading="lazy"><figcaption>The editor mid-Galois: parent chat left, the player above a filmstrip and the visual-blocks / voice-beats lanes, a time crop selected at 10:51→11:44, QA clean across 208 beats.</figcaption></figure>
<h2 id="the-pipeline"><a class="anchor" href="#the-pipeline" aria-label="Permalink">§</a>The pipeline</h2>
<figure class="diagram"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 340" role="img"
     aria-label="Pipeline: paper in, brief, script, narration and Manim per beat, render out">
  <!-- Hand-drawn on purpose: every box is a wobbly path, not a rect, and every
       edge overshoots slightly. Colours come from the page via CSS classes. -->
  <g stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7">

    <!-- paper in -->
    <path class="dg-fill" d="M22 40 L152 37 Q158 38 157 44 L159 88 Q158 95 151 94 L26 96 Q19 95 20 88 L21 45 Q21 40 22 40 Z"/>
    <text class="dg-text" x="42" y="62">arXiv id / PDF</text>
    <text class="dg-note" x="42" y="79">or just a topic</text>

    <!-- critic -->
    <path class="dg-fill" d="M232 38 L344 36 Q350 37 349 43 L351 87 Q350 94 343 93 L236 95 Q229 94 230 87 L231 44 Q231 39 232 38 Z"/>
    <text class="dg-text" x="252" y="62">critic</text>
    <text class="dg-note" x="252" y="79">plans the brief</text>

    <!-- storyteller -->
    <path class="dg-fill" d="M424 39 L556 37 Q562 38 561 44 L563 88 Q562 95 555 94 L428 96 Q421 95 422 88 L423 45 Q423 40 424 39 Z"/>
    <text class="dg-text" x="444" y="62">storyteller</text>
    <text class="dg-note" x="444" y="79">script.md, in beats</text>

    <!-- producer -->
    <path class="dg-fill" d="M232 176 L346 174 Q352 175 351 181 L353 225 Q352 232 345 231 L236 233 Q229 232 230 225 L231 182 Q231 177 232 176 Z"/>
    <text class="dg-text" x="252" y="200">producer</text>
    <text class="dg-note" x="252" y="217">narrates each beat</text>

    <!-- visualizer -->
    <path class="dg-fill" d="M424 177 L554 175 Q560 176 559 182 L561 226 Q560 233 553 232 L428 234 Q421 233 422 226 L423 183 Q423 178 424 177 Z"/>
    <text class="dg-text" x="444" y="200">visualizer</text>
    <text class="dg-note" x="444" y="217">Manim per beat</text>

    <!-- output -->
    <path class="dg-fill" d="M624 176 L736 174 Q742 175 741 181 L743 225 Q742 232 735 231 L628 233 Q621 232 622 225 L623 182 Q623 177 624 176 Z"/>
    <text class="dg-text" x="644" y="200">output.mp4</text>
    <text class="dg-note" x="644" y="217">Remotion</text>

    <!-- arrows, drawn with a little sag -->
    <path class="dg-accent" d="M162 66 Q196 61 224 66"/>
    <path class="dg-accent" d="M224 66 l-9 -4 m9 4 l-9 5"/>

    <path class="dg-accent" d="M356 66 Q390 71 416 66"/>
    <path class="dg-accent" d="M416 66 l-9 -4 m9 4 l-9 5"/>

    <!-- storyteller down and back to producer -->
    <path class="dg-accent" d="M492 100 Q495 132 400 138 Q320 143 291 170"/>
    <path class="dg-accent" d="M291 170 l1 -10 m-1 10 l9 -3"/>

    <path class="dg-accent" d="M357 204 Q390 199 416 204"/>
    <path class="dg-accent" d="M416 204 l-9 -4 m9 4 l-9 5"/>

    <path class="dg-accent" d="M565 204 Q592 209 616 204"/>
    <path class="dg-accent" d="M616 204 l-9 -4 m9 4 l-9 5"/>

    <!-- live-sync loop back to the editor -->
    <path class="dg-accent" stroke-dasharray="5 6" d="M300 236 Q300 286 470 288 Q640 290 672 240"/>
    <path class="dg-accent" d="M672 240 l-7 7 m7 -7 l1 10"/>
    <text class="dg-note" x="392" y="308">live-syncs after every beat — the editor fills in as it goes</text>

    <text class="dg-note" x="22" y="126">Claude Code is the orchestrator; each box is a subagent</text>
  </g>
</svg>
<figcaption>The orchestrator is Claude Code itself, running inside the repo. Deterministic work lives in `src/tools/` as typed CLIs; the agents only do the parts that need judgment.</figcaption></figure>
<p>That split is most of the design. <code>narrate.ts</code>, <code>render-manim.ts</code>, <code>qa.ts</code> and <code>render-remotion.ts</code> are ordinary <code>commander</code> CLIs — arguments in, JSON on stdout, exit codes that mean something. Anything requiring taste is a subagent: a critic plans the brief, a storyteller writes the beats, a producer narrates, a visualizer animates. Six specialists, no message bus, coordination written down as files — &quot;each subagent has its own context window — the brief / script / manifest in <code>videos/&lt;slug&gt;/</code> are the persistent contract between them.&quot;</p>
<p>Rule 2 keeps that honest: LaTeX comes only from <code>equations.json</code>, never from memory of the paper. In topic mode there is no paper — the Galois video never touched a PDF — so the critic fills that same file from its own research.</p>
<h2 id="the-micro-beat-doctrine"><a class="anchor" href="#the-micro-beat-doctrine" aria-label="Permalink">§</a>The micro-beat doctrine</h2>
<p>The part I&#39;d defend in a fight. A <strong>beat</strong> is one visual moment and one narration clip: 8–40 words, two to ten seconds, hard cap 300 characters. So a twelve-minute video is 100–160 beats, not thirty segments. As data, a beat is three lines of markdown:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#999999;--shiki-light-font-weight:bold;--shiki-dark:#666666;--shiki-dark-font-weight:bold">###</span><span style="--shiki-light:#1C6B48;--shiki-light-font-weight:bold;--shiki-dark:#4D9375;--shiki-dark-font-weight:bold"> beat-002</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">[VISUAL: continue]</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">"On a thirty-two thousand token generation, Ouro burns about twenty-eight gigabytes of VRAM."</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#999999;--shiki-light-font-weight:bold;--shiki-dark:#666666;--shiki-dark-font-weight:bold">###</span><span style="--shiki-light:#1C6B48;--shiki-light-font-weight:bold;--shiki-dark:#4D9375;--shiki-dark-font-weight:bold"> beat-004</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">[PAUSE 0.8s]</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">(silent)</span></span></code></pre><p><code>[VISUAL: continue]</code> earns its keep. The parser inherits the previous cue, and the migrator coalesces adjacent identical visuals into one <code>visualBlock</code> with one fade in and one fade out. Re-emit the cue instead and you get two blocks, each fading through the background — a flash to navy and back where nothing changed.</p>
<p>Downstream that becomes two arrays rather than one: <code>voice[]</code>, one-to-one with the mp3s, and <code>visualBlocks[]</code>, which are spans. MELT has 90 voice beats to 59 blocks. Its opening animation runs 588 frames beneath the first three, plays once, then holds its final frame — which is why scenes must end on a held tableau, never a <code>FadeOut</code>. Held black is indistinguishable from a broken render.</p>
<p>Reason three is the one that actually pays: &quot;Re-rendering one bad beat is cheap; re-rendering a 30-second monologue is not.&quot; When beat 87 is wrong, you fix beat 87.</p>
<h2 id="the-padding-arithmetic"><a class="anchor" href="#the-padding-arithmetic" aria-label="Permalink">§</a>The padding arithmetic</h2>
<p><code>narrate.ts</code> hands each mp3 to ffmpeg (<code>adelay</code> + <code>apad</code>) with two constants:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">const </span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">DEFAULT_PAD_LEADING_SEC</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> =</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 0.25</span><span style="--shiki-light:#999999;--shiki-dark:#666666">;</span></span>
<span class="line"><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">const </span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">DEFAULT_PAD_TRAILING_SEC</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> =</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 0.9</span><span style="--shiki-light:#999999;--shiki-dark:#666666">;</span></span></code></pre><p>ElevenLabs&#39; character-level alignment is collapsed into words and shifted by <code>padLeading</code>, so captions stay glued to speech that just moved. <code>audioDurationSeconds</code> is the last word&#39;s end plus the trailing pad. The segment builder then adds one more slice, <code>secondsToFrames(ts.audioDurationSeconds + 0.2, fps)</code>, commented &quot;add 200ms tail so visual settles after voice ends&quot;.</p>
<p>Worked through, on beat-001 of the MELT video: the last word ends at 6.015s, <code>audioDurationSeconds</code> is 6.915, <code>durationFrames</code> is <code>ceil(7.115 × 30) = 214</code>, and beat-002&#39;s first word starts at exactly 0.250s. Speech-end to speech-start: 1.368s. Segments butt straight up against each other in the manifest — every millisecond of that silence lives inside the audio files.<label class="sn-ref" for="sn-drift" tabindex="0">1</label><input type="checkbox" id="sn-drift" class="sn-toggle" aria-hidden="true"><span class="sidenote" role="note"><span class="sn-num">1</span>The repo disagrees with itself here — 0.6s appears in the prose section of <code>CLAUDE.md</code>, in <code>producer.md</code> and in <code>storyteller.md</code>; 0.9s appears in hard rule 4 and in the code. The mp3s on disk say 0.9.</span></p>
<figure class="diagram"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 290" role="img"
     aria-label="Timing diagram: two consecutive narrated beats, each mp3 padded with 0.25s of leading and 0.9s of trailing silence plus a 0.2s segment tail, giving about 1.35 seconds of silence between the end of one beat's speech and the start of the next">
  <!-- Hand-drawn on purpose: wobbly paths, not rects. Colours come from the
       page via the dg-* classes so the drawing follows the theme. -->
  <g stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7">

    <!-- the headline measurement: speech-end to speech-start -->
    <text class="dg-note" x="252" y="42">≈1.35s of silence = 0.9 + 0.2 + 0.25</text>
    <path class="dg-accent" stroke-dasharray="5 6" d="M268 52 Q335 57 402 52"/>
    <path class="dg-accent" d="M268 52 l9 -4 m-9 4 l9 5"/>
    <path class="dg-accent" d="M402 52 l-9 -4 m9 4 l-9 5"/>
    <path class="dg-accent" stroke-dasharray="5 6" d="M268 57 Q265 71 268 84"/>
    <path class="dg-accent" stroke-dasharray="5 6" d="M402 57 Q405 71 402 84"/>

    <!-- beat-001 segment -->
    <path class="dg-fill" d="M27 88 L366 85 Q372 86 371 92 L373 136 Q372 143 365 142 L31 144 Q24 143 25 136 L26 93 Q26 88 27 88 Z"/>
    <path class="dg-stroke" d="M58 87 Q55 112 59 142"/>
    <path class="dg-stroke" d="M268 86 Q271 113 267 143"/>
    <path class="dg-stroke" d="M336 87 Q333 112 337 142"/>
    <text class="dg-text" x="82" y="112">narration mp3</text>
    <text class="dg-note" x="82" y="130">beat-001 · 8–40 words</text>

    <!-- beat-002 segment, butted straight up against it -->
    <path class="dg-fill" d="M371 87 L707 85 Q713 86 712 92 L714 135 Q713 142 706 141 L375 143 Q368 142 369 135 L370 92 Q370 87 371 87 Z"/>
    <path class="dg-stroke" d="M402 87 Q399 112 403 141"/>
    <path class="dg-stroke" d="M612 86 Q615 113 611 142"/>
    <path class="dg-stroke" d="M680 87 Q677 112 681 141"/>
    <text class="dg-text" x="426" y="112">narration mp3</text>
    <text class="dg-note" x="426" y="130">beat-002 · first word 0.25s</text>

    <!-- dimension leaders down to the four padding cells -->
    <path class="dg-stroke" stroke-dasharray="5 6" d="M42 146 Q40 152 42 158"/>
    <text class="dg-note" x="22" y="172">0.25s lead</text>

    <path class="dg-stroke" stroke-dasharray="5 6" d="M302 146 Q300 152 302 158"/>
    <text class="dg-note" x="272" y="172">0.9s trail</text>

    <path class="dg-stroke" stroke-dasharray="5 6" d="M352 146 Q350 168 352 180"/>
    <text class="dg-note" x="300" y="194">0.2s segment tail</text>

    <path class="dg-stroke" stroke-dasharray="5 6" d="M386 146 Q388 176 386 202"/>
    <text class="dg-note" x="396" y="206">0.25s lead</text>

    <path class="dg-stroke" stroke-dasharray="5 6" d="M646 146 Q648 152 646 158"/>
    <text class="dg-note" x="584" y="172">same pads, every beat</text>

    <text class="dg-note" x="24" y="240">narrate.ts pads the mp3 with ffmpeg; every word timestamp shifts +0.25s so captions stay in sync</text>
    <text class="dg-note" x="24" y="262">durationFrames = ceil((last word end + 0.9 + 0.2) × 30) — beat-001 lands on 214 frames</text>
  </g>
</svg>
<figcaption>Two consecutive beats: the gap is three defaults stacked, not a gap.</figcaption></figure>
<p>Which is why the doctrine preempts the obvious mistake: &quot;Pauses between beats come for free via the audio-padding logic — do NOT also insert <code>[PAUSE 0.2s]</code> beats.&quot; <code>[PAUSE Xs]</code> is for deliberately long silences, 0.6s and up.</p>
<h2 id="cue-level-dispatch"><a class="anchor" href="#cue-level-dispatch" aria-label="Permalink">§</a>Cue-level dispatch</h2>
<p>Some beats want photographic motion rather than math. The storyteller signals that inside the cue&#39;s own <code>description</code>, with a <code>clip:</code> prefix (<code>veo:</code> is a legacy alias, treated identically):</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">[MANIM: teaser_markdown_accreting description="clip: cinematic 8 seconds, slow</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">push-in on a single glowing markdown file titled 'best_skill.md' … 8s, 16:9."]</span></span></code></pre><p>The visualizer expands that hint into a full cinematographic prompt and walks the chain — ElevenLabs Studio, then Veo, then Manim:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665">npm</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> run</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> elevenlabs-video</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> --</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">&#x3C;prompt></span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> -m</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> kling-2.6</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> --aspect</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> 16:9</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> \</span></span>
<span class="line"><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076">  --duration</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 8</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> --no-audio</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> --out</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> videos/</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">&#x3C;</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">slu</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">g</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">></span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">/manim/beat-NNN.mp4</span></span>
<span class="line"><span style="--shiki-light:#A0ADA0;--shiki-dark:#758575DD"># exit code 2 = 401/403/404 from the Studio endpoint → private-beta gate, not a failure</span></span>
<span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665">npm</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> run</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> veo</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> --</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">&#x3C;same prompt></span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> --model</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> veo-3.1-generate-preview</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> --aspect</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> 16:9</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> …</span></span></code></pre><p>Exit code 2 is reserved for 401/403/404, so &quot;you don&#39;t have beta access&quot; is machine-distinguishable from &quot;the render failed&quot;. Any other non-zero exit means Manim, always reachable.</p>
<p>The dispatch lives in the cue rather than in an agent&#39;s head for a boring reason: the mp4 lands at <code>manim/beat-NNN.mp4</code> whichever provider produced it, and the composition renders it as a <code>manimClip</code> either way. The winner is recorded in a <code>.elevenlabs.json</code> or <code>.veo.json</code> sidecar carrying the full prompt, so a re-render takes the same path. The script never has to know which key you hold.</p>
<h2 id="spot-edits"><a class="anchor" href="#spot-edits" aria-label="Permalink">§</a>Spot edits</h2>
<p>The manifest re-syncs after every narration and every render, and the teaser comes first, so you judge the voice within seconds rather than at minute twelve. A watcher notices each write and remounts the player.<label class="sn-ref" for="sn-fds" tabindex="0">2</label><input type="checkbox" id="sn-fds" class="sn-toggle" aria-hidden="true"><span class="sidenote" role="note"><span class="sn-num">2</span>The watcher is capped at <code>depth: 3</code> and ignores <code>media/</code>, <code>paper-md-assets/</code> and <code>manim-last-frames/</code>, because watching the whole tree opened 2000+ kqueue FDs on macOS, exhausted the process pool, and made the editor&#39;s later <code>spawn(&#39;claude&#39;)</code> fail with <code>EBADF</code>. The symptom was &quot;chat turn failed: spawn EBADF&quot; and a dead server.</span> So you can select a range on a video that doesn&#39;t exist yet:</p>
<figure><img src="/images/paper-videos-spot-edit.jpg" alt="Dragging horizontally on the filmstrip selects a time crop — `1:28→1:36 · 7.8s` — and an `↗ Spot-edit` pill appears beside it. The lanes below show what falls inside." loading="lazy"><figcaption>Dragging horizontally on the filmstrip selects a time crop — `1:28→1:36 · 7.8s` — and an `↗ Spot-edit` pill appears beside it. The lanes below show what falls inside.</figcaption></figure>
<p>Click it and you get a pin-point conversation about that range rather than about the video — a forked <code>claude --resume</code> session docked on the right, re-narrating and re-rendering while the parent chat carries on:</p>
<figure><img src="/images/paper-videos-spot-threads.jpg" alt="A thread scoped to `0:51→0:56`, running its own `render-manim` and `sync-manifest` loop while the parent chat reports a separate composition-layer fix." loading="lazy"><figcaption>A thread scoped to `0:51→0:56`, running its own `render-manim` and `sync-manifest` loop while the parent chat reports a separate composition-layer fix.</figcaption></figure>
<p>The thread gets the crop and a finding aid, not a task list — &quot;Stay inside the time crop. If a fix genuinely requires editing material outside it, stop and explain rather than silently widening scope.&quot; It closes itself by ending a turn with one line beginning <code>SUMMARY:</code>, which the server posts into the parent chat. Spawn several and each becomes a tab!!</p>
<h2 id="gates"><a class="anchor" href="#gates" aria-label="Permalink">§</a>Gates</h2>
<p>The first gate is <code>afplay</code> on beats 001 to 003: the producer stops and makes you listen before spending anything else. Fail fast, in the voice you&#39;ll hear for the next twelve minutes. The remedies are script-side — bad pronunciation is a phrasing problem, and pacing gets fixed with commas and em-dashes, not voice settings.</p>
<p>Then <code>npm run qa -- &lt;slug&gt;</code>, which exits 2 on anything error-severity: audio overlaps, silent gaps over 1.5s, missing mp3s or mp4s, unknown equation ids, bboxes off the page, adjacent same-content blocks — the flicker regression above, caught mechanically. My favorite check (having a favorite QA check is its own diagnosis) re-runs the LaTeX splitter over every equation and errors on any fragment with unbalanced <code>\begin</code>/<code>\end</code>. A regex splitter tears the <code>\\</code> row separators inside a <code>pmatrix</code>, and KaTeX renders the wreckage as red error text mid-frame while the narration carries on, unbothered. Underneath sits the least glamorous requirement in the repo: scenes must use <code>MathTex</code>, never <code>Text(&quot;vₜ&quot;)</code>. So <code>install.sh</code> puts TinyTeX in user space — without it, as the installer says, &quot;Manim equations will fall back to broken Unicode.&quot;</p>
<p>The gallery keeps what didn&#39;t survive alongside what did:</p>
<figure><img src="/images/paper-videos-gallery.jpg" alt="The home gallery: one card per folder in `videos/`, with duration and beat / block counts. Some carry a gold `✓ rendered` pill; the rest are drafts at `0 beats · 0 blocks`, several still titled `(unknown — will be filled by paper-extractor)`." loading="lazy"><figcaption>The home gallery: one card per folder in `videos/`, with duration and beat / block counts. Some carry a gold `✓ rendered` pill; the rest are drafts at `0 beats · 0 blocks`, several still titled `(unknown — will be filled by paper-extractor)`.</figcaption></figure>
<h2 id="running-it-yourself"><a class="anchor" href="#running-it-yourself" aria-label="Permalink">§</a>Running it yourself</h2>
<p>Two paid accounts and one script. You need a Claude Code login (Pro/Max or API credits — it&#39;s the orchestrator <em>and</em> the chat backend) and an ElevenLabs key for narration; the free tier covers short demos. Everything else is handled:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665">git</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> clone</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> https://github.com/lucastononro/paper-videos</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> &#x26;&#x26;</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965"> cd</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> paper-videos</span></span>
<span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665">./install.sh</span><span style="--shiki-light:#A0ADA0;--shiki-dark:#758575DD">             # idempotent — re-run any time</span></span>
<span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665">claude</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> /login</span><span style="--shiki-light:#A0ADA0;--shiki-dark:#758575DD">            # once; the claude CLI itself comes from docs.claude.com/claude-code</span></span>
<span class="line"><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">$EDITOR</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> .env             </span><span style="--shiki-light:#A0ADA0;--shiki-dark:#758575DD"># paste ELEVENLABS_API_KEY</span></span>
<span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665">./run.sh</span><span style="--shiki-light:#A0ADA0;--shiki-dark:#758575DD">                 # editor at localhost:5173</span></span></code></pre><p><code>install.sh</code> checks Node 20+, installs <code>uv</code> and ffmpeg if missing, runs <code>npm install</code>, <code>uv sync</code> (Manim + Marker + PyMuPDF) and <code>npx remotion browser ensure</code>, and puts TinyTeX in user space — the step you&#39;ll be tempted to skip with <code>--quick</code>, right up until your first equation renders as yellow boxes. Then open the gallery, click <strong>+ New video</strong>, give it an arXiv id or just a topic, and watch the timeline fill in. The only secret in the whole setup is the ElevenLabs key in a gitignored <code>.env</code>; Claude Code brings its own OAuth session and arXiv needs nothing.</p>
<h2 id="the-unit-is-the-design"><a class="anchor" href="#the-unit-is-the-design" aria-label="Permalink">§</a>The unit is the design</h2>
<p>The beat is not a formatting convention. It&#39;s the decision that sets the cost of being wrong, and everything else here is downstream of it. A pipeline whose smallest replaceable piece is a thirty-second monologue has to be right early, so the effort migrates into planning. Make the smallest piece four seconds of audio and one animation, and being wrong forty times is an ordinary afternoon. The partial manifest can truncate at the first unfinished beat only because beats don&#39;t depend on each other. A thread can be confined to a crop because beat 87 is something you can name and re-run.</p>
<p>That generalizes past video. The useful question for a generative pipeline is not how good its output is on a good day. It&#39;s how much you must discard to change one thing you dislike. Small units aren&#39;t free: they bought me <code>[VISUAL: continue]</code>, block coalescing and three stacked padding constants, all of which exist to hide seams a monologue would never have had.</p>
<hr>
<p>The machine will make the video in an afternoon now. Deciding it was worth making is still the whole job.</p>
]]></content:encoded>
    </item>
    <item>
      <title>pr-brief: a reviewer for PRs nobody wants to read</title>
      <link>https://lucastononro.github.io/pr-brief/</link>
      <guid isPermaLink="true">https://lucastononro.github.io/pr-brief/</guid>
      <pubDate>Sat, 25 Apr 2026 12:00:00 GMT</pubDate>
      <description>It groups a huge PR into features, picks the reading order, and narrates each diff from the side.</description>
      <category>skill</category>
      <content:encoded><![CDATA[<p>Three honest reasons <a href="https://github.com/lucastononro/pr-brief" target="_blank" rel="noopener noreferrer" class="external">pr-brief</a> exists. I had to review enormous PRs and couldn&#39;t ask everyone to stack them. The needles in that haystack aren&#39;t evenly distributed, so I wanted to know the right <em>order</em> to look. And reading code isn&#39;t the hard part — connecting a migration in one folder to a cache read in another is. That&#39;s the part you skip at file 140.</p>
<figure class="video">
  <button class="video-embed" type="button" data-yt="9d9u7UEAgLU" data-start="4"
          aria-label="Play video: “PR Brief skill” — the whole loop.">
    <img src="https://i.ytimg.com/vi/9d9u7UEAgLU/maxresdefault.jpg" alt="" width="1280" height="720" loading="lazy"
         onerror="this.onerror=function(){this.remove()};this.src='https://i.ytimg.com/vi/9d9u7UEAgLU/hqdefault.jpg'">
    <span class="video-play" aria-hidden="true"></span>
    <span class="video-label" aria-hidden="true">“PR Brief skill” — the whole loop.</span>
  </button>
  <figcaption>“PR Brief skill” — the whole loop. <a class="video-link" href="https://www.youtube.com/watch?v=9d9u7UEAgLU&t=4s"
    target="_blank" rel="noopener noreferrer">Watch on YouTube ↗</a></figcaption>
</figure>
<h2 id="grouping-before-reading"><a class="anchor" href="#grouping-before-reading" aria-label="Permalink">§</a>Grouping before reading</h2>
<p>Ask Claude to &quot;review this pr&quot; and one opus agent gets the file list, the diff and the PR body, and returns a <code>features.json</code>. A feature is a kebab-case change theme of one to three words — <code>ownership-guards</code>, <code>asgi-middleware</code>. Grouped by theme, not directory. A file carrying two themes joins them with a <code>+</code>: <code>sse-stability + inbox-ux</code>.</p>
<p>The ordering heuristic:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span>- Foundation first: migrations, schemas, core modules, shared utilities, types</span></span>
<span class="line"><span>- Domain/services next: business logic, repositories</span></span>
<span class="line"><span>- Entry points: controllers, API endpoints, middleware</span></span>
<span class="line"><span>- UI: components, stores, pages</span></span>
<span class="line"><span>- Last: docs, tests, build/ci</span></span>
<span class="line"><span>- Within each layer: higher blast_radius first</span></span></code></pre><p><code>blast_radius</code> (<code>high</code> for schema/auth/migrations, <code>low</code> for docs/tests/lockfiles) is only the tiebreak <em>inside</em> a layer. Sorting the whole PR by blast radius is the obvious move, and it&#39;s wrong: it puts the scary auth guard ahead of the migration that defines the column being guarded. Dependency order first, fear second. The agent also emits five to twelve <code>edges</code>, pairs like <code>[&quot;migrations&quot;,&quot;ai-enabled-flag&quot;]</code> meaning &quot;understanding A helps read B&quot;.<label class="sn-ref" for="sn-opus" tabindex="0">1</label><input type="checkbox" id="sn-opus" class="sn-toggle" aria-hidden="true"><span class="sidenote" role="note"><span class="sn-num">1</span><code>SKILL.md</code> mandates opus for every subagent: it &quot;makes fewer mistakes on diff analysis and feature grouping, which is load-bearing&quot;. Past 200 files it falls back to top-level directories.</span></p>
<h2 id="two-kinds-of-pill"><a class="anchor" href="#two-kinds-of-pill" aria-label="Permalink">§</a>Two kinds of pill</h2>
<p>Explain pills are the purple ✨ callouts in the 400px track right of each diff. Each must do three of four jobs: what the block does, why <em>this</em> approach, where it connects (a specific call site by <code>path:symbol</code>), and how it fits the feature. Job three hurts to write:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666">{</span></span>
<span class="line"><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">  "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">title</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">Pure ASGI to unblock SSE</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span></span>
<span class="line"><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">  "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">body</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">Switched from Starlette's `BaseHTTPMiddleware` to raw ASGI because the former buffers `StreamingResponse` bodies through an asyncio queue.</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076">\n\n</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">**Why now:** `inbox_service.stream_conversations` (next file) emits SSE — the buffer would have collapsed all events into a single chunk, which is the bug `sse-stability` fixes.</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span></span>
<span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666">}</span></span></code></pre><p>It names the approach that failed, the file you&#39;ll open next, and the feature it belongs to. None of that comes from reading one file. That&#39;s why step 6a exists — nothing but &quot;walk the sequence, find the seam where feature A&#39;s output becomes feature B&#39;s input&quot; before any pill is written.</p>
<h2 id="severity-that-means-something"><a class="anchor" href="#severity-that-means-something" aria-label="Permalink">§</a>Severity that means something</h2>
<p>Critique pills share that track in red, with an S1–S5 badge. As written:</p>
<ul>
<li><strong>S1 (nit)</strong> — style, naming, minor readability.</li>
<li><strong>S2 (suggestion)</strong> — a cleaner approach exists, not a bug.</li>
<li><strong>S3 (issue)</strong> — real concern: subtle bug, missing edge case, technical debt that will bite.</li>
<li><strong>S4 (problem)</strong> — a bug, security/perf concern, broken contract. Should block until addressed.</li>
<li><strong>S5 (blocker)</strong> — must-fix. Production-impacting bug, data-loss risk, security hole.</li>
</ul>
<p>The definitions are the easy half. The distribution guidance is what stops the scale collapsing: a typical 50-file PR &quot;might have 0 S5s, 1–3 S4s, 5–10 S3s, more S1–S2s&quot;, and a genuinely fine file gets zero critiques, not a forced S1. If everything is S5, nothing is. Vague critiques are banned — name the cleanup or skip the pill.</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666">{</span></span>
<span class="line"><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">  "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">title</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">Race in cache invalidation</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span></span>
<span class="line"><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">  "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">body</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">**`session_management.py`** clears the cache *before* `db.commit()`. A concurrent reader between the clear and the commit will repopulate stale data from the old transaction snapshot, defeating the invalidation.</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076">\n\n</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">Move the `cache.delete()` call after the commit, or use a write-through cache.</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span></span>
<span class="line"><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">  "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">severity</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 4</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span></span>
<span class="line"><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">  "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">start_line</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 142</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span></span>
<span class="line"><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">  "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">end_line</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 147</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span></span>
<span class="line"><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">  "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">side</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">RIGHT</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span></span>
<span class="line"><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">  "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">suggested_change</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">        db.commit()</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076">\n</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">        cache.delete(f</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076">\"</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">ai:{phone_group_key}</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076">\"</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">)</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span></span>
<span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666">}</span></span></code></pre><p>The good part is the mechanism — &quot;repopulate stale data from the old transaction snapshot&quot; — not the word &quot;race&quot;. <code>suggested_change</code> is optional, and it&#39;s what earns the click. &quot;Use as comment →&quot; pre-fills the inline editor with the critique and wraps the replacement in a GitHub <code>```suggestion</code> block, so the author gets the one-click accept UI.<label class="sn-ref" for="sn-posting" tabindex="0">2</label><input type="checkbox" id="sn-posting" class="sn-toggle" aria-hidden="true"><span class="sidenote" role="note"><span class="sn-num">2</span>Saves POST immediately, throttled server-side to one write per 1.5s (GitHub asks for ≥1s). On a secondary rate limit the server returns 429 and the UI flips itself into Batch mode, posting everything as one review.</span></p>
<h2 id="positions-before-the-browser"><a class="anchor" href="#positions-before-the-browser" aria-label="Permalink">§</a>Positions before the browser</h2>
<p>The build step flattens each file&#39;s diff into line objects carrying their GitHub <code>position</code>:</p>
<figure class="diagram"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 340" role="img"
     aria-label="Six rows of one file's unified diff, each labelled with three coordinates. The @@ hunk header is position 1 with no old_line and no new_line; context rows carry both; add rows carry only a new_line; delete rows carry only an old_line. Position increments on every row, counts the header, and resets in the next file. Below, the pill author emits start_line 2, end_line 4 and side RIGHT using post-change numbers only, and the build step matches new_line for RIGHT or old_line for LEFT to recover the position.">
  <!-- Hand-drawn on purpose: wobbly paths, not rects. Colours come from the
       page via the dg-* classes so the drawing follows the theme. -->
  <g stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7">

    <text class="dg-note" x="22" y="34">one file's diff, from the first @@</text>
    <text class="dg-note" x="336" y="34">three coordinates, one physical line</text>

    <!-- column headers -->
    <text class="dg-note" x="336" y="52">old_line</text>
    <text class="dg-note" x="430" y="52">new_line</text>
    <text class="dg-note" x="524" y="52">position</text>

    <!-- column dividers -->
    <path class="dg-stroke" stroke-dasharray="5 6" d="M412 46 Q409 140 413 234"/>
    <path class="dg-stroke" stroke-dasharray="5 6" d="M506 46 Q509 140 505 234"/>

    <!-- the diff fragment, one wobbly box with six rows in it -->
    <path class="dg-fill" d="M24 62 L297 59 Q303 60 302 66 L304 224 Q303 231 296 230 L28 232 Q21 231 22 224 L23 67 Q23 62 24 62 Z"/>
    <path class="dg-stroke" d="M23 90 Q162 93 302 89"/>
    <path class="dg-stroke" d="M23 119 Q160 116 303 118"/>
    <path class="dg-stroke" d="M22 146 Q164 149 302 145"/>
    <path class="dg-stroke" d="M23 175 Q158 172 303 174"/>
    <path class="dg-stroke" d="M22 202 Q162 205 303 201"/>

    <text class="dg-text" x="36" y="81">@@ -1,5 +1,10 @@</text>
    <text class="dg-note" x="196" y="81">hunk</text>
    <text class="dg-note" x="350" y="81">—</text>
    <text class="dg-note" x="444" y="81">—</text>
    <text class="dg-text" x="544" y="81">1</text>

    <text class="dg-text" x="36" y="109">foo</text>
    <text class="dg-note" x="196" y="109">context</text>
    <text class="dg-text" x="356" y="109">1</text>
    <text class="dg-text" x="450" y="109">1</text>
    <text class="dg-text" x="544" y="109">2</text>

    <text class="dg-text" x="36" y="137">+bar</text>
    <text class="dg-note" x="196" y="137">add</text>
    <text class="dg-note" x="350" y="137">—</text>
    <text class="dg-text" x="450" y="137">2</text>
    <text class="dg-text" x="544" y="137">3</text>

    <text class="dg-text" x="36" y="165">-baz</text>
    <text class="dg-note" x="196" y="165">del</text>
    <text class="dg-text" x="356" y="165">2</text>
    <text class="dg-note" x="444" y="165">—</text>
    <text class="dg-text" x="544" y="165">4</text>

    <text class="dg-text" x="36" y="193">qux</text>
    <text class="dg-note" x="196" y="193">context</text>
    <text class="dg-text" x="356" y="193">3</text>
    <text class="dg-text" x="450" y="193">3</text>
    <text class="dg-text" x="544" y="193">5</text>

    <text class="dg-text" x="36" y="221">+quux</text>
    <text class="dg-note" x="196" y="221">add</text>
    <text class="dg-note" x="350" y="221">—</text>
    <text class="dg-text" x="450" y="221">4</text>
    <text class="dg-text" x="544" y="221">6</text>

    <!-- what makes position different -->
    <text class="dg-note" x="604" y="54">counts the @@ row too</text>
    <text class="dg-note" x="604" y="72">resets each file</text>
    <path class="dg-accent" stroke-dasharray="5 6" d="M598 58 Q588 62 580 55"/>
    <path class="dg-accent" d="M580 55 l9 -4 m-9 4 l9 5"/>

    <!-- what the pill author is allowed to say -->
    <path class="dg-fill" d="M338 246 L697 243 Q703 244 702 250 L704 312 Q703 319 696 318 L342 320 Q335 319 336 312 L337 251 Q337 246 338 246 Z"/>
    <text class="dg-text" x="352" y="270">the pill author emits</text>
    <text class="dg-note" x="352" y="290">start_line 2 · end_line 4 · side RIGHT</text>
    <text class="dg-note" x="352" y="308">post-change numbers only</text>

    <!-- RIGHT: match new_line on a context-or-add row -->
    <path class="dg-accent" d="M470 244 Q460 236 456 229"/>
    <path class="dg-accent" d="M456 229 l-3 10 m3 -10 l7 7"/>
    <text class="dg-note" x="478" y="240">RIGHT matches new_line</text>

    <!-- LEFT does the same against old_line -->
    <path class="dg-accent" stroke-dasharray="5 6" d="M356 244 Q314 212 316 180 Q319 166 336 163"/>
    <path class="dg-accent" d="M336 163 l-9 -3 m9 3 l-8 6"/>
    <text class="dg-note" x="196" y="250">LEFT matches old_line</text>

    <!-- and the matched row hands back its position -->
    <path class="dg-accent" d="M464 215 Q496 220 530 215"/>
    <path class="dg-accent" d="M530 215 l-9 -4 m9 4 l-9 5"/>
    <text class="dg-note" x="562" y="196">resolved at build time</text>
    <text class="dg-note" x="562" y="214">unmatched anchors dropped</text>
  </g>
</svg>
<figcaption>The holes are the point: an add row has no old_line, a del row has no new_line, and only position counts the @@ row.</figcaption></figure>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666">{</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577"> "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">position</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 1</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577"> "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">type</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">hunk</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577"> "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">content</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">@@ -1,5 +1,10 @@</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> }</span></span>
<span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666">{</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577"> "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">position</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 2</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577"> "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">type</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">context</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577"> "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">content</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> foo</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577"> "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">old_line</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 1</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577"> "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">new_line</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 1</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> }</span></span>
<span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666">{</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577"> "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">position</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 3</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577"> "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">type</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">add</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577"> "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">content</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">+bar</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577"> "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">new_line</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 2</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> }</span></span>
<span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666">{</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577"> "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">position</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 4</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577"> "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">type</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">del</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577"> "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">content</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">-baz</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577"> "</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">old_line</span><span style="--shiki-light:#99841877;--shiki-dark:#B8A96577">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 2</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> }</span></span></code></pre><p><code>position</code> is not a line number. It&#39;s a 1-indexed offset into that file&#39;s unified diff, counting from the first <code>@@</code> header. Hunk headers, context, adds and deletes all increment it. It resets per file, and <code>\ No newline at end of file</code> markers are skipped. So one physical line has three coordinates — <code>old_line</code>, <code>new_line</code>, <code>position</code> — and the pill author only ever sees the second. (I know.) Pills are written as <code>start_line</code>/<code>end_line</code>/<code>side</code>, and the build step resolves them — for <code>RIGHT</code>, the context-or-add line whose <code>new_line</code> matches; <code>LEFT</code> uses <code>old_line</code> — dropping any anchor missing from the diff with a warning.</p>
<p>Resolving that in the browser means shipping a diff parser and hiding an off-by-one in the one layer with no tests — and the failure isn&#39;t cosmetic: GitHub rejects the comment.</p>
<p>Then the twist: positions never reach GitHub for the comments you write. <code>/api/post-comment</code> sends <code>line</code> and <code>side</code> (plus <code>start_line</code>/<code>start_side</code> for a range), the newer shape that supports multi-line ranges. <code>position</code> is the app&#39;s <em>internal</em> coordinate system: <code>data-position</code> per row, <code>data-start-position</code> per pill, <code>end_position</code> as the local key for a pending comment. The only one crossing the wire is <code>/api/post-briefs</code>, pinning each file&#39;s brief at <code>position: 1</code>. One consequence: files are stacked, so rows restart at position 1 in each. A global <code>querySelector</code> opens the editor in the first match in document order — a file far up the page, invisible to whoever clicked. Lookups are scoped to <code>.diff-wrap</code>.<label class="sn-ref" for="sn-build" tabindex="0">3</label><input type="checkbox" id="sn-build" class="sn-toggle" aria-hidden="true"><span class="sidenote" role="note"><span class="sn-num">3</span><code>SKILL.md</code> cites a <code>build_data.py</code> that isn&#39;t in the repo; step 4 has Claude write the stdlib parser inline each run.</span></p>
<h2 id="chat-that-already-knows"><a class="anchor" href="#chat-that-already-knows" aria-label="Permalink">§</a>Chat that already knows</h2>
<p>It starts as a context menu. Select any code inside a diff, right-click, and the only item is the one you want:</p>
<figure><img src="/images/pr-brief-chat-selection.jpg" alt="Selecting code in a diff and right-clicking surfaces a &quot;Chat about `path:lines`&quot; item — the whole affordance" loading="lazy"><figcaption>Selecting code in a diff and right-clicking surfaces a "Chat about `path:lines`" item — the whole affordance</figcaption></figure>
<figure><img src="/images/pr-brief-inline-chat.jpg" alt="Click it and the drawer opens on the right, pre-loaded with the file, the line range and the selected code, streaming an answer" loading="lazy"><figcaption>Click it and the drawer opens on the right, pre-loaded with the file, the line range and the selected code, streaming an answer</figcaption></figure>
<p>A still of a streaming panel is a poor likeness of one, so here&#39;s the demo from the repo:</p>
<figure class="video">
  <video class="video-file" src="/video/pr-brief-inline-chat.mp4" poster="/video/pr-brief-inline-chat.jpg"
         controls preload="none" playsinline width="1280" height="720"></video>
  <figcaption>Select, right-click, ask, read. The panel already knows what PR this is.</figcaption>
</figure>
<p>Select code, right-click, and a 440px drawer opens. Every panel — across files, across reloads — resumes <em>the same Claude Code session that wrote the brief</em>, via <code>claude --output-format=stream-json --verbose --dangerously-skip-permissions --resume &lt;id&gt; -p &lt;text&gt;</code>, streamed to the browser as newline-delimited JSON. So it starts with the whole PR in context. No re-seeding, no vector store.</p>
<p>Getting the id is fiddly. Just before launch the skill takes the most recently modified <code>*.jsonl</code> under <code>~/.claude/projects/&lt;cwd-with-slashes-turned-into-dashes&gt;/</code> and writes <code>{session_id, cwd}</code> to <code>~/.claude/pr-review/pr-&lt;num&gt;/session.json</code>. The cwd matters as much as the id: <code>--resume</code> looks the id up scoped to the directory it runs in, so resuming from the wrong one gives &quot;No conversation found&quot; instead of a useful error.</p>
<p>The snippet travels only on a panel&#39;s first message; after that <code>firstSent</code> flips and follow-ups go verbatim. Every panel is one conversation, so panel three can say &quot;compare this with the previous file&quot; and mean it. One turn at a time: the server takes a non-blocking lock and answers 409 if you overlap. Stop SIGTERMs the subprocess, and <code>-SIGTERM</code> is deliberately not counted as a failure. If no id was captured, <code>/api/chat-context</code> reports <code>enabled: false</code>, the context menu is never wired, and the feature doesn&#39;t exist instead of half-working.</p>
<p>524 lines of <code>SKILL.md</code>, one 2241-line HTML file, a 511-line stdlib server, no <code>node_modules</code>.</p>
<h2 id="ordering-without-the-model"><a class="anchor" href="#ordering-without-the-model" aria-label="Permalink">§</a>Ordering without the model</h2>
<p>The two halves of this come apart, and only one needs a model. Being told that nine files are one idea called <code>sse-stability</code>, that the migration comes before the guard reading the column it adds, that understanding A helps with B — that&#39;s a sorting problem over a file list, and it removes most of the work before a single pill is written. I think you could delete the explain and critique tracks and it would still be worth running. The reverse is not true: pills hung on an arbitrary file order are annotations on a haystack.</p>
<p>The severity scale generalizes further. S1–S5 definitions are the free part; any tool can write them. What stops the scale being decoration is the distribution guidance — a fine file gets zero critiques, a 50-file PR shouldn&#39;t yield a dozen S4s. Without a stated expectation of how rare the top of the scale is, nothing stops a model spending it, and by the second file I stop reading the badge. That holds for any generated output carrying a number it assigned itself.</p>
<hr>
<p>The pills are the nice part. The ordering is the useful part.</p>
]]></content:encoded>
    </item>
    <item>
      <title>ccli-prompt: cmd+k for your terminal</title>
      <link>https://lucastononro.github.io/ccli-prompt/</link>
      <guid isPermaLink="true">https://lucastononro.github.io/ccli-prompt/</guid>
      <pubDate>Mon, 20 Apr 2026 12:00:00 GMT</pubDate>
      <description>Press Cmd+K, describe the command you&#39;ve forgotten, and read what comes back before running it.</description>
      <category>skill</category>
      <content:encoded><![CDATA[<p>I don&#39;t forget commands. I forget flags. <code>find</code> with a size predicate, <code>tar</code> with the right four letters, whatever incantation evicts whatever is squatting on port 9090. Cursor fixed this inside the editor with Cmd+K, and I wanted the same key to do the same thing one pane over.</p>
<p><a href="https://github.com/lucastononro/ccli-prompt" target="_blank" rel="noopener noreferrer" class="external"><code>ccli-prompt</code></a> binds a zsh widget to <code>^[k</code>. Press Cmd+K, type &quot;find files bigger than 100mb&quot; into a minibuffer, and a command appears on your command line!! Nothing runs. It sits in <code>$BUFFER</code> until you read it and press Enter yourself. (Esc then K works too — the widget quietly raises <code>KEYTIMEOUT</code> to 100 so the chord doesn&#39;t expire in zsh&#39;s default 0.4 s.)</p>
<figure class="video">
  <video class="video-file" src="/video/ccli-prompt-demo.mp4" poster="/video/ccli-prompt-demo.jpg"
         controls preload="none" playsinline width="1280" height="720"></video>
  <figcaption>Asking for a command, getting a command, running nothing.</figcaption>
</figure>
<figure class="diagram"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 300" role="img"
     aria-label="Round trip: Cmd+K, zsh widget, unix socket, warm daemon, Anthropic API, command lands in BUFFER unexecuted, human presses Enter">
  <!-- Hand-drawn on purpose: every box is a wobbly path, not a rect, and every
       edge overshoots slightly. Colours come from the page via CSS classes. -->
  <g stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7">

    <!-- keystroke -->
    <path class="dg-fill" d="M22 40 L152 37 Q158 38 157 44 L159 88 Q158 95 151 94 L26 96 Q19 95 20 88 L21 45 Q21 40 22 40 Z"/>
    <text class="dg-text" x="42" y="62">Cmd+K</text>
    <text class="dg-note" x="42" y="79">or Esc then K</text>

    <!-- widget -->
    <path class="dg-fill" d="M232 38 L344 36 Q350 37 349 43 L351 87 Q350 94 343 93 L236 95 Q229 94 230 87 L231 44 Q231 39 232 38 Z"/>
    <text class="dg-text" x="244" y="62">zle widget</text>
    <text class="dg-note" x="244" y="79">reads your ask</text>

    <!-- socket -->
    <path class="dg-fill" d="M424 39 L556 37 Q562 38 561 44 L563 88 Q562 95 555 94 L428 96 Q421 95 422 88 L423 45 Q423 40 424 39 Z"/>
    <text class="dg-text" x="444" y="62">unix socket</text>
    <text class="dg-note" x="444" y="79">0600, your user</text>

    <!-- daemon -->
    <path class="dg-fill" d="M624 38 L736 36 Q742 37 741 43 L743 87 Q742 94 735 93 L628 95 Q621 94 622 87 L623 44 Q623 39 624 38 Z"/>
    <text class="dg-text" x="644" y="62">daemon</text>
    <text class="dg-note" x="644" y="79">warm HTTPS</text>

    <!-- api -->
    <path class="dg-fill" d="M576 176 L736 174 Q742 175 741 181 L743 225 Q742 232 735 231 L580 233 Q573 232 574 225 L575 182 Q575 177 576 176 Z"/>
    <text class="dg-text" x="594" y="200">/v1/messages</text>
    <text class="dg-note" x="594" y="217">haiku 4.5</text>

    <!-- buffer -->
    <path class="dg-fill" d="M302 177 L465 175 Q471 176 470 182 L472 226 Q471 233 464 232 L306 234 Q299 233 300 226 L301 183 Q301 178 302 177 Z"/>
    <text class="dg-text" x="320" y="200">$BUFFER</text>
    <text class="dg-note" x="320" y="217">the command, unrun</text>

    <!-- the human -->
    <path class="dg-fill" d="M24 177 L191 175 Q197 176 196 182 L198 226 Q197 233 190 232 L28 234 Q21 233 22 226 L23 183 Q23 178 24 177 Z"/>
    <text class="dg-text" x="42" y="200">you press Enter</text>
    <text class="dg-note" x="42" y="217">the step that runs</text>

    <!-- arrows, drawn with a little sag -->
    <path class="dg-accent" d="M162 66 Q196 61 224 66"/>
    <path class="dg-accent" d="M224 66 l-9 -4 m9 4 l-9 5"/>

    <path class="dg-accent" d="M356 66 Q390 71 416 66"/>
    <path class="dg-accent" d="M416 66 l-9 -4 m9 4 l-9 5"/>

    <path class="dg-accent" d="M567 66 Q592 61 616 66"/>
    <path class="dg-accent" d="M616 66 l-9 -4 m9 4 l-9 5"/>

    <!-- daemon down to the API -->
    <path class="dg-accent" d="M682 99 Q692 137 678 170"/>
    <path class="dg-accent" d="M678 170 l-6 -8 m6 8 l5 -8"/>

    <!-- the answer coming back, right to left -->
    <path class="dg-accent" stroke-dasharray="5 6" d="M570 204 Q536 211 482 204"/>
    <path class="dg-accent" d="M482 204 l9 -4 m-9 4 l9 5"/>

    <path class="dg-accent" d="M296 204 Q262 198 208 204"/>
    <path class="dg-accent" d="M208 204 l9 -4 m-9 4 l9 5"/>

    <text class="dg-note" x="22" y="126">the daemon outlives the keystroke — one warm connection, thirty idle minutes</text>
    <text class="dg-note" x="300" y="256">errors come back as # … and print above the prompt</text>
    <text class="dg-note" x="22" y="282">everything above only types — pressing Enter is the only thing that runs it</text>
  </g>
</svg>
<figcaption>Cmd+K in, a command in $BUFFER out — and nothing runs until the last box.</figcaption></figure>
<h2 id="the-prompt-is-the-product"><a class="anchor" href="#the-prompt-is-the-product" aria-label="Permalink">§</a>The prompt is the product</h2>
<p><code>pipx install ccli-prompt</code>, then <code>ccli-prompt install</code>. The widget is copied to <code>~/.ccli-prompt/</code>, one <code>source</code> line is appended to your <code>.zshrc</code>, and a two-step wizard runs — auth, then a model list pulled live from <code>/v1/models</code> with Haiku 4.5 sorted to the top. That leaves the part that actually decides whether any of this is useful, <code>~/.ccli-prompt/prompt.md</code>:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#A65E2B;--shiki-dark:#D4976C">-</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> Output ONLY the command. No prose, no explanation, no markdown, no code fences, no comments.</span></span>
<span class="line"><span style="--shiki-light:#A65E2B;--shiki-dark:#D4976C">-</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> Match the user's shell and OS (macOS </span><span style="--shiki-light:#999999;--shiki-dark:#666666">`</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">zsh</span><span style="--shiki-light:#999999;--shiki-dark:#666666">`</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> unless told otherwise — prefer BSD-flavored flags…)</span></span>
<span class="line"><span style="--shiki-light:#A65E2B;--shiki-dark:#D4976C">-</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> If the user's request cannot be fulfilled with a shell command, output a single line beginning with </span><span style="--shiki-light:#999999;--shiki-dark:#666666">`</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"># </span><span style="--shiki-light:#999999;--shiki-dark:#666666">`</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">…</span></span>
<span class="line"><span style="--shiki-light:#A65E2B;--shiki-dark:#D4976C">-</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> Never output destructive commands (</span><span style="--shiki-light:#999999;--shiki-dark:#666666">`</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">rm -rf /</span><span style="--shiki-light:#999999;--shiki-dark:#666666">`</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">, </span><span style="--shiki-light:#999999;--shiki-dark:#666666">`</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">dd</span><span style="--shiki-light:#999999;--shiki-dark:#666666">`</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">, disk/partition formatting, force-push to main…)</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">…</span></span>
<span class="line"><span style="--shiki-light:#A65E2B;--shiki-dark:#D4976C">-</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> Most requests ("kill port 9090", "tar this folder", "find files bigger than X") are obvious — answer immediately…</span></span>
<span class="line"><span style="--shiki-light:#A65E2B;--shiki-dark:#D4976C">-</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> If the request depends on specifics you don't know … use an ALL-CAPS placeholder like </span><span style="--shiki-light:#999999;--shiki-dark:#666666">`</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">&#x3C;FILENAME></span><span style="--shiki-light:#999999;--shiki-dark:#666666">`</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">, </span><span style="--shiki-light:#999999;--shiki-dark:#666666">`</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">&#x3C;PORT></span><span style="--shiki-light:#999999;--shiki-dark:#666666">`</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">…</span></span></code></pre><p>Every rule there is a scar. No code fences, because a model that helpfully wraps its answer in backticks has just put three backticks on your command line.<label class="sn-ref" for="sn-fences" tabindex="0">1</label><input type="checkbox" id="sn-fences" class="sn-toggle" aria-hidden="true"><span class="sidenote" role="note"><span class="sn-num">1</span>The widget doesn&#39;t trust it either. A <code>sed</code> pass deletes fence lines from whatever comes back, then trims surrounding whitespace, before anything reaches <code>$BUFFER</code>.</span> BSD-flavored flags, because half the internet&#39;s <code>find</code> invocations are GNU and fail differently on a Mac. <em>Do not deliberate</em>, because at a prompt, thinking is latency you can feel. And the placeholder rule is the one that keeps it usable: the model isn&#39;t allowed to ask a clarifying question, so it commits to a shape and leaves you a hole to fill.</p>
<h2 id="three-requests"><a class="anchor" href="#three-requests" aria-label="Permalink">§</a>Three requests</h2>
<p>These are illustrative, not recorded, but each is what those rules demand. &quot;Kill whatever is on port 9090&quot; is the case the prompt names as obvious, so it arrives as one line with nothing around it: <code>lsof -ti tcp:9090 | xargs kill -9</code>. Ask the same thing without naming a port and you get <code>lsof -ti tcp:&lt;PORT&gt; | xargs kill -9</code> — a placeholder, not a question. Ask &quot;which test file covers the auth flow&quot; and you get <code># need more context: the test files in this repo</code>, because the daemon has no tools and can&#39;t read your disk.</p>
<p>The context it <em>does</em> get matters more than I expected. The widget sends your working directory, <code>${SHELL:t}</code>, <code>uname -sr</code>, and — the interesting one — whatever was already on your command line, as a <code>draft</code> field. Type <code>tar -c</code>, press Cmd+K, ask to compress a folder, and the last rule in the prompt tells the model to finish your line instead of starting its own.</p>
<h2 id="a-daemon-not-a-subprocess"><a class="anchor" href="#a-daemon-not-a-subprocess" aria-label="Permalink">§</a>A daemon, not a subprocess</h2>
<p>Shelling out to <code>claude -p</code> per keystroke means paying for a CLI boot every time you can&#39;t remember a flag. So the widget talks to a stdlib-only Python daemon over a Unix socket, spawning it on first use:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">local</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A"> req</span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">$'</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">cwd</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076">\t</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">'"</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">$PWD</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"$'</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076">\n</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">shell</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076">\t</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">'"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">${</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">SHELL</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">:</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">t</span><span style="--shiki-light:#999999;--shiki-dark:#666666">}</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"$'</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076">\n</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">os</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076">\t</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">'"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">$(</span><span style="--shiki-light:#59873A;--shiki-dark:#80A665">uname</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> -sr</span><span style="--shiki-light:#999999;--shiki-dark:#666666">)</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">…</span></span>
<span class="line"><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">output</span><span style="--shiki-light:#999999;--shiki-dark:#666666">=$(</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965">printf</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> '</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">%s</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">'</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">$req</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676"> |</span><span style="--shiki-light:#59873A;--shiki-dark:#80A665"> nc</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> -U</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">$CCLI_SOCKET</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676"> 2></span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">/dev/null</span><span style="--shiki-light:#999999;--shiki-dark:#666666">)</span></span></code></pre><p>Tab-separated lines and <code>nc -U</code>. No HTTP, no JSON, no framing to parse. The socket is <code>/tmp/ccli-$USER.sock</code>, <code>chmod</code>ed to <code>0600</code> immediately after <code>start_unix_server</code> returns. That matters: anything that can write to that socket can spend your tokens and see your <code>$PWD</code>, so on a shared box, mode 0644 would be an open proxy with your subscription attached. The daemon keeps one <code>HTTPSConnection</code> to <code>api.anthropic.com</code> open with a 30 s timeout, resets and retries once if it finds the connection dead, and exits after <code>CCLI_IDLE_TIMEOUT</code> — 1800 seconds of nobody asking it anything. The README&#39;s ~500 ms warm figure (yes, I measured) is TLS you already paid for plus Haiku&#39;s first tokens. The cold path adds a <code>nohup</code> spawn and a poll loop that waits forty 50 ms ticks before giving up.<label class="sn-ref" for="sn-cache" tabindex="0">2</label><input type="checkbox" id="sn-cache" class="sn-toggle" aria-hidden="true"><span class="sidenote" role="note"><span class="sn-num">2</span>The system prompt is sent with <code>cache_control: {&quot;type&quot;: &quot;ephemeral&quot;}</code>, which on Haiku 4.5 achieves nothing — it&#39;s under 500 tokens, far below that model&#39;s 4096-token minimum cacheable prefix. Harmless, aspirational.</span></p>
<h2 id="auth-without-an-api-key"><a class="anchor" href="#auth-without-an-api-key" aria-label="Permalink">§</a>Auth without an API key</h2>
<p>My favorite part, because it asks you for nothing. With no <code>$ANTHROPIC_API_KEY</code> set, the daemon runs <code>security find-generic-password -s &quot;Claude Code-credentials&quot; -w</code>, lifts <code>claudeAiOauth.accessToken</code> out of the JSON Claude Code already stored there, and picks its headers off the token&#39;s prefix:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">if</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> is_oauth_token</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076">self</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">_token</span><span style="--shiki-light:#999999;--shiki-dark:#666666">):</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">    headers</span><span style="--shiki-light:#999999;--shiki-dark:#666666">[</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">Authorization</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">]</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> =</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676"> f</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">"Bearer </span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076">{self</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">_token</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076">}</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">"</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">    headers</span><span style="--shiki-light:#999999;--shiki-dark:#666666">[</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">anthropic-beta</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">]</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> =</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">oauth-2025-04-20</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span></span>
<span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">else</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">    headers</span><span style="--shiki-light:#999999;--shiki-dark:#666666">[</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">x-api-key</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">]</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> =</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> self</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">_token</span></span></code></pre><p><code>sk-ant-oat…</code> rides <code>Authorization</code> with the oauth beta header; <code>sk-ant-api03…</code> rides <code>x-api-key</code>. Identical code path otherwise. A 401 reloads the token once and retries, on the assumption that it rotated rather than that you&#39;ve been thrown out.<label class="sn-ref" for="sn-linux" tabindex="0">3</label><input type="checkbox" id="sn-linux" class="sn-toggle" aria-hidden="true"><span class="sidenote" role="note"><span class="sn-num">3</span>Linux never touches the Keychain — it reads the same <code>claudeAiOauth.accessToken</code> from <code>~/.claude/.credentials.json</code>, which is also the macOS fallback.</span></p>
<h2 id="hash-space"><a class="anchor" href="#hash-space" aria-label="Permalink">§</a>Hash-space</h2>
<p>The detail I&#39;d keep if I had to throw the rest away. Daemon failures come back as strings beginning <code># </code>, and the widget tests for that prefix before it goes anywhere near your command line:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">if</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> [[</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">$output</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676"> ==</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> \#\ </span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">*</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> ]];</span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375"> then</span></span>
<span class="line"><span style="--shiki-light:#998418;--shiki-dark:#B8A965">  print</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> -P</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">%F{red}$output%f</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span></span>
<span class="line"><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">  BUFFER</span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">$saved_buffer</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span></span>
<span class="line"><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">  CURSOR</span><span style="--shiki-light:#999999;--shiki-dark:#666666">=${</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">#</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">BUFFER</span><span style="--shiki-light:#999999;--shiki-dark:#666666">}</span></span>
<span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665">  zle</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> reset-prompt</span></span>
<span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">  return</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 1</span></span>
<span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">fi</span></span></code></pre><p>Three things happen there. The message prints above the prompt instead of landing in the buffer — the widget has already called <code>zle -I</code>, so it can write outside its own line. The half-typed draft you had before pressing Cmd+K is restored verbatim, so a failed guess costs you nothing you&#39;d typed. And <code># </code> is also a shell comment, so the worst case — a convention I got wrong somewhere — is a line that does nothing when executed: <code># api error 401: …</code> is not a command you can accidentally run. The system prompt reuses the same prefix for <em>I can&#39;t do that in a shell</em>, so model refusals and HTTP failures leave by the same door.</p>
<h2 id="nothing-runs-on-purpose"><a class="anchor" href="#nothing-runs-on-purpose" aria-label="Permalink">§</a>Nothing runs, on purpose</h2>
<p>The design commitment worth stealing is the one that sounds like a limitation. The daemon has no tools, can&#39;t read the disk, and hands its answer to <code>$BUFFER</code> — a human presses Enter. That one decision pays for most of what I never had to build: no sandbox, no confirmation dialog, no audit of what the model may touch, no rollback. The <code># </code> prefix is only viable because of it. A comment is a safe failure mode when the worst case is a line you read and delete, not an action already taken.</p>
<p>It also settles where the human sits. Reviewing generated shell is a chore when it means opening something to review it. Here the review is the keypress you were going to make anyway, so it costs nothing and can&#39;t be skipped. The price shows up in the &quot;which test file covers the auth flow&quot; case — no tools, no answer. Before adding autonomy to anything like this, I&#39;d now ask where the workflow already puts a person. That seat is cheaper than one I&#39;d have to build.</p>
<hr>
<p>Zero runtime dependencies, which felt right for something whose entire job is to type.</p>
]]></content:encoded>
    </item>
    <item>
      <title>trainable: the data was never the bottleneck</title>
      <link>https://lucastononro.github.io/trainable/</link>
      <guid isPermaLink="true">https://lucastononro.github.io/trainable/</guid>
      <pubDate>Sun, 05 Apr 2026 12:00:00 GMT</pubDate>
      <description>Every company has the data; almost none have the two specialist weeks that turn it into a model.</description>
      <category>agents</category>
      <content:encoded><![CDATA[<p><a href="https://github.com/lucastononro/trainable" target="_blank" rel="noopener noreferrer" class="external">Trainable</a> is a studio where agents do the data science. Start with the demo — it&#39;s faster than anything I can write here.</p>
<figure class="video">
  <button class="video-embed" type="button" data-yt="hwmT-4pKJQ8" data-start="0"
          aria-label="Play video: Trainable - Agents for data science and Machine Learning — the current build, one session, end to end.">
    <img src="https://i.ytimg.com/vi/hwmT-4pKJQ8/maxresdefault.jpg" alt="" width="1280" height="720" loading="lazy"
         onerror="this.onerror=function(){this.remove()};this.src='https://i.ytimg.com/vi/hwmT-4pKJQ8/hqdefault.jpg'">
    <span class="video-play" aria-hidden="true"></span>
    <span class="video-label" aria-hidden="true">Trainable - Agents for data science and Machine Learning — the current build, one session, end to end.</span>
  </button>
  <figcaption>Trainable - Agents for data science and Machine Learning — the current build, one session, end to end. <a class="video-link" href="https://www.youtube.com/watch?v=hwmT-4pKJQ8"
    target="_blank" rel="noopener noreferrer">Watch on YouTube ↗</a></figcaption>
</figure>
<h2 id="having-the-data-is-not-enough"><a class="anchor" href="#having-the-data-is-not-enough" aria-label="Permalink">§</a>Having the data is not enough</h2>
<p>Every company I&#39;ve worked with already has the data. That was the last decade&#39;s project and it worked: the warehouse exists, the events are instrumented, the nightly job runs, and storage costs less per terabyte than the meeting about it.</p>
<p>What almost none of them have is the person who turns that table into a model somebody will actually deploy. That person knows which distribution to be suspicious of, reads a 0.99 AUC as a leaked column rather than a result, and insists on beating the dull benchmark before anyone is allowed to try something interesting. They&#39;re scarce, expensive, and slow to hire — check how long your last data-scientist req stayed open. So the table sits there. The bottleneck was never storage. It hasn&#39;t been compute for years. It&#39;s the calendar of about four people.</p>
<p>Most of what fills that calendar isn&#39;t the judgment — it&#39;s the two weeks afterwards. Profiling every column, arguing with the missingness pattern, choosing encodings, splitting the data once and meaning it, fitting the boring baseline, thirty Optuna trials on top, writing up the leaderboard and the feature importances. Those two weeks are what Trainable automates, and I want to be exact about where it stops. It doesn&#39;t frame the problem, decide whether the model should exist, or notice that the label you were handed is a proxy for something you&#39;d rather not predict. A human still picks the target, says what a false negative costs, and reads the review. The roster includes a <code>reviewer</code> agent whose entire brief is to disagree with the others — leakage, temporal leakage, features derived from the target. It&#39;s there because judgment is the part that needs checking, not the part that got replaced.</p>
<p>The input doesn&#39;t have to be a table, either. <code>sample-data/</code> ships seven datasets: six are a single CSV with a guessable header — Titanic, telco churn, wine quality, California housing, heart failure, employee attrition — and the seventh is 1,765 photographs of cars with a COCO annotation file beside them. Nothing in the upload path inspects a file: bytes go to S3 and to the Modal Volume under whatever relative path the browser sent, the content type falls back to <code>application/octet-stream</code>, and the agent opens them with Python. The honest limit is the paved road rather than the door: the prep explorer and the tabular training skill both want parquet splits and a named target, so a detector gets the sandbox, a GPU and a live grid of prediction overlays, but no pre-written methodology.</p>
<figure><img src="/images/trainable-license-plate.jpg" alt="One of three images in the smoke-test split, 472×303 in the dataset, carrying a single COCO box at 249, 186, 101, 49 — nothing a SELECT could return" loading="lazy"><figcaption>One of three images in the smoke-test split, 472×303 in the dataset, carrying a single COCO box at 249, 186, 101, 49 — nothing a SELECT could return</figcaption></figure>
<figure class="diagram"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 320" role="img"
     aria-label="System context: one practitioner in a browser talks to Trainable over REST with an SSE stream back; Trainable talks out to the Claude API, Modal for sandboxes and the volume, and S3 or MinIO for datasets">
  <!-- Redrawn by hand from docs/diagrams/c1-context/c1-system-context.excalidraw.
       Hand-drawn on purpose: every box is a wobbly path, not a rect, and every
       edge overshoots slightly. Colours come from the page via CSS classes. -->
  <g stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7">

    <!-- the person -->
    <path class="dg-fill" d="M24 41 L163 38 Q169 39 168 45 L170 98 Q169 105 162 104 L28 106 Q21 105 22 98 L23 46 Q23 41 24 41 Z"/>
    <text class="dg-text" x="44" y="63">practitioner</text>
    <text class="dg-note" x="44" y="80">brings the data</text>

    <!-- browser -->
    <path class="dg-fill" d="M232 41 L371 38 Q377 39 376 45 L378 98 Q377 105 370 104 L236 106 Q229 105 230 98 L231 46 Q231 41 232 41 Z"/>
    <text class="dg-text" x="252" y="63">browser</text>
    <text class="dg-note" x="252" y="80">Next.js studio</text>

    <!-- the system in scope -->
    <path class="dg-fill" d="M432 39 L731 36 Q737 37 736 43 L738 100 Q737 107 730 106 L436 108 Q429 107 430 100 L431 44 Q431 39 432 39 Z"/>
    <text class="dg-text" x="452" y="61">Trainable</text>
    <text class="dg-note" x="452" y="78">nine agents: EDA, prep, train, review</text>

    <!-- externals -->
    <path class="dg-fill" d="M82 205 L253 202 Q259 203 258 209 L260 260 Q259 267 252 266 L86 268 Q79 267 80 260 L81 210 Q81 205 82 205 Z"/>
    <text class="dg-text" x="102" y="227">Claude API</text>
    <text class="dg-note" x="102" y="244">Agent SDK · MCP</text>

    <path class="dg-fill" d="M292 205 L463 202 Q469 203 468 209 L470 260 Q469 267 462 266 L296 268 Q289 267 290 260 L291 210 Q291 205 292 205 Z"/>
    <text class="dg-text" x="312" y="227">Modal</text>
    <text class="dg-note" x="312" y="244">sandboxes + volume</text>

    <path class="dg-fill" d="M502 205 L673 202 Q679 203 678 209 L680 260 Q679 267 672 266 L506 268 Q499 267 500 260 L501 210 Q501 205 502 205 Z"/>
    <text class="dg-text" x="522" y="227">S3 / MinIO</text>
    <text class="dg-note" x="522" y="244">boto3 · browsable copy</text>

    <!-- person to browser -->
    <path class="dg-accent" d="M172 72 Q199 78 226 72"/>
    <path class="dg-accent" d="M226 72 l-9 -4 m9 4 l-9 5"/>
    <text class="dg-note" x="184" y="30">uses</text>

    <!-- browser to backend, and the stream back -->
    <path class="dg-accent" d="M380 82 Q404 88 426 82"/>
    <path class="dg-accent" d="M426 82 l-9 -4 m9 4 l-9 5"/>

    <path class="dg-accent" stroke-dasharray="5 6" d="M426 60 Q403 54 381 60"/>
    <path class="dg-accent" d="M381 60 l9 -4 m-9 4 l9 5"/>
    <text class="dg-note" x="386" y="30">SSE</text>

    <!-- out to the three clouds -->
    <path class="dg-accent" d="M470 110 Q330 132 176 196"/>
    <path class="dg-accent" d="M176 196 l10 1 m-10 -1 l7 -7"/>

    <path class="dg-accent" d="M560 110 Q500 152 384 197"/>
    <path class="dg-accent" d="M384 197 l10 1 m-10 -1 l7 -7"/>

    <path class="dg-accent" d="M660 110 Q650 155 592 197"/>
    <path class="dg-accent" d="M592 197 l10 -2 m-10 2 l5 -9"/>

    <text class="dg-note" x="22" y="296">Redrawn from the repo's own C4 context diagram; the bottom row is all somebody else's cloud.</text>
  </g>
</svg>
<figcaption>Redrawn from the repo's own C4 context diagram: the whole system is one box, and the person stands outside it.</figcaption></figure>
<h2 id="every-call-a-sandbox"><a class="anchor" href="#every-call-a-sandbox" aria-label="Permalink">§</a>Every call, a sandbox</h2>
<p><code>pip install trainable-ai &amp;&amp; trainable init</code>, and a wizard handles Docker and keys. What took the time isn&#39;t the agent roster. It&#39;s what happens after an agent decides to run some Python. The <code>execute-code</code> skill hands a string to <code>services/sandbox.py:run_code</code>, which builds a fresh Modal Sandbox per call:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">sb </span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375"> await</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> modal</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">Sandbox</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">create</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">aio</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span></span>
<span class="line"><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">    "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">python</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">-u</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">-c</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> full_code</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span></span>
<span class="line"><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">    image</span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">_get_image</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(),</span></span>
<span class="line"><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">    volumes</span><span style="--shiki-light:#999999;--shiki-dark:#666666">={</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">/data</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> get_volume</span><span style="--shiki-light:#999999;--shiki-dark:#666666">()},</span></span>
<span class="line"><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">    gpu</span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">gpu</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span></span>
<span class="line"><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">    timeout</span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">effective_timeout</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span></span>
<span class="line"><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">    workdir</span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">f</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">"/data/sessions/</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076">{</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">session_id</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076">}</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span></span>
<span class="line"><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">    app</span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">await</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> _get_app</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(),</span></span>
<span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666">)</span></span></code></pre><p>Every argument there is a decision. <code>-u</code> because buffered stdout defeats the streaming below. The image is <code>debian_slim(python_version=&quot;3.11&quot;)</code> with pandas, scikit-learn, xgboost, lightgbm, duckdb, optuna, shap, statsmodels, CPU-wheel torch and <code>tensorflow-cpu</code> preinstalled — memoized in a module global, so the definition is assembled once per backend process and Modal serves the built layers to every sandbox after that. <code>gpu</code> and <code>timeout</code> come from a profile on the project row, so moving a project onto an A10G is a settings modal and the next call picks it up.<label class="sn-ref" for="sn-gpu" tabindex="0">1</label><input type="checkbox" id="sn-gpu" class="sn-toggle" aria-hidden="true"><span class="sidenote" role="note"><span class="sn-num">1</span>Compute choices are coerced to a known set — <code>cpu</code>, <code>T4</code>, <code>L4</code>, <code>A10G</code>, <code>A100-40GB</code>, <code>A100-80GB</code>, <code>H100</code> — and anything unrecognized falls back to <code>cpu</code>, so that a misspelled value never silently lights up an expensive A100.</span> When Modal kills a sandbox at the 600-second mark the handler doesn&#39;t fail the run: it returns a tool result with <code>is_error=True</code> and prose explaining the options — split the work, shrink the data, or retry with <code>heavy=true</code>.</p>
<h2 id="state-between-calls"><a class="anchor" href="#state-between-calls" aria-label="Permalink">§</a>State between calls</h2>
<p>The sandbox is gone the moment it exits. What survives is the Modal Volume at <code>/data</code>, and <code>workdir=/data/sessions/{session_id}</code> is the line I&#39;d keep if I could only keep one. Every execution and every notebook cell runs with the session workspace as its cwd, so <code>pd.read_parquet(&quot;data/train.parquet&quot;)</code> lands on the volume without anyone reasoning about absolute paths.</p>
<p>Modal needs that workdir to exist before Python starts, so an empty <code>src/__init__.py</code> is written there before every spawn, and the preamble prepended to every execution puts that <code>src/</code> on the path:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">def</span><span style="--shiki-light:#59873A;--shiki-dark:#80A665"> _bootstrap_session_repo</span><span style="--shiki-light:#999999;--shiki-dark:#666666">()</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> -></span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375"> None</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">    session_src </span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> _VOL_ROOT</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676"> /</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">sessions</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676"> /</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> _SID</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676"> /</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">src</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">    session_src</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">mkdir</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">parents</span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">True</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A"> exist_ok</span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">True</span><span style="--shiki-light:#999999;--shiki-dark:#666666">)</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">    …</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">    sys</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">path</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">insert</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91">0</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> src</span><span style="--shiki-light:#999999;--shiki-dark:#666666">)</span></span></code></pre><p>So the workspace is a small repo. One agent promotes a helper out of a notebook into <code>src/loaders.py</code>, and a different agent, later, does <code>from loaders import load_raw</code> instead of rewriting it. State passes between agents as code, not as a summary of code. Notebooks get the one thing a per-call sandbox can&#39;t offer — a kernel that remembers — from a long-lived sandbox per session driven over its own stdin, so variables set in <code>data-overview</code> are visible in <code>baseline-model</code>.</p>
<p>The volume is reloaded before each spawn so a new sandbox sees the last one&#39;s writes, and afterwards a recursive diff emits one event per new path. Nothing in the UI knows where a figure is supposed to live: a post-run pass classifies every file by extension into an <code>artifacts</code> table — <code>.png</code> a chart, <code>.md</code> a report, <code>.pkl</code> a model — and the frontend renders from that index.<label class="sn-ref" for="sn-layout" tabindex="0">2</label><input type="checkbox" id="sn-layout" class="sn-toggle" aria-hidden="true"><span class="sidenote" role="note"><span class="sn-num">2</span>The folder layout — <code>report.md</code>, <code>figures/</code>, <code>data/</code> — is convention, not enforcement. The prep explorer resolves the parquet splits through three tiers (prep metadata, then the artifact table, then a recursive scan) precisely so nothing hardcodes a path. Agents rearrange their workspace; indexes don&#39;t mind.</span></p>
<p>S3 (MinIO in dev) is the second tier and pointedly not the authority. The volume is primary because it&#39;s what sandboxes mount. S3 takes a mirror of the finished workspace, and gets read back only to surface files that were uploaded but never made it into a sandbox, reported per file as <code>in_sandbox: false</code>.</p>
<h2 id="stdout-as-protocol"><a class="anchor" href="#stdout-as-protocol" aria-label="Permalink">§</a>Stdout as protocol</h2>
<figure class="diagram"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 320" role="img"
     aria-label="Infrastructure path: browser to FastAPI with SSE streaming back, code dispatched into a Modal sandbox, session workspace on a Modal Volume, artifacts mirrored to S3, metadata in Postgres">
  <!-- Hand-drawn on purpose: every box is a wobbly path, not a rect, and every
       edge overshoots slightly. Colours come from the page via CSS classes. -->
  <g stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7">

    <!-- browser -->
    <path class="dg-fill" d="M23 42 L152 39 Q158 40 157 46 L159 89 Q158 96 151 95 L27 97 Q20 96 21 89 L22 47 Q22 42 23 42 Z"/>
    <text class="dg-text" x="43" y="63">browser</text>
    <text class="dg-note" x="43" y="80">Next.js studio</text>

    <!-- backend -->
    <path class="dg-fill" d="M237 41 L366 38 Q372 39 371 45 L373 88 Q372 95 365 94 L241 96 Q234 95 235 88 L236 46 Q236 41 237 41 Z"/>
    <text class="dg-text" x="257" y="62">FastAPI</text>
    <text class="dg-note" x="257" y="79">broadcaster + routers</text>

    <!-- sandbox -->
    <path class="dg-fill" d="M449 43 L578 40 Q584 41 583 47 L585 90 Q584 97 577 96 L453 98 Q446 97 447 90 L448 48 Q448 43 449 43 Z"/>
    <text class="dg-text" x="469" y="64">Modal Sandbox</text>
    <text class="dg-note" x="469" y="81">600s per call</text>

    <!-- database -->
    <path class="dg-fill" d="M237 185 L366 182 Q372 183 371 189 L373 232 Q372 239 365 238 L241 240 Q234 239 235 232 L236 190 Q236 185 237 185 Z"/>
    <text class="dg-text" x="257" y="206">Postgres</text>
    <text class="dg-note" x="257" y="223">metrics, artifacts</text>

    <!-- volume -->
    <path class="dg-fill" d="M449 184 L578 182 Q584 183 583 189 L585 233 Q584 240 577 239 L453 241 Q446 240 447 233 L448 190 Q448 185 449 184 Z"/>
    <text class="dg-text" x="469" y="206">Modal Volume</text>
    <text class="dg-note" x="469" y="223">/data/sessions/{id}</text>

    <!-- object store -->
    <path class="dg-fill" d="M621 185 L734 182 Q740 183 739 189 L741 232 Q740 239 733 238 L625 240 Q618 239 619 232 L620 190 Q620 185 621 185 Z"/>
    <text class="dg-text" x="641" y="206">S3 / MinIO</text>
    <text class="dg-note" x="641" y="223">browsable copy</text>

    <!-- browser to backend, and the SSE stream back -->
    <path class="dg-accent" d="M163 74 Q199 80 231 74"/>
    <path class="dg-accent" d="M231 74 l-9 -4 m9 4 l-9 5"/>

    <path class="dg-accent" stroke-dasharray="5 6" d="M231 55 Q197 49 165 55"/>
    <path class="dg-accent" d="M165 55 l9 -4 m-9 4 l9 5"/>
    <text class="dg-note" x="182" y="36">SSE</text>

    <!-- backend dispatches code; stdout comes back as a stream -->
    <path class="dg-accent" d="M375 57 Q411 51 443 57"/>
    <path class="dg-accent" d="M443 57 l-9 -4 m9 4 l-9 5"/>
    <text class="dg-note" x="386" y="30">execute_code</text>

    <path class="dg-accent" stroke-dasharray="5 6" d="M443 80 Q409 87 377 80"/>
    <path class="dg-accent" d="M377 80 l9 -4 m-9 4 l9 5"/>
    <text class="dg-note" x="376" y="120">stdout: metrics, charts, new files</text>

    <!-- backend writes rows -->
    <path class="dg-accent" d="M300 98 Q296 138 301 176"/>
    <path class="dg-accent" d="M301 176 l-5 -9 m5 9 l5 -9"/>
    <text class="dg-note" x="196" y="146">rows, never files</text>

    <!-- sandbox mounts the volume -->
    <path class="dg-accent" d="M512 99 Q508 139 513 177"/>
    <path class="dg-accent" d="M513 177 l-5 -9 m5 9 l5 -9"/>
    <text class="dg-note" x="521" y="145">mounted at /data</text>

    <!-- workspace mirrored out -->
    <path class="dg-accent" d="M587 209 Q603 215 615 209"/>
    <path class="dg-accent" d="M615 209 l-9 -4 m9 4 l-9 5"/>
    <text class="dg-note" x="472" y="270">s3_sync mirrors the finished workspace</text>

    <text class="dg-note" x="22" y="298">Solid = a request. Dashed = a stream. The sandbox mounts the volume; S3 is the copy you can browse.</text>
  </g>
</svg>
<figcaption>Where a line of agent-written Python goes, and where its output ends up.</figcaption></figure>
<p>There is no agent in the loop of the live dashboard. Inside the sandbox, <code>trainable.log()</code> prints a line:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">def</span><span style="--shiki-light:#59873A;--shiki-dark:#80A665"> log</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">step</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> metrics</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> run</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">=</span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">None</span><span style="--shiki-light:#999999;--shiki-dark:#666666">):</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">    payload </span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> {</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">step</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965"> int</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">step</span><span style="--shiki-light:#999999;--shiki-dark:#666666">),</span></span>
<span class="line"><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">               "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">metrics</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> {</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">k</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965"> float</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">v</span><span style="--shiki-light:#999999;--shiki-dark:#666666">)</span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375"> for</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> k</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> v </span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">in</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965"> dict</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">metrics</span><span style="--shiki-light:#999999;--shiki-dark:#666666">).</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">items</span><span style="--shiki-light:#999999;--shiki-dark:#666666">()}}</span></span>
<span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">    if</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> _MODE</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676"> ==</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">sandbox</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">        _emit</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">payload</span><span style="--shiki-light:#999999;--shiki-dark:#666666">)</span><span style="--shiki-light:#A0ADA0;--shiki-dark:#758575DD">      # print(json.dumps(...), flush=True)</span></span>
<span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">        return</span></span></code></pre><p><code>run_code</code> consumes the sandbox&#39;s stdout chunk by chunk, buffers it into lines, and sends each through <code>parse_stdout_line</code>. Recognized envelopes — scalar metrics, a <code>chart_config</code>, or a rich event such as an image, table or confusion matrix — get persisted and published; everything else is just output the model will read back. The whitelist of rich types is deliberately small. A new one needs a frontend renderer first; otherwise a typo in agent code quietly fills the table with rows nothing can draw.</p>
<p>Publishing means a per-session <code>asyncio.Queue</code> in an in-process broadcaster, drained by exactly one SSE route. The routers never learn the event types; they call <code>broadcaster.publish</code>, and the generator behind the endpoint is thirteen lines long (I counted).</p>
<p>This is the part that changes how the thing feels, and the part I&#39;d defend to somebody who cares about none of the above. A chart that appears while the fit is still running is a chart you check at minute two, when the wrong column is still cheap to fix!! A report twenty minutes later is something you audit; a metric arriving now is something you supervise.</p>
<h2 id="what-you-can-actually-do"><a class="anchor" href="#what-you-can-actually-do" aria-label="Permalink">§</a>What you can actually do</h2>
<p>A project owns datasets; an experiment is an agent-declared bundle of processed dataset, model and metrics inside a session. <code>fork-experiment</code> copies the parent&#39;s input datasets under a new name and hypothesis and leaves the parent alone — the &quot;same prep, different model&quot; loop, agent-only, no button. Comparing runs is one route: up to eight session ids in, and metric series, feature-column overlap and per-session cost out. The prep explorer runs DuckDB over the parquet splits in-process and locks the connection down <em>after</em> loading rather than before: <code>SET enable_external_access = false</code>, SELECT-only, <code>read_csv</code> and <code>glob</code> blocked, limit forced to 1000.</p>
<p>Promotion is where the session stops mattering. <code>promote_session_model</code> copies artifact bytes to a versioned path under the project, freezes the metric summary, and infers the framework from the extension. The module docstring is the design: <em>sessions die; promoted models don&#39;t.</em> Deploying is a second, separate step, because a pickle isn&#39;t a service — an agent writes a Modal <code>app.py</code> next to the artifact, where <code>@app.cls</code> loads the model at container start and a <code>fastapi_endpoint</code> exposes <code>predict</code> behind a typed Pydantic contract. <code>validate-serving-app</code> runs before the Deploy button becomes clickable, and the check that earns its keep is the dullest one: that the artifact path resolves on the volume. A wrong path makes <code>@modal.enter</code> raise <code>FileNotFoundError</code>, Modal then retries the container forever, and that presents as a hung endpoint rather than an error.</p>
<p>And you can leave. The session download streams a zip of the workspace with a <code>requirements.txt</code>, a README and a local shim for the <code>trainable</code> module appended, so scripts that <code>from trainable import log</code> still run on a laptop.</p>
<h2 id="where-this-started"><a class="anchor" href="#where-this-started" aria-label="Permalink">§</a>Where this started</h2>
<p>The demo at the top is an update. This is the first version, recorded before most of the machinery above existed:</p>
<figure class="video">
  <button class="video-embed" type="button" data-yt="FhQlUC7YokA" data-start="1"
          aria-label="Play video: Trainable - Introducing a different path to Data Science — the original cut, and the argument unchanged.">
    <img src="https://i.ytimg.com/vi/FhQlUC7YokA/maxresdefault.jpg" alt="" width="1280" height="720" loading="lazy"
         onerror="this.onerror=function(){this.remove()};this.src='https://i.ytimg.com/vi/FhQlUC7YokA/hqdefault.jpg'">
    <span class="video-play" aria-hidden="true"></span>
    <span class="video-label" aria-hidden="true">Trainable - Introducing a different path to Data Science — the original cut, and the argument unchanged.</span>
  </button>
  <figcaption>Trainable - Introducing a different path to Data Science — the original cut, and the argument unchanged. <a class="video-link" href="https://www.youtube.com/watch?v=FhQlUC7YokA&t=1s"
    target="_blank" rel="noopener noreferrer">Watch on YouTube ↗</a></figcaption>
</figure>
<p>I keep it up because the framing in that title is the one I still hold; everything that changed since is underneath it. A different path to the same deployed model: the labor is automatable, the judgment is not, and the interesting engineering is the part nobody demos — a machine per call, a directory that outlives it, and a stream that lets you catch a mistake at minute two instead of in the write-up.</p>
<h2 id="state-as-code-not-summaries"><a class="anchor" href="#state-as-code-not-summaries" aria-label="Permalink">§</a>State as code, not summaries</h2>
<p>The question underneath all of this: how do you let a language model run arbitrary code for twenty minutes without the run becoming unauditable? My answer turned out to be a shape of storage, not a permission model: destroy the machine after every call, keep the directory. Everything a run produced is a file on the volume with a path, so a recursive diff and a classification by extension are enough to build the index the UI reads. Nothing had to be declared up front. No agent had to remember to register its own output.</p>
<p>The transferable idea is the smaller one. When an agent promotes a helper out of a notebook into <code>src/loaders.py</code> and a later agent imports it, the second one isn&#39;t working from a paraphrase of the first one&#39;s reasoning — it&#39;s running the same code, and it fails loudly if that code was wrong. Summaries drop exactly the details that break. Delete the volume and what remains is a transcript of a data science project: fluent, ordered, and reproducible by nobody.</p>
<hr>
<p>The agents are the demo; the two weeks are the point.</p>
]]></content:encoded>
    </item>
    <item>
      <title>ralph-installer: make a loop anywhere</title>
      <link>https://lucastononro.github.io/ralph-installer/</link>
      <guid isPermaLink="true">https://lucastononro.github.io/ralph-installer/</guid>
      <pubDate>Mon, 19 Jan 2026 12:00:00 GMT</pubDate>
      <description>One line of bash runs the loop; the state files around it are the actual work.</description>
      <category>skill</category>
      <content:encoded><![CDATA[<p>The Ralph loop is a coding agent restarted over and over with the same prompt. Nothing carries over in context: the instructions are a file, the plan is a file, the notes the agent leaves for its successor are a file, and every iteration is a fresh context window that reads all three off disk. Geoffrey Huntley, who named it after the Simpsons character, <a href="https://ghuntley.com/ralph/" target="_blank" rel="noopener noreferrer" class="external">writes it as one line</a>:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">while</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965"> :</span><span style="--shiki-light:#999999;--shiki-dark:#666666">;</span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375"> do</span><span style="--shiki-light:#59873A;--shiki-dark:#80A665"> cat</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> PROMPT.md</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676"> |</span><span style="--shiki-light:#59873A;--shiki-dark:#80A665"> claude-code</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> ;</span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375"> done</span></span></code></pre><p>&quot;Ralph is a technique. In its purest form, Ralph is a Bash loop.&quot; That&#39;s the whole idea, and it spread: <a href="https://github.com/snwfdhmp/awesome-ralph" target="_blank" rel="noopener noreferrer" class="external">awesome-ralph</a> catalogs forty-plus implementations, and in December 2025 Anthropic shipped <a href="https://github.com/anthropics/claude-code/tree/main/plugins/ralph-wiggum" target="_blank" rel="noopener noreferrer" class="external">a ralph-wiggum plugin</a> inside Claude Code that does the same thing with a Stop hook instead of a shell loop.<label class="sn-ref" for="sn-plugin" tabindex="0">1</label><input type="checkbox" id="sn-plugin" class="sn-toggle" aria-hidden="true"><span class="sidenote" role="note"><span class="sn-num">1</span>Check this before reaching for it. Dex Horthy, who wrote <a href="https://www.humanlayer.dev/blog/brief-history-of-ralph" target="_blank" rel="noopener noreferrer" class="external">a history of the technique</a>, says the plugin &quot;dies in cryptic ways&quot; and &quot;misses the key point of ralph&quot; — a Stop hook keeps you in one session, so you lose the fresh context window per iteration the bash loop gives you for free.</span></p>
<p><a href="https://github.com/lucastononro/ralph-installer" target="_blank" rel="noopener noreferrer" class="external"><code>ralph-installer</code></a> is my version. <code>npx ralph-installer@latest install</code> drops five files into <code>ralph/</code> and two skills into <code>.claude/skills/</code>. MIT, published to npm the same day the repo started.</p>
<figure class="diagram"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 310" role="img"
     aria-label="Loop: the same prompt in, one story implemented, checks run, state written to disk, loop back with the prompt unchanged">
  <!-- Hand-drawn on purpose: every box is a wobbly path, not a rect, and every
       edge overshoots slightly. Colors come from the page via CSS classes. -->
  <g stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7">

    <!-- the prompt, unchanged -->
    <path class="dg-fill" d="M22 37 L152 34 Q158 35 157 41 L159 85 Q158 92 151 91 L26 93 Q19 92 20 85 L21 42 Q21 37 22 37 Z"/>
    <text class="dg-text" x="42" y="59">prompt.md</text>
    <text class="dg-note" x="42" y="76">never edited</text>

    <!-- fresh agent -->
    <path class="dg-fill" d="M232 35 L344 33 Q350 34 349 40 L351 84 Q350 91 343 90 L236 92 Q229 91 230 84 L231 41 Q231 36 232 35 Z"/>
    <text class="dg-text" x="252" y="59">fresh agent</text>
    <text class="dg-note" x="252" y="76">one story</text>

    <!-- checks -->
    <path class="dg-fill" d="M424 36 L556 34 Q562 35 561 41 L563 85 Q562 92 555 91 L428 93 Q421 92 422 85 L423 42 Q423 37 424 36 Z"/>
    <text class="dg-text" x="444" y="59">typecheck, test</text>
    <text class="dg-note" x="444" y="76">then commit</text>

    <!-- state on disk -->
    <path class="dg-fill" d="M226 159 L365 157 Q371 158 370 164 L372 208 Q371 215 364 214 L230 216 Q223 215 224 208 L225 165 Q225 160 226 159 Z"/>
    <text class="dg-text" x="246" y="183">prd.json</text>
    <text class="dg-note" x="246" y="200">+ progress.txt</text>

    <!-- stopping condition -->
    <path class="dg-fill" d="M424 160 L556 158 Q562 159 561 165 L563 209 Q562 216 555 215 L428 217 Q421 216 422 209 L423 166 Q423 161 424 160 Z"/>
    <text class="dg-text" x="444" y="184">COMPLETE?</text>
    <text class="dg-note" x="444" y="201">or max iters</text>

    <!-- arrows, drawn with a little sag -->
    <path class="dg-accent" d="M162 63 Q196 58 222 63"/>
    <path class="dg-accent" d="M222 63 l-9 -4 m9 4 l-9 5"/>

    <path class="dg-accent" d="M356 63 Q390 68 414 63"/>
    <path class="dg-accent" d="M414 63 l-9 -4 m9 4 l-9 5"/>

    <!-- checks down and back to the files on disk -->
    <path class="dg-accent" d="M492 97 Q495 129 400 136 Q330 141 300 151"/>
    <path class="dg-accent" d="M300 151 l1 -10 m-1 10 l9 -3"/>

    <path class="dg-accent" d="M376 187 Q396 182 414 187"/>
    <path class="dg-accent" d="M414 187 l-9 -4 m9 4 l-9 5"/>

    <path class="dg-accent" d="M565 187 Q596 192 620 187"/>
    <path class="dg-accent" d="M620 187 l-9 -4 m9 4 l-9 5"/>
    <text class="dg-note" x="630" y="192">exit 0</text>

    <!-- loop back with the prompt untouched -->
    <path class="dg-accent" stroke-dasharray="5 6" d="M488 220 Q488 262 270 264 Q60 266 62 96"/>
    <path class="dg-accent" d="M62 96 l-5 9 m5 -9 l7 6"/>
    <text class="dg-note" x="140" y="288">the prompt goes in again byte for byte — only the repo changed</text>

    <text class="dg-note" x="88" y="130">no memory between passes</text>
  </g>
</svg>
<figcaption>The same prompt every pass; the repository is the only thing that changes.</figcaption></figure>
<h2 id="what-the-loop-reads"><a class="anchor" href="#what-the-loop-reads" aria-label="Permalink">§</a>What the loop reads</h2>
<p><code>ralph/ralph-claude.sh</code>, trimmed to the part that matters:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">for</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A"> i</span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375"> in</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> $(</span><span style="--shiki-light:#59873A;--shiki-dark:#80A665">seq</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 1</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A"> $MAX_ITERATIONS</span><span style="--shiki-light:#999999;--shiki-dark:#666666">);</span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375"> do</span></span>
<span class="line"><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">  PROMPT_CONTENT</span><span style="--shiki-light:#999999;--shiki-dark:#666666">=$(</span><span style="--shiki-light:#59873A;--shiki-dark:#80A665">cat</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">$SCRIPT_DIR/prompt.md</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">)</span></span>
<span class="line"><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">  OUTPUT</span><span style="--shiki-light:#999999;--shiki-dark:#666666">=$(</span><span style="--shiki-light:#59873A;--shiki-dark:#80A665">claude</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> --print</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> --dangerously-skip-permissions</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">$PROMPT_CONTENT</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676"> 2>&#x26;1</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676"> |</span><span style="--shiki-light:#59873A;--shiki-dark:#80A665"> tee</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> /dev/stderr</span><span style="--shiki-light:#999999;--shiki-dark:#666666">)</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676"> ||</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965"> true</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">  if</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965"> echo</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">$OUTPUT</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676"> |</span><span style="--shiki-light:#59873A;--shiki-dark:#80A665"> grep</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> -q</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">&#x3C;promise>COMPLETE&#x3C;/promise></span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">;</span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375"> then</span></span>
<span class="line"><span style="--shiki-light:#998418;--shiki-dark:#B8A965">    echo</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">Ralph completed all tasks!</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span></span>
<span class="line"><span style="--shiki-light:#998418;--shiki-dark:#B8A965">    exit</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 0</span></span>
<span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">  fi</span></span>
<span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665">  sleep</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 2</span></span>
<span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">done</span></span>
<span class="line"><span style="--shiki-light:#998418;--shiki-dark:#B8A965">exit</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 1</span></span></code></pre><p><code>prompt.md</code> is re-read from disk on every pass and handed over untouched. So the only difference between iteration three and iteration four is the repository — a commit, a <code>passes: true</code> flipped in <code>prd.json</code>, and a few lines appended to <code>progress.txt</code>.</p>
<p>The stopping condition is a string the agent has to say. <code>prompt.md</code> ends by telling it to check whether all stories have <code>passes: true</code> and, if so, reply <code>&lt;promise&gt;COMPLETE&lt;/promise&gt;</code>. Exit 0 when that appears, exit 1 when the loop burns through <code>MAX_ITERATIONS</code> without it. Different exit codes for &quot;done&quot; and &quot;gave up&quot; matter the moment something other than you reads them.</p>
<p>The rest of <code>prompt.md</code> is ten numbered steps: read the PRD and the progress log, check out the branch named in <code>prd.json</code>, take the highest-priority story where <code>passes: false</code>, implement that one, run the project&#39;s checks, commit as <code>feat: [Story ID] - [Story Title]</code>, flip the flag, append notes. Frontend stories aren&#39;t complete until verified in a browser.</p>
<h2 id="why-a-wrapper-exists"><a class="anchor" href="#why-a-wrapper-exists" aria-label="Permalink">§</a>Why a wrapper exists</h2>
<p>The loop is five lines. Everything that decides whether it works is in the files it reads, and each one is a place to be slightly wrong.</p>
<p>The plan has to be cut to the size of a context window. <code>skills/ralph.md</code> is blunt: &quot;Each story must be completable in ONE Ralph iteration (one context window)... If a story is too big, the LLM runs out of context before finishing and produces broken code.&quot; The rule of thumb is that if you can&#39;t describe the change in two or three sentences, split it. Criteria have to be checkable — the skill lists &quot;Works correctly&quot; and &quot;Good UX&quot; as bad ones, and appends &quot;Typecheck passes&quot; to every story.</p>
<p>The progress log has to have a shape, or its notes are useless to the next pass. Each iteration appends a <strong>Learnings for future iterations</strong> block, then promotes anything general into a <code>## Codebase Patterns</code> section pinned to the top. That section is the closest thing the design has to memory.</p>
<p>And the installer has to not destroy any of it on a second run. The line I&#39;d point at:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#A0ADA0;--shiki-dark:#758575DD">// User data files that should never be overwritten if they exist</span></span>
<span class="line"><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676">const</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A"> PRESERVE_FILES</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> =</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> [</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">'</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">prd.json</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">'</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> '</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">progress.txt</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">'</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> '</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">prompt.md</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">'</span><span style="--shiki-light:#999999;--shiki-dark:#666666">];</span></span></code></pre><p>Those three are the loop&#39;s state. Upgrading to a newer runner script would otherwise wipe your plan and your accumulated notes, so <code>--force</code> overwrites the scripts and still refuses to touch them — there&#39;s a test named exactly that, out of eighteen. Anything else that already exists is a conflict, and conflicts exit 2 with the list rather than guessing.</p>
<p>The rest is small and dull, which is the right amount of interesting for an installer. <code>ensureFrontmatter</code> fills a skill&#39;s missing <code>name</code> from the kebab-cased filename and <code>description</code> from its first H1 before writing <code>.claude/skills/&lt;name&gt;/SKILL.md</code>. The runner archives itself: when <code>branchName</code> no longer matches <code>.last-branch</code>, the old plan and log move into <code>archive/YYYY-MM-DD-&lt;name&gt;/</code> and a clean log starts. And <code>view</code> serves <code>/api/prd</code> and <code>/api/progress</code> off a stdlib Python server on 8089, to a canvas that redraws every two seconds — you watch stories go green instead of tailing a log.</p>
<h2 id="usage-as-a-stopping-condition"><a class="anchor" href="#usage-as-a-stopping-condition" aria-label="Permalink">§</a>Usage as a stopping condition</h2>
<p>The criticism of Ralph with numbers attached is cost. The Register <a href="https://www.theregister.com/2026/01/27/ralph_wiggum_claude_loops/" target="_blank" rel="noopener noreferrer" class="external">puts Huntley&#39;s figure</a> at &quot;about US $10 of compute and/or SaaS resources each hour&quot;, which he notes is &quot;far closer to wages paid to fast food workers&quot; than to developer salaries. Anthropic&#39;s plugin README cites a contract &quot;completed for $297 in API costs&quot; and tells you to always set <code>--max-iterations</code>.</p>
<p><code>scheduled-ralph.sh</code> measures a different meter, the one you&#39;re on when you run <code>claude</code> rather than the API. It lifts the Claude Code OAuth token out of the macOS Keychain (or <code>~/.config/claude-code/auth.json</code> on Linux) and asks:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665">curl</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> -s</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> -f</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">https://api.anthropic.com/api/oauth/usage</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> \</span></span>
<span class="line"><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076">  -H</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">Authorization: Bearer $token</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> \</span></span>
<span class="line"><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076">  -H</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">anthropic-beta: oauth-2025-04-20</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span></span></code></pre><p>Then it reads <code>.five_hour.utilization</code>, <code>.seven_day.utilization</code> and <code>.five_hour.resets_at</code>. <code>--max-usage 70</code> stops the loop at 70% of the five-hour block. <code>--wait</code> parks it instead, re-checking every 300 seconds until the block rolls over. <code>--wait-next-session</code> sleeps through the current block before starting — set it before bed and the loop runs on tomorrow&#39;s quota!!</p>
<p>If usage is already past the ceiling and you didn&#39;t pass <code>--wait</code>, it exits 2 instead of starting a loop it can&#39;t finish.<label class="sn-ref" for="sn-open" tabindex="0">2</label><input type="checkbox" id="sn-open" class="sn-toggle" aria-hidden="true"><span class="sidenote" role="note"><span class="sn-num">2</span>When it can&#39;t get a token, <code>get_usage_percent</code> returns <code>-1</code>, the script logs a warning, and the loop runs anyway — bounded only by iterations. It fails open, not closed. That&#39;s the wrong default for a script whose whole job is a budget.</span></p>
<h2 id="when-it39s-the-wrong-tool"><a class="anchor" href="#when-it39s-the-wrong-tool" aria-label="Permalink">§</a>When it&#39;s the wrong tool</h2>
<p>The people who like this technique hold the sharpest limits on it. Huntley: &quot;There&#39;s no way in heck would I use Ralph in an existing code base,&quot; and &quot;Engineers are still needed.&quot; His framing is greenfield bootstrapping, &quot;with the expectation you&#39;ll get 90% done.&quot; <a href="https://github.com/ghuntley/how-to-ralph-wiggum" target="_blank" rel="noopener noreferrer" class="external">how-to-ralph-wiggum</a> states the failure plainly: &quot;Ralph can go in circles, ignore instructions, or take wrong directions—this is expected and part of the tuning process.&quot; Horthy adds the two that hurt: &quot;If the specs are bad, the results will be meh,&quot; and &quot;If you are iterating/exploring, you probably don&#39;t want ralph in the first place.&quot;</p>
<p>The critics land in the same place from the other side. On <a href="https://news.ycombinator.com/item?id=46682325" target="_blank" rel="noopener noreferrer" class="external">the thread for that history</a>, the top comment is &quot;Just look at the code quality produced by these loops... It&#39;s complete garbage, and since it runs in a loop, the amount of garbage multiplies over time.&quot; Horthy&#39;s own reply is the sober version: &quot;I don&#39;t think anyone serious would recommend it for serious production systems.&quot; Further down sits the shape that does work — somebody Ralphing personal Mac menu bar apps, who reports that &quot;the apps work and scratch the itch that motivated them&quot; and admits they can&#39;t judge the Swift.</p>
<p>The reports agree on one thing: the loop needs a machine-checkable definition of done. Migrations, lint sweeps, dependency bumps, test cleanups. Tessl&#39;s writeup describes <a href="https://tessl.io/blog/unpacking-the-unpossible-logic-of-ralph-wiggumstyle-ai-coding/" target="_blank" rel="noopener noreferrer" class="external">a Jest-to-Vitest migration</a> where done meant tests pass, <code>vitest.config</code> exists, <code>jest.config</code> is gone and no Jest imports remain, bounded by &quot;explicit limits on iteration count, token usage, and cost.&quot; Nothing on that list requires taste. The same piece quotes Huntley on the part everyone skips: &quot;you really want to babysit this thing.&quot;</p>
<p>Measured against that, <code>passes: true</code> plus &quot;Typecheck passes&quot; is a weak gate, since the agent sets its own flag. The PRD is doing a spec&#39;s job, and a vague criterion gets marked done by an agent that meant well. The honest limit: this makes a good loop cheap to start, and it does not make a bad PRD safe.</p>
<hr>
<p>None of the difficulty is in the five lines.</p>
]]></content:encoded>
    </item>
    <item>
      <title>localiza&amp;co: what we actually ship with LLMs</title>
      <link>https://lucastononro.github.io/localiza-videocast/</link>
      <guid isPermaLink="true">https://lucastononro.github.io/localiza-videocast/</guid>
      <pubDate>Wed, 16 Apr 2025 12:00:00 GMT</pubDate>
      <description>A Portuguese-language videocast on how Localiza uses advanced analytics and LLMs day to day.</description>
      <category>talks</category>
      <content:encoded><![CDATA[<p>I joined Juliana Aarão Rocha, Samuel Oliveira and Thamires Souto on the Localiza&amp;Co videocast, for an episode called <em>Revolução Digital: Como a AI está transformando nosso mundo</em>. It is in Portuguese, and the title is grander than the conversation, which I mean as a compliment.</p>
<p>Most of it was concrete: how we use advanced analytics and LLMs inside Localiza, across a wide spread of situations and products. Four people who work on this from different angles, comparing notes on what the technology actually does in a real company — not in a keynote.</p>
<p>No grand thesis came out of it. I think that&#39;s the correct outcome. The interesting part of this work is almost always the specific problem, not the pattern you can draw over the top of it.</p>
<figure class="audio">
  <button class="audio-embed" type="button" data-spotify="episode/5465KG3EKwhkNid5OVFkyw"
          aria-label="Play: Revolução Digital: Como a AI está transformando nosso mundo (in Portuguese)">
    <span class="audio-play" aria-hidden="true"></span>
    <span class="audio-label">Revolução Digital: Como a AI está transformando nosso mundo (in Portuguese)</span>
  </button>
  <figcaption><a class="video-link" href="https://open.spotify.com/episode/5465KG3EKwhkNid5OVFkyw"
    target="_blank" rel="noopener noreferrer">Open in Spotify ↗</a></figcaption>
</figure>
<hr>
<p>The useful part of these conversations is hearing colleagues describe the same tools from a different seat.</p>
]]></content:encoded>
    </item>
    <item>
      <title>consulting cast: I was the guest</title>
      <link>https://lucastononro.github.io/consulting-cast/</link>
      <guid isPermaLink="true">https://lucastononro.github.io/consulting-cast/</guid>
      <pubDate>Fri, 22 Dec 2023 12:00:00 GMT</pubDate>
      <description>A guest spot on UFRJ&#39;s Consulting Cast, talking about consulting, AI and LLMs.</description>
      <category>talks</category>
      <content:encoded><![CDATA[<p>I was the guest on Consulting Cast, a podcast run out of UFRJ. We talked about consulting, AI and LLMs, and what they are doing to the industry.</p>
<p>It&#39;s in Portuguese.</p>
<figure class="audio">
  <button class="audio-embed" type="button" data-spotify="episode/6vX9wZ4sz7IRfiNohFFtol"
          aria-label="Play: Consulting Cast — UFRJ (in Portuguese)">
    <span class="audio-play" aria-hidden="true"></span>
    <span class="audio-label">Consulting Cast — UFRJ (in Portuguese)</span>
  </button>
  <figcaption><a class="video-link" href="https://open.spotify.com/episode/6vX9wZ4sz7IRfiNohFFtol"
    target="_blank" rel="noopener noreferrer">Open in Spotify ↗</a></figcaption>
</figure>
]]></content:encoded>
    </item>
    <item>
      <title>llm-food-delivery: the agent loop was a switch statement</title>
      <link>https://lucastononro.github.io/llm-food-delivery/</link>
      <guid isPermaLink="true">https://lucastononro.github.io/llm-food-delivery/</guid>
      <pubDate>Sun, 17 Dec 2023 12:00:00 GMT</pubDate>
      <description>Ordering dinner by voice in 2023: eleven hand-written function schemas and a loop that lived in the browser.</description>
      <category>agents</category>
      <content:encoded><![CDATA[<p>In December 2023 I wanted a chatbot that could <em>drive</em> a web interface rather than talk about one. <a href="https://github.com/lucastononro/llm-food-delivery" target="_blank" rel="noopener noreferrer" class="external">llm-food-delivery</a> is a fake delivery app — FastAPI, Vue, SQLite, Pinecone — where you order dinner by voice and never have to touch the deliberately cluttered UI. <code>whisper-1</code> in, <code>tts-1</code> out (voice <code>shimmer</code>), <code>gpt-4-32k</code> in the middle. The README calls it an &quot;Interface-omniscient&quot; agent, which tells you roughly what 2023 felt like.</p>
<figure class="video">
  <video class="video-file" src="/video/llm-food-delivery-demo.mp4" poster="/video/llm-food-delivery-demo.jpg"
         controls preload="none" playsinline width="1280" height="720"></video>
  <figcaption>Ordering dinner without touching the interface. December 2023.</figcaption>
</figure>
<h2 id="eleven-schemas-by-hand"><a class="anchor" href="#eleven-schemas-by-hand" aria-label="Permalink">§</a>Eleven schemas, by hand</h2>
<p>Every action a user could take was mapped to a function. Each function was a YAML block I typed out myself:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666">-</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965"> name</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> get_restaurant_pages</span></span>
<span class="line"><span style="--shiki-light:#998418;--shiki-dark:#B8A965">  description</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> This function finds a restaurant that has similar food or name to …</span></span>
<span class="line"><span style="--shiki-light:#998418;--shiki-dark:#B8A965">  parameters</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span></span>
<span class="line"><span style="--shiki-light:#998418;--shiki-dark:#B8A965">    type</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> object</span></span>
<span class="line"><span style="--shiki-light:#998418;--shiki-dark:#B8A965">    properties</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span></span>
<span class="line"><span style="--shiki-light:#998418;--shiki-dark:#B8A965">      type_of_restaurant</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span></span>
<span class="line"><span style="--shiki-light:#998418;--shiki-dark:#B8A965">        type</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> string</span></span>
<span class="line"><span style="--shiki-light:#998418;--shiki-dark:#B8A965">        description</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> The type of food or restaurant that the user requested.</span></span>
<span class="line"><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">          E.g. Italian, Pizza, Sushi, Indian, Vegan, etc...</span></span>
<span class="line"><span style="--shiki-light:#998418;--shiki-dark:#B8A965">      quantity</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span></span>
<span class="line"><span style="--shiki-light:#998418;--shiki-dark:#B8A965">        type</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> integer</span></span>
<span class="line"><span style="--shiki-light:#998418;--shiki-dark:#B8A965">        description</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> … if the user request is broad you should set 2,3,4 or even 5</span></span>
<span class="line"><span style="--shiki-light:#998418;--shiki-dark:#B8A965">  required</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> [</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">name_of_restaurant</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> type_of_restaurant</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> food_requested</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D"> …</span><span style="--shiki-light:#999999;--shiki-dark:#666666">]</span></span>
<span class="line"><span style="--shiki-light:#998418;--shiki-dark:#B8A965">  allow</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375"> true</span></span></code></pre><p>Eleven of those, each ending in <code>allow: true</code> (a flag I wrote eleven times and never once flipped). <code>prompts/functions/__init__.py</code> reads the YAML, keeps the allowed entries, pops the <code>allow</code> key and writes <code>signatures.json</code> — at import time, as a side effect of importing the package. That&#39;s the sort of thing you do when the schema list is also your build system.</p>
<p>What strikes me now is how much of the control flow is written in English, inside YAML descriptions, addressed to a model free to ignore it. There was no way to express ordering, so the descriptions do it: <code>open_restaurant_page</code> says &quot;This function can only be called after the function <code>get_restaurant_pages</code>&quot;, and <code>close_restaurant_page</code> says &quot;you can check the recent actions with <code>get_user_actions</code> to verify it, before calling the function&quot;. Sequencing, preconditions, confirmation prompts — all prose, all politely unenforced. Today the schema falls out of a type hint and the ordering is a graph you can look at. Then, it was a paragraph and a hope.<label class="sn-ref" for="sn-typo" tabindex="0">1</label><input type="checkbox" id="sn-typo" class="sn-toggle" aria-hidden="true"><span class="sidenote" role="note"><span class="sn-num">1</span><code>close_restaurant_page</code>&#39;s description ends &quot;goes back to the main page (menu with all the restaurants) x&quot;. The stray <code>x</code> is still sitting there in <code>config.yaml</code>, and I have never worked out what it was going to be.</span></p>
<h2 id="the-actual-call"><a class="anchor" href="#the-actual-call" aria-label="Permalink">§</a>The actual call</h2>
<p>The whole model layer is one function, and it predates everything you&#39;d expect:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">model_args </span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> {</span></span>
<span class="line"><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">    "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">model</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> CFG_OPENAI</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">get</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">chat_model</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">gpt-4</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">),</span></span>
<span class="line"><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">    "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">temperature</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> CFG_OPENAI</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">get</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">temperature</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 0</span><span style="--shiki-light:#999999;--shiki-dark:#666666">),</span></span>
<span class="line"><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">    "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">max_tokens</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> CFG_OPENAI</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">get</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">max_tokens</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 512</span><span style="--shiki-light:#999999;--shiki-dark:#666666">),</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">    …</span></span>
<span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666">}</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A0ADA0;--shiki-dark:#758575DD"># Incrementing in cases of function calling</span></span>
<span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">if</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965"> len</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">functions</span><span style="--shiki-light:#999999;--shiki-dark:#666666">)</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676"> ></span><span style="--shiki-light:#2F798A;--shiki-dark:#4C9A91"> 0</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">    model_args</span><span style="--shiki-light:#999999;--shiki-dark:#666666">[</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">functions</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">]</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> =</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE"> functions</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">    model_args</span><span style="--shiki-light:#999999;--shiki-dark:#666666">[</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">function_call</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">]</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> =</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">auto</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span></span></code></pre><p><code>functions</code>, not <code>tools</code>. <code>function_call: &quot;auto&quot;</code>, not <code>tool_choice</code>. The config pins <code>temperature: 0.0</code> and <code>max_tokens: 256</code>, and the system prompt closes with &quot;You do not answer with more than 70 words&quot;. The ceiling was a budget as much as a guard.</p>
<p>Three absences did most of the shaping. There are no tool-call ids, so a result goes back as a bare <code>{role, name, content}</code> triple, and <code>PromptHandler.get_messages</code> has to re-shape every message so that only <code>function</code> ones carry a <code>name</code>. There are no parallel calls, so two items into the cart meant two round trips — exactly why <code>add_food_to_cart</code>&#39;s description pleads &quot;You can call this function multiple times in a row&quot;. And there was no loop. The API returned one <code>function_call</code> and considered the matter closed. Every service function is wrapped in <code>@retry(wait=wait_random(min=1, max=5), stop=stop_after_attempt(5))</code>, because that was the other thing 2023 gave you a lot of.</p>
<h2 id="the-loop-in-the-browser"><a class="anchor" href="#the-loop-in-the-browser" aria-label="Permalink">§</a>The loop in the browser</h2>
<figure class="diagram"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 318" role="img"
     aria-label="Loop: voice in, whisper-1, gpt-4 with hand-written function schemas, a switch statement in the browser, a Vue method that moves the interface, the result pushed back into the chat history, and the model asked again">
  <!-- Hand-drawn on purpose: every box is a wobbly path, not a rect, and every
       edge overshoots slightly. Colours come from the page via CSS classes. -->
  <g stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7">

    <!-- voice in -->
    <path class="dg-fill" d="M22 40 L163 37 Q169 38 168 44 L170 88 Q169 95 162 94 L26 96 Q19 95 20 88 L21 45 Q21 40 22 40 Z"/>
    <text class="dg-text" x="42" y="62">you, talking</text>
    <text class="dg-note" x="42" y="79">MediaRecorder</text>

    <!-- transcription -->
    <path class="dg-fill" d="M240 38 L381 35 Q387 36 386 42 L388 87 Q387 94 380 93 L244 95 Q237 94 238 87 L239 43 Q239 38 240 38 Z"/>
    <text class="dg-text" x="260" y="62">whisper-1</text>
    <text class="dg-note" x="260" y="79">/chat/transcribe</text>

    <!-- the model -->
    <path class="dg-fill" d="M458 39 L619 36 Q625 37 624 43 L626 89 Q625 96 618 95 L462 97 Q455 96 456 89 L457 44 Q457 39 458 39 Z"/>
    <text class="dg-text" x="478" y="62">gpt-4-32k</text>
    <text class="dg-note" x="478" y="79">functions=[…]</text>

    <!-- the switch -->
    <path class="dg-fill" d="M40 176 L207 173 Q213 174 212 180 L214 225 Q213 232 206 231 L44 233 Q37 232 38 225 L39 181 Q39 176 40 176 Z"/>
    <text class="dg-text" x="60" y="200">switch, 11 cases</text>
    <text class="dg-note" x="60" y="217">handleFunctionCall</text>

    <!-- the interface moves -->
    <path class="dg-fill" d="M300 177 L473 174 Q479 175 478 181 L480 227 Q479 234 472 233 L304 235 Q297 234 298 227 L299 182 Q299 177 300 177 Z"/>
    <text class="dg-text" x="320" y="200">a Vue method</text>
    <text class="dg-note" x="320" y="217">@action: breadcrumb</text>

    <!-- the result -->
    <path class="dg-fill" d="M560 176 L735 173 Q741 174 740 180 L742 225 Q741 232 734 231 L564 233 Q557 232 558 225 L559 181 Q559 176 560 176 Z"/>
    <text class="dg-text" x="580" y="200">role: &quot;function&quot;</text>
    <text class="dg-note" x="580" y="217">back into history</text>

    <!-- arrows, drawn with a little sag -->
    <path class="dg-accent" d="M171 66 Q205 61 234 66"/>
    <path class="dg-accent" d="M234 66 l-9 -4 m9 4 l-9 5"/>

    <path class="dg-accent" d="M389 66 Q423 71 452 66"/>
    <path class="dg-accent" d="M452 66 l-9 -4 m9 4 l-9 5"/>

    <!-- out of the model, down and left into the browser -->
    <path class="dg-accent" d="M520 99 Q524 133 400 141 Q225 149 130 170"/>
    <path class="dg-accent" d="M130 170 l1 -10 m-1 10 l9 -3"/>

    <path class="dg-accent" d="M216 204 Q256 199 294 204"/>
    <path class="dg-accent" d="M294 204 l-9 -4 m9 4 l-9 5"/>

    <path class="dg-accent" d="M482 204 Q516 209 554 204"/>
    <path class="dg-accent" d="M554 204 l-9 -4 m9 4 l-9 5"/>

    <!-- and round again -->
    <path class="dg-accent" stroke-dasharray="5 6" d="M700 172 Q744 130 688 112 Q654 99 626 90"/>
    <path class="dg-accent" d="M626 90 l10 -1 m-10 1 l8 8"/>
    <text class="dg-note" x="596" y="148">ask it again</text>

    <text class="dg-note" x="22" y="126">top row: FastAPI — bottom row: one Vue file</text>

    <text class="dg-note" x="22" y="272">The tools are interface actions, not computations, so the loop closes in the browser.</text>
    <text class="dg-note" x="22" y="294">Breadcrumbs only come back when the model calls get_user_actions.</text>
  </g>
</svg>
<figcaption>The unusual bit: the cycle closes through a Vue component, not through the server.</figcaption></figure>
<p>Since nobody supplied a loop, the loop went where the tools were — the frontend. <code>handleFunctionCall</code> is a switch over eleven names:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">switch</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> (</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">functionCallSignal</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">name</span><span style="--shiki-light:#999999;--shiki-dark:#666666">)</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> {</span></span>
<span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">  case</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">get_restaurant_pages</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span></span>
<span class="line"><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">    functionCallResponseContent</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> =</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> this</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#59873A;--shiki-dark:#80A665">handleGetRestaurant</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">functionCallResponse</span><span style="--shiki-light:#999999;--shiki-dark:#666666">);</span></span>
<span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">    break</span><span style="--shiki-light:#999999;--shiki-dark:#666666">;</span></span>
<span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">  case</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">open_restaurant_page</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span></span>
<span class="line"><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">    functionCallResponseContent</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> =</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076"> this</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#59873A;--shiki-dark:#80A665">handleOpenRestaurant</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">functionCallResponse</span><span style="--shiki-light:#999999;--shiki-dark:#666666">);</span></span>
<span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">    break</span><span style="--shiki-light:#999999;--shiki-dark:#666666">;</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE">  …</span></span>
<span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666">}</span></span>
<span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665">resolve</span><span style="--shiki-light:#999999;--shiki-dark:#666666">({</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965"> role</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77"> "</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D">function</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77">"</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span><span style="--shiki-light:#998418;--shiki-dark:#B8A965"> content</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A"> functionCallResponseContent</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span></span>
<span class="line"><span style="--shiki-light:#998418;--shiki-dark:#B8A965">          name</span><span style="--shiki-light:#999999;--shiki-dark:#666666">:</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A"> functionCallSignal</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">name</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> });</span></span></code></pre><p>and <code>generateAnswer</code> calls itself with the result appended:</p>
<pre class="shiki shiki-themes vitesse-light vitesse-dark" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212" tabindex="0"><code><span class="line"><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076">this</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#59873A;--shiki-dark:#80A665">handleFunctionCall</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">functionCallSignal</span><span style="--shiki-light:#999999;--shiki-dark:#666666">)</span></span>
<span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666">  .</span><span style="--shiki-light:#59873A;--shiki-dark:#80A665">then</span><span style="--shiki-light:#999999;--shiki-dark:#666666">((</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">functionCallOutput</span><span style="--shiki-light:#999999;--shiki-dark:#666666">)</span><span style="--shiki-light:#999999;--shiki-dark:#666666"> =></span><span style="--shiki-light:#999999;--shiki-dark:#666666"> {</span></span>
<span class="line"><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076">    this</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">messages</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#59873A;--shiki-dark:#80A665">push</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">functionCallOutput</span><span style="--shiki-light:#999999;--shiki-dark:#666666">)</span></span>
<span class="line"><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076">    this</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#59873A;--shiki-dark:#80A665">generateAnswer</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(</span></span>
<span class="line"><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">      chatHistory</span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076">this</span><span style="--shiki-light:#999999;--shiki-dark:#666666">.</span><span style="--shiki-light:#59873A;--shiki-dark:#80A665">getChatHistory</span><span style="--shiki-light:#999999;--shiki-dark:#666666">(),</span></span>
<span class="line"><span style="--shiki-light:#A0ADA0;--shiki-dark:#758575DD">      // function_call=false,</span></span>
<span class="line"><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A">      function_call</span><span style="--shiki-light:#999999;--shiki-dark:#666666">=</span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375">true</span><span style="--shiki-light:#999999;--shiki-dark:#666666">,</span></span>
<span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666">    )</span></span>
<span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666">  })</span></span></code></pre><p><code>handleOpenRestaurant</code> parses the uuid out of the response and then calls <code>this.$refs.restaurantsContainer.selectRestaurant(restaurantId)</code>. A tool call is a <code>$refs</code> poke. This is why the backend has <code>dummy_function()</code>. Six of the eleven server handlers (<code>close_restaurant_page</code>, <code>get_user_actions</code>, <code>open_shopping_cart</code>, <code>close_shopping_cart</code>, <code>place_order</code>, <code>activate_handsfree</code>) route to a coroutine that returns <code>&quot;&quot;</code>, and <code>add_food_to_cart</code> echoes its own arguments straight back. The round trip exists to keep the shape uniform. Nothing happens on the server because there is nothing there to happen: &quot;open the cart&quot; has no headless meaning.</p>
<p>That&#39;s the part I&#39;d defend. If your tools are interface actions, the agent loop belongs on the same side of the wire as the interface, and the backend degrades into a schema server with a retry decorator.<label class="sn-ref" for="sn-kwargs" tabindex="0">2</label><input type="checkbox" id="sn-kwargs" class="sn-toggle" aria-hidden="true"><span class="sidenote" role="note"><span class="sn-num">2</span><code>chatHistory=this.getChatHistory()</code> looks like a Python keyword argument. In JavaScript it assigns to the enclosing scope&#39;s variable and passes the value along, which happens to do the right thing. Nothing counts the hops, either — the recursion&#39;s only brake is the model deciding to answer.</span></p>
<h2 id="memory-as-breadcrumbs"><a class="anchor" href="#memory-as-breadcrumbs" aria-label="Permalink">§</a>Memory as breadcrumbs</h2>
<p>The model can&#39;t see the DOM, so the interface narrates itself. Every component emits upward into one method with a one-line body — <code>this.actions.push(&quot;@action:&quot; + msg + &quot; at &quot; + this.getCurrentTime())</code>. The call sites are written for a reader rather than a parser: <code>registerAction(&quot;opened the restaurant page &quot; + this.selectedRestaurant.name + &quot; with restaurant_uuid=&quot; + this.selectedRestaurant.uuid)</code>, or &quot;incremented the amount of food Margherita Pizza to 2 items (in the restaurant page, not in the shopping cart)&quot;. Two vocabularies coexist: <code>@action:</code> for anything that happened in the interface, <code>@agent-action:</code> for the string handed back to the model after it caused something. The system prompt introduces the convention directly — &quot;Every time the user or you do something ... you will receive a message starting with <code>@action:</code>&quot; — and <code>get_user_actions</code> hands over the last ten on demand. Ask it &quot;what did I just do?&quot; and it goes and looks.<label class="sn-ref" for="sn-splice" tabindex="0">3</label><input type="checkbox" id="sn-splice" class="sn-toggle" aria-hidden="true"><span class="sidenote" role="note"><span class="sn-num">3</span>The implementation is <code>JSON.stringify(this.actions.splice(-10))</code>, and <code>splice</code> <em>removes</em>. Reading the memory deleted it. In a demo, nobody noticed.</span></p>
<p>Timestamps come from <code>hourTime + &#39;:&#39; + minuteTime + &#39;:&#39; + secondTime</code>, unpadded, so the log reads <code>at 14:2:9</code>. It never mattered.</p>
<h2 id="synthetic-everything"><a class="anchor" href="#synthetic-everything" aria-label="Permalink">§</a>Synthetic everything</h2>
<p>Restaurants and menus are a literal Python list in <code>populate_fake_data.py</code> — Italian Bistro, Sushi House, Taco Fiesta, twenty-five of them with eight items each. The README credits the list to GPT-4. The photographs are DALL·E 3, one call per row, with a prompt of magnificent brevity: <code>&quot;Photorealistic zoomed picture of food: &quot; + food.name</code>, skipped if the file already exists. Search is llama-index over a Pinecone index called <code>auto-food-order</code>: one document per restaurant, its text the name, the description and every dish concatenated. Retrieval is <code>ExactMatchFilter(key=&quot;search_type&quot;, value=&quot;restaurant&quot;)</code> with <code>top_k=quantity</code> — the model&#39;s own guess, from that schema above, at how many restaurants it ought to look at.</p>
<h2 id="the-loop-follows-the-tools"><a class="anchor" href="#the-loop-follows-the-tools" aria-label="Permalink">§</a>The loop follows the tools</h2>
<p>I&#39;ve said where the loop went. The general form is the part I&#39;d keep: placement is settled by where the tools are, not by where the model call is convenient to make. A tool call here was a <code>$refs</code> poke, which is why six of the eleven server handlers returned <code>&quot;&quot;</code> and the backend stayed in the cycle only for the shape of it. Anything the user could otherwise have clicked pulls the loop toward the client the same way.</p>
<p>The other thing is a note about my own labor. Nearly everything I typed out by hand has since become somebody else&#39;s code. The eleven YAML blocks fall out of a type hint. The sequencing I wrote as prose in a <code>description</code> field is a graph. The recursion in <code>generateAnswer</code> ships in the SDK. None of that was foresight — the platform arrived and the scaffolding stopped being mine. Which leaves the bit worth carrying forward: I only hand-write what nothing supplies yet. So whichever piece of this year&#39;s scaffolding I&#39;m proudest of having built myself is probably next.</p>
<hr>
<p>The config on disk has since drifted to <code>gpt-4-0125-preview</code>, which is the only part of this that has aged as expected.</p>
]]></content:encoded>
    </item>
  </channel>
</rss>
