Interpretable weight-space programming builds transparent transformers and brain encoding models
Yash Mehta, Chandan Singh, Weijia Xu, Richard J. Antonello, Adeen Flinker, Nima Mesgarani, Michael F. Bonner, Nebojsa Jojic, Jianfeng Gao
cs.CE, cs.AI
2026-11-13
An LLM agent hand-writes weights in code with no backprop: 13 algorithmic tasks hit 100% with 166-parameter models, and brain encoding beats interpretable baselines.
Neuroscience runs on encoding models: deep networks that predict brain responses to images, stories or speech. They predict well and explain nothing, because nobody can say which stimulus feature drives a prediction. Hand-built alternatives like Gabor filters or texture statistics read cleanly but predict worse. For science that trade is a bad one, since explanation is the product. iWSP (interpretable weight-space programming) takes the direct route: no training at all, an LLM agent writes the network weights by hand, in code.
Banning training is the point. With no gradients to tune, the agent has to hypothesize a structure, write the weights, read the score, and revise, the way a person would. On algorithmic tasks the target is a small GPT-style transformer; for brain encoding the agent writes a feature extractor and a fixed ridge regression maps features to responses.
| Item | Result |
| 13 algorithmic tasks (26 Opus runs) | 100% on visible and hidden sets |
| Median smallest perfect model | 166 params (Opus) vs 100,000 (Haiku) |
| TREC hidden accuracy | 87.3% Opus, 71.1% Haiku |
| Rebuilt from 200-word description | 100% algorithmic, -1.4 pts NLP |
All algorithmic tasks (multiplication, sorting, edit distance, GCD, date normalization and more) land at 100%; three of four NLP tasks beat a majority baseline, and paraphrase detection fails. The searches behave like engineers: algorithmic runs hit 99% visible accuracy in the first tenth of their iterations, then compress from about 3,400 parameters to about 200. GCD becomes the subtractive Euclidean algorithm, a block of three ReLU units repeated 1,000 times. The sentiment model is 1,515 hand-written word patterns plus an attention layer that flips positive words near a negator, then a sum.
In visual cortex, 600 search iterations on LAION-fMRI recover a classical V1 front end (multiscale Gabors plus divisive normalization) within the first nine steps and end at an 865-line program with 14 explicit computations. Transferred zero-shot to NSD, it beats all seven interpretable baselines in every subject: 0.443 versus 0.400 in early cortex, 0.317 versus 0.256 in ventral. It matches AlexNet early and trails it in ventral (0.391).
The language fMRI run surfaced something unplanned. In one step performance jumped from 0.067 to 0.104, and reading the model showed the new features encoded only a word's position in the story, not its meaning. Position alone scored 0.090, above the GPT-2 XL baseline of 0.079; the cause is a timing artifact in the first and last 40-odd TRs of each scan that long-context models can exploit.
On auditory ECoG, 3,852 hand-written acoustic features reach 0.065 against Whisper's 0.070 over all 166 electrodes, but the two share only 69% of explained variance. Combining them raises performance from 0.070 to 0.075, improving 126 of 166 electrodes. The full experimental bill came to about $17,500 at API list prices.
This validates an inverted route to interpretability: start from the explanation and build the model to match, rather than training first and explaining afterward. The 200-word text-bottleneck rebuild is a strict test, far better than a subjective read, and deserves to become standard for this kind of work. The fixed evaluator plus anti-cheating audit protocol can be lifted wholesale into other data-rich domains, and the fMRI artifact shows an interpretable model doubling as a data auditor. The agent-capability result is concrete too: frontier models can translate known algorithms into weights, and stronger models compress far harder (166 parameters for Opus against 100,000 for Haiku).
The authors are candid. The agents invent no new computational principles; they recombine known motifs (textbook algorithms, Gabor filters, modulation filters). The models are shallow parallel banks feeding a linear readout, with no deep hierarchy, which is exactly why iWSP trails trained deep networks in ventral cortex, harder language tasks, and speech ECoG. The method leans on the agent's written explanations staying faithful to its weight edits; stronger future models could hide opaque heuristics, so audits have to keep pace. The neuroscience is observational: few subjects, no causal interventions.
Two more caveats from the results themselves. The 100% scores hold only inside the tested input distribution (GCD was tested on three-digit inputs only), and with hundreds of evaluations per search and roughly $17,500 for the whole paper, this is not a cheap workflow.