<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://lohitha0607.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://lohitha0607.github.io/" rel="alternate" type="text/html" /><updated>2026-11-27T07:17:17+00:00</updated><id>https://lohitha0607.github.io/feed.xml</id><title type="html">Lohitha Naidu</title><subtitle>Building RL environments, agents and evals from scratch.</subtitle><author><name>Lohitha Naidu</name></author><entry><title type="html">Watching a looped transformer think: where the hidden reasoning step lives</title><link href="https://lohitha0607.github.io/2026/11/27/looped-reasoning.html" rel="alternate" type="text/html" title="Watching a looped transformer think: where the hidden reasoning step lives" /><published>2026-11-27T00:00:00+00:00</published><updated>2026-11-27T00:00:00+00:00</updated><id>https://lohitha0607.github.io/2026/11/27/looped-reasoning</id><content type="html" xml:base="https://lohitha0607.github.io/2026/11/27/looped-reasoning.html"><![CDATA[<p>Thinking Machines built Inkling 2 Mini, a “looped” language model that reuses the same layers three times for every word. In their post, they asked researchers to study what actually happens inside those loops. I wanted to answer one simple question: when a looped model reasons, does each loop do one step?</p>

<p>I tested it twice: first on a tiny looped model I built myself, then on the real Inkling 2 Mini. The short answer is no, not one step per loop. But on the real model I found where the hidden reasoning step lives, and that each loop makes it stronger.</p>

<hr />

<h2 id="what-is-a-looped-transformer">What is a looped transformer?</h2>

<p>A normal language model passes each word up through a stack of layers, like floors in a building. Every layer is different, and more layers means more “thinking rounds”, but also a bigger model.</p>

<p>A looped model reuses the same layers again and again instead of adding more. Inkling 2 Mini has 24 layers: the first few run once (the “prelude”, which reads the question), the middle twelve run three times (the loop, where the thinking happens), and the last few run once (the “coda”, which writes the answer). So each word passes through 48 layer steps, using only 24 layers’ worth of weights.</p>

<p><img src="/assets/looped/looped_vs_normal.png" alt="A normal transformer next to a looped one" /></p>

<p>More thinking, no extra weights. But nobody had shown what the extra loops actually do.</p>

<h2 id="the-question-and-the-puzzle">The question, and the puzzle</h2>

<p>To see reasoning steps, I needed a task with clear steps where I know every step’s answer. I used chains of friends:</p>

<blockquote>
  <p>Anna’s friend is Tom. Tom’s friend is Sara. Sara’s friend is Ben.
Who is the friend of the friend of Anna?</p>
</blockquote>

<p>To answer “Sara”, the model first has to work out “Tom” in its head. Each arrow is one step, called a “hop”, and the middle answer (Tom) is the hidden step: the model needs it, but never writes it. The names are made up, so the model can’t remember the answer; it has to follow the chain. I also added a few distracting facts about other people.</p>

<p>The hope was simple: loop 1 finds Tom, loop 2 finds Sara.</p>

<p>To look inside, I used probes. A probe is a tiny reader trained on the model’s internal numbers (its “thought” at one point) to answer a question like “which person is the hidden step?”. If the probe can read Tom from the thought after loop 1, the model is holding that step there. To keep it honest, I always compared against a control: a name that appears in the puzzle but is not on the path. If the probe reads both equally well, it’s only detecting “names that were mentioned”, not reasoning.</p>

<hr />

<h2 id="part-1-a-tiny-looped-model-built-from-scratch">Part 1: a tiny looped model, built from scratch</h2>

<p>I started small, with a looped model I built myself: a few transformer blocks, where one middle block is reused four times, next to a normal model with four different blocks for comparison.</p>

<p>Getting it to solve the puzzle took four tries, and every failure was a lesson:</p>
<ul>
  <li><strong>Too hard to start:</strong> with all puzzle lengths mixed from the beginning, it learned nothing. I switched to a curriculum: one-step puzzles first, longer ones later.</li>
  <li><strong>A shortcut:</strong> it got stuck at exactly 50%. It had learned “the answer is the letter after the start of a chain”, without even reading the question. There were two chains, so it was guessing between two answers. I made the questions start at a random point in the chain.</li>
  <li><strong>The wrong format:</strong> with each fact spread over several tokens, the tiny model couldn’t connect them. When I gave each fact its own position, it jumped to 100% on 1 to 4 steps within a few minutes of training.</li>
</ul>

<p>Then I probed it after every loop. The result was clear, and repeated across three training seeds:</p>

<ul>
  <li><strong>Each loop does at most one step.</strong> I never saw a loop do two dependent steps at once at the question.</li>
  <li><strong>The model uses only as many loops as it needs.</strong> A version with only 2 loops worked just as well as 4, and in three of five models, switching off all but one loop barely changed the accuracy.</li>
  <li><strong>When it can, it avoids looping.</strong> The facts were quietly combining with each other (“Anna → Tom” plus “Tom → Sara” became “Anna → Sara”), a known trick called pointer jumping. That let the model skip steps in parallel, so the extra loops sat idle. When I blocked that trick, each step finally happened one at a time, but the model still used only the loops it needed.</li>
</ul>

<p>So in the toy model: not one step per loop. Loops are used only when there’s no shortcut.</p>

<hr />

<h2 id="part-2-inside-the-real-inkling-2-mini">Part 2: inside the real Inkling 2 Mini</h2>

<p>Inkling 2 Mini is far too big for my laptop, so I ran it through NDIF, a research service that hosts large models and lets you read their insides with a library called nnsight.</p>

<p><strong>First, a quick look with the “logit lens”.</strong> This trick takes a thought from the middle of the model and runs it through the model’s own final word-picker: “if the model had to speak right now, what would it say?” On simple questions, the answer only appeared around layers 10–12, during the second and third loop runs (first at layer 12). The first loop run showed nothing.</p>

<p><strong>The loops are not idle.</strong> I compared the model’s thought at the same layer between loop runs. The last loop run changed the thought the most, and it did so the same way whether the model got the answer right or wrong, like a fixed routine. When I made the third loop run do nothing, the model broke completely: on simple questions it went from 90% correct to 0%.</p>

<p><strong>The puzzles were hard for it.</strong> Without writing out its thinking, Inkling solved about 80% of one-step questions, 37% of two-step ones and 17% of three-step ones.</p>

<p><strong>Looking at the last word showed almost nothing.</strong> My first probes read the thought at the last word of the question, where the model is about to answer. The hidden person was only faintly readable there, about twice the control.</p>

<p><strong>A better lens didn’t help with hidden steps.</strong> I also trained a “tuned lens”, a small translator per layer that makes middle thoughts readable as words. It read the model’s upcoming answer far better than the basic logit lens (around 50–70% agreement with the model’s real prediction, versus 1–25%). But it could not see the hidden step. That makes sense: a tuned lens is trained to predict what the model is about to say, and the hidden step is never said. To find a hidden step, you need a reader trained on the hidden step itself.</p>

<h3 id="where-the-hidden-step-lives">Where the hidden step lives</h3>

<p>So I tried reading in different places. For each of 590 two-step puzzles, I read Inkling’s thought at four positions in the question: at the start name (“Anna”), at the question mark, at the end of the question, and at the last word.</p>

<p><img src="/assets/looped/hidden_step.png" alt="Where the hidden step shows up at layer 12" /></p>

<p>At the start name, at layer 12, the hidden person became clearly readable, and more so with every loop run: 36%, then 41%, then 46%, while the control name stayed around 7–9% (chance is 6%). At the question mark, it peaked in the second loop run and then dropped. At the end of the question and at the last word, it stayed weak, which is why my first probes saw so little.</p>

<p>In plain words: Inkling seems to work out the hidden step right where the starting name appears in the question, at layer 12, and each pass through the loop makes it stronger. It isn’t “one step per loop”. It’s one step, built up gradually across the loops, in one specific place. Layer 12 is also where the logit lens first found answers, so two different methods point to the same spot.</p>

<hr />

<h2 id="what-i-learned">What I learned</h2>

<ol>
  <li><strong>Models love shortcuts.</strong> I ran into four different ones. A correct answer tells you nothing about how the model got there, so check the how.</li>
  <li><strong>How you present a task can matter more than the model.</strong> The same tiny model went from 12% to 100% when I changed how the facts were written.</li>
  <li><strong>Look in the right place.</strong> The signal was at the start name, not at the last word, where everyone looks first.</li>
  <li><strong>Always use a control.</strong> The off-path name kept me from fooling myself.</li>
  <li><strong>Different tools answer different questions.</strong> The logit lens and tuned lens read what the model is about to say; a probe trained on the hidden step reads what it is thinking but not saying.</li>
</ol>

<h2 id="limits-and-next-steps">Limits and next steps</h2>

<p>These are early findings. The Inkling results come from 590 puzzles, simple linear probes, and 12 sampled points inside the model, and Inkling only solved 38% of these puzzles without writing out its thinking. A probe also shows that information is readable, not that the model uses it. Next, I want to:</p>
<ul>
  <li>probe all twelve looped layers at the start-name position, to see exactly where the step forms</li>
  <li>repeat it on a fresh set of puzzles</li>
  <li>run causal tests: change the hidden step at layer 12 and check whether the model’s answer changes. That would show the model actually uses it.</li>
</ul>

<h2 id="code">Code</h2>
<p>Everything is open: the toy model, the probes and the Inkling scripts are at <a href="https://github.com/Lohitha0607/looped-reasoning">https://github.com/Lohitha0607/looped-reasoning</a>, with a notebook you can run for free in Colab. The trained tuned lens is on Hugging Face: <a href="https://huggingface.co/loh0607/inkling-2-mini-tuned-lens">https://huggingface.co/loh0607/inkling-2-mini-tuned-lens</a>.</p>

<h2 id="thanks">Thanks</h2>
<ul>
  <li>Thinking Machines, for Inkling 2 Mini and for asking this question in the open</li>
  <li>NDIF and nnsight, for free access to the model</li>
  <li>Goodfire, whose early analysis of Inkling helped me know where to look</li>
</ul>

<p>If you’re working on looped models or interpretability, I’d love to hear from you:</p>
<ul>
  <li>GitHub: <a href="https://github.com/Lohitha0607">https://github.com/Lohitha0607</a></li>
  <li>X: <a href="https://x.com/Loh0607">https://x.com/Loh0607</a></li>
  <li>Hugging Face: <a href="https://huggingface.co/loh0607">https://huggingface.co/loh0607</a></li>
</ul>]]></content><author><name>Lohitha Naidu</name></author><summary type="html"><![CDATA[Thinking Machines built Inkling 2 Mini, a “looped” language model that reuses the same layers three times for every word. In their post, they asked researchers to study what actually happens inside those loops. I wanted to answer one simple question: when a looped model reasons, does each loop do one step?]]></summary></entry><entry><title type="html">Weight Doctor: testing how well LLMs repair broken models without retraining (by editing their weights)</title><link href="https://lohitha0607.github.io/2026/11/26/weight-doctor.html" rel="alternate" type="text/html" title="Weight Doctor: testing how well LLMs repair broken models without retraining (by editing their weights)" /><published>2026-11-26T00:00:00+00:00</published><updated>2026-11-26T00:00:00+00:00</updated><id>https://lohitha0607.github.io/2026/11/26/weight-doctor</id><content type="html" xml:base="https://lohitha0607.github.io/2026/11/26/weight-doctor.html"><![CDATA[<p>The MIT post <a href="https://rikiyat.github.io/blog/weight-space-programming">Weight-Space Programming</a> showed that a big AI can repair a small AI by editing its weights directly, without retraining it. But it was a single demo, and no fair test existed. So I built an open RL environment that measures how well any AI can do this, and used it to test and train AI “doctors”.</p>

<p>The open question was: how good are AIs at this, in general, and can it be measured fairly?</p>

<hr />

<h2 id="how-it-started">How it started</h2>

<p>I came across a blog post from MIT, “Weight-Space Programming”, that showed something surprising: a big LLM could fix a small LLM, not by retraining it, but by directly editing its weights. In their experiment, GPT-6 Astra fixed Qwen3.5-0.8B’s maths by changing just 0.016% of its weights, and its score on MATH-500 (a standard test of 500 competition-style maths problems) jumped from 7.9% to 48.1%, with no training at all.</p>

<p>That idea excited me. Retraining a model takes GPUs, money and time. If a big model can repair a small one with a handful of precise edits instead, we could save a lot of all three.</p>

<p>But it was one impressive demo, by one AI. The authors themselves said they were still building a benchmark for it. There was no open, fair way to measure how good AIs actually are at this. So I decided to build one: an RL environment where a big AI “doctor” repairs a small, broken AI “patient” by editing its weights directly, and gets graded on data it never sees.</p>

<p>One distinction matters here: the patient is never retrained, which is what keeps each fix cheap. The doctor can be trained, once, to get better at fixing, just like a doctor goes through medical school once and then treats thousands of patients.</p>

<hr />

<h2 id="the-idea-in-simple-words">The idea in simple words</h2>

<p>Let’s say the big LLM is a <strong>doctor</strong>, and the small, broken AI is its <strong>patient</strong>. The doctor’s job is to cure the patient’s illness by directly editing its weights, using a few tools I give it inside my RL environment.</p>

<p><strong>How does the doctor find out what’s wrong?</strong> Just like a real doctor, it examines the patient first. It has two kinds of tools for this:</p>
<ul>
  <li><strong>looking</strong>: an overview of how big the weights are in each part of the patient (a damaged part often looks unusual), and a closer look at one part</li>
  <li><strong>testing</strong>: running the patient and measuring how well it works right now: how “surprised” it is by normal sentences, how it does on a short fact quiz, what it writes, and what happens when one part is switched off</li>
</ul>

<p>Tests are limited: the doctor gets a budget of 10, so it has to think before it tests, like a real doctor who can’t order every scan in the hospital.</p>

<p><strong>How does the doctor treat the patient?</strong> With editing tools that change the weights directly, mainly making one part of the patient louder or quieter by multiplying its weights by a number. No retraining, just a few precise edits.</p>

<p><strong>How do we know the patient is really cured?</strong> With medical tests the doctor never sees. After the doctor says it’s done, my environment checks the patient on <strong>hidden</strong> data. The score is mostly about how much of the lost health came back (80%), plus a bonus for a clean cure that didn’t touch healthy parts (20%).</p>

<p>The data has to be hidden. If the doctor could see the exam, it could “cure” the patient just for those exact questions, the way a student who memorises the answer key doesn’t really learn anything.</p>

<p>Before trusting any of this, I tested the test itself: a perfect doctor that undoes the damage exactly scores 1, and a doctor that does nothing scores 0, on every patient.</p>

<hr />

<h2 id="building-it">Building it</h2>

<h3 id="meet-the-cast">Meet the cast</h3>
<p>Every hospital story needs characters. Here are mine:</p>
<ul>
  <li><strong>The little patient</strong>: a tiny digit reader I built and trained myself. Just 2,410 weights. Perfect for practice.</li>
  <li><strong>The real patient</strong>: Qwen3-0.6B, a real open-weights LLM with 596 million weights, running on my Mac.</li>
  <li><strong>The senior doctors</strong>: big LLMs, both closed and open: GPT-6 Astra, Claude Haiku and Sonnet, NVIDIA’s Nemotron models, DeepSeek, ERNIE and dots-3. I called them through OpenRouter, so I never needed my own GPU to run them.</li>
  <li><strong>The student doctor</strong>: Qwen3 4B, a small model I tried to train into a better doctor.</li>
  <li><strong>The dice</strong>: a fake doctor with no brain, a little program I wrote (<code class="language-plaintext highlighter-rouge">random_doctor.py</code>) that picks everything randomly. It gets exactly what the AI doctors get: the same tools, the same patients, the same 10-test budget. But instead of thinking, it rolls dice at every step:</li>
</ul>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>roll → "test the quiz"
roll → "flip floor 17 back" (multiply by −1)
roll → "make floor 3 louder"
roll → "done"
</code></pre></div></div>

<p>Why build a doctor with no brain? To know what a score actually means. Imagine an AI scores 0.67. Is that good? If the dice also score 0.65, the AI is barely better than luck. If the dice score 0.11, the AI is really doing something smart. (I ran the dice 10 times and averaged the scores.)</p>

<h3 id="why-start-with-a-tiny-patient">Why start with a tiny patient?</h3>
<p>Before spending any money on GPUs, I wanted to get the exam itself right. A tiny patient trains in seconds on a normal laptop CPU, and grading it takes milliseconds. So I could build the hospital, break patients, try doctors and fix my own mistakes quickly and almost for free. Only once the exam worked did I move on to a real LLM.</p>

<h3 id="inside-the-real-patient-a-28-floor-building">Inside the real patient: a 28-floor building</h3>
<p>Here’s how I picture an LLM. Think of it as an office building with 28 floors. Each word comes in at the ground floor and travels up, and every floor improves the building’s understanding a little.</p>

<p>Each floor has two rooms:</p>
<ul>
  <li><strong>the looking room</strong> (attention): the words look at each other for context, like people in a meeting looking around the table (“bank” next to “river” means something different from “bank” next to “money”)</li>
  <li><strong>the thinking room</strong> (the MLP): each word thinks about what it gathered and adds knowledge, like “Paris → France”</li>
</ul>

<p><img src="/assets/wsp/llm_vs_building.png" alt="The real LLM next to the 28-floor building" /></p>

<p>The building has 596 million numbers, so no doctor can check them one by one. Instead, a doctor checks whole floors: “hmm, this floor’s thinking room is 10 times louder than all the others…”</p>

<h3 id="making-the-patients-sick">Making the patients sick</h3>
<p>To make a patient, I took the healthy building and broke the thinking room on one floor, by multiplying its last set of weights (the part that writes the floor’s message out) by a number:</p>
<ul>
  <li><strong>too loud</strong> (× 10): that floor shouts over everyone else, and the patient talks gibberish</li>
  <li><strong>dead</strong> (× 0.01): that floor goes almost silent. The other floors often cover for it, so the patient seems fine… until you ask it facts. With one silenced floor, it started saying things like “France is the capital of Belgium”</li>
  <li><strong>flipped</strong> (× −1): that floor says the exact opposite of what it should. This is the sneaky one: its weights are the same size as before, so just looking at the building shows nothing unusual. The only way to find it is to run the patient and test it</li>
</ul>

<p><img src="/assets/wsp/illnesses.png" alt="The three illnesses" /></p>

<p>That’s the key difference in my whole exam: <strong>visible damage</strong> (loud and dead floors look unusual) versus <strong>hidden damage</strong> (flipped floors look normal). Keep this in mind, because it’s exactly where the doctors split apart. (The little patient had its own six illnesses, from flipped and silenced parts to two “answer” neurons swapped with each other, and the same split showed up there.)</p>

<h3 id="the-exam-got-better-three-times">The exam got better three times</h3>
<p>My exam didn’t come out right the first time. It improved in three versions, each one because a patient or a doctor showed me something I’d missed:</p>
<ul>
  <li><strong>v1: one health check.</strong> I measured how “surprised” the patient was by normal sentences (if it’s surprised by ordinary English, something is wrong).</li>
  <li><strong>v2: add a fact quiz.</strong> The dead floor taught me that surprise isn’t enough: the patient sounded almost normal (its surprise barely moved, from 10 to 11), yet it was confidently stating false facts. So I added a multiple-choice fact quiz (“The capital of Japan is… Tokyo / Paris / Cairo / Lima”). The healthy patient gets 88% on the hidden version. Now a fix only counts if the patient both talks normally and knows its facts again.</li>
  <li><strong>v3: close a loophole.</strong> GPT-6 Astra was the only doctor to cure a hidden flipped floor, but when I read how it did it, I saw it was using the <code class="language-plaintext highlighter-rouge">write</code> tool (letting the patient write a few words) as a free, unlimited test, which quietly skipped my 10-test budget. Clever, but not fair. So in v3, <code class="language-plaintext highlighter-rouge">write</code> counts as a test too. Then I tested the test again: perfect doctor = 1, doing nothing = 0.</li>
</ul>

<p>Every fix to the exam came from reading what actually happened, not just looking at the scores.</p>

<hr />

<h2 id="what-the-ai-doctors-did">What the AI doctors did</h2>

<h3 id="round-1-the-little-patient">Round 1: the little patient</h3>
<p>On the little digit reader, almost every doctor handled the visible damage. The hidden kind was a different story:</p>
<ul>
  <li><strong>GPT-6 Astra</strong> was the star: it cured the hidden flipped parts and the swapped neurons perfectly, by working systematically: flip one part, test, keep it if the patient improved.</li>
  <li><strong>Claude Sonnet</strong> didn’t cure the flips, but it also didn’t pretend: it honestly reported that it couldn’t fix them.</li>
  <li><strong>Claude Haiku</strong> solved the swapped neurons and the rigged answer perfectly.</li>
  <li><strong>DeepSeek</strong> fixed all the visible damage but scored 0 on the hidden flips (0.51 overall), about the same as a simple hand-written rule-based doctor (0.50).</li>
  <li><strong>The free models</strong> (Nemotron, ERNIE, dots-3) all solved the swap, and none solved the flip.</li>
  <li><strong>A small Qwen model running on my laptop</strong> only managed the easy bugs, and once claimed to have made a swap it never actually made.</li>
</ul>

<h3 id="round-2-the-real-patient-qwen3-06b">Round 2: the real patient (Qwen3-0.6B)</h3>
<p>Here’s the final leaderboard, with 3 tries per patient, on 9 hidden-exam patients (floors 2, 6 and 20, each loud, dead or flipped):</p>

<table>
  <thead>
    <tr>
      <th>Doctor</th>
      <th>Score</th>
      <th>Visible damage (loud + dead)</th>
      <th>Hidden flips</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Nemotron 3.5 Super (free)</td>
      <td><strong>0.82</strong></td>
      <td>18/18</td>
      <td>4 of 9</td>
    </tr>
    <tr>
      <td>Claude Haiku 5.5</td>
      <td><strong>0.74</strong></td>
      <td>18/18</td>
      <td>~2 of 9</td>
    </tr>
    <tr>
      <td>Nemotron Lightning (free)</td>
      <td><strong>0.67</strong></td>
      <td>16/18</td>
      <td>~2 of 9</td>
    </tr>
    <tr>
      <td>Qwen3 4B (my student doctor, untrained)</td>
      <td><strong>0.42</strong></td>
      <td>partly</td>
      <td>0</td>
    </tr>
    <tr>
      <td>the dice</td>
      <td><strong>0.11</strong></td>
      <td>about 1 in 10</td>
      <td>partly</td>
    </tr>
  </tbody>
</table>

<p><img src="/assets/wsp/leaderboard.png" alt="Leaderboard" /></p>

<p>(GPT-6 Astra only took the hidden-flip part of an earlier version of the exam, curing 1 of 3, so it isn’t ranked here. The dice score is the average of 10 random runs.)</p>

<p>What each doctor did:</p>
<ul>
  <li><strong>Nemotron Super</strong> came top, and fixed the most hidden flips (4 of 9 tries).</li>
  <li><strong>Claude Haiku</strong> was the fastest and most reliable on visible damage: it fixed all 18 cases in about 4 turns each, for about 3 cents per round of 9 patients. On flips, it often couldn’t find the damage, but it said so honestly (“I could not find or repair the damage”).</li>
  <li><strong>Nemotron Lightning</strong> gave me my favourite failure. In one run it announced “fixed: perplexity 36.05”, but when my exam checked the patient, it was actually at 145, still very sick. It narrated a cure that never happened. Another time, it searched for a flipped floor by checking floors one by one from the top (25, 24, 23… 17) and ran out of tests before reaching floor 2, where the damage was.</li>
  <li><strong>GPT-6 Astra</strong> cured 1 of the 3 hidden flips, and that’s where I caught it using the <code class="language-plaintext highlighter-rouge">write</code> tool as a free test.</li>
  <li><strong>My student doctor</strong> fixed most loud floors, rarely the dead ones, and never a flip. It usually gave up after just a few turns.</li>
  <li><strong>The dice</strong> scored only 0.11 overall, so the AI doctors were 6–7 times better. But here’s the twist: <strong>on the hidden flips, the dice beat both Claude Haiku and Nemotron Lightning</strong> in that round (0.12 vs 0). Why? To fix a flipped floor, you have to actually <em>try</em> flipping it back. The AIs were too careful: they kept running tests and thinking, and never made the bold move. The dice don’t think, so they just try things, and sometimes they get lucky and flip the right floor. The dice revealed the AIs’ blind spot: lots of thinking, not enough trying.</li>
</ul>

<h3 id="what-surprised-me">What surprised me</h3>
<ol>
  <li><strong>Visible vs hidden damage separates doctors.</strong> Everyone handles “loud” and “dead”; very few can find a “flip”, because finding it means running experiments, not just reading numbers.</li>
  <li><strong>Smart agents find loopholes.</strong> Astra didn’t break my rules, it found a gap in them. Fix the environment, not the agent.</li>
  <li><strong>Narration is not the same as the result.</strong> Always grade the patient, never the doctor’s own report.</li>
</ol>

<h3 id="so-could-i-train-a-better-doctor">So… could I train a better doctor?</h3>
<p>The senior doctors were good at visible damage and weak at hidden damage, and my little student doctor was weaker still (0.42). So the next question was obvious: can I <em>teach</em> the student to be a better doctor? I tried two ways. First, <strong>GEPA</strong>, which only improves the student’s instructions without changing its weights. Then <strong>GRPO</strong>, real reinforcement learning, which changes the student’s weights by letting it practise on patients and rewarding good fixes.</p>

<hr />

<h2 id="teaching-a-small-ai-to-be-a-better-doctor">Teaching a small AI to be a better doctor</h2>

<p>My student doctor, Qwen3 4B, started at <strong>0.42</strong> on the hidden exam. I wanted to see if I could make it better, using the same environment as a training gym instead of just an exam.</p>

<h3 id="attempt-1-better-instructions-gepa">Attempt 1: better instructions (GEPA)</h3>
<p>GEPA doesn’t change the student’s weights at all. A bigger “teacher” AI watches the student’s mistakes and rewrites its instructions, like a tutor rewriting a cheat sheet. It sounded perfect. The result: <strong>0.25</strong>, worse than before! When I read the new instructions, I found out why: the teacher had written a confident but wrong hint (“for a loud floor, multiply by 0.1–0.5”), and the student followed it, making half-fixes. GEPA had chosen these instructions after checking them on only 4 practice patients, too few to catch the mistake. When I corrected just that one hint by hand (“undo the damage exactly”), the student reached <strong>0.52</strong>.</p>

<h3 id="attempt-2-real-reinforcement-learning-grpo">Attempt 2: real reinforcement learning (GRPO)</h3>
<p>Next, real RL. With GRPO, the student tries several fixes for the same patient, my environment scores each one, and the student learns to do more of what scored better than its own average. To keep it free, I trained on Kaggle’s free GPUs, in a simpler “one-shot” format: the student reads the patient’s numbers once and writes its fixes in one go.</p>

<p><strong>Run 1 learned nothing.</strong> After 150 training steps, the exam score went from 0.42 to 0.39. The training logs told me why: all 4 of the student’s attempts for each patient were exactly the same short answer. GRPO learns by comparing attempts, so if every attempt is identical, there’s nothing to compare, and nothing to learn.</p>

<p><strong>Run 2 worked.</strong> I changed four things, each for a reason:</p>
<ul>
  <li>the student writes one short line of reasoning before its fix, so its answers can differ and improve</li>
  <li>8 attempts per patient instead of 4</li>
  <li>more randomness when it answers (temperature 1.2), so it explores</li>
  <li>a “closeness” bonus, so a near-miss scores better than a wild miss</li>
</ul>

<p>After 1 hour 50 minutes on free GPUs, the student went from <strong>0.385 to 0.783</strong> on the hidden exam, <strong>twice as good</strong>. It now reasons like “floor 6 is 100 times quieter than its neighbours, so multiply it by 100”, and it cured all 12 dead-floor cases. It wasn’t perfect: on one loud floor, it read the wrong row of the table every time. Training fixes what the reward sees, not everything.</p>

<h3 id="the-twist-it-didnt-transfer">The twist: it didn’t transfer</h3>
<p>Then I gave the trained student the real exam, where it has to have a conversation with the tools: examine, test, edit, check. It scored <strong>0.34</strong>, lower than the untrained student’s 0.42. It had learned the practice format (“read a table, write one fix”), not how to work through a real conversation with tools. Gains on a simplified task don’t automatically carry over.</p>

<h3 id="next-training-on-the-real-exam">Next: training on the real exam</h3>
<p>The proper fix is to train on the real conversation format (multi-turn RL). I ran a first small test of this on a rented A100 GPU: the pipeline works end to end, but the run was too short to tell whether it helps. That’s my next step, with a bigger budget.</p>

<hr />

<h2 id="lessons">Lessons</h2>

<p>Here are the four lessons I’d tell anyone building an RL environment or training with RL:</p>

<p><strong>1. RL needs variety.</strong> If a model always gives the same answer, it can never discover a better one. My first training run learned nothing because every attempt was identical. Giving the student room to reason and a bit more randomness fixed it, and doubled its score.</p>

<p><strong>2. The reward must measure exactly what you want.</strong> My student once “fixed” a floor that was 10 times too loud by making it 100 times quieter. Now it was 10 times too quiet, and it still got 0.95 of the reward! Why? The other floors have backups, so a too-quiet floor barely hurts the patient. So the reward was really measuring “is the patient talking normally again?”, not “is the floor repaired?”. It’s like rewarding a puppy for being quiet: it might learn to hide under the bed instead of sitting calmly. Training finds whatever shortcut your reward allows (Goodhart’s law: when a measure becomes a target, it stops being a good measure).</p>

<p><strong>3. A confident wrong hint is worse than no hint.</strong> The GEPA teacher wrote instructions with one wrong number in them, and my student followed them straight to a worse score (0.42 → 0.25). Only the hidden exam caught it. If you let an AI write instructions for another AI, test the result on data neither of them has seen.</p>

<p><strong>4. Always compare with the dice, and run several tries.</strong> A random baseline tells you whether a score means anything, and mine even showed me the AI doctors’ blind spot. And one try can mislead in both directions: with one try per patient, Nemotron Lightning looked like it “never fixed a flip”; with three, it fixed flipped floor 20 in two out of three. Run several tries and look at the spread.</p>

<h3 id="weird-things-i-learned-along-the-way">Weird things I learned along the way</h3>
<p>Some facts surprised me while building this. Most people don’t know them:</p>
<ul>
  <li><strong>Tiny edits, huge effects.</strong> The MIT experiment changed just 0.016% of a model’s weights and its maths score jumped from 7.9% to 48.1%. A handful of numbers can matter more than months of training.</li>
  <li><strong>A model can sound perfectly normal while lying.</strong> With one floor almost silenced, my patient’s sentences looked fine, but it calmly said “France is the capital of Belgium”. Fluent doesn’t mean correct, which is why one health check is never enough.</li>
  <li><strong>The bottom floors hold the knowledge; the rest have backups.</strong> (A “floor” is a layer; Qwen3-0.6B has 28 of them.) When I silenced the thinking room (the MLP) of just one layer, layer 2 dropped the fact quiz from 88% to 46%, while any single layer from 4 to 26 barely mattered (86–89%). Why: the early layers build the basic meaning of the words, so everything above depends on them. Each later layer only adds a small correction to a shared running total (the “residual stream”), so if one goes quiet, the others still carry the meaning through. Researchers have seen the same: early layers are often critical, while many later layers can be removed with little loss.</li>
  <li><strong>The first and last tables can be the same table.</strong> Before the first layer, a big table turns each word into numbers (its “ID card”); after the last layer, a table turns the final numbers back into a score for every possible next word. In small models like Qwen3-0.6B, it’s the same table used twice (“weight tying”), because it’s huge: about 155 million numbers, a quarter of the whole model. Break it, and the model can neither read nor write, which is why I never damaged it.</li>
  <li><strong>The reward can go up while the model learns nothing.</strong> During my failed first training run, the average reward rose from 0.36 to 0.52. It looked like learning, but the logs showed the model’s weights never changed at all. The rise was just luck: some patients are easy (loud ones score ~0.95) and some score 0, and each step happened to draw a different mix. Always check that the model actually changed, not just the reward.</li>
</ul>

<h3 id="how-this-connects-back-to-the-mit-post">How this connects back to the MIT post</h3>
<p>Reading the Weight-Space Programming post again after all this, a few things clicked:</p>
<ul>
  <li><strong>No backpropagation, just like them.</strong> Their editor wasn’t allowed to compute gradients or train; it could only read weights, edit them, and run a limited number of tests. My doctors work the same way: look, test (10 times at most), edit. That’s what makes this kind of fix so cheap: no training run at all.</li>
  <li><strong>Testing still matters.</strong> Even their editor ran test passes to check its edits, and in my exam the hidden flips could only be found by running the patient. Reading the numbers alone isn’t enough for the sneaky damage.</li>
  <li><strong>Repairing is not the same as teaching.</strong> They found that editing weights “could remove an obstacle that hid an ability, but it could not add an ability the model lacked”. That’s exactly what my exam measures: every patient started healthy, and the doctor’s job is to remove the obstacle I added.</li>
  <li><strong>Where the edits live.</strong> Their big maths fix was “one direction written by the MLPs of layers 15 and 19”, in the middle of the model. In my patient, silencing a whole middle layer barely hurt its facts. Together, that suggests middle layers are robust to big, blunt damage, yet a small, precise edit there can still change a lot.</li>
</ul>

<h3 id="what-my-results-add">What my results add</h3>
<p>My setup is different from theirs: they used one editor to improve a real weakness, while my doctors repair damage that I created. So my results don’t prove theirs, but they are consistent with their main idea: AIs can restore a model’s lost abilities by editing weights directly, with no gradients and no training (the top doctors cured all 18 visible-damage cases this way), and on the hardest, hidden damage, GPT-6 Astra was again the strongest editor.</p>

<p>On top of that, my exam measured things the post didn’t:</p>
<ul>
  <li><strong>A fair, repeatable test.</strong> Hidden grading data, a 10-test budget, and a check that a perfect doctor scores 1 and a do-nothing doctor scores 0. This is the kind of benchmark the authors said they were still building.</li>
  <li><strong>Many editors, side by side.</strong> Not just one model: a leaderboard from Nemotron 3.5 Super (0.82) and Claude Haiku 5.5 (0.74) down to a small 4B model (0.42) and the dice (0.11), with visible vs hidden damage as the line that separates them.</li>
  <li><strong>A brainless baseline exposes a blind spot.</strong> The dice beat two AI editors on hidden flips (0.12 vs 0), because the AIs tested a lot but rarely committed to a fix.</li>
  <li><strong>Editors cheat and bluff.</strong> One found a loophole in the editing rules, and another reported a cure that never happened (“perplexity 36”, actually 145). An exam must grade the model, never the editor’s own report.</li>
  <li><strong>A small model can be trained to edit better.</strong> With GRPO, my 4B student went from 0.385 to 0.783 on the practice format, though that gain didn’t carry over to the full tool-using exam yet.</li>
</ul>

<hr />

<h2 id="try-it-yourself">Try it yourself</h2>

<p>The exam is public on Prime Intellect’s Environments Hub. You can install it and test your own favourite AI as a doctor:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>prime <span class="nb">env install </span>loh/wsp-llm
</code></pre></div></div>
<ul>
  <li>Environment: <a href="https://app.primeintellect.ai/dashboard/environments/loh/wsp-llm">https://app.primeintellect.ai/dashboard/environments/loh/wsp-llm</a></li>
  <li>Code (both patients, the training scripts and the dice): <a href="https://github.com/Lohitha0607/wsp-env">https://github.com/Lohitha0607/wsp-env</a></li>
</ul>

<h2 id="whats-next">What’s next</h2>
<p>There are still open questions I’d love to answer:</p>
<ol>
  <li><strong>Does real multi-turn training make the student a better doctor?</strong> My small run was too short to tell. With a bigger budget: more training steps, and more test tries to measure the change properly.</li>
  <li><strong>Why do AIs struggle with flips: finding them, or fixing them?</strong> One simple test: tell the doctor which floor is broken. If it then fixes the flip, the hard part is finding it, not editing it.</li>
  <li><strong>A reward that can’t be fooled.</strong> Over-correcting a loud floor still scores 0.95. A better reward would also check that the repaired floor matches its neighbours.</li>
</ol>

<h2 id="thanks">Thanks</h2>
<ul>
  <li>The Weight-Space Programming post (MIT), for the spark: <a href="https://rikiyat.github.io/blog/weight-space-programming">https://rikiyat.github.io/blog/weight-space-programming</a></li>
  <li>Prime Intellect, for Verifiers and the Environments Hub</li>
  <li>Kaggle, for the free GPUs that trained my student doctor</li>
</ul>

<p>If you try the exam, find a bug, or have ideas, I’d love to hear from you:</p>
<ul>
  <li>GitHub: <a href="https://github.com/Lohitha0607">https://github.com/Lohitha0607</a></li>
  <li>X: <a href="https://x.com/Loh0607">https://x.com/Loh0607</a></li>
  <li>Hugging Face: <a href="https://huggingface.co/loh0607">https://huggingface.co/loh0607</a></li>
</ul>]]></content><author><name>Lohitha Naidu</name></author><summary type="html"><![CDATA[The MIT post Weight-Space Programming showed that a big AI can repair a small AI by editing its weights directly, without retraining it. But it was a single demo, and no fair test existed. So I built an open RL environment that measures how well any AI can do this, and used it to test and train AI “doctors”.]]></summary></entry></feed>