Rank-One Self-Edits Transfer Within a Problem Family, Not Across Tasks: Finding the Decisive Token Is Not What Makes Them Work
Can a language model repair its own failures by directly editing its weights, and do such repairs generalize? We study gradient-free, rank-one edits to a small code model (Qwen3.5-0.8B). In a pilot, model-chosen neuron edits fixed 5 of 45 failures, exactly as many as random edits. We then use an external diagnosis. Given a failing greedy answer and one of the model's own passing samples, a binary search over forced prefixes finds the decisive token, and a rank-one MLP edit flips it. On MBPP+, these edits fix 50 of 91 solvable failures, but edits at random positions where the model disagrees with the passing answer fix 47 (p=0.72), and summed edits do not transfer to held-out tasks. To tell "edits cannot transfer" apart from "these tasks share nothing to transfer", we build 32 parametric code templates whose variants differ only in the values in the specification. Here transfer appears. Across 16 templates and three splits, summing the fixing edits from five variants of a template raises greedy passes on its unseen variants from 44 to 217 of 292, breaking one. Norm-matched noise and edits from other templates have no reliable effect (paired p<0.001 against both), and random-position edits transfer as well as decisive ones. A third of the fixing edits flip the first statement of the function body. Their key activations are nearly identical across variants of a template (median cosine 0.89) and dissimilar across templates (0.22). The template result replicates on a second software stack (PyTorch on an RTX 5090) from Qwen3.5-0.8B to 9B, using 19 harder templates for 4B and 9B, which solve almost all of the original ones. Held-out greedy passes rise from 62 to 188 of 324 (0.8B), 90 to 214 of 312 (2B), 158 to 193 of 308 (4B) and 43 to 144 of 244 (9B). Controls stay flat, and random-position edits transfer as well as decisive ones. The effect is weakest at 4B, where the model already solves half of the held-out variants. We conclude that rank-one self-edits act as context-keyed strategy switches: they generalize within a problem family but not across unrelated tasks, and precise localization is not what makes them work.
Authors
- Avijit Bhuin
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-12-02
- DOI
- https://doi.org/10.5281/zenodo.24740162
- Primary Topic
- Software Testing and Debugging Techniques
- Type
- preprint