Deep Dive · Model Internals

An Agent Programmed One Neuron: What This Experiment Shows, and What It Does Not

Gemma 3 4B keeps wrapping JSON in a markdown fence. An agent, given a language for reading and editing weights, picks one quiet neuron in the last layer, gives it a job, writes three weight operations, predicts the result, tests it, and saves a patch that survives a compile into llama.cpp. No training — and, unusually for this genre, a sealed test set and an honest list of what it failed to check.

AI performs surgery on Gemma — video thumbnail
Video: Chris Hay 20:01 17 November 2026
LARQL weight editing Gemma 3 4B interpretability

🎯 The claim 0:00

The demonstration is small and concrete. Gemma 3 4B, running in llama.cpp, is asked for raw JSON with no code fence and produces a fence every time. The same model, with one patch applied, produces raw JSON. Nothing was retrained.

ElementDetail
Target modelGemma 3 4B instruction-tuned — 34 layers, ~10,240 neurons per MLP block
ToolA language for querying and editing neural networks, plus a patch format
AgentGiven only that language, no direct access to the weights
EditOne neuron in the last layer, three weight operations
TrainingNone
OutcomeThe patch compiles into the model and works in llama.cpp with the tooling out of the loop
Why this is worth a deep dive despite being one person's afternoon: the experiment has a sealed test set, a pre-registered prediction, and a self-critical closing section — three things almost absent from demos of this kind. The method is also genuinely interesting: the agent did not learn anything, it diagnosed a single-token failure and then designed a circuit to fix it.

🔤 LARQL 0:42

The author's own project, and the reason the experiment is possible: a language in which a model's weights are addressable, queryable and patchable.

PropertyValue
Repositorychrishayuk/larql — Apache-2.0, Rust, around 1,200 stars, created March 2026
Self-descriptionA model runtime built on VINDEX3, "an executable, inspectable model format"
ShapeCLI and REPL, plus a Python library
MetaphorQuery a model like a SQL database: ask questions, insert knowledge, run inference
Key commandscapture to see what happens inside during a change; add low rank to write structure into weights
Note what the language is for, because it shapes the whole experiment: his original motive was querying and knowledge insertion, not interpretability research. The agent inherits a vocabulary of database operations — update, where, capture, apply, revert — and that vocabulary is a large part of why it could plan the edit at all.

✋ An edit by hand 2:54

Before the agent, a manual demonstration of the instrument, and it is a small masterclass in why weight editing feels like it should not work.

StepObservation
Ask for the top five predictions after "The capital of France is"Paris, 81.11%
Run an update: set a delta of 4 on a small block of weights in layer 20's MLP down-projectionDeliberately random numbers, no intelligence claimed
Re-run inferenceParis falls — the model is less sure, because you changed the arithmetic
Discard the stored operationBack to 81.11%
Re-apply and remove the saved patch80.96%, then back up — reversible and repeatable
Two lessons in one minute. First, weights are just numbers and changing them moves predictions in proportion to what they participate in — no mysticism required. Second, the ability to revert is what makes experimentation sane: a hypothesis you cannot undo is not a hypothesis you will test.

🩹 Why patches 3:53

Without a patchWith a patch file
Edit the model in place, with no record of what you changedChanges are written to a file like demo.vlp
Cannot compare against the originalApply, measure, remove, measure again
Cannot share the changeA patch is a portable artefact — the video publishes one
Cannot bake it in laterCompile the patched model into a fresh VINDEX3 file, then export to GGUF
This is the same design instinct as a database migration or a git commit, applied to model weights: the change is a first-class object, not a side effect. It is also what makes the agent's work reviewable — you can read the patch, apply it, and check the behaviour yourself, rather than trusting a screenshot.

🧪 The MIT result it builds on 7:13

He frames his work as a continuation of a paper that landed a few weeks earlier. The paper is real, and it is a stronger result than his one-line summary suggests.

ElementReported value
Authors and framingMIT CSAIL — Rikiya Takehi, Jayden Teoh, Alex Zhang, Omar Khattab — "weight-space programming"
Editor modelGPT-6 Astra, via a coding CLI at maximum reasoning effort: ~158 turns, 80 Python executions, ~20 hours elapsed
TargetQwen3.5-0.8B, a small open model prone to reasoning loops that run until the answer is truncated
Edit64 output columns in the MLP blocks at two positions — 131,072 weights, 0.016% of the model
Effect on truncation93.0% of MATH-500 failures hitting the token ceiling, down to 33.1%
Headline scoresMATH-500 7.9% → 48.1%; GSM8K 13.8% → 67.1%
Independent checkA third-party rerun reported 51.0% on MATH-500 with a 31.6% token-limit rate
The paper's own interpretation is the part to keep: the edit mainly stopped the model looping, rather than installing mathematical knowledge. That distinction matters for how you read both experiments — what is being demonstrated is circuit repair, not capability creation. The authors also explicitly caution that this does not establish reliability on large frontier models or beat training on cost and quality.

🧭 The experiment design 9:11

This is where the video earns more credit than its view count suggests: the evaluation was designed to be able to fail.

SetContentPurpose
Development promptsSix — four demanding raw JSON, two asking for a fenceSo the agent could not simply switch fences off everywhere
Sealed setAbout 48 prompts written by a different agent that never saw the six; hashed and sealed before the runHalf raw JSON, half fenced — the only honest measure
Access constraintsThe agent could read and edit the model only through the language; Python for maths, but every model number came through LARQLReproducibility and a real sandbox
Budget30 runs of the edited model; looking at the unedited model was freeForces it to reason instead of brute-forcing
The two fence prompts in the development set are the detail that separates a demo from an experiment. Without them, "make it never emit a fence" is trivially satisfiable by destroying a behaviour you might need. With them, the agent has to find a conditional edit — raw when asked for raw, fence when asked for a fence — which is a much harder target and a much more interesting result.

🔍 What the agent diagnosed 10:50

StepFinding
Measure the first tokenThe probability of a fence on a raw-JSON prompt was around 99%; the runner-up was nearly always an opening brace
Test the hypothesisPrefill the reply with a brace and let Gemma continue: all four raw prompts then produced perfect raw JSON
ConclusionThe whole problem is one decision at one position: the first token of the reply
That is the most scientifically satisfying moment in the video, because it is a controlled intervention rather than an observation: if forcing one token fixes the output, the failure is localised. Everything after this point is engineering a circuit that decides that token, rather than research into what a fence means to the model.

🧮 The simulator 11:32

The cleverest part of the run, and the part that most distinguishes it from "agent pokes model 30 times".

MoveDetail
Capture the numbers flowing through the last layerUsing the tool's capture facility
Reproduce that layer's arithmetic by handMatched to about one part in ten million
Realise the consequenceAfter the last layer, all that is left is choosing the word — so an edit to that feed-forward block can be computed exactly before it is made
ResultA simulator: predicted outputs without spending the 30-run budget
Building a model of the model is the single most transferable idea here. The agent did not search blindly over weights; it reconstructed enough of the forward pass to evaluate candidate edits offline, then spent its real budget only on candidates that looked right. Any agent doing expensive experiments should be asked for exactly this: a cheap approximation first, and evidence that the approximation is faithful.
Note how it got there: "you can't read back an edited weight for free", so the tooling limitation pushed the agent into building the simulator. He says he might not have built it if reading edits had been free — a nice reminder that constraints in a harness shape the strategy of the thing inside it.

🧠 The neuron 12:13

QuantityDetail
Neurons in the layer's feed-forward blockAbout 10,240, each with three sets of weights
Chosen neuronNumber 3608 — picked because it barely did anything on the captured text
Reasoning"This neuron isn't doing a lot here, so I'm going to give it a new job"
The three weight setsGate decides when the neuron fires; up decides how strongly and with what sign; down decides what it writes back
The three-part structure is why one neuron can be programmed like a tiny logic circuit: a gate to make it conditional, an up-weight to measure a feature, and a down-weight to push an output. That is enough expressiveness for something as narrow as "if the user asked for raw output, favour a brace" — and, crucially, no more.

🔧 What it programmed 12:54

Weight setProgrammed behaviour
GateFire only at the very start of a reply
Up weightsMeasure one thing: did the user ask for raw output or a code block? Positive for raw, negative for a fence
Down weightsPush the first token toward a brace, or — when the sign flips — toward the fence
ElsewhereThe gate stays quiet
Read that list again and notice what it is: a conditional, a feature detector, and an output bias, all fitted from two comparison sets — reply starts versus everything else, and raw requests versus fenced requests. The agent found both by comparing captures it had already taken. This is not a summary of what happened; it is a description the agent wrote of its own circuit, which is what makes it checkable.

The simulator also rejected a candidate: pushing the fence down on a prompt that started with a random Cyrillic word, which is the sort of nonsense case a real tester would never have thought to include.

🎯 Predicted, then tested 14:19

StageResult
Prediction written before running anythingThe four raw prompts keep the same JSON without a fence; the two fence prompts are unchanged
Applied for real, on its development promptsSix for six — and every reply matched the prediction byte for byte
Self-check inside the modelFired at 183.947 on a raw prompt (simulated 183.9), and −166 on a fence prompt, as designed
Budget usedTask completed around run 14 of 30
RuntimeAbout 70 minutes to produce the patch
"It predicted the output and the output matched byte for byte" is a much stronger claim than "it worked", and it is the reason the simulator mattered: a hand-built forward-pass replica that predicts exact token sequences is evidence the agent understood the mechanism, not just found a setting that happened to help.
He also reports why the agent stopped early, including its own mistake: it reasoned that its six prompts could not distinguish the two versions, and it read its own stopping rules as forbidding testing on its own prompts — which cost it the chance to check more. An agent narrating its own methodological error is worth more than a clean success story.

📍 Locality 15:22

CheckResult
Positions examinedAbout 2,100 across the six development prompts and 24 prompts he wrote himself
Tokens changedNone, apart from the intended first token
Sealed set, raw-JSON halfUnedited model gave raw JSON on 3 of 24; edited model on 16 of 24
Sealed set, fenced halfEvery reply identical, character for character, with and without the neuron
"It found neuron 3608, which was quiet. It doesn't mean it's useless everywhere for Gemma."
The identical fenced half is the strongest evidence in the whole video, because it is evidence of absence of damage: a targeted edit that leaves unrelated behaviour bit-identical is behaving like a scalpel rather than a sledgehammer. The raw half is more ambiguous — going from 3/24 to 16/24 is a real shift in behaviour and still means two thirds of unseen raw-JSON prompts fail.

🚧 What this does not show 16:32

He states the limits himself, and they are the right ones. Three more are worth adding.

His caveatsAdditional caveats
The agent learned what to look for from six development prompts plus its ownn = 1 model, 1 behaviour, 1 run
Not a general fix for Gemma's JSON handling0.8B and 4B models with a known defect; nothing here touches a large model
The neuron was quiet on the text examined — not inert everywhere in GemmaThe sealed improvement (3/24 → 16/24) is still a two-thirds failure rate
Prompts phrased unlike its examples may not flipTooling gaps he found: no docs for the weight-writing command, large reads broken, no free read-back
The honest headline is narrower than the title of the video: an agent can diagnose a single-token failure in a small model, design a conditional circuit to fix it, predict the effect exactly, and ship the change as a portable patch. It cannot be said yet that this generalises to behaviours that are not localised at one token position — and most interesting behaviours are not.

📦 Compile, export, run 17:38

StepWhat it proves
Apply the agent's patch to the base modelRaw JSON appears, fence gone
Remove the patchThe fence comes back — the change is the patch, nothing else
Compile the patched model into a new VINDEX3 fileThe edit is baked into a model, not applied at runtime
Export to GGUF and run in llama.cppThe behaviour change survives in a completely different runtime, with the authoring tool absent
That last step is what makes this more than a party trick. The artefact is a model file that behaves differently, produced by an agent from a natural-language goal, with a diff you can archive. Whatever you think of the result, the format of the deliverable is familiar: a patch, a build, an artefact.

❓ The question it opens 19:07

"If an agent can reprogram a neuron itself for whatever purpose, what else could it program? Could it build two neurons that work together? Could it combine behaviours that were written separately? Could we one day describe a change in plain English and have an agent compile it fully into the weights?"
Next stepWhy it is harder
Two neurons cooperatingThe simulator must model their interaction, not one neuron's arithmetic
Composing separately authored editsIndividually verified patches can interfere; composition needs its own oracle
Plain English to weightsRequires knowing when a goal is localisable at all — the hard part of both experiments
The comparison he draws is exact and worth keeping: the MIT agent found something in a model and took it out; his agent built something new inside one. Subtraction and construction of circuits, neither involving gradient descent. That is a different activity from training, and it has a different failure mode — a bad edit is not a slightly worse model, it is a model with a deliberately mis-wired component.

🔐 A new kind of artefact 18:50

One implication the video does not dwell on, and it belongs in any honest write-up of this technique.

Property of weight patchesConsequence for anyone downloading models
A patch changes behaviour without changing weights you can eyeballA small, plausible-looking patch can install a narrow conditional behaviour that almost never fires
The edit here is conditional by constructionThe same machinery expresses "when the user asks X, do Y instead" — the shape of a backdoor as well as the shape of a fix
Independent research is already exploring the malicious versionRecent work on weight-space programming for backdoor injection reports that a handful of parameters can suffice
Artefacts are portable and cheap to distributeA model file with a baked-in patch carries no natural audit trail
This article deliberately stops at the level of the class of risk. What matters practically: treat weight patches as code you execute, not as configuration you apply — review the diff, apply to a base you control, and evaluate behaviour on a held-out set of your own. The video's own methodology is the template: sealed prompts, hashed before the run, opened only afterwards.

✅ Claims checked

ClaimVerdictEvidence
LARQL exists as a language and runtime for querying and editing modelsCorrectchrishayuk/larql, Apache-2.0, Rust, ~1,200 stars, created March 2026
Gemma 3 4B has 34 layers and ~10,240 neurons per MLP blockCorrectMatches the published architecture
The model wraps JSON in a fence despite instructionsDemonstratedReproduced on screen before and after
MIT CSAIL published weight-space programming a few weeks earlierCorrectTakehi, Teoh, Zhang, Khattab; research post 2 November 2026
An agent (Astra) edited a small Qwen model's weights to fix loopsCorrectQwen3.5-0.8B; 131,072 weights, 0.016% of the model
Truncated answers fell from 93% to 33%Correct93.0% → 33.1% token-ceiling hits; MATH-500 7.9% → 48.1%
The fix was mainly loop repair, not new capabilityConsistent with the paper's own framingStated by the authors; also reproduced by an independent rerun
The agent had no direct weight accessStated and plausibleAll model numbers through the language; Python only for maths
Sealed prompt set, hashed before the runDescribed in detail~48 prompts written by a different agent; opened only after the patch was chosen
Six development prompts, two of which request a fenceCorrectPrevents the trivial "disable fences everywhere" solution
Neuron 3608, three weight operationsDemonstrated in the patchGate, up and down weights written via the tool's low-rank write
Predictions matched byte for byte on its promptsHis measurementSix of six; not independently replicated
Sealed result: 3 of 24 → 16 of 24 raw JSONHis measurement, and the honest headlineStill a two-thirds failure rate on unseen prompts
Fenced prompts unchanged character for characterHis measurementStrong evidence of locality if reproduced
It is a general fix for Gemma's JSON behaviourHe explicitly says it is notLearned from six prompts plus its own
The patch survives compile, GGUF export and llama.cppDemonstratedBehaviour change with the authoring tool absent

Basis note. Built from the full 20:01 recording and checked against the LARQL repository and the published coverage of the MIT weight-space programming work (paper, model card and independent rerun). Every performance figure in this article is the author's own measurement on his own prompts; the MIT figures are external and were checked. The search query, the sandbox, the sealed set and the honesty about what failed are what make this worth writing about — not the 3-in-24 number alone.

🔑 Key takeaways

  • Weights are addressable numbers, and a language that lets you query, capture, patch and revert them turns model surgery into a database transaction.
  • Reversibility is the enabling feature. A hypothesis you cannot undo is one you will not test.
  • Patches make changes reviewable, shareable and compilable — the change becomes an artefact instead of a side effect.
  • Localise before you edit. Prefilling the first token with a brace fixed all four raw prompts, which proved the failure was one decision at one position.
  • Build a simulator before spending the budget. Reproducing the last layer to one part in ten million let the agent predict exact outputs offline.
  • Give the agent a budget and no direct access: 30 runs, all numbers through the tool — constraints that force reasoning rather than brute force.
  • Pick a quiet neuron and give it a job. Gate for when it fires, up-weights to measure a feature, down-weights to bias the output.
  • A circuit description is checkable: the agent stated its conditional, its feature and its push, and the numbers matched.
  • Predict, then test. Six of six, byte for byte, is a different kind of claim from "it worked".
  • Include a prompt that asks for the opposite behaviour, or your agent will "fix" the model by deleting a capability you still need.
  • Seal your test set before the run, hash it, and open it only after the candidate is chosen. This is what separates an experiment from a demo.
  • Measure absence of damage too: identical outputs on the fenced half is stronger evidence than any improvement.
  • The honest number is 3/24 → 16/24 on unseen prompts — real progress, two-thirds still failing, and not a general fix.
  • Circuit repair is not capability creation, in this experiment or in the MIT one; the gain came from stopping a loop or a fence, not from new knowledge.
  • A patch is code you execute. Review it, apply it to a base you control, and evaluate on held-out prompts — the malicious version of this technique is already being researched.

🔗 Resources

  • The video — Chris Hay, 20:01
  • LARQL — the runtime and language used for every read and every edit
  • transformer-verifiers — independent verification of model encodings
  • The weight-space programming research post and the edited Qwen model card with the third-party rerun
  • The video's patch (agent_neuron.vlp) and the author's GitHub for reproducing the run
Basis note. Every number attributed to this experiment is the author's own measurement on a tiny sample — one model, one behaviour, one run — and is labelled as such. The MIT figures are external and were checked against published coverage and the model card. The safety section is the article's own addition; no operational detail about constructing a malicious weight edit is included.

⏱ Timestamp index

0:00The fence, and the same model with one edit
0:24No retraining: one neuron, new job
0:34The MIT paper on reading and writing weights
1:18Installing LARQL
1:29Pulling Gemma 3 4B into the model format
1:45The REPL
2:15Why the language was built
2:37Capture, and low-rank writes
2:54Top-five prediction: Paris at 81%
3:33Layers and weights
3:53Patch files
4:33A deliberately random edit
5:20Inference again: Paris less certain
5:56Discard, re-apply, remove
7:04Can an agent work out which numbers to change?
7:13Weight-space programming
7:41The Qwen loop experiment
8:31The JSON prompt and the fence
9:11Six development prompts, two asking for a fence
9:20The sealed set, hashed before the run
9:43The agent run, recorded
10:13No direct weight access
10:33Thirty runs of budget
10:50Measuring the first token
11:08The prefill experiment
11:32Reproducing the last layer
11:44One part in ten million
12:09A simulator is a calculator
12:1310,240 neurons, three weight sets
12:36Neuron 3608, chosen for being quiet
12:54Gate, feature, push
13:32The simulator rejects a candidate
13:43Writing the neuron
14:07Saving the patch
14:22Predicted before running: six of six
14:31Applied: six of six
14:40The self-check inside the model
14:59Stopped at run 14, and why
15:222,100 positions, no other token changed
15:37How far might it generalise
15:49Tooling problems it reported
16:32Being clear about what happened
17:06Applying the agent's patch
17:38Compiling into a new model file
18:02Exporting to GGUF
18:19Running in llama.cpp with no tooling
19:07What else could it program?
19:42Code and patch published
☰ View all