<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Zichuan Xu: Blog</title>
  <link href="https://zichuanxu.me/feed.xml" rel="self" type="application/atom+xml" />
  <link href="https://zichuanxu.me/blog/" rel="alternate" type="text/html" />
  <id>https://zichuanxu.me/blog/</id>
  <updated>2026-11-06T14:00:28+00:00</updated>
  <author><name>Zichuan Xu</name><uri>https://zichuanxu.me/</uri></author>
  <entry>
    <title>Closing the loop: a simple rule beats an agent-written weight edit</title>
    <link href="https://zichuanxu.me/blog/closing-the-loop/" rel="alternate" type="text/html" />
    <id>https://zichuanxu.me/blog/closing-the-loop/</id>
    <published>2026-11-06T00:00:00+00:00</published>
    <updated>2026-11-06T00:00:00+00:00</updated>
    <summary>An LLM agent spent 20 hours writing a weight edit that stops Qwen3.5-0.8B from looping. A fixed rule, run on the model&apos;s own answers for 84 GPU-minutes, writes a better one.</summary>
    <content type="html">&lt;p&gt;Small reasoning models have an awkward way of failing. They start thinking, write a paragraph, write it again, and keep writing it until the token budget runs out. Qwen3.5-0.8B in thinking mode does this on 93% of MATH-500 problems, and it solves 7.4% of them.&lt;/p&gt;

&lt;p&gt;Earlier this year, &lt;a href=&quot;https://rikiyat.github.io/blog/weight-space-programming/&quot;&gt;Takehi et al.&lt;/a&gt; let an LLM agent, GPT-6 Astra, read this model’s weights for about 20 hours. Astra wrote a small edit to two layers, the Astra edit, that stops many of the loops and lifts MATH-500 accuracy to about 48%. It is one of the most striking results in their post.&lt;/p&gt;

&lt;p&gt;I took the agent’s edit apart. It turned out to be one direction and 64 neurons in each of two layers. A fixed rule can write an edit of the same shape and size from the model’s own answers to practice problems, with no agent, no gradients and no correctness labels. That rule, &lt;strong&gt;CLC-sel&lt;/strong&gt;, writes a better edit than the agent did.&lt;/p&gt;

&lt;div class=&quot;stats&quot;&gt;
  &lt;div&gt;&lt;b&gt;56.3%&lt;/b&gt;&lt;span&gt;on MATH-500, up from 7.4%. The agent&apos;s edit: 49.7%&lt;/span&gt;&lt;/div&gt;
  &lt;div&gt;&lt;b&gt;84 min&lt;/b&gt;&lt;span&gt;of one GPU to build the edit, against 20 hours of agent time&lt;/span&gt;&lt;/div&gt;
  &lt;div&gt;&lt;b&gt;131,072&lt;/b&gt;&lt;span&gt;weights changed, the same as the agent&apos;s edit: 0.016% of the model&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;figure&gt;
&lt;div class=&quot;fig-scroll&quot;&gt;&lt;svg class=&quot;ch&quot; viewBox=&quot;0 0 720 292&quot; role=&quot;img&quot; aria-labelledby=&quot;hero-t hero-d&quot;&gt;&lt;title id=&quot;hero-t&quot;&gt;MATH-500 accuracy by method&lt;/title&gt;&lt;desc id=&quot;hero-d&quot;&gt;Qwen3.5-0.8B in thinking mode. Base 7.4%, with repetition penalty 22.4%, with budget forcing 35.0%, thinking off 45.8%, Astra edit 49.7%, CLC-sel 56.3%, CLC-sel with budget forcing 59.6%.&lt;/desc&gt;
&lt;line class=&quot;grid&quot; x1=&quot;236.0&quot; y1=&quot;8&quot; x2=&quot;236.0&quot; y2=&quot;266&quot; /&gt;
&lt;text x=&quot;236.0&quot; y=&quot;284.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;0%&lt;/text&gt;
&lt;line class=&quot;grid&quot; x1=&quot;360.0&quot; y1=&quot;8&quot; x2=&quot;360.0&quot; y2=&quot;266&quot; /&gt;
&lt;text x=&quot;360.0&quot; y=&quot;284.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;20%&lt;/text&gt;
&lt;line class=&quot;grid&quot; x1=&quot;484.0&quot; y1=&quot;8&quot; x2=&quot;484.0&quot; y2=&quot;266&quot; /&gt;
&lt;text x=&quot;484.0&quot; y=&quot;284.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;40%&lt;/text&gt;
&lt;line class=&quot;grid&quot; x1=&quot;608.0&quot; y1=&quot;8&quot; x2=&quot;608.0&quot; y2=&quot;266&quot; /&gt;
&lt;text x=&quot;608.0&quot; y=&quot;284.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;60%&lt;/text&gt;
&lt;text x=&quot;224.0&quot; y=&quot;33.0&quot; class=&quot;lab&quot; text-anchor=&quot;end&quot;&gt;Base model, thinking&lt;/text&gt;
&lt;path class=&quot;n&quot; d=&quot;M236.0,18.0h41.9a4,4 0 0 1 4,4v16.0a4,4 0 0 1 -4,4h-41.9z&quot;&gt;&lt;title&gt;Base model, thinking: 7.4% correct, 93.0% truncated (one seed)&lt;/title&gt;&lt;/path&gt;
&lt;text x=&quot;289.9&quot; y=&quot;33.0&quot; class=&quot;val&quot;&gt;7.4&lt;/text&gt;
&lt;text x=&quot;224.0&quot; y=&quot;69.0&quot; class=&quot;lab&quot; text-anchor=&quot;end&quot;&gt;+ repetition penalty&lt;/text&gt;
&lt;path class=&quot;n&quot; d=&quot;M236.0,54.0h134.9a4,4 0 0 1 4,4v16.0a4,4 0 0 1 -4,4h-134.9z&quot;&gt;&lt;title&gt;+ repetition penalty: 22.4% correct, 75.8% truncated (one seed)&lt;/title&gt;&lt;/path&gt;
&lt;text x=&quot;382.9&quot; y=&quot;69.0&quot; class=&quot;val&quot;&gt;22.4&lt;/text&gt;
&lt;text x=&quot;224.0&quot; y=&quot;105.0&quot; class=&quot;lab&quot; text-anchor=&quot;end&quot;&gt;+ budget forcing&lt;/text&gt;
&lt;path class=&quot;n&quot; d=&quot;M236.0,90.0h213.0a4,4 0 0 1 4,4v16.0a4,4 0 0 1 -4,4h-213.0z&quot;&gt;&lt;title&gt;+ budget forcing: 35.0% correct, 63.8% truncated (one seed)&lt;/title&gt;&lt;/path&gt;
&lt;text x=&quot;461.0&quot; y=&quot;105.0&quot; class=&quot;val&quot;&gt;35.0&lt;/text&gt;
&lt;text x=&quot;224.0&quot; y=&quot;141.0&quot; class=&quot;lab&quot; text-anchor=&quot;end&quot;&gt;Base model, thinking off&lt;/text&gt;
&lt;path class=&quot;n&quot; d=&quot;M236.0,126.0h280.0a4,4 0 0 1 4,4v16.0a4,4 0 0 1 -4,4h-280.0z&quot;&gt;&lt;title&gt;Base model, thinking off: 45.8% correct, 31.0% truncated (one seed)&lt;/title&gt;&lt;/path&gt;
&lt;text x=&quot;528.0&quot; y=&quot;141.0&quot; class=&quot;val&quot;&gt;45.8&lt;/text&gt;
&lt;text x=&quot;224.0&quot; y=&quot;177.0&quot; class=&quot;lab&quot; text-anchor=&quot;end&quot;&gt;Astra edit (agent, 20 h)&lt;/text&gt;
&lt;path class=&quot;m&quot; d=&quot;M236.0,162.0h304.1a4,4 0 0 1 4,4v16.0a4,4 0 0 1 -4,4h-304.1z&quot;&gt;&lt;title&gt;Astra edit (agent, 20 h): 49.7% correct, 32.1% truncated (three seeds)&lt;/title&gt;&lt;/path&gt;
&lt;text x=&quot;552.1&quot; y=&quot;177.0&quot; class=&quot;val&quot;&gt;49.7&lt;/text&gt;
&lt;text x=&quot;224.0&quot; y=&quot;213.0&quot; class=&quot;lab strong&quot; text-anchor=&quot;end&quot;&gt;CLC-sel (rule, 84 GPU-min)&lt;/text&gt;
&lt;path class=&quot;a&quot; d=&quot;M236.0,198.0h345.1a4,4 0 0 1 4,4v16.0a4,4 0 0 1 -4,4h-345.1z&quot;&gt;&lt;title&gt;CLC-sel (rule, 84 GPU-min): 56.3% correct, 17.7% truncated (three seeds)&lt;/title&gt;&lt;/path&gt;
&lt;text x=&quot;593.1&quot; y=&quot;213.0&quot; class=&quot;val strong&quot;&gt;56.3&lt;/text&gt;
&lt;text x=&quot;224.0&quot; y=&quot;249.0&quot; class=&quot;lab strong&quot; text-anchor=&quot;end&quot;&gt;CLC-sel + budget forcing&lt;/text&gt;
&lt;path class=&quot;a&quot; d=&quot;M236.0,234.0h365.5a4,4 0 0 1 4,4v16.0a4,4 0 0 1 -4,4h-365.5z&quot;&gt;&lt;title&gt;CLC-sel + budget forcing: 59.6% correct, 14.6% truncated (one seed)&lt;/title&gt;&lt;/path&gt;
&lt;text x=&quot;613.5&quot; y=&quot;249.0&quot; class=&quot;val strong&quot;&gt;59.6&lt;/text&gt;
&lt;line class=&quot;axis&quot; x1=&quot;236&quot; y1=&quot;8&quot; x2=&quot;236&quot; y2=&quot;266&quot; /&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;figcaption&gt;&lt;b&gt;MATH-500 accuracy of Qwen3.5-0.8B in thinking mode&lt;/b&gt;, 32,768-token limit. The Astra edit and CLC-sel average three seeds; the other rows are one seed. Hover a bar for its truncation rate.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;The code, the edited model and every generation are public: &lt;a href=&quot;https://github.com/zichuanxu/closing-the-loop&quot;&gt;GitHub&lt;/a&gt;, &lt;a href=&quot;https://huggingface.co/zichuanxu/Qwen3.5-0.8B-CLC-sel&quot;&gt;model&lt;/a&gt;, &lt;a href=&quot;https://huggingface.co/datasets/zichuanxu/closing-the-loop-generations&quot;&gt;generations&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;the-failure&quot;&gt;The failure&lt;/h2&gt;

&lt;p&gt;Reasoning models write a long chain of thought before they answer. In thinking mode, Qwen3.5-0.8B reaches the 32,768-token limit on 93% of MATH-500 problems. Almost all of these are verbatim loops: of 55 truncated answers I inspected, 53 end in a repeated 8-gram tail. The model writes a block of text, writes the same block again, and never stops.&lt;/p&gt;

&lt;p&gt;The model does know a fair amount of math. With thinking turned off, it scores 45.8% on MATH-500 in about 3,600 tokens per answer. Thinking mode is where it gets stuck, and there the loops are verbatim: in non-thinking mode only 16 of 155 truncated answers end in a repeated tail.&lt;/p&gt;

&lt;h2 id=&quot;what-the-agent-did&quot;&gt;What the agent did&lt;/h2&gt;

&lt;p&gt;Takehi et al. asked whether an LLM agent can fix a failure like this by editing weights directly. Astra read the weights of Qwen3.5-0.8B and ran 50 forward passes on practice problems, over 20.3 hours of wall time. It then wrote an edit that changes 64 output columns of the MLP in each of two layers. In their evaluation, MATH-500 accuracy in thinking mode rose from 7.9% to 48.1%. Runs of Astra with 10 and 25 forward passes reached only 12.3% and 14.1%.&lt;/p&gt;

&lt;p&gt;Their &lt;a href=&quot;https://github.com/RikiyaT/lm_understand-logs&quot;&gt;logs&lt;/a&gt; and the edited weights are public, which is what made this work possible. They raise a practical question: how much of what the agent did can a fixed rule do?&lt;/p&gt;

&lt;h2 id=&quot;taking-the-agents-edit-apart&quot;&gt;Taking the agent’s edit apart&lt;/h2&gt;

&lt;p&gt;Some background on the model first. Qwen3.5-0.8B has 24 layers and a hidden size of 1,024. Each layer has an MLP with 3,584 neurons, and its last matrix, the down projection \(W\), writes their activations into the residual stream. Column \(c\) of \(W\) is what neuron \(c\) writes per unit of activation.&lt;/p&gt;

&lt;p&gt;The agent changed \(W\) in layers 15 and 19. In each layer, the change is rank one up to bf16 rounding: the second singular value is about \(6 \times 10^{-4}\) of the first. It can be written as&lt;/p&gt;

\[W&apos; = W - \alpha\,\mathbf{u}\,\big(\mathbf{m} \odot \mathbf{s}\big)^{\top}, \qquad \mathbf{s} = W^{\top}\mathbf{u}\]

&lt;p&gt;where \(\mathbf{u}\) is a unit direction in the residual stream (1,024 numbers), \(\mathbf{m}\) is a mask that selects 64 neurons, and \(\alpha = 6\). With the direction and mask recovered from the released weights, this formula rebuilds 99.8% of the edited bf16 entries exactly.&lt;/p&gt;

&lt;p&gt;The form is easy to read. Write \(s_c\) for the amount neuron \(c\) writes along \(\mathbf{u}\). After the edit, the layer’s write along \(\mathbf{u}\) is&lt;/p&gt;

\[\mathbf{u}^{\top} W&apos; \mathbf{a} = \sum_{c} s_c\,a_c \;-\; \alpha \sum_{c \in \mathbf{m}} s_c\,a_c\]

&lt;p&gt;and every other direction is unchanged. With \(\alpha = 6\), the 64 selected neurons now write five times their original amount &lt;em&gt;against&lt;/em&gt; \(\mathbf{u}\). So the whole edit is three choices per layer: a direction, a set of neurons and a strength. A rule that makes those three choices writes the same kind of edit.&lt;/p&gt;

&lt;h2 id=&quot;first-attempt-erase-i-am-repeating&quot;&gt;First attempt: erase “I am repeating”&lt;/h2&gt;

&lt;p&gt;My first guess at the direction was the obvious one. Take the model’s hidden state inside a loop, subtract its state at the first occurrence of the same text, and remove what is left. Call it the contrastive recurrence direction, CRD. If the edit erases the signal “I am repeating this”, the loop should break.&lt;/p&gt;

&lt;p&gt;It did not work. At the agent’s layers, CRD scored 23.2% on MATH-500, against 49.2% for the agent’s edit in the same run. A random direction of the same form scored 8.6%.&lt;/p&gt;

&lt;p&gt;Reading the agent’s direction through the &lt;a href=&quot;https://www.lesswrong.com/posts/AcKRB8wDpdaN6v6ru/interpreting-gpt-the-logit-lens&quot;&gt;logit lens&lt;/a&gt;, which decodes a hidden direction into next-token scores, showed why. Part of the direction promotes tokens that end a text. The agent’s edit does more than erase repetition: it moves the loop state toward the state in which the model finishes.&lt;/p&gt;

&lt;p&gt;Similarity to the agent’s direction would not have found this. The three repetition-based directions I built all have a cosine of 0.71 to 0.74 with it, and their accuracy on the development set ranged from 39.1% to 67.2%.&lt;/p&gt;

&lt;h2 id=&quot;the-rule-clc-sel&quot;&gt;The rule: CLC-sel&lt;/h2&gt;

&lt;p&gt;That observation gives the method, loop-selective closure contrast. It needs three kinds of windows from the model’s own answers.&lt;/p&gt;

&lt;figure&gt;
&lt;div class=&quot;fig-scroll&quot;&gt;&lt;svg class=&quot;ch&quot; viewBox=&quot;0 0 720 210&quot; role=&quot;img&quot; aria-labelledby=&quot;windows-t windows-d&quot;&gt;&lt;title id=&quot;windows-t&quot;&gt;The three windows CLC-sel reads&lt;/title&gt;&lt;desc id=&quot;windows-d&quot;&gt;Top: a looping answer, with a first-occurrence window F and a later loop window R that repeats it verbatim until the token limit. Bottom: an answer that finishes, with the closure window C, the 64 tokens before &amp;lt;/think&amp;gt;.&lt;/desc&gt;
&lt;text x=&quot;0.0&quot; y=&quot;22.0&quot; class=&quot;lab strong&quot;&gt;A looping answer&lt;/text&gt;
&lt;rect class=&quot;tok&quot; x=&quot;0.0&quot; y=&quot;38&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;tok&quot; x=&quot;28.0&quot; y=&quot;38&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;tok&quot; x=&quot;56.0&quot; y=&quot;38&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;n&quot; x=&quot;84.0&quot; y=&quot;38&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;n&quot; x=&quot;112.0&quot; y=&quot;38&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;n&quot; x=&quot;140.0&quot; y=&quot;38&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;n&quot; x=&quot;168.0&quot; y=&quot;38&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;tok&quot; x=&quot;196.0&quot; y=&quot;38&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;tok&quot; x=&quot;224.0&quot; y=&quot;38&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;b&quot; x=&quot;252.0&quot; y=&quot;38&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;b&quot; x=&quot;280.0&quot; y=&quot;38&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;b&quot; x=&quot;308.0&quot; y=&quot;38&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;b&quot; x=&quot;336.0&quot; y=&quot;38&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;b soft&quot; x=&quot;364.0&quot; y=&quot;38&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;b soft&quot; x=&quot;392.0&quot; y=&quot;38&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;b soft&quot; x=&quot;420.0&quot; y=&quot;38&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;b soft&quot; x=&quot;448.0&quot; y=&quot;38&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;text x=&quot;480.0&quot; y=&quot;54.0&quot; class=&quot;tick&quot;&gt;&amp;#8230; until 32,768 tokens&lt;/text&gt;
&lt;path class=&quot;brace&quot; d=&quot;M84,68v5h108v-5&quot; /&gt;
&lt;text x=&quot;138.0&quot; y=&quot;90.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;first occurrence F&lt;/text&gt;
&lt;path class=&quot;brace&quot; d=&quot;M252,68v5h108v-5&quot; /&gt;
&lt;text x=&quot;346.0&quot; y=&quot;90.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;loop R: the same 64 tokens again&lt;/text&gt;
&lt;text x=&quot;0.0&quot; y=&quot;132.0&quot; class=&quot;lab strong&quot;&gt;An answer that finishes&lt;/text&gt;
&lt;rect class=&quot;tok&quot; x=&quot;0.0&quot; y=&quot;148&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;tok&quot; x=&quot;28.0&quot; y=&quot;148&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;tok&quot; x=&quot;56.0&quot; y=&quot;148&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;tok&quot; x=&quot;84.0&quot; y=&quot;148&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;tok&quot; x=&quot;112.0&quot; y=&quot;148&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;tok&quot; x=&quot;140.0&quot; y=&quot;148&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;tok&quot; x=&quot;168.0&quot; y=&quot;148&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;tok&quot; x=&quot;196.0&quot; y=&quot;148&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;a&quot; x=&quot;224.0&quot; y=&quot;148&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;a&quot; x=&quot;252.0&quot; y=&quot;148&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;a&quot; x=&quot;280.0&quot; y=&quot;148&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;a&quot; x=&quot;308.0&quot; y=&quot;148&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;tag&quot; x=&quot;336.0&quot; y=&quot;148&quot; width=&quot;78&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;text x=&quot;375.0&quot; y=&quot;163.5&quot; class=&quot;tagtext&quot; text-anchor=&quot;middle&quot;&gt;&amp;lt;/think&amp;gt;&lt;/text&gt;
&lt;rect class=&quot;tok&quot; x=&quot;418.0&quot; y=&quot;148&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;tok&quot; x=&quot;446.0&quot; y=&quot;148&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;rect class=&quot;tok&quot; x=&quot;474.0&quot; y=&quot;148&quot; width=&quot;24&quot; height=&quot;22&quot; rx=&quot;4&quot; /&gt;
&lt;path class=&quot;brace&quot; d=&quot;M224,178v5h108v-5&quot; /&gt;
&lt;text x=&quot;278.0&quot; y=&quot;200.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;closure C: the 64 tokens before it&lt;/text&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;figcaption&gt;&lt;b&gt;The three windows.&lt;/b&gt; A looping answer gives a first occurrence F and its verbatim repeat R. An answer that finishes gives the closure window C, the 64 tokens before the model closes its thinking.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;&lt;strong&gt;Practice answers.&lt;/strong&gt; The base model answers 512 practice problems in thinking mode, half from the MATH training set and half from GSM8K’s, with the evaluation’s sampling settings and up to 16,384 tokens. In each answer I find the first block of 64 tokens that appears again later, verbatim. That gives a first-occurrence window F and a loop window R, found in 256 answers. In the 43 answers that close their thinking, the 64 tokens before &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;/think&amp;gt;&lt;/code&gt; form a closure window C.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Window statistics.&lt;/strong&gt; One teacher-forced pass over these answers gives, for each layer, the mean residual state and the mean neuron activations in each kind of window. Write \(\bar{\mathbf{h}}^{R}\) for the mean state over loop windows and \(\bar a^{R}_c\) for the mean activation of neuron \(c\) there, and likewise with F and C.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Direction.&lt;/strong&gt; The edit direction points from the closure state to the loop state:&lt;/p&gt;

\[\mathbf{u} = \frac{\bar{\mathbf{h}}^{R} - \bar{\mathbf{h}}^{C}}{\lVert \bar{\mathbf{h}}^{R} - \bar{\mathbf{h}}^{C} \rVert}\]

&lt;p&gt;Since the edit subtracts along \(\mathbf{u}\), it pushes a looping state toward the state in which the model ends its thinking.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Neurons.&lt;/strong&gt; The plain choice is the 64 neurons with the largest write along \(\mathbf{u}\) inside loops. I call that edit CLC. It pushes toward closure in every context, including normal reasoning, and on GSM8K it ends good answers too early. CLC-sel instead ranks neurons by how much their write along \(\mathbf{u}\) &lt;em&gt;rises&lt;/em&gt; when the same text is repeated:&lt;/p&gt;

\[r_c = \big(\bar a^{R}_c - \bar a^{F}_c\big)\, s_c\]

&lt;p&gt;These neurons are more active on the second pass over the same text than on the first, so the edit acts mainly inside loops. The two rules pick different neurons: only 27 of 64 are shared at layer 19, and 45 at layer 15. At layer 19, the chosen 64 of 3,584 neurons carry 71% of the positive score.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Layers and strength.&lt;/strong&gt; For the main comparison, CLC-sel uses the agent’s layers (15 and 19) and strength (\(\alpha = 6\)), so the comparison isolates the direction and the neurons. A later section replaces both with rules.&lt;/p&gt;

&lt;p&gt;The edit itself is a few lines of NumPy in the &lt;a href=&quot;https://github.com/zichuanxu/closing-the-loop/blob/main/src/clc_sel/edit.py&quot;&gt;repository&lt;/a&gt;:&lt;/p&gt;

&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;clc_sel&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;apply_edit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;closure_direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;select_neurons&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;u&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;closure_direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;h_loop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;h_close&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;             &lt;span class=&quot;c1&quot;&gt;# mean residual states of one layer
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cols&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;select_neurons&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;W&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;u&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a_rep&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a_first&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;k&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;c1&quot;&gt;# activations on repeats and first occurrences
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;W_edited&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;apply_edit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;W&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;u&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cols&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;alpha&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;6.0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Generating the 512 answers and the teacher-forced pass took about 84 minutes on one shared A100. Building the edit takes seconds on a CPU, and the edited model has the same size and inference cost as the original.&lt;/p&gt;

&lt;h2 id=&quot;results&quot;&gt;Results&lt;/h2&gt;

&lt;p&gt;All runs follow the agent paper’s evaluation protocol: thinking mode, temperature 0.6, top-&lt;em&gt;p&lt;/em&gt; 0.95, top-&lt;em&gt;k&lt;/em&gt; 20, presence penalty 1.5, at most 32,768 new tokens, and answers graded with Math-Verify. Comparisons use a paired bootstrap over problems with 10,000 resamples.&lt;/p&gt;

&lt;table class=&quot;num&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;&lt;/th&gt;&lt;th colspan=&quot;3&quot;&gt;MATH-500&lt;/th&gt;&lt;th colspan=&quot;3&quot; class=&quot;g&quot;&gt;GSM8K&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th&gt;Method&lt;/th&gt;&lt;th&gt;Accuracy&lt;/th&gt;&lt;th&gt;Truncated&lt;/th&gt;&lt;th&gt;Tokens&lt;/th&gt;&lt;th class=&quot;g&quot;&gt;Accuracy&lt;/th&gt;&lt;th&gt;Truncated&lt;/th&gt;&lt;th&gt;Tokens&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Base model&lt;/td&gt;&lt;td&gt;7.4&lt;/td&gt;&lt;td&gt;93.0&lt;/td&gt;&lt;td&gt;30.9k&lt;/td&gt;&lt;td class=&quot;g&quot;&gt;13.8¹&lt;/td&gt;&lt;td class=&quot;na&quot;&gt;–&lt;/td&gt;&lt;td class=&quot;na&quot;&gt;–&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Astra edit (agent)&lt;/td&gt;&lt;td&gt;49.7&lt;/td&gt;&lt;td&gt;32.1&lt;/td&gt;&lt;td&gt;21.8k&lt;/td&gt;&lt;td class=&quot;g&quot;&gt;67.4&lt;/td&gt;&lt;td&gt;6.9&lt;/td&gt;&lt;td&gt;12.0k&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;CLC (one seed)&lt;/td&gt;&lt;td&gt;53.0&lt;/td&gt;&lt;td&gt;21.8&lt;/td&gt;&lt;td&gt;18.1k&lt;/td&gt;&lt;td class=&quot;g&quot;&gt;64.6&lt;/td&gt;&lt;td&gt;0.5&lt;/td&gt;&lt;td&gt;7.6k&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;best&quot;&gt;&lt;td&gt;&lt;strong&gt;CLC-sel&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;strong&gt;56.3&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;strong&gt;17.7&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;18.3k&lt;/td&gt;&lt;td class=&quot;g&quot;&gt;&lt;strong&gt;69.0&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;strong&gt;1.0&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;9.1k&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;p class=&quot;table-note&quot;&gt;Accuracy and truncation in %, tokens per answer. Astra and CLC-sel average three seeds. ¹ Reported by Takehi et al.&lt;/p&gt;

&lt;p&gt;On MATH-500, CLC-sel is &lt;strong&gt;6.7 points&lt;/strong&gt; above the agent’s edit (95% CI 4.5 to 8.9). The interval excludes zero on each seed separately: +6.6, +8.2 and +5.2. It truncates 17.7% of answers against 32.1% and uses 16% fewer tokens. It is also 10.0 points above the base model with thinking off (CI 5.4 to 14.6), which the agent’s edit does not significantly beat.&lt;/p&gt;

&lt;p&gt;On GSM8K, CLC-sel scores 69.0, 68.8 and 69.2% on the three seeds; the agent’s edit scores 68.4, 65.7 and 68.1%. Over three seeds CLC-sel is &lt;strong&gt;1.6 points&lt;/strong&gt; ahead (CI 0.2 to 3.0), and it uses 24% fewer tokens.&lt;/p&gt;

&lt;p&gt;The neuron rule matters. CLC, with neurons chosen by their write on loops, already beats the agent’s edit on MATH-500, but on GSM8K it falls 3.8 points behind and uses 35% fewer tokens: it ends normal reasoning too early. Choosing neurons by their rise on repeated text fixes that. On GSM8K, CLC-sel is 4.4 points above CLC (CI 2.0 to 6.8).&lt;/p&gt;

&lt;h2 id=&quot;against-decoding-time-fixes&quot;&gt;Against decoding-time fixes&lt;/h2&gt;

&lt;p&gt;A weight edit should beat the cheap fixes that need no edit at all. I tried two.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Repetition penalty&lt;/strong&gt; helps little. On the selection set, strengths 1.05, 1.1 and 1.2 reached 21.9%, 34.0% and 1.2%, against 66.4% for CLC-sel; the strongest penalty breaks the model. On MATH-500 the chosen strength, 1.1, reached 22.4%, and 75.8% of its answers still ran out of tokens.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Budget forcing&lt;/strong&gt; is a much stronger baseline. When thinking reaches 30,720 tokens without &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;/think&amp;gt;&lt;/code&gt;, it appends the tag and allows 2,048 more tokens for the answer, so the total budget stays the same. It lifts the base model from 7.4% to 35.0%. CLC-sel alone is 20.8 points higher still (CI 16.8 to 24.8). A looping model often keeps writing after the forced tag, so 63.8% of base-model answers still run out.&lt;/p&gt;

&lt;p&gt;With budget forcing on both edits, CLC-sel stays 6.8 points ahead of the agent’s edit (CI 3.0 to 10.6). The two also combine: CLC-sel with budget forcing reaches 59.6%, 3.8 points above CLC-sel alone (CI 0.0 to 7.6).&lt;/p&gt;

&lt;h2 id=&quot;where-the-gain-comes-from&quot;&gt;Where the gain comes from&lt;/h2&gt;

&lt;p&gt;Across every edit and control, accuracy rises with the share of answers that finish.&lt;/p&gt;

&lt;figure&gt;
&lt;div class=&quot;fig-scroll&quot;&gt;&lt;svg class=&quot;ch&quot; viewBox=&quot;0 0 720 390&quot; role=&quot;img&quot; aria-labelledby=&quot;finish-t finish-d&quot;&gt;&lt;title id=&quot;finish-t&quot;&gt;Accuracy against the share of answers that finish&lt;/title&gt;&lt;desc id=&quot;finish-d&quot;&gt;Every thinking-mode run on MATH-500. Accuracy rises with the share of answers that finish; the edits that finish most answers lie near a line of slope 0.71 through the origin. CLC-sel finishes 82% and scores 56.3%; the Astra edit finishes 68% and scores 49.7%; the automatic layer-13 edit finishes 90% but scores 49.6%.&lt;/desc&gt;
&lt;line class=&quot;grid&quot; x1=&quot;64.0&quot; y1=&quot;340.0&quot; x2=&quot;694.0&quot; y2=&quot;340.0&quot; /&gt;
&lt;text x=&quot;54.0&quot; y=&quot;344.0&quot; class=&quot;tick&quot; text-anchor=&quot;end&quot;&gt;0&lt;/text&gt;
&lt;line class=&quot;grid&quot; x1=&quot;64.0&quot; y1=&quot;248.0&quot; x2=&quot;694.0&quot; y2=&quot;248.0&quot; /&gt;
&lt;text x=&quot;54.0&quot; y=&quot;252.0&quot; class=&quot;tick&quot; text-anchor=&quot;end&quot;&gt;20&lt;/text&gt;
&lt;line class=&quot;grid&quot; x1=&quot;64.0&quot; y1=&quot;156.0&quot; x2=&quot;694.0&quot; y2=&quot;156.0&quot; /&gt;
&lt;text x=&quot;54.0&quot; y=&quot;160.0&quot; class=&quot;tick&quot; text-anchor=&quot;end&quot;&gt;40&lt;/text&gt;
&lt;line class=&quot;grid&quot; x1=&quot;64.0&quot; y1=&quot;64.0&quot; x2=&quot;694.0&quot; y2=&quot;64.0&quot; /&gt;
&lt;text x=&quot;54.0&quot; y=&quot;68.0&quot; class=&quot;tick&quot; text-anchor=&quot;end&quot;&gt;60&lt;/text&gt;
&lt;text x=&quot;64.0&quot; y=&quot;360.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;0&lt;/text&gt;
&lt;text x=&quot;190.0&quot; y=&quot;360.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;20&lt;/text&gt;
&lt;text x=&quot;316.0&quot; y=&quot;360.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;40&lt;/text&gt;
&lt;text x=&quot;442.0&quot; y=&quot;360.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;60&lt;/text&gt;
&lt;text x=&quot;568.0&quot; y=&quot;360.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;80&lt;/text&gt;
&lt;text x=&quot;694.0&quot; y=&quot;360.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;100&lt;/text&gt;
&lt;text x=&quot;379.0&quot; y=&quot;382.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;Answers that finish (%)&lt;/text&gt;
&lt;text x=&quot;54.0&quot; y=&quot;14.0&quot; class=&quot;tick&quot;&gt;Accuracy (%)&lt;/text&gt;
&lt;line class=&quot;axis&quot; x1=&quot;64.0&quot; y1=&quot;340.0&quot; x2=&quot;694.0&quot; y2=&quot;340.0&quot; /&gt;
&lt;line class=&quot;fit&quot; x1=&quot;64.0&quot; y1=&quot;340.0&quot; x2=&quot;662.5&quot; y2=&quot;29.7&quot; /&gt;
&lt;text x=&quot;360.1&quot; y=&quot;220.5&quot; class=&quot;tick&quot;&gt;0.71 &amp;#215; share finished&lt;/text&gt;
&lt;circle class=&quot;n ring&quot; cx=&quot;108.1&quot; cy=&quot;306.0&quot; r=&quot;6.5&quot;&gt;&lt;title&gt;Base: 7.4% correct, 7.0% of answers finish&lt;/title&gt;&lt;/circle&gt;
&lt;text x=&quot;120.1&quot; y=&quot;310.0&quot; class=&quot;lab small&quot;&gt;Base&lt;/text&gt;
&lt;circle class=&quot;n ring&quot; cx=&quot;163.5&quot; cy=&quot;264.6&quot; r=&quot;6.5&quot;&gt;&lt;title&gt;CRD 7/12: 16.4% correct, 15.8% of answers finish&lt;/title&gt;&lt;/circle&gt;
&lt;text x=&quot;151.5&quot; y=&quot;268.6&quot; class=&quot;lab small&quot; text-anchor=&quot;end&quot;&gt;CRD 7/12&lt;/text&gt;
&lt;circle class=&quot;n ring&quot; cx=&quot;207.6&quot; cy=&quot;233.3&quot; r=&quot;6.5&quot;&gt;&lt;title&gt;CRD 15/19: 23.2% correct, 22.8% of answers finish&lt;/title&gt;&lt;/circle&gt;
&lt;text x=&quot;195.6&quot; y=&quot;237.3&quot; class=&quot;lab small&quot; text-anchor=&quot;end&quot;&gt;CRD 15/19&lt;/text&gt;
&lt;circle class=&quot;n ring hollow&quot; cx=&quot;292.1&quot; cy=&quot;179.0&quot; r=&quot;6.5&quot;&gt;&lt;title&gt;Base + BF: 35.0% correct, 36.2% of answers finish&lt;/title&gt;&lt;/circle&gt;
&lt;text x=&quot;280.1&quot; y=&quot;183.0&quot; class=&quot;lab small&quot; text-anchor=&quot;end&quot;&gt;Base + BF&lt;/text&gt;
&lt;circle class=&quot;m ring&quot; cx=&quot;491.8&quot; cy=&quot;111.4&quot; r=&quot;6.5&quot;&gt;&lt;title&gt;Astra: 49.7% correct, 67.9% of answers finish&lt;/title&gt;&lt;/circle&gt;
&lt;text x=&quot;479.8&quot; y=&quot;116.4&quot; class=&quot;lab small&quot; text-anchor=&quot;end&quot;&gt;Astra&lt;/text&gt;
&lt;circle class=&quot;m ring hollow&quot; cx=&quot;511.3&quot; cy=&quot;97.1&quot; r=&quot;6.5&quot;&gt;&lt;title&gt;Astra + BF: 52.8% correct, 71.0% of answers finish&lt;/title&gt;&lt;/circle&gt;
&lt;text x=&quot;501.3&quot; y=&quot;88.1&quot; class=&quot;lab small&quot; text-anchor=&quot;end&quot;&gt;Astra + BF&lt;/text&gt;
&lt;circle class=&quot;n ring&quot; cx=&quot;556.7&quot; cy=&quot;96.2&quot; r=&quot;6.5&quot;&gt;&lt;title&gt;CLC: 53.0% correct, 78.2% of answers finish&lt;/title&gt;&lt;/circle&gt;
&lt;text x=&quot;556.7&quot; y=&quot;120.2&quot; class=&quot;lab small&quot; text-anchor=&quot;middle&quot;&gt;CLC&lt;/text&gt;
&lt;circle class=&quot;a ring&quot; cx=&quot;582.5&quot; cy=&quot;81.0&quot; r=&quot;6.5&quot;&gt;&lt;title&gt;CLC-sel: 56.3% correct, 82.3% of answers finish&lt;/title&gt;&lt;/circle&gt;
&lt;text x=&quot;594.5&quot; y=&quot;87.0&quot; class=&quot;lab small strong&quot;&gt;CLC-sel&lt;/text&gt;
&lt;circle class=&quot;a ring hollow&quot; cx=&quot;602.0&quot; cy=&quot;65.8&quot; r=&quot;6.5&quot;&gt;&lt;title&gt;CLC-sel + BF: 59.6% correct, 85.4% of answers finish&lt;/title&gt;&lt;/circle&gt;
&lt;text x=&quot;592.0&quot; y=&quot;56.8&quot; class=&quot;lab small strong&quot; text-anchor=&quot;end&quot;&gt;CLC-sel + BF&lt;/text&gt;
&lt;circle class=&quot;n ring&quot; cx=&quot;629.7&quot; cy=&quot;111.8&quot; r=&quot;6.5&quot;&gt;&lt;title&gt;Auto, layer 13: 49.6% correct, 89.8% of answers finish&lt;/title&gt;&lt;/circle&gt;
&lt;text x=&quot;629.7&quot; y=&quot;135.8&quot; class=&quot;lab small&quot; text-anchor=&quot;middle&quot;&gt;Auto, layer 13&lt;/text&gt;
&lt;circle class=&quot;n ring&quot; cx=&quot;89.2&quot; cy=&quot;36.4&quot; r=&quot;5&quot; /&gt;
&lt;text x=&quot;101.2&quot; y=&quot;40.4&quot; class=&quot;tick&quot;&gt;no forcing&lt;/text&gt;
&lt;circle class=&quot;n ring hollow&quot; cx=&quot;190.0&quot; cy=&quot;36.4&quot; r=&quot;5&quot; /&gt;
&lt;text x=&quot;202.0&quot; y=&quot;40.4&quot; class=&quot;tick&quot;&gt;with budget forcing (BF)&lt;/text&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;figcaption&gt;&lt;b&gt;Accuracy against the share of answers that finish&lt;/b&gt;, every thinking-mode run on MATH-500, seeds averaged. The edits that finish most answers sit near a line of slope 0.71 through the origin. Runs that finish few answers lie above it, because the few they finish are easy ones.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Splitting each paired comparison by what happened to each problem shows where CLC-sel’s lead comes from.&lt;/p&gt;

&lt;figure&gt;
&lt;div class=&quot;fig-scroll&quot;&gt;&lt;svg class=&quot;ch&quot; viewBox=&quot;0 0 720 354&quot; role=&quot;img&quot; aria-labelledby=&quot;split-t split-d&quot;&gt;&lt;title id=&quot;split-t&quot;&gt;Where CLC-sel&apos;s lead over the Astra edit comes from&lt;/title&gt;&lt;desc id=&quot;split-d&quot;&gt;For each run, the paired accuracy difference split by outcome. Most of the lead comes from problems the Astra edit truncates and CLC-sel finishes (+7.2 to +8.8 points on MATH-500); problems CLC-sel truncates cost 1.6 to 3.2 points; problems both finish change little.&lt;/desc&gt;
&lt;rect class=&quot;a&quot; x=&quot;0&quot; y=&quot;4&quot; width=&quot;14&quot; height=&quot;14&quot; rx=&quot;3&quot; /&gt;
&lt;text x=&quot;20.0&quot; y=&quot;16.0&quot; class=&quot;tick&quot;&gt;Astra truncated, CLC-sel finished&lt;/text&gt;
&lt;rect class=&quot;b&quot; x=&quot;278.9&quot; y=&quot;4&quot; width=&quot;14&quot; height=&quot;14&quot; rx=&quot;3&quot; /&gt;
&lt;text x=&quot;298.9&quot; y=&quot;16.0&quot; class=&quot;tick&quot;&gt;CLC-sel truncated, Astra finished&lt;/text&gt;
&lt;rect class=&quot;n&quot; x=&quot;0&quot; y=&quot;26&quot; width=&quot;14&quot; height=&quot;14&quot; rx=&quot;3&quot; /&gt;
&lt;text x=&quot;20.0&quot; y=&quot;38.0&quot; class=&quot;tick&quot;&gt;both finished or both truncated&lt;/text&gt;
&lt;line class=&quot;grid&quot; x1=&quot;168.0&quot; y1=&quot;60&quot; x2=&quot;168.0&quot; y2=&quot;304&quot; /&gt;
&lt;text x=&quot;168.0&quot; y=&quot;322.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;-4&lt;/text&gt;
&lt;line class=&quot;grid&quot; x1=&quot;238.3&quot; y1=&quot;60&quot; x2=&quot;238.3&quot; y2=&quot;304&quot; /&gt;
&lt;text x=&quot;238.3&quot; y=&quot;322.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;-2&lt;/text&gt;
&lt;line class=&quot;grid&quot; x1=&quot;308.6&quot; y1=&quot;60&quot; x2=&quot;308.6&quot; y2=&quot;304&quot; /&gt;
&lt;text x=&quot;308.6&quot; y=&quot;322.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;0&lt;/text&gt;
&lt;line class=&quot;grid&quot; x1=&quot;378.9&quot; y1=&quot;60&quot; x2=&quot;378.9&quot; y2=&quot;304&quot; /&gt;
&lt;text x=&quot;378.9&quot; y=&quot;322.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;+2&lt;/text&gt;
&lt;line class=&quot;grid&quot; x1=&quot;449.1&quot; y1=&quot;60&quot; x2=&quot;449.1&quot; y2=&quot;304&quot; /&gt;
&lt;text x=&quot;449.1&quot; y=&quot;322.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;+4&lt;/text&gt;
&lt;line class=&quot;grid&quot; x1=&quot;519.4&quot; y1=&quot;60&quot; x2=&quot;519.4&quot; y2=&quot;304&quot; /&gt;
&lt;text x=&quot;519.4&quot; y=&quot;322.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;+6&lt;/text&gt;
&lt;line class=&quot;grid&quot; x1=&quot;589.7&quot; y1=&quot;60&quot; x2=&quot;589.7&quot; y2=&quot;304&quot; /&gt;
&lt;text x=&quot;589.7&quot; y=&quot;322.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;+8&lt;/text&gt;
&lt;line class=&quot;grid&quot; x1=&quot;660.0&quot; y1=&quot;60&quot; x2=&quot;660.0&quot; y2=&quot;304&quot; /&gt;
&lt;text x=&quot;660.0&quot; y=&quot;322.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;+10&lt;/text&gt;
&lt;text x=&quot;414.0&quot; y=&quot;344.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;CLC-sel minus Astra, accuracy points&lt;/text&gt;
&lt;text x=&quot;154.0&quot; y=&quot;84.0&quot; class=&quot;lab&quot; text-anchor=&quot;end&quot;&gt;MATH-500, seed 0&lt;/text&gt;
&lt;path class=&quot;a gap&quot; d=&quot;M308.6,71.0h306.3a3,3 0 0 1 3,3v14.0a3,3 0 0 1 -3,3h-306.3z&quot;&gt;&lt;title&gt;99 problems Astra truncated and CLC-sel finished: +8.8 points&lt;/title&gt;&lt;/path&gt;
&lt;path class=&quot;n gap&quot; d=&quot;M308.6,71.0h-18.1a3,3 0 0 0 -3,3v14.0a3,3 0 0 0 3,3h18.1z&quot;&gt;&lt;title&gt;problems both finished or both truncated: -0.6 points&lt;/title&gt;&lt;/path&gt;
&lt;path class=&quot;b gap&quot; d=&quot;M287.5,71.0h-53.2a3,3 0 0 0 -3,3v14.0a3,3 0 0 0 3,3h53.2z&quot;&gt;&lt;title&gt;24 problems CLC-sel truncated and Astra finished: -1.6 points&lt;/title&gt;&lt;/path&gt;
&lt;path class=&quot;net&quot; d=&quot;M540.5,75.0l6,6l-6,6l-6,-6z&quot;&gt;&lt;title&gt;net +6.6 points&lt;/title&gt;&lt;/path&gt;
&lt;text x=&quot;627.8&quot; y=&quot;84.0&quot; class=&quot;val&quot;&gt;+6.6&lt;/text&gt;
&lt;text x=&quot;154.0&quot; y=&quot;118.0&quot; class=&quot;lab&quot; text-anchor=&quot;end&quot;&gt;seed 1&lt;/text&gt;
&lt;path class=&quot;a gap&quot; d=&quot;M308.6,105.0h292.2a3,3 0 0 1 3,3v14.0a3,3 0 0 1 -3,3h-292.2z&quot;&gt;&lt;title&gt;101 problems Astra truncated and CLC-sel finished: +8.4 points&lt;/title&gt;&lt;/path&gt;
&lt;path class=&quot;n gap&quot; d=&quot;M603.8,105.0h53.2a3,3 0 0 1 3,3v14.0a3,3 0 0 1 -3,3h-53.2z&quot;&gt;&lt;title&gt;problems both finished or both truncated: +1.6 points&lt;/title&gt;&lt;/path&gt;
&lt;path class=&quot;b gap&quot; d=&quot;M308.6,105.0h-60.3a3,3 0 0 0 -3,3v14.0a3,3 0 0 0 3,3h60.3z&quot;&gt;&lt;title&gt;27 problems CLC-sel truncated and Astra finished: -1.8 points&lt;/title&gt;&lt;/path&gt;
&lt;path class=&quot;net&quot; d=&quot;M596.7,109.0l6,6l-6,6l-6,-6z&quot;&gt;&lt;title&gt;net +8.2 points&lt;/title&gt;&lt;/path&gt;
&lt;text x=&quot;670.0&quot; y=&quot;118.0&quot; class=&quot;val&quot;&gt;+8.2&lt;/text&gt;
&lt;text x=&quot;154.0&quot; y=&quot;152.0&quot; class=&quot;lab&quot; text-anchor=&quot;end&quot;&gt;seed 2&lt;/text&gt;
&lt;path class=&quot;a gap&quot; d=&quot;M308.6,139.0h250.0a3,3 0 0 1 3,3v14.0a3,3 0 0 1 -3,3h-250.0z&quot;&gt;&lt;title&gt;92 problems Astra truncated and CLC-sel finished: +7.2 points&lt;/title&gt;&lt;/path&gt;
&lt;path class=&quot;n gap&quot; d=&quot;M561.6,139.0h39.2a3,3 0 0 1 3,3v14.0a3,3 0 0 1 -3,3h-39.2z&quot;&gt;&lt;title&gt;problems both finished or both truncated: +1.2 points&lt;/title&gt;&lt;/path&gt;
&lt;path class=&quot;b gap&quot; d=&quot;M308.6,139.0h-109.5a3,3 0 0 0 -3,3v14.0a3,3 0 0 0 3,3h109.5z&quot;&gt;&lt;title&gt;26 problems CLC-sel truncated and Astra finished: -3.2 points&lt;/title&gt;&lt;/path&gt;
&lt;path class=&quot;net&quot; d=&quot;M491.3,143.0l6,6l-6,6l-6,-6z&quot;&gt;&lt;title&gt;net +5.2 points&lt;/title&gt;&lt;/path&gt;
&lt;text x=&quot;613.8&quot; y=&quot;152.0&quot; class=&quot;val&quot;&gt;+5.2&lt;/text&gt;
&lt;text x=&quot;154.0&quot; y=&quot;186.0&quot; class=&quot;lab&quot; text-anchor=&quot;end&quot;&gt;both with BF&lt;/text&gt;
&lt;path class=&quot;a gap&quot; d=&quot;M308.6,173.0h299.2a3,3 0 0 1 3,3v14.0a3,3 0 0 1 -3,3h-299.2z&quot;&gt;&lt;title&gt;96 problems Astra truncated and CLC-sel finished: +8.6 points&lt;/title&gt;&lt;/path&gt;
&lt;path class=&quot;n gap&quot; d=&quot;M610.8,173.0h18.1a3,3 0 0 1 3,3v14.0a3,3 0 0 1 -3,3h-18.1z&quot;&gt;&lt;title&gt;problems both finished or both truncated: +0.6 points&lt;/title&gt;&lt;/path&gt;
&lt;path class=&quot;b gap&quot; d=&quot;M308.6,173.0h-81.3a3,3 0 0 0 -3,3v14.0a3,3 0 0 0 3,3h81.3z&quot;&gt;&lt;title&gt;24 problems CLC-sel truncated and Astra finished: -2.4 points&lt;/title&gt;&lt;/path&gt;
&lt;path class=&quot;net&quot; d=&quot;M547.5,177.0l6,6l-6,6l-6,-6z&quot;&gt;&lt;title&gt;net +6.8 points&lt;/title&gt;&lt;/path&gt;
&lt;text x=&quot;641.9&quot; y=&quot;186.0&quot; class=&quot;val&quot;&gt;+6.8&lt;/text&gt;
&lt;text x=&quot;154.0&quot; y=&quot;220.0&quot; class=&quot;lab&quot; text-anchor=&quot;end&quot;&gt;GSM8K, seed 0&lt;/text&gt;
&lt;path class=&quot;a gap&quot; d=&quot;M308.6,207.0h79.6a3,3 0 0 1 3,3v14.0a3,3 0 0 1 -3,3h-79.6z&quot;&gt;&lt;title&gt;70 problems Astra truncated and CLC-sel finished: +2.4 points&lt;/title&gt;&lt;/path&gt;
&lt;path class=&quot;n gap&quot; d=&quot;M308.6,207.0h-50.3a3,3 0 0 0 -3,3v14.0a3,3 0 0 0 3,3h50.3z&quot;&gt;&lt;title&gt;problems both finished or both truncated: -1.5 points&lt;/title&gt;&lt;/path&gt;
&lt;path class=&quot;b gap&quot; d=&quot;M255.3,207.0h-5.0a3,3 0 0 0 -3,3v14.0a3,3 0 0 0 3,3h5.0z&quot;&gt;&lt;title&gt;13 problems CLC-sel truncated and Astra finished: -0.2 points&lt;/title&gt;&lt;/path&gt;
&lt;path class=&quot;net&quot; d=&quot;M329.9,211.0l6,6l-6,6l-6,-6z&quot;&gt;&lt;title&gt;net +0.6 points&lt;/title&gt;&lt;/path&gt;
&lt;text x=&quot;401.2&quot; y=&quot;220.0&quot; class=&quot;val&quot;&gt;+0.6&lt;/text&gt;
&lt;text x=&quot;154.0&quot; y=&quot;254.0&quot; class=&quot;lab&quot; text-anchor=&quot;end&quot;&gt;seed 1&lt;/text&gt;
&lt;path class=&quot;a gap&quot; d=&quot;M308.6,241.0h116.9a3,3 0 0 1 3,3v14.0a3,3 0 0 1 -3,3h-116.9z&quot;&gt;&lt;title&gt;105 problems Astra truncated and CLC-sel finished: +3.4 points&lt;/title&gt;&lt;/path&gt;
&lt;path class=&quot;n gap&quot; d=&quot;M428.5,241.0h1.3a1.3321780569695654,1.3321780569695654 0 0 1 1.3321780569695654,1.3321780569695654v17.3a1.3321780569695654,1.3321780569695654 0 0 1 -1.3321780569695654,1.3321780569695654h-1.3z&quot;&gt;&lt;title&gt;problems both finished or both truncated: +0.1 points&lt;/title&gt;&lt;/path&gt;
&lt;path class=&quot;b gap&quot; d=&quot;M308.6,241.0h-10.3a3,3 0 0 0 -3,3v14.0a3,3 0 0 0 3,3h10.3z&quot;&gt;&lt;title&gt;10 problems CLC-sel truncated and Astra finished: -0.4 points&lt;/title&gt;&lt;/path&gt;
&lt;path class=&quot;net&quot; d=&quot;M417.8,245.0l6,6l-6,6l-6,-6z&quot;&gt;&lt;title&gt;net +3.1 points&lt;/title&gt;&lt;/path&gt;
&lt;text x=&quot;441.1&quot; y=&quot;254.0&quot; class=&quot;val&quot;&gt;+3.1&lt;/text&gt;
&lt;text x=&quot;154.0&quot; y=&quot;288.0&quot; class=&quot;lab&quot; text-anchor=&quot;end&quot;&gt;seed 2&lt;/text&gt;
&lt;path class=&quot;a gap&quot; d=&quot;M308.6,275.0h90.3a3,3 0 0 1 3,3v14.0a3,3 0 0 1 -3,3h-90.3z&quot;&gt;&lt;title&gt;88 problems Astra truncated and CLC-sel finished: +2.7 points&lt;/title&gt;&lt;/path&gt;
&lt;path class=&quot;n gap&quot; d=&quot;M308.6,275.0h-42.3a3,3 0 0 0 -3,3v14.0a3,3 0 0 0 3,3h42.3z&quot;&gt;&lt;title&gt;problems both finished or both truncated: -1.3 points&lt;/title&gt;&lt;/path&gt;
&lt;path class=&quot;b gap&quot; d=&quot;M263.3,275.0h-5.0a3,3 0 0 0 -3,3v14.0a3,3 0 0 0 3,3h5.0z&quot;&gt;&lt;title&gt;7 problems CLC-sel truncated and Astra finished: -0.2 points&lt;/title&gt;&lt;/path&gt;
&lt;path class=&quot;net&quot; d=&quot;M348.5,279.0l6,6l-6,6l-6,-6z&quot;&gt;&lt;title&gt;net +1.1 points&lt;/title&gt;&lt;/path&gt;
&lt;text x=&quot;411.8&quot; y=&quot;288.0&quot; class=&quot;val&quot;&gt;+1.1&lt;/text&gt;
&lt;line class=&quot;axis&quot; x1=&quot;308.6&quot; y1=&quot;60&quot; x2=&quot;308.6&quot; y2=&quot;304&quot; /&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;figcaption&gt;&lt;b&gt;CLC-sel minus the Astra edit, split by outcome.&lt;/b&gt; Most of the lead comes from problems the agent&apos;s edit truncates and CLC-sel finishes. The diamond marks the net difference.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;On MATH-500 (seed 0), 315 problems finish under both edits, and there the two are level: 74.0% for CLC-sel and 74.9% for the agent’s edit. On 99 problems the agent’s edit runs out of tokens and CLC-sel finishes. CLC-sel solves 44% of these, which adds 8.8 points. On 24 problems the opposite happens, which costs 1.6 points. The other seeds show the same pattern.&lt;/p&gt;

&lt;p&gt;So the edit does not make the model reason better. It makes the model finish problems it would otherwise loop on. Accuracy over finished answers even favors the agent’s edit, 72.3% against 67.1%, because the problems CLC-sel rescues are harder than average.&lt;/p&gt;

&lt;h2 id=&quot;what-matters-inside-the-edit&quot;&gt;What matters inside the edit&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Edit (development set, 128 problems)&lt;/th&gt;
      &lt;th style=&quot;text-align: right&quot;&gt;Accuracy&lt;/th&gt;
      &lt;th style=&quot;text-align: right&quot;&gt;Truncated&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Base model&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;13.3&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;85.2&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Astra edit&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;66.4&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;14.8&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;CRD direction&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;39.1&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;57.8&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Closure direction (CLC)&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;&lt;strong&gt;67.2&lt;/strong&gt;&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;7.8&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Astra direction, top-write neurons&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;59.4&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;21.1&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;CRD direction, Astra neurons&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;50.8&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;44.5&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p class=&quot;table-note&quot;&gt;Thinking mode, one seed, layers 15 and 19, \(\alpha = 6\), 64 neurons.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The direction must point toward closure.&lt;/strong&gt; At the same layers, CRD reached 23.2% on MATH-500 and the closure direction 53.0%.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Neuron choice matters as much as direction.&lt;/strong&gt; The agent’s own direction with neurons ranked by their write reaches 59.4%; CRD with the agent’s neurons reaches 50.8%. Editing every neuron, with the projection \((I - \alpha\,\mathbf{u}\mathbf{u}^{\top})\,W\), reached only 14.8 to 25.0%.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A weaker push does not help.&lt;/strong&gt; Lowering CLC’s strength to 4 kept selection-set accuracy at 60.9%; lowering it to 3 dropped it to 57.8%. Only the loop-selective neurons improved on CLC, to 66.4%.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Measure under sampling.&lt;/strong&gt; My first layer screen ranked layers by how much an edit lowers the log-probability of held-out loop text, with a guard against harming finished text. It ruled out layers 15 and 19 because of that cost. Under sampling, they are among the best layers.&lt;/p&gt;

&lt;h2 id=&quot;removing-the-last-borrowed-settings&quot;&gt;Removing the last borrowed settings&lt;/h2&gt;

&lt;p&gt;CLC-sel so far borrows two settings from the agent: the layers and the strength. Both can be chosen by rules that use only the practice answers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Strength in closed form.&lt;/strong&gt; The edit lowers the write along \(\mathbf{u}\) by \(\alpha \sum_{c \in \mathbf{m}} s_c\,a_c\), a sum over the selected neurons. Choose \(\alpha\) so that, to first order, this closes the gap between the loop state and the closure state:&lt;/p&gt;

\[\alpha^{*} = \frac{\lVert \bar{\mathbf{h}}^{R} - \bar{\mathbf{h}}^{C} \rVert}{\sum_{c \in \mathbf{m}} s_c \big(\bar a^{R}_c - \bar a^{C}_c\big)}\]

&lt;p&gt;clipped to \([0.5, 16]\). This needs no generation. At the agent’s layers it gives 8.1 and 11.6. Split over two layers, that is 4.0 and 5.8 per layer, close to the agent’s 6, although the rule never saw the agent’s edit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Layers by a screen.&lt;/strong&gt; I built a single-layer CLC-sel edit at every odd layer, each with its own \(\alpha^{*}\), and ran each on 128 screening problems.&lt;/p&gt;

&lt;figure&gt;
&lt;div class=&quot;fig-scroll&quot;&gt;&lt;svg class=&quot;ch&quot; viewBox=&quot;0 0 720 310&quot; role=&quot;img&quot; aria-labelledby=&quot;layers-t layers-d&quot;&gt;&lt;title id=&quot;layers-t&quot;&gt;Single-layer CLC-sel edits on the screening set&lt;/title&gt;&lt;desc id=&quot;layers-d&quot;&gt;Accuracy and truncation for a CLC-sel edit at each odd layer with its closed-form strength, on 128 screening problems. Early layers and the last two fail; layers 9 to 19 reach 52 to 64%, against 14% for the base model. Layers 13 and 19 are best.&lt;/desc&gt;
&lt;line class=&quot;grid&quot; x1=&quot;54&quot; y1=&quot;262.0&quot; x2=&quot;628&quot; y2=&quot;262.0&quot; /&gt;
&lt;text x=&quot;46.0&quot; y=&quot;266.0&quot; class=&quot;tick&quot; text-anchor=&quot;end&quot;&gt;0&lt;/text&gt;
&lt;line class=&quot;grid&quot; x1=&quot;54&quot; y1=&quot;207.0&quot; x2=&quot;628&quot; y2=&quot;207.0&quot; /&gt;
&lt;text x=&quot;46.0&quot; y=&quot;211.0&quot; class=&quot;tick&quot; text-anchor=&quot;end&quot;&gt;25&lt;/text&gt;
&lt;line class=&quot;grid&quot; x1=&quot;54&quot; y1=&quot;152.0&quot; x2=&quot;628&quot; y2=&quot;152.0&quot; /&gt;
&lt;text x=&quot;46.0&quot; y=&quot;156.0&quot; class=&quot;tick&quot; text-anchor=&quot;end&quot;&gt;50&lt;/text&gt;
&lt;line class=&quot;grid&quot; x1=&quot;54&quot; y1=&quot;97.0&quot; x2=&quot;628&quot; y2=&quot;97.0&quot; /&gt;
&lt;text x=&quot;46.0&quot; y=&quot;101.0&quot; class=&quot;tick&quot; text-anchor=&quot;end&quot;&gt;75&lt;/text&gt;
&lt;line class=&quot;grid&quot; x1=&quot;54&quot; y1=&quot;42.0&quot; x2=&quot;628&quot; y2=&quot;42.0&quot; /&gt;
&lt;text x=&quot;46.0&quot; y=&quot;46.0&quot; class=&quot;tick&quot; text-anchor=&quot;end&quot;&gt;100&lt;/text&gt;
&lt;line class=&quot;base&quot; x1=&quot;54&quot; y1=&quot;231.1&quot; x2=&quot;628&quot; y2=&quot;231.1&quot; /&gt;
&lt;text x=&quot;634.0&quot; y=&quot;235.1&quot; class=&quot;tick&quot;&gt;base 14%&lt;/text&gt;
&lt;path class=&quot;a soft&quot; d=&quot;M73.0,262.0v-32.1a4,4 0 0 1 4,-4h21.0a4,4 0 0 1 4,4v32.1z&quot;&gt;&lt;title&gt;Layer 1 (alpha* 5.3): 16.4% correct, 84.4% truncated&lt;/title&gt;&lt;/path&gt;
&lt;text x=&quot;87.5&quot; y=&quot;218.9&quot; class=&quot;val&quot; text-anchor=&quot;middle&quot;&gt;16&lt;/text&gt;
&lt;text x=&quot;87.5&quot; y=&quot;280.0&quot; class=&quot;lab small&quot; text-anchor=&quot;middle&quot;&gt;1&lt;/text&gt;
&lt;text x=&quot;87.5&quot; y=&quot;296.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;5.3&lt;/text&gt;
&lt;path class=&quot;a soft&quot; d=&quot;M120.0,262.0v-11.5a4,4 0 0 1 4,-4h21.0a4,4 0 0 1 4,4v11.5z&quot;&gt;&lt;title&gt;Layer 3 (alpha* 7.1): 7.0% correct, 95.3% truncated&lt;/title&gt;&lt;/path&gt;
&lt;text x=&quot;134.5&quot; y=&quot;239.5&quot; class=&quot;val&quot; text-anchor=&quot;middle&quot;&gt;7&lt;/text&gt;
&lt;text x=&quot;134.5&quot; y=&quot;280.0&quot; class=&quot;lab small&quot; text-anchor=&quot;middle&quot;&gt;3&lt;/text&gt;
&lt;text x=&quot;134.5&quot; y=&quot;296.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;7.1&lt;/text&gt;
&lt;path class=&quot;a soft&quot; d=&quot;M167.0,262.0v-4.6a4,4 0 0 1 4,-4h21.0a4,4 0 0 1 4,4v4.6z&quot;&gt;&lt;title&gt;Layer 5 (alpha* 16.0): 3.9% correct, 96.9% truncated&lt;/title&gt;&lt;/path&gt;
&lt;text x=&quot;181.5&quot; y=&quot;246.4&quot; class=&quot;val&quot; text-anchor=&quot;middle&quot;&gt;4&lt;/text&gt;
&lt;text x=&quot;181.5&quot; y=&quot;280.0&quot; class=&quot;lab small&quot; text-anchor=&quot;middle&quot;&gt;5&lt;/text&gt;
&lt;text x=&quot;181.5&quot; y=&quot;296.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;16.0&lt;/text&gt;
&lt;path class=&quot;a soft&quot; d=&quot;M214.0,262.0v-92.3a4,4 0 0 1 4,-4h21.0a4,4 0 0 1 4,4v92.3z&quot;&gt;&lt;title&gt;Layer 7 (alpha* 10.6): 43.8% correct, 35.9% truncated&lt;/title&gt;&lt;/path&gt;
&lt;text x=&quot;228.5&quot; y=&quot;158.8&quot; class=&quot;val&quot; text-anchor=&quot;middle&quot;&gt;44&lt;/text&gt;
&lt;text x=&quot;228.5&quot; y=&quot;280.0&quot; class=&quot;lab small&quot; text-anchor=&quot;middle&quot;&gt;7&lt;/text&gt;
&lt;text x=&quot;228.5&quot; y=&quot;296.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;10.6&lt;/text&gt;
&lt;path class=&quot;a soft&quot; d=&quot;M261.0,262.0v-119.8a4,4 0 0 1 4,-4h21.0a4,4 0 0 1 4,4v119.8z&quot;&gt;&lt;title&gt;Layer 9 (alpha* 14.4): 56.2% correct, 7.8% truncated&lt;/title&gt;&lt;/path&gt;
&lt;text x=&quot;275.5&quot; y=&quot;131.2&quot; class=&quot;val&quot; text-anchor=&quot;middle&quot;&gt;56&lt;/text&gt;
&lt;text x=&quot;275.5&quot; y=&quot;280.0&quot; class=&quot;lab small&quot; text-anchor=&quot;middle&quot;&gt;9&lt;/text&gt;
&lt;text x=&quot;275.5&quot; y=&quot;296.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;14.4&lt;/text&gt;
&lt;path class=&quot;a soft&quot; d=&quot;M308.0,262.0v-126.6a4,4 0 0 1 4,-4h21.0a4,4 0 0 1 4,4v126.6z&quot;&gt;&lt;title&gt;Layer 11 (alpha* 14.2): 59.4% correct, 4.7% truncated&lt;/title&gt;&lt;/path&gt;
&lt;text x=&quot;322.5&quot; y=&quot;124.4&quot; class=&quot;val&quot; text-anchor=&quot;middle&quot;&gt;59&lt;/text&gt;
&lt;text x=&quot;322.5&quot; y=&quot;280.0&quot; class=&quot;lab small&quot; text-anchor=&quot;middle&quot;&gt;11&lt;/text&gt;
&lt;text x=&quot;322.5&quot; y=&quot;296.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;14.2&lt;/text&gt;
&lt;path class=&quot;a&quot; d=&quot;M355.0,262.0v-136.9a4,4 0 0 1 4,-4h21.0a4,4 0 0 1 4,4v136.9z&quot;&gt;&lt;title&gt;Layer 13 (alpha* 11.8): 64.1% correct, 3.9% truncated&lt;/title&gt;&lt;/path&gt;
&lt;text x=&quot;369.5&quot; y=&quot;114.1&quot; class=&quot;val strong&quot; text-anchor=&quot;middle&quot;&gt;64&lt;/text&gt;
&lt;text x=&quot;369.5&quot; y=&quot;280.0&quot; class=&quot;lab small&quot; text-anchor=&quot;middle&quot;&gt;13&lt;/text&gt;
&lt;text x=&quot;369.5&quot; y=&quot;296.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;11.8&lt;/text&gt;
&lt;path class=&quot;a soft&quot; d=&quot;M402.0,262.0v-130.1a4,4 0 0 1 4,-4h21.0a4,4 0 0 1 4,4v130.1z&quot;&gt;&lt;title&gt;Layer 15 (alpha* 8.1): 60.9% correct, 14.8% truncated&lt;/title&gt;&lt;/path&gt;
&lt;text x=&quot;416.5&quot; y=&quot;120.9&quot; class=&quot;val&quot; text-anchor=&quot;middle&quot;&gt;61&lt;/text&gt;
&lt;text x=&quot;416.5&quot; y=&quot;280.0&quot; class=&quot;lab small&quot; text-anchor=&quot;middle&quot;&gt;15&lt;/text&gt;
&lt;text x=&quot;416.5&quot; y=&quot;296.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;8.1&lt;/text&gt;
&lt;path class=&quot;a soft&quot; d=&quot;M449.0,262.0v-109.4a4,4 0 0 1 4,-4h21.0a4,4 0 0 1 4,4v109.4z&quot;&gt;&lt;title&gt;Layer 17 (alpha* 16.0): 51.6% correct, 26.6% truncated&lt;/title&gt;&lt;/path&gt;
&lt;text x=&quot;463.5&quot; y=&quot;141.6&quot; class=&quot;val&quot; text-anchor=&quot;middle&quot;&gt;52&lt;/text&gt;
&lt;text x=&quot;463.5&quot; y=&quot;280.0&quot; class=&quot;lab small&quot; text-anchor=&quot;middle&quot;&gt;17&lt;/text&gt;
&lt;text x=&quot;463.5&quot; y=&quot;296.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;16.0&lt;/text&gt;
&lt;path class=&quot;a&quot; d=&quot;M496.0,262.0v-133.5a4,4 0 0 1 4,-4h21.0a4,4 0 0 1 4,4v133.5z&quot;&gt;&lt;title&gt;Layer 19 (alpha* 11.6): 62.5% correct, 5.5% truncated&lt;/title&gt;&lt;/path&gt;
&lt;text x=&quot;510.5&quot; y=&quot;117.5&quot; class=&quot;val strong&quot; text-anchor=&quot;middle&quot;&gt;62&lt;/text&gt;
&lt;text x=&quot;510.5&quot; y=&quot;280.0&quot; class=&quot;lab small&quot; text-anchor=&quot;middle&quot;&gt;19&lt;/text&gt;
&lt;text x=&quot;510.5&quot; y=&quot;296.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;11.6&lt;/text&gt;
&lt;path class=&quot;a soft&quot; d=&quot;M543.0,262.0v-52.7a4,4 0 0 1 4,-4h21.0a4,4 0 0 1 4,4v52.7z&quot;&gt;&lt;title&gt;Layer 21 (alpha* 16.0): 25.8% correct, 74.2% truncated&lt;/title&gt;&lt;/path&gt;
&lt;text x=&quot;557.5&quot; y=&quot;198.3&quot; class=&quot;val&quot; text-anchor=&quot;middle&quot;&gt;26&lt;/text&gt;
&lt;text x=&quot;557.5&quot; y=&quot;280.0&quot; class=&quot;lab small&quot; text-anchor=&quot;middle&quot;&gt;21&lt;/text&gt;
&lt;text x=&quot;557.5&quot; y=&quot;296.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;16.0&lt;/text&gt;
&lt;path class=&quot;a soft&quot; d=&quot;M590.0,262.0v-8.0a4,4 0 0 1 4,-4h21.0a4,4 0 0 1 4,4v8.0z&quot;&gt;&lt;title&gt;Layer 23 (alpha* 16.0): 5.5% correct, 82.8% truncated&lt;/title&gt;&lt;/path&gt;
&lt;text x=&quot;604.5&quot; y=&quot;243.0&quot; class=&quot;val&quot; text-anchor=&quot;middle&quot;&gt;5&lt;/text&gt;
&lt;text x=&quot;604.5&quot; y=&quot;280.0&quot; class=&quot;lab small&quot; text-anchor=&quot;middle&quot;&gt;23&lt;/text&gt;
&lt;text x=&quot;604.5&quot; y=&quot;296.0&quot; class=&quot;tick&quot; text-anchor=&quot;middle&quot;&gt;16.0&lt;/text&gt;
&lt;text x=&quot;46.0&quot; y=&quot;280.0&quot; class=&quot;tick&quot; text-anchor=&quot;end&quot;&gt;layer&lt;/text&gt;
&lt;text x=&quot;46.0&quot; y=&quot;296.0&quot; class=&quot;tick&quot; text-anchor=&quot;end&quot;&gt;&amp;#945;*&lt;/text&gt;
&lt;polyline class=&quot;line-b&quot; points=&quot;87.5,76.4 134.5,52.3 181.5,48.9 228.5,182.9 275.5,244.8 322.5,251.7 369.5,253.4 416.5,229.3 463.5,203.6 510.5,250.0 557.5,98.7 604.5,79.8&quot; /&gt;
&lt;circle class=&quot;b ring&quot; cx=&quot;87.5&quot; cy=&quot;76.4&quot; r=&quot;4.5&quot;&gt;&lt;title&gt;Layer 1: 84.4% truncated&lt;/title&gt;&lt;/circle&gt;
&lt;circle class=&quot;b ring&quot; cx=&quot;134.5&quot; cy=&quot;52.3&quot; r=&quot;4.5&quot;&gt;&lt;title&gt;Layer 3: 95.3% truncated&lt;/title&gt;&lt;/circle&gt;
&lt;circle class=&quot;b ring&quot; cx=&quot;181.5&quot; cy=&quot;48.9&quot; r=&quot;4.5&quot;&gt;&lt;title&gt;Layer 5: 96.9% truncated&lt;/title&gt;&lt;/circle&gt;
&lt;circle class=&quot;b ring&quot; cx=&quot;228.5&quot; cy=&quot;182.9&quot; r=&quot;4.5&quot;&gt;&lt;title&gt;Layer 7: 35.9% truncated&lt;/title&gt;&lt;/circle&gt;
&lt;circle class=&quot;b ring&quot; cx=&quot;275.5&quot; cy=&quot;244.8&quot; r=&quot;4.5&quot;&gt;&lt;title&gt;Layer 9: 7.8% truncated&lt;/title&gt;&lt;/circle&gt;
&lt;circle class=&quot;b ring&quot; cx=&quot;322.5&quot; cy=&quot;251.7&quot; r=&quot;4.5&quot;&gt;&lt;title&gt;Layer 11: 4.7% truncated&lt;/title&gt;&lt;/circle&gt;
&lt;circle class=&quot;b ring&quot; cx=&quot;369.5&quot; cy=&quot;253.4&quot; r=&quot;4.5&quot;&gt;&lt;title&gt;Layer 13: 3.9% truncated&lt;/title&gt;&lt;/circle&gt;
&lt;circle class=&quot;b ring&quot; cx=&quot;416.5&quot; cy=&quot;229.3&quot; r=&quot;4.5&quot;&gt;&lt;title&gt;Layer 15: 14.8% truncated&lt;/title&gt;&lt;/circle&gt;
&lt;circle class=&quot;b ring&quot; cx=&quot;463.5&quot; cy=&quot;203.6&quot; r=&quot;4.5&quot;&gt;&lt;title&gt;Layer 17: 26.6% truncated&lt;/title&gt;&lt;/circle&gt;
&lt;circle class=&quot;b ring&quot; cx=&quot;510.5&quot; cy=&quot;250.0&quot; r=&quot;4.5&quot;&gt;&lt;title&gt;Layer 19: 5.5% truncated&lt;/title&gt;&lt;/circle&gt;
&lt;circle class=&quot;b ring&quot; cx=&quot;557.5&quot; cy=&quot;98.7&quot; r=&quot;4.5&quot;&gt;&lt;title&gt;Layer 21: 74.2% truncated&lt;/title&gt;&lt;/circle&gt;
&lt;circle class=&quot;b ring&quot; cx=&quot;604.5&quot; cy=&quot;79.8&quot; r=&quot;4.5&quot;&gt;&lt;title&gt;Layer 23: 82.8% truncated&lt;/title&gt;&lt;/circle&gt;
&lt;rect class=&quot;a&quot; x=&quot;64&quot; y=&quot;4&quot; width=&quot;14&quot; height=&quot;14&quot; rx=&quot;3&quot; /&gt;
&lt;text x=&quot;84.0&quot; y=&quot;16.0&quot; class=&quot;tick&quot;&gt;accuracy, % (two best layers solid)&lt;/text&gt;
&lt;line class=&quot;line-b&quot; x1=&quot;364&quot; y1=&quot;11&quot; x2=&quot;388&quot; y2=&quot;11&quot; /&gt;
&lt;circle class=&quot;b ring&quot; cx=&quot;376&quot; cy=&quot;11&quot; r=&quot;4.5&quot; /&gt;
&lt;text x=&quot;396.0&quot; y=&quot;16.0&quot; class=&quot;tick&quot;&gt;truncated, %&lt;/text&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;figcaption&gt;&lt;b&gt;Single-layer edits on the screening set.&lt;/b&gt; Bars show accuracy and the line shows the share of truncated answers. Early layers and the last two fail; every layer from 9 to 19 reaches 52 to 64%, against 14% for the base model.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;The two best layers are 13 and 19. Together they reach 61.7%, below layer 13 alone, so the rule keeps layer 13 with \(\alpha^{*} = 11.8\).&lt;/p&gt;

&lt;p&gt;On the test sets, this fully automatic edit &lt;strong&gt;matches&lt;/strong&gt; the agent’s edit. On MATH-500 it reaches 49.6%, 0.4 points above (CI −3.4 to 4.2); on GSM8K it reaches 67.4%, 1.0 point below (CI −3.3 to 1.4). It ends more loops than any other edit, truncating only 10.2% of MATH-500 answers. But its finished answers are less often correct, 55.0% against 72.3%. One layer at strength 11.8 ends the thinking too early on some problems the model could have solved. The closed-form strength closes the gap between the two states but does not weigh that cost.&lt;/p&gt;

&lt;h2 id=&quot;what-this-does-not-show&quot;&gt;What this does not show&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;One model.&lt;/strong&gt; I tested Qwen3.5-0.8B on two math benchmarks. I do not know whether the rule transfers to other models or sizes.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;The agent found the idea.&lt;/strong&gt; The closure direction came from reading the agent’s edit, and CLC-sel’s lead depends on the agent’s layers and strength. The automatic version matches the agent but does not beat it.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;The search had a cost.&lt;/strong&gt; The final rule runs in 84 GPU-minutes, but finding it took about 40 more runs on practice problems. Each test set was used to confirm two successive methods, which may favor the second.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Finishing, not reasoning.&lt;/strong&gt; The edit fixes loops. With thinking off, the base model reaches 45.8% on MATH-500 with a fifth of the tokens, so the edit matters most when thinking mode is needed.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Untested.&lt;/strong&gt; General tasks such as instruction following, CLC-sel in non-thinking mode, and an activation-steering baseline that adds \(\mathbf{u}\) at every token. The closure state is a mean over only 43 answers, and each run draws one sample per problem.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;how-the-study-was-run&quot;&gt;How the study was run&lt;/h2&gt;

&lt;p&gt;Every test-set comparison was written down with its pass condition before it ran, in a protocol and addenda frozen with their hashes. There were 18 such comparisons, and 5 failed, including both tests of my first method: CRD gained 9.0 points over the base model against a target of 20, and fell 32.8 points short of the agent’s edit. The &lt;a href=&quot;https://github.com/zichuanxu/closing-the-loop/tree/main/study&quot;&gt;study record&lt;/a&gt; keeps all of them, failures included.&lt;/p&gt;

&lt;p&gt;All method decisions used practice problems drawn from the MATH and GSM8K training sets, checked for overlap with the test sets by id, by text and for near duplicates. Two independent audits re-graded the answers and re-ran the statistics. The full texts and grades of all 69 runs are on &lt;a href=&quot;https://huggingface.co/datasets/zichuanxu/closing-the-loop-generations&quot;&gt;Hugging Face&lt;/a&gt;, and every number above can be checked against them.&lt;/p&gt;

&lt;h2 id=&quot;try-it&quot;&gt;Try it&lt;/h2&gt;

&lt;p&gt;The edited model runs anywhere Qwen3.5-0.8B runs. With vLLM, using the evaluation’s settings:&lt;/p&gt;

&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;vllm&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;LLM&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SamplingParams&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;llm&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;LLM&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;zichuanxu/Qwen3.5-0.8B-CLC-sel&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;params&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SamplingParams&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;temperature&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0.6&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;top_p&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0.95&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;top_k&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;presence_penalty&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;1.5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;max_tokens&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;32768&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;problem&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;What is the smallest positive integer n such that 3n is a perfect square and 2n is a perfect cube?&quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;prompt&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;problem&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot; Please reason step by step, and put your final answer within &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\\&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;boxed{}.&quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;out&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;llm&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;chat&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([{&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;role&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;user&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;content&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;prompt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}],&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;chat_template_kwargs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;enable_thinking&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;outputs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To rebuild the edit from the base model, bit for bit:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git clone https://github.com/zichuanxu/closing-the-loop &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;closing-the-loop
uv &lt;span class=&quot;nb&quot;&gt;sync
&lt;/span&gt;uv run &lt;span class=&quot;nt&quot;&gt;--extra&lt;/span&gt; model python &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; clc_sel.apply edits/clc_sel.json &lt;span class=&quot;nt&quot;&gt;--out&lt;/span&gt; ckpt/clc_sel
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;what-i-take-from-this&quot;&gt;What I take from this&lt;/h2&gt;

&lt;p&gt;The agent spent 20 hours and found something real: a loop can be closed by pushing the model toward the state in which it finishes, through a handful of neurons. Once that mechanism is written down, a fixed rule applies it better, in a fraction of the time, and in a form anyone can check and rerun.&lt;/p&gt;

&lt;p&gt;That suggests a division of labor. Agents that read weights are good at finding mechanisms. Rules are good at applying them. The most useful output of an agent like this may be the mechanism it finds, more than the edit it writes.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;If you use this work, please cite it:&lt;/p&gt;

&lt;div class=&quot;language-bibtex highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nc&quot;&gt;@misc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;xu2026closingtheloop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;title&lt;/span&gt;  &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;{Closing the Loop: A Simple Rule Beats an Agent-Written Weight Edit for Reasoning Loops}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;author&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;{Xu, Zichuan}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;year&lt;/span&gt;   &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;{2026}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;url&lt;/span&gt;    &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;{https://github.com/zichuanxu/closing-the-loop}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The Astra edit, its logs and the evaluation protocol are by &lt;a href=&quot;https://rikiyat.github.io/blog/weight-space-programming/&quot;&gt;Takehi et al. (2026)&lt;/a&gt;. Thanks to them for releasing all three.&lt;/p&gt;
</content>
  </entry>
</feed>
