Don't Train It, Write It: An AI Agent Writes New Capabilities into Language Model Weights
Santiago Rivadeneira Quintero in Agents
Can an agent write computation a model lacks into its weights?
Don't Train It, Write It: An AI Agent Writes New Capabilities into Language Model Weights
The target was computation the model lacked
Even with chain-of-thought, Qwen2.5-1.5B scored 0.3% on 12 multiplication lengths classified as absent.
Could an agent write that algorithm into model weights without backpropagation or fitting weights to task answers?
A coding agent writes a patch
- 1
Inspect the host
It reads pretrained weights and activations; original tensors stayed untouched in 54 of 55 official sessions.
- 2
Write inside layers
Scripts add gated attention heads and MLP neurons inside existing layers, without backpropagation or fitting weights to task answers.
- 3
Use a fixed budget
Each session has 50 passes; practice is visible, and validation is available only as accuracy per length or subtask, never as examples.
A real implant, layer by layer

(a) traces weight/activation reading, design/simulation, patching, and measurement; (b) maps a Qwen2.5-1.5B tracking implant by layer. Gates make outputs exactly zero off-trigger; computation lives in weights, not task code.
One adder carries a task through model layers
- 1
Read the template
An assistant-gated head checks “ Reply”; position readers encode operand length as a rotary phase and fetch aligned digits for each answer column.
- 2
Propagate carry
Later layers compute generate/propagate terms over a finite window and route carry to each answer position.
- 3
Emit and test
The layer emits (a+b+c)mod10 (with c as carry); all 10 Qwen2.5-0.5B/1.5B sessions were exact on the sealed test through 30 digits, beyond 12-digit practice.
Multiplication extrapolates past six-digit practice
Qwen2.5-1.5B and Gemma-3-1B-it could execute only up to six-digit operands; lengths 13–20 were unseen during model runs.
On each host's absent-length set, implants scored 100.0%; same-budget LoRA scored 1.3% and 2.1%, respectively. Implants also hit 100.0% from 13–20 digits.
Five patches put Qwen 1.5B above its 7B sibling
Stage-2 sealed score: normalized 24-subtask BBH; 7B uses same evaluator. Modules target six subtasks; other 18 match the format control.
The score lift is selective, not general
Qwen's five-module composite covers six BBH subtasks; Gemma's four omit multiplication, which could not compose with tracking on practice.
Against float32 format controls, both composites had KL exactly 0 on 1,023,000 WikiText tokens and matched the other 18 BBH subtasks and 15,845 items across five tests.
This is targeted capability installation, not a broad model upgrade.
The test was sealed before sessions
- 1
Precommit
Task sets, decision rules, and verdict wording were fixed before the first session.
- 2
Examine once
A frozen evaluator tested each final implant once; no agent saw an individual validation or test example.
Writing a circuit is not always discovering it
Frozen manuals recorded development designs for tracking, web_of_lies, and multiplication; official runs tested implementation.
For navigate and boolean_expressions, the manual gave the goal and scoring, not an algorithm. Every brief still specified what to compute.
Where this result stops
Template and scale
Rewrites were announced, not free language; near-task prompts may trigger gates. Evidence spans 0.5B–1.5B hosts, two families, one agent, and a handful of tasks.
Validation selection
Agents could request aggregate scores and stop when high; claims rest on the sealed test.
Search remains
Small numerical searches shaped design constants in 21 of 55 sessions; none fitted weights to task answers.
Failures and edge cases
4 of 45 modules failed side-effect checks; 5 of 50 stage-2 sessions timed out. Adders can fail on 5–8 consecutive columns whose digits sum to 9.
Why it matters
- The result is task-specific computation written into model weights, not a general upgrade to the host.
- Practitioners can try narrow algorithms with stable formats, then measure composition and off-task effects.
- The open test is whether agents can discover unspecified computations and survive unannounced wording in larger models.
12 slides, 3 min
25 Nov 2026