Language Models Can Rewrite Their Own Weights
This presentation explores a breakthrough in AI self-modification: language models that can directly inspect their own parameters, diagnose behavioral failures, write weight edits through reasoning alone, and improve their performance without gradients, optimizers, or external teachers. We examine how a 27B-parameter model improves its own accuracy, repairs catastrophic weight corruption, and transfers text-derived fixes to unseen visual tasks—all through internally measured edits that change what the model is, not just what it says.Script
A language model opens its own weight files, reads its hidden states, writes a small edit to layer 8, tests the change, and decides whether to keep it. No gradients, no optimizer, no stronger teacher. Just the model reasoning about its own parameters and rewriting them directly.
The 27B model notices a pattern: some answers reach the correct solution but then repeat a single sentence until the token budget runs out. It measures hidden states from terminated versus exhausted answers, constructs a direction separating them, and removes 5% of that direction from two matrices in layer 8. On held-out problems, accuracy rises from 57.2% to 58.3%, and several answers that previously looped now terminate correctly.
The authors corrupt eight rows of one matrix with Gaussian noise 200 times larger than the original weights. The damaged model scores zero percent. An undamaged copy is then asked to repair it without seeing the clean weights. It computes an outlier statistic: largest weight divided by matrix median. The corrupted matrix screams with a ratio of 1397; the next highest is 162. The model clips the outliers, and accuracy jumps from 0% to 33% on held-out math.
The repair was found using only text mathematics problems, never seeing a single image during diagnosis or testing. Yet when evaluated on six visual benchmarks including GUI understanding, the repaired model recovers 83% of base accuracy, solving 388 image problems that the damaged version failed. On ScreenSpot, it goes from 0 out of 100 screens to 89 out of 100. The corruption broke shared computation, so the repair transfers across modalities.
Only the 27B model completes the full capability ladder: executable code, self forward passes, paired tests, hidden state reads, acting on evidence, and beneficial edits. The 2B model never runs a forward pass of itself. The 4B introduces random noise after negative tests. The 9B reads states once but submits an edit that crashes accuracy to zero. Scale adds not just better candidate edits but closed-loop experimental control: diagnosis, intervention, measurement, revision, and withdrawal when tests fail.
This work demonstrates that a language model can be both the diagnostician and the patient, writing parameter changes through its own reasoning while locked out of gradients, optimizers, and external help. The result is modest but conceptually sharp: self-modification that changes what the model is, stored in weights, without paying an inference cost on every future input. To explore the full protocol and create your own video explanation, visit EmergentMind.com.