thegovind's picture
Split the longest sentences and fit the install command on screen (from 338f312) (part 2)
09fbc15 verified
Raw History Blame Contribute Delete
124 kB
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="only light">
<meta name="theme-color" content="#f5f5f5">
<title>Weight-space programming lab</title>
<meta name="description" content="Big thing: These nine hands-on labs reproduce and take apart Experiment 8 of the MIT CSAIL blog post &quot;Sparks of Weight-Space Programming&quot; on two 8-GPU A100 machines. In that experiment, an AI agent…">
<link rel="icon" href="static/favicon.svg" type="image/svg+xml">
<link rel="preload" href="static/fonts/geist-latin-wght-normal.woff2" as="font" type="font/woff2" crossorigin>
<link rel="stylesheet" href="static/site.css">
<link rel="stylesheet" href="static/katex/katex.min.css">
<script>document.documentElement.classList.add("js")</script>
<script defer src="static/site.js"></script>
</head>
<body data-copy="Copy" data-copied="Copied">
<a class="skip" href="#main">Skip to content</a>
<header class="top">
<div class="top-in">
<a class="brand" href="index.html">Weight-space programming lab</a>
<nav class="top-links" aria-label="Site"><a href="index.html" aria-current="page">Home</a><a href="quickstart.html">Quick start</a><a href="index.html#the-nine-labs">Labs</a><a href="reference/theory-guide.html">Theory</a><a href="results/summary.html">Results</a><a href="https://huggingface.co/spaces/thegovind/weight-space-programming/tree/main/code/" target="_blank" rel="noopener">Code</a></nav>
</div>
</header>
<div class="page">
<main id="main" class="doc">
<article class="prose">
<h1 id="weight-space-programming-labs">Weight-space programming labs</h1>
<details class="tocm"><summary>On this page</summary><nav aria-label="On this page"><ul><li class="l2"><a href="#the-story">The story</a></li><li class="l2"><a href="#what-we-found">What we found</a></li><li class="l2"><a href="#start-here">Start here</a></li><li class="l2"><a href="#the-nine-labs">The nine labs</a></li><li class="l2"><a href="#project-layout">Project layout</a></li><li class="l2"><a href="#running-things">Running things</a></li><li class="l2"><a href="#sources">Sources</a></li></ul></nav></details>
<p><strong>Big thing:</strong> These nine hands-on labs reproduce and take apart Experiment 8 of the MIT CSAIL blog post &quot;Sparks of Weight-Space Programming&quot; on two 8-GPU A100 machines. In that experiment, an AI agent fixed a small language model (Qwen3.5-0.8B) that got stuck repeating itself on math problems by editing 131,072 of its 873,438,784 weights with arithmetic, without training.</p>
<p><strong>Why it matters:</strong> Most model fixes change the prompt or sampling settings, or run gradient descent (training that adjusts weights to reduce errors). Here you do four things:</p>
<ul>
<li>Inspect the <code>131,072</code> edited weights (<code>130,188</code> change after bf16 rounding, which stores numbers at reduced precision).</li>
<li>Rebuild the edit from 8 short texts in one minute.</li>
<li>Prove that the weight edit equals an input-driven steering vector (a change to the model's internal numbers whose strength depends on the input).</li>
<li>Build your own edit from the model's failures.</li>
</ul>
<h2 id="the-story">The story<a class="anchor" href="#the-story" aria-hidden="true" tabindex="-1">#</a></h2>
<p>Weight-space programming changes what a trained neural network does by reading and editing its weight matrices with arithmetic instead of gradient training.</p>
<p>In Experiment 8 (2 Nov 2026), an AI agent (GPT-6 Astra) got a CPU-only Python session with Qwen3.5-0.8B, an open model with about 0.87 billion weights across 24 repeated layers (blocks). It had practice math problems with answers and a budget of 50 forward passes. A forward pass runs inputs through the network to read internal activations (numbers computed as the input passes through each layer) or generate answers. One pass could answer up to 512 problems or read activations on up to 1,024 texts, and all training was forbidden.</p>
<p>With thinking on, the model writes a <code>&lt;think&gt;...&lt;/think&gt;</code> scratchpad before its final answer. In this mode, the unedited model kept falling into verbatim loops, repeating the same block of tokens (word pieces) over and over until it hit the 32,768-token cap: 85 of its first 96 practice answers hit that limit.</p>
<p>The agent wrote 4 productive and 4 looping scratchpads and compared the model's activations on them. That contrast gave a unit direction vector <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.4306em;"></span><span class="mord mathnormal">u</span></span></span></span>: a list of 1,024 numbers whose overall length is 1, pointing from productive text toward looping text. It then applied a rank-one projection edit (one column vector times one row vector) in blocks 15 and 19. Each block's MLP (multi-layer perceptron, the block's second half) has an output matrix <code>down_proj</code> of shape 1,024 by 3,584. Each column is the 1,024-number vector one neuron adds to the residual stream (the running list of numbers each token carries from block to block) per unit of activation. The agent picked the 64 neurons that push hardest along <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.4306em;"></span><span class="mord mathnormal">u</span></span></span></span> during loops and updated their columns <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>W</mi><mi>S</mi></msub></mrow><annotation encoding="application/x-tex">W_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.1389em;">W</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.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" style="margin-right:0.0576em;">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> via <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>W</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo>=</mo><mi>W</mi><mo>−</mo><mi>α</mi><mi>u</mi><mo stretchy="false">(</mo><msup><mi>u</mi><mi>T</mi></msup><msub><mi>W</mi><mi>S</mi></msub><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">W&#x27; = W - \alpha u (u^T W_S)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7519em;"></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.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="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:1.0913em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.0037em;">α</span><span class="mord mathnormal">u</span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">u</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 mathnormal mtight" style="margin-right:0.1389em;">T</span></span></span></span></span></span></span></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.3283em;"><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" style="margin-right:0.0576em;">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 class="mclose">)</span></span></span></span> with strength <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mo>=</mo><mn>6</mn></mrow><annotation encoding="application/x-tex">\alpha = 6</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">6</span></span></span></span>. That edit touches <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>2</mn><mo>×</mo><mn>64</mn><mo>×</mo><mn>1</mn><mo separator="true">,</mo><mn>024</mn><mo>=</mo><mn>131</mn><mo separator="true">,</mo><mn>072</mn></mrow><annotation encoding="application/x-tex">2 \times 64 \times 1,024 = 131,072</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.7278em;vertical-align:-0.0833em;"></span><span class="mord">64</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.8389em;vertical-align:-0.1944em;"></span><span class="mord">1</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">024</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">131</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">072</span></span></span></span> weights (<code>p50c</code>, from the 50-pass run folder <code>runs/p50c</code>).</p>
<p>On three unseen benchmarks, the paper reported these results for <code>p50c</code>:</p>
<ul>
<li><strong>MATH-500:</strong> Accuracy rose from 7.9% to 48.1%. Answers cut at the cap fell from 93.0% to 33.05%, and mean tokens fell from 30,868 to 22,037.</li>
<li><strong>GSM8K:</strong> Accuracy rose from 13.84% to 67.1%. Answers cut at the cap fell from 87.5% to 7.24%, and mean tokens fell from 29,289 to 11,993.</li>
<li><strong>IFEval:</strong> Instruction-following accuracy rose from 21.0% to 62.3%. Answers cut at the cap fell from 74.9% to 2.2%, and mean tokens fell from 25,296 to 4,241.</li>
</ul>
<h2 id="what-we-found">What we found<a class="anchor" href="#what-we-found" aria-hidden="true" tabindex="-1">#</a></h2>
<ul>
<li><strong>The benchmark gains reproduce on our hardware</strong> (<a href="labs/lab2_reproduce.html"><code>labs/lab2_reproduce.md</code></a>, <a href="labs/lab1_diff.html"><code>labs/lab1_diff.md</code></a>). Diffing all 488 weight tensors (arrays of weights) confirms that only <code>layers.15.mlp.down_proj.weight</code> and <code>layers.19.mlp.down_proj.weight</code> changed, in 64 columns each, with fitted <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mo>=</mo><mn>6.0003</mn></mrow><annotation encoding="application/x-tex">\alpha = 6.0003</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">6.0003</span></span></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>6.0002</mn></mrow><annotation encoding="application/x-tex">6.0002</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">6.0002</span></span></span></span>. On our GPUs, <code>p50c</code> raises MATH-500 from <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>7.3</mn><mo>±</mo><mn>0.9</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">7.3 \pm 0.9\%</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">7.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.8056em;vertical-align:-0.0556em;"></span><span class="mord">0.9%</span></span></span></span> to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>51.8</mn><mo>±</mo><mn>1.9</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">51.8 \pm 1.9\%</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">51.8</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.8056em;vertical-align:-0.0556em;"></span><span class="mord">1.9%</span></span></span></span>, GSM8K from <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>14.2</mn><mo>±</mo><mn>0.8</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">14.2 \pm 0.8\%</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">14.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.8056em;vertical-align:-0.0556em;"></span><span class="mord">0.8%</span></span></span></span> to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>66.9</mn><mo>±</mo><mn>1.2</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">66.9 \pm 1.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">66.9</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.8056em;vertical-align:-0.0556em;"></span><span class="mord">1.2%</span></span></span></span>, and IFEval from <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>21.2</mn><mo>±</mo><mn>1.4</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">21.2 \pm 1.4\%</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">21.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.8056em;vertical-align:-0.0556em;"></span><span class="mord">1.4%</span></span></span></span> to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>63.4</mn><mo>±</mo><mn>1.8</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">63.4 \pm 1.8\%</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">63.4</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.8056em;vertical-align:-0.0556em;"></span><span class="mord">1.8%</span></span></span></span>.</li>
<li><strong>The 5-minute quick run shows the same effect on 16 problems</strong> (<a href="quickstart.html"><code>QUICKSTART.md</code></a>, <a href="labs/lab2_reproduce.html"><code>labs/lab2_reproduce.md</code></a>). On the first 16 GSM8K problems of our 256-problem practice test set (<code>dev256</code>), the unedited model scores <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>18.8</mn><mo>±</mo><mn>7.7</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">18.8 \pm 7.7\%</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">18.8</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.8056em;vertical-align:-0.0556em;"></span><span class="mord">7.7%</span></span></span></span> and <code>p50c</code> scores <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>65.6</mn><mo>±</mo><mn>11.8</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">65.6 \pm 11.8\%</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">65.6</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.8056em;vertical-align:-0.0556em;"></span><span class="mord">11.8%</span></span></span></span> (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>+</mo><mn>46.9</mn><mo>±</mo><mn>11.6</mn></mrow><annotation encoding="application/x-tex">+46.9 \pm 11.6</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">46.9</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">11.6</span></span></span></span> percentage points). Answers cut at the 32,768-token cap fall from 27 of 32 (all ending in a verbatim loop) to 3 of 32 (0 in a loop).</li>
<li><strong>Rebuilding the edit from the agent's 8 texts recovers all 64 neurons in both layers</strong> (<a href="labs/lab3_rebuild.html"><code>labs/lab3_rebuild.md</code></a>). Teacher-forcing the agent's 4 productive and 4 looping texts (feeding fixed text through the model and recording activations with hooks, small functions attached to layers) shows that the MLPs of blocks 15 and 19 widen the looping-minus-productive gap the most. The rebuilt edit recovers directions matching the released <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.4306em;"></span><span class="mord mathnormal">u</span></span></span></span> to cosine <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>+</mo><mn>0.99998</mn></mrow><annotation encoding="application/x-tex">+0.99998</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.99998</span></span></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><mn>0.99998</mn></mrow><annotation encoding="application/x-tex">-0.99998</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.99998</span></span></span></span> (nearly the same line, with opposite orientation at the second layer), picks the same 64 neurons in both layers, and scores <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>61.5</mn><mo>±</mo><mn>2.8</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">61.5 \pm 2.8\%</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">61.5</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.8056em;vertical-align:-0.0556em;"></span><span class="mord">2.8%</span></span></span></span> on <code>dev256</code> (matching <code>p50c</code>'s <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>61.5</mn><mo>±</mo><mn>2.8</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">61.5 \pm 2.8\%</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">61.5</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.8056em;vertical-align:-0.0556em;"></span><span class="mord">2.8%</span></span></span></span>). Using only the first 2 text pairs still reaches <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>62.3</mn><mo>±</mo><mn>2.7</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">62.3 \pm 2.7\%</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">62.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.8056em;vertical-align:-0.0556em;"></span><span class="mord">2.7%</span></span></span></span>.</li>
<li><strong>Accuracy rises with <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> up to a plateau from 4 to 8, while random controls move accuracy by about +2 points</strong> (<a href="labs/lab4_dose.html"><code>labs/lab4_dose.md</code></a>, <a href="labs/lab7_side_effects.html"><code>labs/lab7_side_effects.md</code></a>). On <code>dev256</code>, accuracy goes from <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>12.1</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">12.1\%</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8056em;vertical-align:-0.0556em;"></span><span class="mord">12.1%</span></span></span></span> (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\alpha = 0</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</span></span></span></span>, unedited) to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>22.7</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">22.7\%</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8056em;vertical-align:-0.0556em;"></span><span class="mord">22.7%</span></span></span></span> (<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">\alpha = 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.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">1</span></span></span></span>, erase), <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>35.2</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">35.2\%</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8056em;vertical-align:-0.0556em;"></span><span class="mord">35.2%</span></span></span></span> (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mo>=</mo><mn>2</mn></mrow><annotation encoding="application/x-tex">\alpha = 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" 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">2</span></span></span></span>, mirror), <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>59.2</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">59.2\%</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8056em;vertical-align:-0.0556em;"></span><span class="mord">59.2%</span></span></span></span> (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mo>=</mo><mn>4</mn></mrow><annotation encoding="application/x-tex">\alpha = 4</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">4</span></span></span></span>), <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>61.5</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">61.5\%</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8056em;vertical-align:-0.0556em;"></span><span class="mord">61.5%</span></span></span></span> (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mo>=</mo><mn>6</mn></mrow><annotation encoding="application/x-tex">\alpha = 6</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">6</span></span></span></span>), and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>60.7</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">60.7\%</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8056em;vertical-align:-0.0556em;"></span><span class="mord">60.7%</span></span></span></span> (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mo>=</mo><mn>8</mn></mrow><annotation encoding="application/x-tex">\alpha = 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" 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">8</span></span></span></span>). Accuracy then drops to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>51.8</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">51.8\%</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8056em;vertical-align:-0.0556em;"></span><span class="mord">51.8%</span></span></span></span> at <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mo>=</mo><mn>12</mn></mrow><annotation encoding="application/x-tex">\alpha = 12</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">12</span></span></span></span>, and WikiText-2 perplexity (prediction uncertainty on ordinary text, lower is better) rises by <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>+</mo><mn>14.34</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">+14.34\%</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.0833em;"></span><span class="mord">+</span><span class="mord">14.34%</span></span></span></span>, versus <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>+</mo><mn>0.79</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">+0.79\%</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.0833em;"></span><span class="mord">+</span><span class="mord">0.79%</span></span></span></span> at <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mo>=</mo><mn>6</mn></mrow><annotation encoding="application/x-tex">\alpha = 6</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">6</span></span></span></span>. Matched-norm controls with a random orthogonal direction (<code>randdir</code>) or 64 random neurons (<code>randcols</code>) score <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>14.5</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">14.5\%</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8056em;vertical-align:-0.0556em;"></span><span class="mord">14.5%</span></span></span></span> (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>+</mo><mn>2.3</mn><mo>±</mo><mn>1.6</mn></mrow><annotation encoding="application/x-tex">+2.3 \pm 1.6</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">2.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">1.6</span></span></span></span> points) and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>14.6</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">14.6\%</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8056em;vertical-align:-0.0556em;"></span><span class="mord">14.6%</span></span></span></span> (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>+</mo><mn>2.5</mn><mo>±</mo><mn>1.6</mn></mrow><annotation encoding="application/x-tex">+2.5 \pm 1.6</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">2.5</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.6</span></span></span></span> points).</li>
<li><strong>Setting <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mo>=</mo><mo>−</mo><mn>4</mn></mrow><annotation encoding="application/x-tex">\alpha = -4</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.7278em;vertical-align:-0.0833em;"></span><span class="mord">−</span><span class="mord">4</span></span></span></span> gains +7.6 points for the wrong reason</strong> (<a href="labs/lab4_dose.html"><code>labs/lab4_dose.md</code></a>). Amplifying the 64 neurons' push toward the loop direction 5 times raises <code>dev256</code> accuracy from <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>12.1</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">12.1\%</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8056em;vertical-align:-0.0556em;"></span><span class="mord">12.1%</span></span></span></span> to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>19.7</mn><mo>±</mo><mn>1.9</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">19.7 \pm 1.9\%</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">19.7</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.8056em;vertical-align:-0.0556em;"></span><span class="mord">1.9%</span></span></span></span> (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>+</mo><mn>7.6</mn><mo>±</mo><mn>2.2</mn></mrow><annotation encoding="application/x-tex">+7.6 \pm 2.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">+</span><span class="mord">7.6</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.2</span></span></span></span> points) because 197 of 512 answers abruptly emit <code>&lt;/think&gt;</code> out of a loop. Yet it loses 24 problems the unedited model solved, drops accuracy among finished answers from <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>100.0</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">100.0\%</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8056em;vertical-align:-0.0556em;"></span><span class="mord">100.0%</span></span></span></span> to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>55.4</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">55.4\%</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8056em;vertical-align:-0.0556em;"></span><span class="mord">55.4%</span></span></span></span>, and raises WikiText-2 perplexity by <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>+</mo><mn>5.39</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">+5.39\%</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.0833em;"></span><span class="mord">+</span><span class="mord">5.39%</span></span></span></span>.</li>
<li><strong>Turning thinking off reaches 52.1% using 13 times fewer tokens, and the weight edit adds nothing there</strong> (<a href="labs/lab5_decoding.html"><code>labs/lab5_decoding.md</code></a>). With thinking on, setting temperature to 1.0 (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>27.9</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">27.9\%</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8056em;vertical-align:-0.0556em;"></span><span class="mord">27.9%</span></span></span></span>) or repetition penalty to 1.1 (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>34.4</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">34.4\%</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8056em;vertical-align:-0.0556em;"></span><span class="mord">34.4%</span></span></span></span>) falls well short of the weight edit (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>61.5</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">61.5\%</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8056em;vertical-align:-0.0556em;"></span><span class="mord">61.5%</span></span></span></span>), and dropping the 1.5 presence penalty cuts accuracy to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>4.5</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">4.5\%</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8056em;vertical-align:-0.0556em;"></span><span class="mord">4.5%</span></span></span></span>, with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>99.0</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">99.0\%</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8056em;vertical-align:-0.0556em;"></span><span class="mord">99.0%</span></span></span></span> of answers cut. Without thinking, the base model reaches <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>52.1</mn><mo>±</mo><mn>2.7</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">52.1 \pm 2.7\%</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">52.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.8056em;vertical-align:-0.0556em;"></span><span class="mord">2.7%</span></span></span></span> on <code>dev256</code> with 2,270 tokens per answer on average, versus 29,683 with thinking on (16,104 with the edit). Adding <code>p50c</code> with thinking off scores <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>53.5</mn><mo>±</mo><mn>2.8</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">53.5 \pm 2.8\%</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">53.5</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.8056em;vertical-align:-0.0556em;"></span><span class="mord">2.8%</span></span></span></span> (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>+</mo><mn>1.4</mn><mo>±</mo><mn>1.9</mn></mrow><annotation encoding="application/x-tex">+1.4 \pm 1.9</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.4</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.9</span></span></span></span> points), because answers rarely loop without thinking.</li>
<li><strong>The static weight edit is algebraically equal to token-by-token activation steering</strong> (<a href="labs/lab6_steering.html"><code>labs/lab6_steering.md</code></a>, <a href="labs/lab0_toy.html"><code>labs/lab0_toy.md</code></a>). Multiplying the edited matrix by neuron activations <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><mo stretchy="false">(</mo><mi>t</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">a(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="mord mathnormal">a</span><span class="mopen">(</span><span class="mord mathnormal">t</span><span class="mclose">)</span></span></span></span> gives <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>W</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mi>a</mi><mo stretchy="false">(</mo><mi>t</mi><mo stretchy="false">)</mo><mo>=</mo><mi>W</mi><mi>a</mi><mo stretchy="false">(</mo><mi>t</mi><mo stretchy="false">)</mo><mo>−</mo><mi>α</mi><mi>s</mi><mo stretchy="false">(</mo><mi>t</mi><mo stretchy="false">)</mo><mi>u</mi></mrow><annotation encoding="application/x-tex">W&#x27; a(t) = W a(t) - \alpha s(t) u</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.1389em;">W</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="mord mathnormal">a</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" style="margin-right:0.1389em;">W</span><span class="mord mathnormal">a</span><span class="mopen">(</span><span class="mord mathnormal">t</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 mathnormal" style="margin-right:0.0037em;">α</span><span class="mord mathnormal">s</span><span class="mopen">(</span><span class="mord mathnormal">t</span><span class="mclose">)</span><span class="mord mathnormal">u</span></span></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi><mo stretchy="false">(</mo><mi>t</mi><mo stretchy="false">)</mo><mo>=</mo><mi>u</mi><mo>⋅</mo><mo stretchy="false">(</mo><msub><mi>W</mi><mi>S</mi></msub><msub><mi>a</mi><mi>S</mi></msub><mo stretchy="false">(</mo><mi>t</mi><mo stretchy="false">)</mo><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">s(t) = u \cdot (W_S a_S(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="mord mathnormal">s</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:0.4445em;"></span><span class="mord mathnormal">u</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"><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.3283em;"><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" style="margin-right:0.0576em;">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 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.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.0576em;">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 class="mopen">(</span><span class="mord mathnormal">t</span><span class="mclose">))</span></span></span></span> is one number per token measuring how hard the 64 chosen neurons push along <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.4306em;"></span><span class="mord mathnormal">u</span></span></span></span>. In 64-bit floats on one layer, the matrix edit and a runtime steering hook match to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>3.33</mn><mo>×</mo><msup><mn>10</mn><mrow><mo>−</mo><mn>16</mn></mrow></msup></mrow><annotation encoding="application/x-tex">3.33 \times 10^{-16}</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.33</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">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">16</span></span></span></span></span></span></span></span></span></span></span></span>. On 48 real looping answers from the base model, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi><mo stretchy="false">(</mo><mi>t</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">s(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="mord mathnormal">s</span><span class="mopen">(</span><span class="mord mathnormal">t</span><span class="mclose">)</span></span></span></span> stays low early in the answer (0.096 at layer 15, 0.116 at layer 19) and jumps inside the loop (0.424 and 0.758), so the edit pushes back hardest inside loops.</li>
<li><strong>An edit built from the model's own loops reaches 58.2% without hand-written texts</strong> (<a href="labs/lab8_capstone.html"><code>labs/lab8_capstone.md</code></a>). On 225 looping answers the unedited model wrote for 128 separate practice problems (<code>build128</code>), comparing loop tokens with tokens well before the loop (recipe B) matches <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.4306em;"></span><span class="mord mathnormal">u</span></span></span></span> to cosine 0.782 and 0.773 and scores <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>58.2</mn><mo>±</mo><mn>2.9</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">58.2 \pm 2.9\%</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">58.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.8056em;vertical-align:-0.0556em;"></span><span class="mord">2.9%</span></span></span></span> on <code>dev256</code> (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>+</mo><mn>46.1</mn><mo>±</mo><mn>2.6</mn></mrow><annotation encoding="application/x-tex">+46.1 \pm 2.6</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">46.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">2.6</span></span></span></span> points). Comparing with the 32 tokens just before the loop starts (recipe A) reaches only <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>43.0</mn><mo>±</mo><mn>2.6</mn><mi mathvariant="normal">%</mi></mrow><annotation encoding="application/x-tex">43.0 \pm 2.6\%</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">43.0</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.8056em;vertical-align:-0.0556em;"></span><span class="mord">2.6%</span></span></span></span> because pre-loop text has already drifted along <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.4306em;"></span><span class="mord mathnormal">u</span></span></span></span>.</li>
</ul>
<h2 id="start-here">Start here<a class="anchor" href="#start-here" aria-hidden="true" tabindex="-1">#</a></h2>
<p>Start with <a href="quickstart.html"><strong><code>QUICKSTART.md</code></strong></a> for a one-page, 2-hour path through the labs with exact commands and expected numbers.</p>
<p>The Quickstart also shows how to download the code from this site. Lab 0 runs on any laptop. The other labs need NVIDIA GPUs; we used two machines with 8 A100 80 GB GPUs each, and most steps use 1 or 2 of them.</p>
<h2 id="the-nine-labs">The nine labs<a class="anchor" href="#the-nine-labs" aria-hidden="true" tabindex="-1">#</a></h2>
<figure class="mermaid-svg" role="img" aria-label="Diagram: The nine labs" style="--mw:664px"><svg id="m-4d44ce4b9b0b" width="100%" xmlns="http://www.w3.org/2000/svg" class="flowchart" style="max-width: 884.75px;" viewBox="0 0 884.75 662" role="graphics-document document" aria-roledescription="flowchart-v2"><style>#m-4d44ce4b9b0b{font-family:Geist,Inter,ui-sans-serif,system-ui,sans-serif;font-size:16px;fill:#000000;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#m-4d44ce4b9b0b .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#m-4d44ce4b9b0b .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#m-4d44ce4b9b0b .error-icon{fill:#552222;}#m-4d44ce4b9b0b .error-text{fill:#552222;stroke:#552222;}#m-4d44ce4b9b0b .edge-thickness-normal{stroke-width:1px;}#m-4d44ce4b9b0b .edge-thickness-thick{stroke-width:3.5px;}#m-4d44ce4b9b0b .edge-pattern-solid{stroke-dasharray:0;}#m-4d44ce4b9b0b .edge-thickness-invisible{stroke-width:0;fill:none;}#m-4d44ce4b9b0b .edge-pattern-dashed{stroke-dasharray:3;}#m-4d44ce4b9b0b .edge-pattern-dotted{stroke-dasharray:2;}#m-4d44ce4b9b0b .marker{fill:#666;stroke:#666;}#m-4d44ce4b9b0b .marker.cross{stroke:#666;}#m-4d44ce4b9b0b svg{font-family:Geist,Inter,ui-sans-serif,system-ui,sans-serif;font-size:16px;}#m-4d44ce4b9b0b p{margin:0;}#m-4d44ce4b9b0b .label{font-family:Geist,Inter,ui-sans-serif,system-ui,sans-serif;color:#000000;}#m-4d44ce4b9b0b .cluster-label text{fill:#333;}#m-4d44ce4b9b0b .cluster-label span{color:#333;}#m-4d44ce4b9b0b .cluster-label span p{background-color:transparent;}#m-4d44ce4b9b0b .label text,#m-4d44ce4b9b0b span{fill:#000000;color:#000000;}#m-4d44ce4b9b0b .node rect,#m-4d44ce4b9b0b .node circle,#m-4d44ce4b9b0b .node ellipse,#m-4d44ce4b9b0b .node polygon,#m-4d44ce4b9b0b .node path{fill:#eee;stroke:#999;stroke-width:1px;}#m-4d44ce4b9b0b .rough-node .label text,#m-4d44ce4b9b0b .node .label text,#m-4d44ce4b9b0b .image-shape .label,#m-4d44ce4b9b0b .icon-shape .label{text-anchor:middle;}#m-4d44ce4b9b0b .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#m-4d44ce4b9b0b .rough-node .label,#m-4d44ce4b9b0b .node .label,#m-4d44ce4b9b0b .image-shape .label,#m-4d44ce4b9b0b .icon-shape .label{text-align:center;}#m-4d44ce4b9b0b .node.clickable{cursor:pointer;}#m-4d44ce4b9b0b .root .anchor path{fill:#666!important;stroke-width:0;stroke:#666;}#m-4d44ce4b9b0b .arrowheadPath{fill:#333333;}#m-4d44ce4b9b0b .edgePaths .path{stroke:#666;stroke-width:1px;}#m-4d44ce4b9b0b .flowchart-link{stroke:#666;fill:none;}#m-4d44ce4b9b0b .edgeLabel{background-color:white;text-align:center;}#m-4d44ce4b9b0b .edgeLabel p{background-color:white;}#m-4d44ce4b9b0b .edgeLabel rect{opacity:0.5;background-color:white;fill:white;}#m-4d44ce4b9b0b .labelBkg{background-color:rgba(255, 255, 255, 0.5);}#m-4d44ce4b9b0b .cluster rect{fill:hsl(0, 0%, 98.9215686275%);stroke:#707070;stroke-width:1px;}#m-4d44ce4b9b0b .cluster text{fill:#333;}#m-4d44ce4b9b0b .cluster span{color:#333;}#m-4d44ce4b9b0b .node .collapsed-indicator{fill:#707070;stroke:none;opacity:0.6;}#m-4d44ce4b9b0b .node .collapsed-separator{stroke:#707070;stroke-width:0.75px;}#m-4d44ce4b9b0b div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:Geist,Inter,ui-sans-serif,system-ui,sans-serif;font-size:12px;background:hsl(-160, 0%, 93.3333333333%);border:1px solid #707070;border-radius:2px;pointer-events:none;z-index:100;}#m-4d44ce4b9b0b .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#000000;}#m-4d44ce4b9b0b rect.text{fill:none;stroke-width:0;}#m-4d44ce4b9b0b .icon-shape,#m-4d44ce4b9b0b .image-shape{background-color:white;text-align:center;}#m-4d44ce4b9b0b .icon-shape p,#m-4d44ce4b9b0b .image-shape p{background-color:white;padding:2px;}#m-4d44ce4b9b0b .icon-shape .label rect,#m-4d44ce4b9b0b .image-shape .label rect{opacity:0.5;background-color:white;fill:white;}#m-4d44ce4b9b0b .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#m-4d44ce4b9b0b .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#m-4d44ce4b9b0b .node .neo-node{stroke:#999;}#m-4d44ce4b9b0b [data-look="neo"].node rect,#m-4d44ce4b9b0b [data-look="neo"].cluster rect,#m-4d44ce4b9b0b [data-look="neo"].node polygon{stroke:url(#m-4d44ce4b9b0b-gradient);filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#m-4d44ce4b9b0b [data-look="neo"].swimlane.cluster rect{filter:none;}#m-4d44ce4b9b0b [data-look="neo"].node path{stroke:url(#m-4d44ce4b9b0b-gradient);stroke-width:1px;}#m-4d44ce4b9b0b [data-look="neo"].node .outer-path{filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#m-4d44ce4b9b0b [data-look="neo"].node .neo-line path{stroke:#999;filter:none;}#m-4d44ce4b9b0b [data-look="neo"].node circle{stroke:url(#m-4d44ce4b9b0b-gradient);filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#m-4d44ce4b9b0b [data-look="neo"].node circle .state-start{fill:#000000;}#m-4d44ce4b9b0b [data-look="neo"].icon-shape .icon{fill:url(#m-4d44ce4b9b0b-gradient);filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#m-4d44ce4b9b0b [data-look="neo"].icon-shape .icon-neo path{stroke:url(#m-4d44ce4b9b0b-gradient);filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#m-4d44ce4b9b0b :root{--mermaid-font-family:Geist,Inter,ui-sans-serif,system-ui,sans-serif;}</style><g><marker id="m-4d44ce4b9b0b_flowchart-v2-pointEnd" class="marker flowchart-v2" viewBox="0 0 10 10" refX="5" refY="5" markerUnits="userSpaceOnUse" markerWidth="8" markerHeight="8" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker><marker id="m-4d44ce4b9b0b_flowchart-v2-pointStart" class="marker flowchart-v2" viewBox="0 0 10 10" refX="4.5" refY="5" markerUnits="userSpaceOnUse" markerWidth="8" markerHeight="8" orient="auto"><path d="M 0 5 L 10 10 L 10 0 z" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker><marker id="m-4d44ce4b9b0b_flowchart-v2-pointEnd-margin" class="marker flowchart-v2" viewBox="0 0 11.5 14" refX="11.5" refY="7" markerUnits="userSpaceOnUse" markerWidth="10.5" markerHeight="14" orient="auto"><path d="M 0 0 L 11.5 7 L 0 14 z" class="arrowMarkerPath" style="stroke-width: 0; stroke-dasharray: 1, 0;"></path></marker><marker id="m-4d44ce4b9b0b_flowchart-v2-pointStart-margin" class="marker flowchart-v2" viewBox="0 0 11.5 14" refX="1" refY="7" markerUnits="userSpaceOnUse" markerWidth="11.5" markerHeight="14" orient="auto"><polygon points="0,7 11.5,14 11.5,0" class="arrowMarkerPath" style="stroke-width: 0; stroke-dasharray: 1, 0;"></polygon></marker><marker id="m-4d44ce4b9b0b_flowchart-v2-circleEnd" class="marker flowchart-v2" viewBox="0 0 10 10" refX="11" refY="5" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"><circle cx="5" cy="5" r="5" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></circle></marker><marker id="m-4d44ce4b9b0b_flowchart-v2-circleStart" class="marker flowchart-v2" viewBox="0 0 10 10" refX="-1" refY="5" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"><circle cx="5" cy="5" r="5" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></circle></marker><marker id="m-4d44ce4b9b0b_flowchart-v2-circleEnd-margin" class="marker flowchart-v2" viewBox="0 0 10 10" refY="5" refX="12.25" markerUnits="userSpaceOnUse" markerWidth="14" markerHeight="14" orient="auto"><circle cx="5" cy="5" r="5" class="arrowMarkerPath" style="stroke-width: 0; stroke-dasharray: 1, 0;"></circle></marker><marker id="m-4d44ce4b9b0b_flowchart-v2-circleStart-margin" class="marker flowchart-v2" viewBox="0 0 10 10" refX="-2" refY="5" markerUnits="userSpaceOnUse" markerWidth="14" markerHeight="14" orient="auto"><circle cx="5" cy="5" r="5" class="arrowMarkerPath" style="stroke-width: 0; stroke-dasharray: 1, 0;"></circle></marker><marker id="m-4d44ce4b9b0b_flowchart-v2-crossEnd" class="marker cross flowchart-v2" viewBox="0 0 11 11" refX="12" refY="5.2" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"><path d="M 1,1 l 9,9 M 10,1 l -9,9" class="arrowMarkerPath" style="stroke-width: 2; stroke-dasharray: 1, 0;"></path></marker><marker id="m-4d44ce4b9b0b_flowchart-v2-crossStart" class="marker cross flowchart-v2" viewBox="0 0 11 11" refX="-1" refY="5.2" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"><path d="M 1,1 l 9,9 M 10,1 l -9,9" class="arrowMarkerPath" style="stroke-width: 2; stroke-dasharray: 1, 0;"></path></marker><marker id="m-4d44ce4b9b0b_flowchart-v2-crossEnd-margin" class="marker cross flowchart-v2" viewBox="0 0 15 15" refX="17.7" refY="7.5" markerUnits="userSpaceOnUse" markerWidth="12" markerHeight="12" orient="auto"><path d="M 1,1 L 14,14 M 1,14 L 14,1" class="arrowMarkerPath" style="stroke-width: 2.5;"></path></marker><marker id="m-4d44ce4b9b0b_flowchart-v2-crossStart-margin" class="marker cross flowchart-v2" viewBox="0 0 15 15" refX="-3.5" refY="7.5" markerUnits="userSpaceOnUse" markerWidth="12" markerHeight="12" orient="auto"><path d="M 1,1 L 14,14 M 1,14 L 14,1" class="arrowMarkerPath" style="stroke-width: 2.5; stroke-dasharray: 1, 0;"></path></marker><g class="root"><g class="clusters"></g><g class="edgePaths"><path d="M441.25,62L441.25,66.167C441.25,70.333,441.25,78.667,441.25,86.333C441.25,94,441.25,101,441.25,104.5L441.25,108" id="m-4d44ce4b9b0b-L_L0_L1_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style=";" data-edge="true" data-et="edge" data-id="L_L0_L1_0" data-points="W3sieCI6NDQxLjI1LCJ5Ijo2Mn0seyJ4Ijo0NDEuMjUsInkiOjg3fSx7IngiOjQ0MS4yNSwieSI6MTEyfV0=" data-look="classic" marker-end="url(#m-4d44ce4b9b0b_flowchart-v2-pointEnd)"></path><path d="M330.75,157.948L298.625,163.457C266.5,168.965,202.25,179.983,170.125,188.991C138,198,138,205,138,208.5L138,212" id="m-4d44ce4b9b0b-L_L1_L2_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style=";" data-edge="true" data-et="edge" data-id="L_L1_L2_0" data-points="W3sieCI6MzMwLjc1LCJ5IjoxNTcuOTQ4MDYyNjU0NTc1NDR9LHsieCI6MTM4LCJ5IjoxOTF9LHsieCI6MTM4LCJ5IjoyMTZ9XQ==" data-look="classic" marker-end="url(#m-4d44ce4b9b0b_flowchart-v2-pointEnd)"></path><path d="M521.731,166L534.151,170.167C546.571,174.333,571.41,182.667,583.83,192.333C596.25,202,596.25,213,596.25,218.5L596.25,224" id="m-4d44ce4b9b0b-L_L1_L3_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style=";" data-edge="true" data-et="edge" data-id="L_L1_L3_0" data-points="W3sieCI6NTIxLjczMDc2OTIzMDc2OTMsInkiOjE2Nn0seyJ4Ijo1OTYuMjUsInkiOjE5MX0seyJ4Ijo1OTYuMjUsInkiOjIyOH1d" data-look="classic" marker-end="url(#m-4d44ce4b9b0b_flowchart-v2-pointEnd)"></path><path d="M532.125,282L517.479,288.167C502.833,294.333,473.542,306.667,458.896,316.333C444.25,326,444.25,333,444.25,336.5L444.25,340" id="m-4d44ce4b9b0b-L_L3_L4_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style=";" data-edge="true" data-et="edge" data-id="L_L3_L4_0" data-points="W3sieCI6NTMyLjEyNSwieSI6MjgyfSx7IngiOjQ0NC4yNSwieSI6MzE5fSx7IngiOjQ0NC4yNSwieSI6MzQ0fV0=" data-look="classic" marker-end="url(#m-4d44ce4b9b0b_flowchart-v2-pointEnd)"></path><path d="M138,294L138,298.167C138,302.333,138,310.667,138,320.333C138,330,138,341,138,346.5L138,352" id="m-4d44ce4b9b0b-L_L2_L5_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style=";" data-edge="true" data-et="edge" data-id="L_L2_L5_0" data-points="W3sieCI6MTM4LCJ5IjoyOTR9LHsieCI6MTM4LCJ5IjozMTl9LHsieCI6MTM4LCJ5IjozNTZ9XQ==" data-look="classic" marker-end="url(#m-4d44ce4b9b0b_flowchart-v2-pointEnd)"></path><path d="M660.375,282L675.021,288.167C689.667,294.333,718.958,306.667,733.604,323.5C748.25,340.333,748.25,361.667,748.25,383C748.25,404.333,748.25,425.667,748.25,439.833C748.25,454,748.25,461,748.25,464.5L748.25,468" id="m-4d44ce4b9b0b-L_L3_L6_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style=";" data-edge="true" data-et="edge" data-id="L_L3_L6_0" data-points="W3sieCI6NjYwLjM3NSwieSI6MjgyfSx7IngiOjc0OC4yNSwieSI6MzE5fSx7IngiOjc0OC4yNSwieSI6MzgzfSx7IngiOjc0OC4yNSwieSI6NDQ3fSx7IngiOjc0OC4yNSwieSI6NDcyfV0=" data-look="classic" marker-end="url(#m-4d44ce4b9b0b_flowchart-v2-pointEnd)"></path><path d="M444.25,422L444.25,426.167C444.25,430.333,444.25,438.667,444.25,446.333C444.25,454,444.25,461,444.25,464.5L444.25,468" id="m-4d44ce4b9b0b-L_L4_L7_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style=";" data-edge="true" data-et="edge" data-id="L_L4_L7_0" data-points="W3sieCI6NDQ0LjI1LCJ5Ijo0MjJ9LHsieCI6NDQ0LjI1LCJ5Ijo0NDd9LHsieCI6NDQ0LjI1LCJ5Ijo0NzJ9XQ==" data-look="classic" marker-end="url(#m-4d44ce4b9b0b_flowchart-v2-pointEnd)"></path><path d="M748.25,526L748.25,530.167C748.25,534.333,748.25,542.667,738.969,550.741C729.687,558.816,711.124,566.632,701.843,570.54L692.562,574.448" id="m-4d44ce4b9b0b-L_L6_L8_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style=";" data-edge="true" data-et="edge" data-id="L_L6_L8_0" data-points="W3sieCI6NzQ4LjI1LCJ5Ijo1MjZ9LHsieCI6NzQ4LjI1LCJ5Ijo1NTF9LHsieCI6Njg4Ljg3NSwieSI6NTc2fV0=" data-look="classic" marker-end="url(#m-4d44ce4b9b0b_flowchart-v2-pointEnd)"></path><path d="M444.25,526L444.25,530.167C444.25,534.333,444.25,542.667,453.531,550.741C462.813,558.816,481.376,566.632,490.657,570.54L499.938,574.448" id="m-4d44ce4b9b0b-L_L7_L8_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style=";" data-edge="true" data-et="edge" data-id="L_L7_L8_0" data-points="W3sieCI6NDQ0LjI1LCJ5Ijo1MjZ9LHsieCI6NDQ0LjI1LCJ5Ijo1NTF9LHsieCI6NTAzLjYyNSwieSI6NTc2fV0=" data-look="classic" marker-end="url(#m-4d44ce4b9b0b_flowchart-v2-pointEnd)"></path></g><g class="edgeLabels"><g class="edgeLabel"><g class="label" data-id="L_L0_L1_0" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" class="labelBkg" style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" data-id="L_L1_L2_0" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" class="labelBkg" style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" data-id="L_L1_L3_0" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" class="labelBkg" style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" data-id="L_L3_L4_0" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" class="labelBkg" style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" data-id="L_L2_L5_0" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" class="labelBkg" style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" data-id="L_L3_L6_0" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" class="labelBkg" style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" data-id="L_L4_L7_0" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" class="labelBkg" style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" data-id="L_L6_L8_0" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" class="labelBkg" style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" data-id="L_L7_L8_0" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" class="labelBkg" style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;"><span class="edgeLabel"></span></div></foreignObject></g></g></g><g class="nodes"><g class="node default" id="m-4d44ce4b9b0b-flowchart-L0-0" data-look="classic" transform="translate(441.25, 35)"><rect class="basic label-container" style="" x="-110" y="-27" width="220" height="54"></rect><g class="label" style="" transform="translate(-80, -12)"><rect></rect><foreignObject width="160" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;"><span class="nodeLabel"><p>Lab 0: Toy 4x6 matrix</p></span></div></foreignObject></g></g><g class="node default" id="m-4d44ce4b9b0b-flowchart-L1-1" data-look="classic" transform="translate(441.25, 139)"><rect class="basic label-container" style="" x="-110.5" y="-27" width="221" height="54"></rect><g class="label" style="" transform="translate(-80.5, -12)"><rect></rect><foreignObject width="161" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;"><span class="nodeLabel"><p>Lab 1: Diff weight files</p></span></div></foreignObject></g></g><g class="node default" id="m-4d44ce4b9b0b-flowchart-L2-3" data-look="classic" transform="translate(138, 255)"><rect class="basic label-container" style="" x="-130" y="-39" width="260" height="78"></rect><g class="label" style="" transform="translate(-100, -24)"><rect></rect><foreignObject width="200" height="48"><div xmlns="http://www.w3.org/1999/xhtml" style="display: table; white-space: break-spaces; line-height: 1.5; max-width: 200px; text-align: center; width: 200px;"><span class="nodeLabel"><p>Lab 2: Reproduce benchmarks</p></span></div></foreignObject></g></g><g class="node default" id="m-4d44ce4b9b0b-flowchart-L3-5" data-look="classic" transform="translate(596.25, 255)"><rect class="basic label-container" style="" x="-130" y="-27" width="260" height="54"></rect><g class="label" style="" transform="translate(-100, -12)"><rect></rect><foreignObject width="200" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: table; white-space: break-spaces; line-height: 1.5; max-width: 200px; text-align: center; width: 200px;"><span class="nodeLabel"><p>Lab 3: Rebuild from 8 texts</p></span></div></foreignObject></g></g><g class="node default" id="m-4d44ce4b9b0b-flowchart-L4-7" data-look="classic" transform="translate(444.25, 383)"><rect class="basic label-container" style="" x="-130" y="-39" width="260" height="78"></rect><g class="label" style="" transform="translate(-100, -24)"><rect></rect><foreignObject width="200" height="48"><div xmlns="http://www.w3.org/1999/xhtml" style="display: table; white-space: break-spaces; line-height: 1.5; max-width: 200px; text-align: center; width: 200px;"><span class="nodeLabel"><p>Lab 4: Dose curve and controls</p></span></div></foreignObject></g></g><g class="node default" id="m-4d44ce4b9b0b-flowchart-L5-9" data-look="classic" transform="translate(138, 383)"><rect class="basic label-container" style="" x="-122.5" y="-27" width="245" height="54"></rect><g class="label" style="" transform="translate(-92.5, -12)"><rect></rect><foreignObject width="185" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;"><span class="nodeLabel"><p>Lab 5: Decoding settings</p></span></div></foreignObject></g></g><g class="node default" id="m-4d44ce4b9b0b-flowchart-L6-11" data-look="classic" transform="translate(748.25, 499)"><rect class="basic label-container" style="" x="-128.5" y="-27" width="257" height="54"></rect><g class="label" style="" transform="translate(-98.5, -12)"><rect></rect><foreignObject width="197" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;"><span class="nodeLabel"><p>Lab 6: Edit equals steering</p></span></div></foreignObject></g></g><g class="node default" id="m-4d44ce4b9b0b-flowchart-L7-13" data-look="classic" transform="translate(444.25, 499)"><rect class="basic label-container" style="" x="-125.5" y="-27" width="251" height="54"></rect><g class="label" style="" transform="translate(-95.5, -12)"><rect></rect><foreignObject width="191" height="24"><div xmlns="http://www.w3.org/1999/xhtml" style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;"><span class="nodeLabel"><p>Lab 7: Side effects on text</p></span></div></foreignObject></g></g><g class="node default" id="m-4d44ce4b9b0b-flowchart-L8-15" data-look="classic" transform="translate(596.25, 615)"><rect class="basic label-container" style="" x="-130" y="-39" width="260" height="78"></rect><g class="label" style="" transform="translate(-100, -24)"><rect></rect><foreignObject width="200" height="48"><div xmlns="http://www.w3.org/1999/xhtml" style="display: table; white-space: break-spaces; line-height: 1.5; max-width: 200px; text-align: center; width: 200px;"><span class="nodeLabel"><p>Lab 8: Capstone from own loops</p></span></div></foreignObject></g></g></g></g></g><defs><filter id="m-4d44ce4b9b0b-drop-shadow" height="130%" width="130%"><feDropShadow dx="4" dy="4" stdDeviation="0" flood-opacity="0.06" flood-color="#000000"></feDropShadow></filter></defs><defs><filter id="m-4d44ce4b9b0b-drop-shadow-small" height="150%" width="150%"><feDropShadow dx="2" dy="2" stdDeviation="0" flood-opacity="0.06" flood-color="#000000"></feDropShadow></filter></defs><linearGradient id="m-4d44ce4b9b0b-gradient" gradientUnits="objectBoundingBox" x1="0%" y1="0%" x2="100%" y2="0%"><stop offset="0%" stop-color="hsl(0, 0%, 83.3333333333%)" stop-opacity="1"></stop><stop offset="100%" stop-color="hsl(0, 0%, 88.9215686275%)" stop-opacity="1"></stop></linearGradient></svg></figure>
<div class="table-wrap"><table>
<thead>
<tr>
<th>Lab</th>
<th>Title and sheet</th>
<th>Question it answers</th>
<th>What you run</th>
<th>Time and hardware</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td><a href="labs/lab0_toy.html">The toy edit on a 4 x 6 matrix</a></td>
<td>What does <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>W</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo>=</mo><mi>W</mi><mo>−</mo><mi>α</mi><mi>u</mi><msup><mi>u</mi><mi>T</mi></msup><msub><mi>W</mi><mi>S</mi></msub></mrow><annotation encoding="application/x-tex">W&#x27; = W - \alpha u u^T W_S</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7519em;"></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.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="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.9913em;vertical-align:-0.15em;"></span><span class="mord mathnormal" style="margin-right:0.0037em;">α</span><span class="mord mathnormal">u</span><span class="mord"><span class="mord mathnormal">u</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 mathnormal mtight" style="margin-right:0.1389em;">T</span></span></span></span></span></span></span></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.3283em;"><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" style="margin-right:0.0576em;">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> do on a matrix small enough to print?</td>
<td><code class="cell"><span>uv</span> <span>run</span> <span>--with</span> <span>numpy</span> <span>--with</span> <span>matplotlib</span> <span>python</span> <span>labs/lab0_toy.py</span></code></td>
<td>5 seconds on any laptop CPU</td>
</tr>
<tr>
<td>1</td>
<td><a href="labs/lab1_diff.html">Find the edit by diffing the two weight files</a></td>
<td>What did the agent change in the 488 weight tensors?</td>
<td><code class="cell"><span>python labs/lab1_diff.py</span></code></td>
<td>Under 1 minute on VM CPU</td>
</tr>
<tr>
<td>2</td>
<td><a href="labs/lab2_reproduce.html">Reproduce the paper's benchmark numbers</a></td>
<td>Do the looping failure and the <code class="cell"><span>p50c</span></code> fix reproduce on MATH-500, GSM8K, and IFEval?</td>
<td><code class="cell"><span>python</span> <span>scripts/run_jobs.py</span> <span>plans/trainer.json</span> <span>--gpus</span> <span>0-7</span></code> (or <code class="cell"><span>plans/quick.json</span> <span>--gpus</span> <span>0,1</span></code>)</td>
<td>5 minutes on 2 A100s (quick run) or 1.5 hours on 8 A100s (<code class="cell"><span>trainer</span></code>)</td>
</tr>
<tr>
<td>3</td>
<td><a href="labs/lab3_rebuild.html">Rebuild the edit from the agent's 8 texts</a></td>
<td>Can we recover layers 15 and 19, <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.4306em;"></span><span class="mord mathnormal">u</span></span></span></span>, and the 64 neurons from the agent's 8 texts with hooks?</td>
<td><code class="cell"><span>CUDA_VISIBLE_DEVICES=7</span> <span>python</span> <span>labs/lab3_rebuild.py</span></code></td>
<td>About 1 minute on 1 A100 GPU (plus 21 minutes on 1 A100 to test on <code class="cell"><span>dev256</span></code>)</td>
</tr>
<tr>
<td>4</td>
<td><a href="labs/lab4_dose.html">Turn the alpha knob and check controls</a></td>
<td>How does accuracy change across <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mo>∈</mo><mo stretchy="false">{</mo><mo>−</mo><mn>4</mn><mo separator="true">,</mo><mn>1</mn><mo separator="true">,</mo><mn>2</mn><mo separator="true">,</mo><mn>4</mn><mo separator="true">,</mo><mn>6</mn><mo separator="true">,</mo><mn>8</mn><mo separator="true">,</mo><mn>12</mn><mo stretchy="false">}</mo></mrow><annotation encoding="application/x-tex">\alpha \in \{-4, 1, 2, 4, 6, 8, 12\}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5782em;vertical-align:-0.0391em;"></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:1em;vertical-align:-0.25em;"></span><span class="mopen">{</span><span class="mord">−</span><span class="mord">4</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">1</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">2</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">4</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">6</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">8</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">12</span><span class="mclose">}</span></span></span></span>, single layers, all neurons, and random controls?</td>
<td><code class="cell"><span>python</span> <span>scripts/run_jobs.py</span> <span>plans/sampler.json</span> <span>--gpus</span> <span>0-6</span></code> and <code class="cell"><span>python</span> <span>labs/lab4_endings.py</span></code></td>
<td>17 to 45 minutes per run on 1 A100 (<code class="cell"><span>sampler</span></code>), seconds on CPU for endings</td>
</tr>
<tr>
<td>5</td>
<td><a href="labs/lab5_decoding.html">Can decoding settings do the same job?</a></td>
<td>Can temperature, presence or repetition penalties, a 4,096-token cap, or turning thinking off replace the weight edit?</td>
<td><code class="cell"><span>python</span> <span>scripts/run_jobs.py</span> <span>plans/sampler.json</span> <span>--gpus</span> <span>0-6</span></code> (decoding runs)</td>
<td>About 3 to 49 minutes per run on 1 A100 (<code class="cell"><span>sampler</span></code>)</td>
</tr>
<tr>
<td>6</td>
<td><a href="labs/lab6_steering.html">The weight edit is steering in disguise</a></td>
<td>Is the weight edit identical to subtracting <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mi>s</mi><mo stretchy="false">(</mo><mi>t</mi><mo stretchy="false">)</mo><mi>u</mi></mrow><annotation encoding="application/x-tex">\alpha s(t) u</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 mathnormal">s</span><span class="mopen">(</span><span class="mord mathnormal">t</span><span class="mclose">)</span><span class="mord mathnormal">u</span></span></span></span>, and when does <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi><mo stretchy="false">(</mo><mi>t</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">s(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="mord mathnormal">s</span><span class="mopen">(</span><span class="mord mathnormal">t</span><span class="mclose">)</span></span></span></span> fire on real loops?</td>
<td><code class="cell"><span>CUDA_VISIBLE_DEVICES=7</span> <span>python</span> <span>labs</span><wbr><span>/lab6_steering.py</span></code> (and <code class="cell"><span>--parts 3,4</span></code>)</td>
<td>About 1 minute on 1 A100 for parts 1 and 2; about 3 minutes for parts 3 and 4 (<code class="cell"><span>sampler</span></code>)</td>
</tr>
<tr>
<td>7</td>
<td><a href="labs/lab7_side_effects.html">What else did the edit change?</a></td>
<td>How much does each edit move WikiText-2 perplexity and KL divergence on productive versus looping text?</td>
<td><code class="cell"><span>CUDA_VISIBLE_DEVICES=7</span> <span>python</span> <span>labs</span><wbr><span>/lab7_side_effects.py</span></code></td>
<td>About 1.5 minutes (78 seconds) on 1 A100 GPU</td>
</tr>
<tr>
<td>8</td>
<td><a href="labs/lab8_capstone.html">Capstone: build your own edit from the model's own loops</a></td>
<td>Can we extract <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.4306em;"></span><span class="mord mathnormal">u</span></span></span></span> and 64 neurons from the base model's own looping answers and fix unseen problems?</td>
<td><code class="cell"><span>CUDA_VISIBLE_DEVICES=7</span> <span>python</span> <span>labs</span><wbr><span>/lab8_capstone.py</span></code></td>
<td>About 5 minutes on 1 A100 to build, 30 minutes on 2 A100s to test (<code class="cell"><span>sampler</span></code>)</td>
</tr>
</tbody>
</table></div>
<h2 id="project-layout">Project layout<a class="anchor" href="#project-layout" aria-hidden="true" tabindex="-1">#</a></h2>
<ul>
<li><code>configs/</code>: JSON definitions of edited models (<code>variants.json</code> for Lab 4 controls and <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> sweep, <code>rebuilt.json</code> from Lab 3, <code>capstone.json</code> from Lab 8).</li>
<li><code>data/</code>: Prepared JSONL datasets (<code>dev256.jsonl</code> with 256 unseen practice problems, <code>build128.jsonl</code> with 128 practice problems for Lab 8, plus <code>math500.jsonl</code>, <code>gsm8k.jsonl</code>, and <code>ifeval.jsonl</code>).</li>
<li><code>external/</code>: Local checkout of the paper's log repository (<code>lm_understand-logs</code>, ignored by <code>.gitignore</code>; <code>exp8_math/</code> holds the agent's scripts, edit manifest, and work notes).</li>
<li><code>labs/</code>: Lab scripts (<code>lab0_toy.py</code> through <code>lab8_capstone.py</code>), answer inspection tools (<code>peek.py</code>, <code>lab4_endings.py</code>), lab sheets (<code>lab0_toy.md</code> through <code>lab8_capstone.md</code>), and the agent's 8 contrastive texts (<code>labs/data/astra_pairs.json</code>).</li>
<li><code>plans/</code>: Generation job plans for <code>scripts/run_jobs.py</code> (<code>quick.json</code>, <code>trainer.json</code>, <code>sampler.json</code>, <code>extra.json</code>, and <code>lab3-tries.json</code>).</li>
<li><code>reference/</code>: The first-principles companion guide <a href="reference/theory-guide.html"><code>reference/theory-guide.md</code></a>.</li>
<li><code>results/</code>: Saved JSON outputs for Labs 1 through 8 (including committed <code>results/*/try-*</code> folders to compare your runs with ours), per-run graded records in <code>results/runs/</code>, the master table <a href="results/summary.html"><code>results/summary.md</code></a> (<code>results/summary.json</code>), and all plots in <code>results/figures/*.png</code>.</li>
<li><code>scripts/</code>: VM setup and sync scripts (<code>setup_vm.sh</code>, <code>sync_vm.sh</code>, <code>pull_runs.sh</code>, <code>env.sh</code>), dataset and model builders (<code>prepare_data.py</code>, <code>build_models.py</code>), the multi-GPU vLLM runner (<code>run_jobs.py</code>, <code>gen_worker.py</code>), and reporting scripts (<code>summarize.py</code>, <code>plot_runs.py</code>).</li>
<li><code>wsp/</code>: Shared Python library (<code>hf.py</code> for model loading and PyTorch hooks, <code>edits.py</code> for rank-one edits and SVD recovery, <code>loops.py</code> for verbatim loop detection, <code>protocol.py</code> for presets and sampler probabilities, <code>grading.py</code>, and <code>summary.py</code>).</li>
</ul>
<h2 id="running-things">Running things<a class="anchor" href="#running-things" aria-hidden="true" tabindex="-1">#</a></h2>
<figure class="mermaid-svg" role="img" aria-label="Diagram: Running things" style="--mw:206px"><svg id="m-5bcada9763cb" width="100%" xmlns="http://www.w3.org/2000/svg" class="flowchart" style="max-width: 275px;" viewBox="0 0 275 470" role="graphics-document document" aria-roledescription="flowchart-v2"><style>#m-5bcada9763cb{font-family:Geist,Inter,ui-sans-serif,system-ui,sans-serif;font-size:16px;fill:#000000;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#m-5bcada9763cb .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#m-5bcada9763cb .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#m-5bcada9763cb .error-icon{fill:#552222;}#m-5bcada9763cb .error-text{fill:#552222;stroke:#552222;}#m-5bcada9763cb .edge-thickness-normal{stroke-width:1px;}#m-5bcada9763cb .edge-thickness-thick{stroke-width:3.5px;}#m-5bcada9763cb .edge-pattern-solid{stroke-dasharray:0;}#m-5bcada9763cb .edge-thickness-invisible{stroke-width:0;fill:none;}#m-5bcada9763cb .edge-pattern-dashed{stroke-dasharray:3;}#m-5bcada9763cb .edge-pattern-dotted{stroke-dasharray:2;}#m-5bcada9763cb .marker{fill:#666;stroke:#666;}#m-5bcada9763cb .marker.cross{stroke:#666;}#m-5bcada9763cb svg{font-family:Geist,Inter,ui-sans-serif,system-ui,sans-serif;font-size:16px;}#m-5bcada9763cb p{margin:0;}#m-5bcada9763cb .label{font-family:Geist,Inter,ui-sans-serif,system-ui,sans-serif;color:#000000;}#m-5bcada9763cb .cluster-label text{fill:#333;}#m-5bcada9763cb .cluster-label span{color:#333;}#m-5bcada9763cb .cluster-label span p{background-color:transparent;}#m-5bcada9763cb .label text,#m-5bcada9763cb span{fill:#000000;color:#000000;}#m-5bcada9763cb .node rect,#m-5bcada9763cb .node circle,#m-5bcada9763cb .node ellipse,#m-5bcada9763cb .node polygon,#m-5bcada9763cb .node path{fill:#eee;stroke:#999;stroke-width:1px;}#m-5bcada9763cb .rough-node .label text,#m-5bcada9763cb .node .label text,#m-5bcada9763cb .image-shape .label,#m-5bcada9763cb .icon-shape .label{text-anchor:middle;}#m-5bcada9763cb .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#m-5bcada9763cb .rough-node .label,#m-5bcada9763cb .node .label,#m-5bcada9763cb .image-shape .label,#m-5bcada9763cb .icon-shape .label{text-align:center;}#m-5bcada9763cb .node.clickable{cursor:pointer;}#m-5bcada9763cb .root .anchor path{fill:#666!important;stroke-width:0;stroke:#666;}#m-5bcada9763cb .arrowheadPath{fill:#333333;}#m-5bcada9763cb .edgePaths .path{stroke:#666;stroke-width:1px;}#m-5bcada9763cb .flowchart-link{stroke:#666;fill:none;}#m-5bcada9763cb .edgeLabel{background-color:white;text-align:center;}#m-5bcada9763cb .edgeLabel p{background-color:white;}#m-5bcada9763cb .edgeLabel rect{opacity:0.5;background-color:white;fill:white;}#m-5bcada9763cb .labelBkg{background-color:rgba(255, 255, 255, 0.5);}#m-5bcada9763cb .cluster rect{fill:hsl(0, 0%, 98.9215686275%);stroke:#707070;stroke-width:1px;}#m-5bcada9763cb .cluster text{fill:#333;}#m-5bcada9763cb .cluster span{color:#333;}#m-5bcada9763cb .node .collapsed-indicator{fill:#707070;stroke:none;opacity:0.6;}#m-5bcada9763cb .node .collapsed-separator{stroke:#707070;stroke-width:0.75px;}#m-5bcada9763cb div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:Geist,Inter,ui-sans-serif,system-ui,sans-serif;font-size:12px;background:hsl(-160, 0%, 93.3333333333%);border:1px solid #707070;border-radius:2px;pointer-events:none;z-index:100;}#m-5bcada9763cb .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#000000;}#m-5bcada9763cb rect.text{fill:none;stroke-width:0;}#m-5bcada9763cb .icon-shape,#m-5bcada9763cb .image-shape{background-color:white;text-align:center;}#m-5bcada9763cb .icon-shape p,#m-5bcada9763cb .image-shape p{background-color:white;padding:2px;}#m-5bcada9763cb .icon-shape .label rect,#m-5bcada9763cb .image-shape .label rect{opacity:0.5;background-color:white;fill:white;}#m-5bcada9763cb .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#m-5bcada9763cb .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#m-5bcada9763cb .node .neo-node{stroke:#999;}#m-5bcada9763cb [data-look="neo"].node rect,#m-5bcada9763cb [data-look="neo"].cluster rect,#m-5bcada9763cb [data-look="neo"].node polygon{stroke:url(#m-5bcada9763cb-gradient);filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#m-5bcada9763cb [data-look="neo"].swimlane.cluster rect{filter:none;}#m-5bcada9763cb [data-look="neo"].node path{stroke:url(#m-5bcada9763cb-gradient);stroke-width:1px;}#m-5bcada9763cb [data-look="neo"].node .outer-path{filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#m-5bcada9763cb [data-look="neo"].node .neo-line path{stroke:#999;filter:none;}#m-5bcada9763cb [data-look="neo"].node circle{stroke:url(#m-5bcada9763cb-gradient);filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#m-5bcada9763cb [data-look="neo"].node circle .state-start{fill:#000000;}#m-5bcada9763cb [data-look="neo"].icon-shape .icon{fill:url(#m-5bcada9763cb-gradient);filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#m-5bcada9763cb [data-look="neo"].icon-shape .icon-neo path{stroke:url(#m-5bcada9763cb-gradient);filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#m-5bcada9763cb :root{--mermaid-font-family:Geist,Inter,ui-sans-serif,system-ui,sans-serif;}</style><g><marker id="m-5bcada9763cb_flowchart-v2-pointEnd" class="marker flowchart-v2" viewBox="0 0 10 10" refX="5" refY="5" markerUnits="userSpaceOnUse" markerWidth="8" markerHeight="8" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker><marker id="m-5bcada9763cb_flowchart-v2-pointStart" class="marker flowchart-v2" viewBox="0 0 10 10" refX="4.5" refY="5" markerUnits="userSpaceOnUse" markerWidth="8" markerHeight="8" orient="auto"><path d="M 0 5 L 10 10 L 10 0 z" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker><marker id="m-5bcada9763cb_flowchart-v2-pointEnd-margin" class="marker flowchart-v2" viewBox="0 0 11.5 14" refX="11.5" refY="7" markerUnits="userSpaceOnUse" markerWidth="10.5" markerHeight="14" orient="auto"><path d="M 0 0 L 11.5 7 L 0 14 z" class="arrowMarkerPath" style="stroke-width: 0; stroke-dasharray: 1, 0;"></path></marker><marker id="m-5bcada9763cb_flowchart-v2-pointStart-margin" class="marker flowchart-v2" viewBox="0 0 11.5 14" refX="1" refY="7" markerUnits="userSpaceOnUse" markerWidth="11.5" markerHeight="14" orient="auto"><polygon points="0,7 11.5,14 11.5,0" class="arrowMarkerPath" style="stroke-width: 0; stroke-dasharray: 1, 0;"></polygon></marker><marker id="m-5bcada9763cb_flowchart-v2-circleEnd" class="marker flowchart-v2" viewBox="0 0 10 10" refX="11" refY="5" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"><circle cx="5" cy="5" r="5" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></circle></marker><marker id="m-5bcada9763cb_flowchart-v2-circleStart" class="marker flowchart-v2" viewBox="0 0 10 10" refX="-1" refY="5" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"><circle cx="5" cy="5" r="5" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></circle></marker><marker id="m-5bcada9763cb_flowchart-v2-circleEnd-margin" class="marker flowchart-v2" viewBox="0 0 10 10" refY="5" refX="12.25" markerUnits="userSpaceOnUse" markerWidth="14" markerHeight="14" orient="auto"><circle cx="5" cy="5" r="5" class="arrowMarkerPath" style="stroke-width: 0; stroke-dasharray: 1, 0;"></circle></marker><marker id="m-5bcada9763cb_flowchart-v2-circleStart-margin" class="marker flowchart-v2" viewBox="0 0 10 10" refX="-2" refY="5" markerUnits="userSpaceOnUse" markerWidth="14" markerHeight="14" orient="auto"><circle cx="5" cy="5" r="5" class="arrowMarkerPath" style="stroke-width: 0; stroke-dasharray: 1, 0;"></circle></marker><marker id="m-5bcada9763cb_flowchart-v2-crossEnd" class="marker cross flowchart-v2" viewBox="0 0 11 11" refX="12" refY="5.2" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"><path d="M 1,1 l 9,9 M 10,1 l -9,9" class="arrowMarkerPath" style="stroke-width: 2; stroke-dasharray: 1, 0;"></path></marker><marker id="m-5bcada9763cb_flowchart-v2-crossStart" class="marker cross flowchart-v2" viewBox="0 0 11 11" refX="-1" refY="5.2" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"><path d="M 1,1 l 9,9 M 10,1 l -9,9" class="arrowMarkerPath" style="stroke-width: 2; stroke-dasharray: 1, 0;"></path></marker><marker id="m-5bcada9763cb_flowchart-v2-crossEnd-margin" class="marker cross flowchart-v2" viewBox="0 0 15 15" refX="17.7" refY="7.5" markerUnits="userSpaceOnUse" markerWidth="12" markerHeight="12" orient="auto"><path d="M 1,1 L 14,14 M 1,14 L 14,1" class="arrowMarkerPath" style="stroke-width: 2.5;"></path></marker><marker id="m-5bcada9763cb_flowchart-v2-crossStart-margin" class="marker cross flowchart-v2" viewBox="0 0 15 15" refX="-3.5" refY="7.5" markerUnits="userSpaceOnUse" markerWidth="12" markerHeight="12" orient="auto"><path d="M 1,1 L 14,14 M 1,14 L 14,1" class="arrowMarkerPath" style="stroke-width: 2.5; stroke-dasharray: 1, 0;"></path></marker><g class="root"><g class="clusters"></g><g class="edgePaths"><path d="M137.5,114L137.5,119.5C137.5,125,137.5,136,137.5,147C137.5,158,137.5,169,137.5,174.5L137.5,180" id="m-5bcada9763cb-L_Trainer_Laptop_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style=";" data-edge="true" data-et="edge" data-id="L_Trainer_Laptop_0" data-points="W3sieCI6MTM3LjUsInkiOjExMH0seyJ4IjoxMzcuNSwieSI6MTQ3fSx7IngiOjEzNy41LCJ5IjoxODR9XQ==" data-look="classic" marker-start="url(#m-5bcada9763cb_flowchart-v2-pointStart)" marker-end="url(#m-5bcada9763cb_flowchart-v2-pointEnd)"></path><path d="M137.5,290L137.5,295.5C137.5,301,137.5,312,137.5,323C137.5,334,137.5,345,137.5,350.5L137.5,356" id="m-5bcada9763cb-L_Laptop_Sampler_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style=";" data-edge="true" data-et="edge" data-id="L_Laptop_Sampler_0" data-points="W3sieCI6MTM3LjUsInkiOjI4Nn0seyJ4IjoxMzcuNSwieSI6MzIzfSx7IngiOjEzNy41LCJ5IjozNjB9XQ==" data-look="classic" marker-start="url(#m-5bcada9763cb_flowchart-v2-pointStart)" marker-end="url(#m-5bcada9763cb_flowchart-v2-pointEnd)"></path></g><g class="edgeLabels"><g class="edgeLabel" transform="translate(137.5, 147)"><g class="label" data-id="L_Trainer_Laptop_0" transform="translate(-95.5, -12)"><foreignObject width="191" height="24"><div xmlns="http://www.w3.org/1999/xhtml" class="labelBkg" style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;"><span class="edgeLabel"><p>sync_vm.sh / pull_runs.sh</p></span></div></foreignObject></g></g><g class="edgeLabel" transform="translate(137.5, 323)"><g class="label" data-id="L_Laptop_Sampler_0" transform="translate(-95.5, -12)"><foreignObject width="191" height="24"><div xmlns="http://www.w3.org/1999/xhtml" class="labelBkg" style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;"><span class="edgeLabel"><p>sync_vm.sh / pull_runs.sh</p></span></div></foreignObject></g></g></g><g class="nodes"><g class="node default" id="m-5bcada9763cb-flowchart-Trainer-0" data-look="classic" transform="translate(137.5, 59)"><rect class="basic label-container" style="" x="-129.5" y="-51" width="259" height="102"></rect><g class="label" style="" transform="translate(-99.5, -36)"><rect></rect><foreignObject width="199" height="72"><div xmlns="http://www.w3.org/1999/xhtml" style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;"><span class="nodeLabel"><p>trainer (8x A100)<br>/nvme/wsp-lab/runs/<br>bench/*, quick/*, lab3 tries</p></span></div></foreignObject></g></g><g class="node default" id="m-5bcada9763cb-flowchart-Laptop-1" data-look="classic" transform="translate(137.5, 235)"><rect class="basic label-container" style="" x="-118.5" y="-51" width="237" height="102"></rect><g class="label" style="" transform="translate(-88.5, -36)"><rect></rect><foreignObject width="177" height="72"><div xmlns="http://www.w3.org/1999/xhtml" style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;"><span class="nodeLabel"><p>This machine (CPU)<br>Project root and results/<br>Lab 0 and plotting</p></span></div></foreignObject></g></g><g class="node default" id="m-5bcada9763cb-flowchart-Sampler-3" data-look="classic" transform="translate(137.5, 411)"><rect class="basic label-container" style="" x="-112" y="-51" width="224" height="102"></rect><g class="label" style="" transform="translate(-82, -36)"><rect></rect><foreignObject width="164" height="72"><div xmlns="http://www.w3.org/1999/xhtml" style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;"><span class="nodeLabel"><p>sampler (8x A100)<br>/nvme/wsp-lab/runs/<br>build/base, dev/*</p></span></div></foreignObject></g></g></g></g></g><defs><filter id="m-5bcada9763cb-drop-shadow" height="130%" width="130%"><feDropShadow dx="4" dy="4" stdDeviation="0" flood-opacity="0.06" flood-color="#000000"></feDropShadow></filter></defs><defs><filter id="m-5bcada9763cb-drop-shadow-small" height="150%" width="150%"><feDropShadow dx="2" dy="2" stdDeviation="0" flood-opacity="0.06" flood-color="#000000"></feDropShadow></filter></defs><linearGradient id="m-5bcada9763cb-gradient" gradientUnits="objectBoundingBox" x1="0%" y1="0%" x2="100%" y2="0%"><stop offset="0%" stop-color="hsl(0, 0%, 83.3333333333%)" stop-opacity="1"></stop><stop offset="100%" stop-color="hsl(0, 0%, 88.9215686275%)" stop-opacity="1"></stop></linearGradient></svg></figure>
<p><strong>Cloning the paper's logs.</strong> <code>.gitignore</code> ignores <code>external/</code>, so the paper's log repository is not committed here. If <code>external/lm_understand-logs</code> is missing, clone it from the project root before syncing or building models:</p>
<div class="code"><div class="code-head"><span class="code-lang">bash</span></div><pre><code class="language-bash">git clone https://github.com/RikiyaT/lm_understand-logs external/lm_understand-logs
git -C external/lm_understand-logs log -1
</code></pre></div>
<p>We used commit <code>4d09ba6d</code> (29 October 2026). <code>scripts/prepare_data.py</code> and <code>scripts/build_models.py</code> read from <code>external/lm_understand-logs/exp8_math</code>, and <code>scripts/sync_vm.sh</code> copies the parts the GPU machines need (<code>code</code>, <code>practice</code>, and <code>runs/p50c</code>).</p>
<p><strong>The two GPU VMs and environment setup.</strong> GPU work runs on <code>trainer</code> and <code>sampler</code>, each with 8 NVIDIA A100 80 GB GPUs. All VM files live under <code>/nvme/wsp-lab</code> (<code>venv/</code>, <code>models/</code>, <code>data/</code>, <code>runs/</code>, <code>logs/</code>, and <code>code/</code>). Start every VM command by sourcing <code>env.sh</code>, which activates Python 3.12 (vLLM 0.33.0, PyTorch 2.14.0, transformers 5.20.2, flash-linear-attention 0.6.0) and keeps caches inside <code>/nvme/wsp-lab</code>:</p>
<div class="code"><div class="code-head"><span class="code-lang">bash</span></div><pre><code class="language-bash">. /nvme/wsp-lab/code/scripts/env.sh &amp;&amp; cd /nvme/wsp-lab/code
</code></pre></div>
<p><strong>Syncing code and pulling results.</strong> Files move between each VM and this machine. From the project root on this machine:</p>
<div class="code"><div class="code-head"><span class="code-lang">bash</span></div><pre><code class="language-bash">bash scripts/sync_vm.sh trainer sampler # push wsp, scripts, configs, plans, labs, and exp8_math files
bash scripts/pull_runs.sh trainer sampler # pull merged.jsonl, summary.json, and *.done.json into results/runs/
python3 scripts/summarize.py results/runs # rebuild results/summary.md and results/summary.json
uv run --with matplotlib python scripts/plot_runs.py
</code></pre></div>
<p><code>sync_vm.sh</code> mirrors the five code folders onto the VM with <code>rsync --delete</code>, so any file you create or edit only on the VM is deleted or overwritten on the next sync. Edit on this machine first, then sync. The one exception is <code>configs/capstone.json</code>, which Lab 8 writes on the VM: syncing never deletes it, but a local copy will overwrite the VM's copy, so pull the VM version first. <code>pull_runs.sh</code> copies only run records. Lab scripts write their outputs to <code>results/labN/</code> and <code>results/figures/</code> on the VM where they ran; copy those back by name:</p>
<div class="code"><div class="code-head"><span class="code-lang">bash</span></div><pre><code class="language-bash">rsync -az sampler:/nvme/wsp-lab/code/results/lab6/ results/lab6/ &lt;/dev/null
rsync -az sampler:/nvme/wsp-lab/code/results/figures/lab6_real_loop.png results/figures/ &lt;/dev/null
</code></pre></div>
<p>Copy figures individually instead of syncing the whole folder, since each VM holds only the figures it generated and an older copy would overwrite a newer one.</p>
<p><strong>Setting up a new machine.</strong> To provision a fresh GPU machine (about 10 minutes and 15 GB under <code>/nvme/wsp-lab</code>, no root needed), run these commands from the project root (see <code>scripts/setup_vm.sh</code>):</p>
<div class="code"><div class="code-head"><span class="code-lang">bash</span></div><pre><code class="language-bash">scp scripts/setup_vm.sh &lt;host&gt;:/tmp/ &amp;&amp; ssh &lt;host&gt; bash /tmp/setup_vm.sh
bash scripts/sync_vm.sh &lt;host&gt;
ssh &lt;host&gt; &#x27;cd /nvme/wsp-lab/code &amp;&amp; . scripts/env.sh &amp;&amp;
python scripts/prepare_data.py --exp8 external/lm_understand-logs/exp8_math --out /nvme/wsp-lab/data &amp;&amp;
python scripts/build_models.py &amp;&amp; python scripts/build_models.py --variants configs/rebuilt.json&#x27;
</code></pre></div>
<p><strong>Where full answer texts live.</strong> Full answer texts (<code>runs/&lt;name&gt;/shard*.texts.jsonl.gz</code>) are ignored by <code>.gitignore</code> and skipped by <code>scripts/pull_runs.sh</code>, so they stay on the VM that generated them (while <code>results/*/try-*</code> folders are committed to git). Because <code>labs/peek.py</code> and <code>labs/lab4_endings.py</code> read <code>.texts.jsonl.gz</code> files, run them on the VM that produced the run:</p>
<ul>
<li>On <code>trainer</code>: <code>bench/*</code>, <code>quick/*</code>, <code>dev/rebuilt-pairs2</code>, <code>dev/rebuilt-windows36-36</code>, and <code>dev/rebuilt-layers15-19-21</code>.</li>
<li>On <code>sampler</code>: <code>build/base</code> and every other <code>dev/*</code> run (<code>dev/base</code>, <code>dev/p50c</code>, <code>dev/rebuilt</code>, the Lab 4 dose and control runs, the Lab 5 decoding runs, and the Lab 8 <code>dev/cap*</code> runs).</li>
</ul>
<p><strong>Rerunning a finished job.</strong> <code>scripts/run_jobs.py</code> skips any shard (a batch of problems) that has a <code>shard*.done.json</code> file, so rerunning a finished plan reports <code>0 shards to run</code>. To run a finished job again, move its output folder aside on the VM first:</p>
<div class="code"><div class="code-head"><span class="code-lang">bash</span></div><pre><code class="language-bash">mv /nvme/wsp-lab/runs/quick /nvme/wsp-lab/runs/quick-ours
</code></pre></div>
<p>Then run the plan; <code>python labs/peek.py quick/base</code> reads the new run and <code>python labs/peek.py quick-ours/base</code> reads the earlier one.</p>
<p><strong>How to read <code>results/summary.md</code>.</strong> Every generation run has one row in <a href="results/summary.html"><code>results/summary.md</code></a> with these nine columns:</p>
<ul>
<li><code>run</code>: Run identifier (<code>bench/&lt;model&gt;/&lt;dataset&gt;</code>, <code>dev/&lt;variant&gt;</code>, <code>build/base</code>, or <code>quick/&lt;model&gt;</code>).</li>
<li><code>problems x samples</code>: Distinct problems times sampled answers per problem (for example <code>256x2</code> = 512 answers on <code>dev256</code>).</li>
<li><code>accuracy %</code>: Percentage of correct answers, plus or minus one standard error (SE, typical sampling uncertainty; a gap of 2 SE or more is unlikely to be chance).</li>
<li><code>cut at the cap %</code>: Percentage of answers that hit the token limit (32,768 by default) without finishing.</li>
<li><code>mean tokens</code>: Average generated tokens per answer.</li>
<li><code>correct when finished %</code>: Accuracy among answers that finished before the token limit (97.5% to 100% for the unedited model on math benchmarks, showing its main failure is not finishing).</li>
<li><code>cut answers ending in repetition %</code>: Percentage of cap-cut answers ending in repetition. An answer counts if it ends in a word-for-word loop (a block of words repeated at least 3 times in a row) or in looser circling. Looser circling means at least half of the 4-word phrase positions in the last 200 words hold a phrase repeated 3 or more times there (see <code>results/summary.md</code>).</li>
<li><code>gain vs baseline (pp)</code>: Accuracy change in percentage points versus the paired baseline on the same problems, plus or minus paired SE (<code>dev/*</code> against <code>dev/base</code>, <code>dev/p50c+nothink</code> against <code>dev/base+nothink</code>, <code>bench/p50c/X</code> against <code>bench/base/X</code>, and <code>quick/*</code> against <code>quick/base</code>).</li>
<li><code>rescued / lost problems</code>: <code>rescued</code> counts problems where the run got at least one answer right and the baseline got none; <code>lost</code> counts the reverse.</li>
</ul>
<h2 id="sources">Sources<a class="anchor" href="#sources" aria-hidden="true" tabindex="-1">#</a></h2>
<ul>
<li><strong>Blog post:</strong> Rikiya Takahashi, <a href="https://rikiyat.github.io/blog/weight-space-programming/" target="_blank" rel="noopener">&quot;Sparks of Weight-Space Programming&quot;</a> (MIT CSAIL, 2 Nov 2026).</li>
<li><strong>Experiment logs and code:</strong> <a href="https://github.com/RikiyaT/lm_understand-logs" target="_blank" rel="noopener"><code>https://github.com/RikiyaT/lm_understand-logs</code></a> (local copy in <code>external/lm_understand-logs/</code>, with Experiment 8 in <code>external/lm_understand-logs/exp8_math/</code>).</li>
<li><strong>Released edited model:</strong> <a href="https://huggingface.co/RikiyaT/Qwen3.5-0.8B-weight-space-programming" target="_blank" rel="noopener"><code>https://huggingface.co/RikiyaT/Qwen3.5-0.8B-weight-space-programming</code></a>.</li>
<li><strong>Interactive demo Space:</strong> <a href="https://huggingface.co/spaces/ML-Intern-lab/weight-space-programming-demo" target="_blank" rel="noopener"><code>https://huggingface.co/spaces/ML-Intern-lab/weight-space-programming-demo</code></a>.</li>
<li><strong>First-principles theory guide:</strong> <a href="reference/theory-guide.html"><code>reference/theory-guide.md</code></a>.</li>
</ul>
</article>
</main>
<aside class="toc"><nav aria-label="On this page"><p class="toc-title">On this page</p><ul><li class="l2"><a href="#the-story">The story</a></li><li class="l2"><a href="#what-we-found">What we found</a></li><li class="l2"><a href="#start-here">Start here</a></li><li class="l2"><a href="#the-nine-labs">The nine labs</a></li><li class="l2"><a href="#project-layout">Project layout</a></li><li class="l2"><a href="#running-things">Running things</a></li><li class="l2"><a href="#sources">Sources</a></li></ul></nav></aside>
</div>
<footer class="foot">
<div class="foot-in">
<p class="foot-note">Based on Experiment 8 of "<a href="https://rikiyat.github.io/blog/weight-space-programming/" target="_blank" rel="noopener">Sparks of Weight-Space Programming</a>". Logs and the agent's texts come from <a href="https://github.com/RikiyaT/lm_understand-logs" target="_blank" rel="noopener">RikiyaT/lm_understand-logs</a>, <a href="https://creativecommons.org/licenses/by/4.0/" target="_blank" rel="noopener">CC BY 4.0</a>.</p>
<p class="foot-links"><a href="https://huggingface.co/spaces/thegovind/weight-space-programming/blob/main/code/README.md" target="_blank" rel="noopener">View source</a></p>
</div>
</footer>
</body>
</html>