UIUC and CMU team demonstrates Qwen3.5-27B self-rewriting weights, improving math accuracy by 6.6%
A new paper shows large language models can autonomously rewrite their own weights to improve performance without gradient-based training.
Researchers from the University of Illinois Urbana-Champaign (UIUC), Carnegie Mellon University (CMU) and four other institutions have published a paper titled "Language Models Can Rewrite Their Own Weights," proposing a method called Self-rewriting. The study demonstrates that the open-source model Qwen3.5-27B can analyze its own hidden states and underlying weights, identify errors, and write code to directly modify its parameters without calculating gradients or retraining.
In experiments on 490 unseen math problems, the self-rewritten model improved its accuracy from 57.2% to 63.8%, a gain of 6.6 percentage points. The best-performing version also reduced the rate of truncated answers due to token exhaustion from 33.6% to 26.1%. In one specific case, the original model failed to answer a base-4 counting question after generating 16,384 tokens; the modified model answered correctly using only 5,341 tokens under the same random seed.
The team also tested the model's ability to repair corrupted copies of itself. When random noise was injected into a weight matrix in layer 30, the intact model diagnosed the anomaly and wrote code to suppress the abnormal values. This restored the damaged copy's accuracy on text math tasks from 0% to 33.0%, and surprisingly, also recovered its image processing capabilities, bringing overall accuracy on six visual benchmarks back to approximately 83% of the undamaged model's level.
However, this capability is highly dependent on model scale. Among Qwen3.5 variants with 2B, 4B, 9B, and 27B parameters, only the 27B model successfully completed the full loop of diagnosis, modification, and validation. Smaller models either failed to use tools effectively, made changes that degraded performance to zero, or could not properly evaluate the impact of their modifications.
The authors describe Self-rewriting as a necessary step toward Recursive Self-Improvement (RSI). Unlike previous work where an external agent modified another model's weights, this study shows a model modifying its own internal state. The improvements are saved directly in the weights, requiring no additional computational overhead during subsequent inference.