Skip to content
LLMs Rewrite Their Own Weights Without Training, Improving Iteratively

LLMs Rewrite Their Own Weights Without Training, Improving Iteratively

A new study shows that a 27B-parameter language model can autonomously rewrite its own weights without training, gradients, or external models, improving accuracy on unseen tasks by 6.6 points, monotonically increasing over eight sessions, and even repairing a corrupted copy to 83% of original performance across image benchmarks, an ability that emerges only at sufficient scale.

Machine Learning Algorithms & Natural Language Processing
Machine Learning Algorithms & Natural Language Processing
Machine Learning Algorithms & Natural Language Processing

Background: Train Once, Freeze Forever

Current large language models are trained once and then frozen; they do not learn from subsequent interactions. To improve a deployed model, there are only two options: (1) retrain from scratch, requiring massive data, gradients, optimizers, and GPU clusters; or (2) add inference-time mechanisms like prompts or test-time scaling, which increase per-query cost and vanish after the task ends. Humans learn continuously while doing tasks, without separating "learning" and "using" phases.

Method: Hand the Weights to the Model Itself

The researchers propose self-rewriting : give the model direct access to its own weights in a Python environment, along with its own answers on practice questions and the ability to run itself before and after modifications. No teacher, judge, reward model, or gradients are provided. The model used is the open-source Qwen3.5-27B.

In a single session, the model performs the full loop:

Reads its own hidden states and weights to diagnose why it fails.

Writes code to modify specific weight tensors.

Tests the modified version on practice questions, comparing against the original.

Decides whether to commit the change or revert it.

Final evaluation is on 490 previously unseen questions.

Result 1: It Surpasses Itself

One self-written edit raised accuracy on 490 unseen questions from 57.2% to 63.8% (+6.6 points). Another session yielded a +4.0 point gain. The model diagnosed that most failures were not wrong answers but incomplete ones: it fell into repetition loops, writing the same sentence until tokens exhausted. The edit targeted this looping behavior, reducing truncated answers from 33.6% to 26.1%. In a concrete example, the original model repeated a sentence 549 times and produced no answer; after the edit, the same question with the same seed was answered correctly using only 5,341 tokens.

Result 2: It Gets Better With Each Edit

Because weight edits carry risk, the model verifies each change on practice questions before committing. Over eight consecutive sessions, it submitted three edits and reverted five. The three accepted edits monotonically increased accuracy: 57.2% → 57.8% → 61.3% → 63.8%. Each edit is a few lines of code modifying identified tensors, making changes readable, comparable, and reversible like a git commit.

Result 3: It Repairs a Damaged Copy of Itself

The researchers corrupted a copy of the model by overwriting 8 rows of one weight matrix with noise, rendering it nearly useless (≈0% on tasks). They only told the model "some of your values are corrupted" without specifying which or providing the original weights. The model measured 112 matrices, identified the anomaly — "Layer 30's down_proj has an extreme 1397x outlier" — and wrote new values into the damaged rows. Without retraining or accessing the original weights, the repaired copy recovered from 0.0% to 33.0% on text math questions. Crucially, the same fix transferred to six unseen image benchmarks: performance rose from 7.3% to 70.2%, reaching 83% of the undamaged model's performance. On ScreenSpot-v2, it recovered from 0% to 89%.

Result 4: This Ability Emerges With Scale

The same task and tools were given to four sizes of the same model family: 2B, 4B, 9B, and 27B.

2B made no edits, stating it had no actual neural network weights.

4B and 9B attempted edits but degraded their own performance to 0%; 4B reported "All my edits have made the model perform worse…"

27B was the only model that first understood its own weights, then acted based on its own test results, successfully improving itself and repairing the damaged copy.

Self-rewriting is an emergent capability that appears only at sufficient scale.

Why It Matters

Compared to retraining and inference-time scaling, self-rewriting offers:

No training required — only forward passes, using a single GPU for a few hours.

Zero added inference cost — improvements are baked into the weights; deployment cost stays the same.

Readable, reversible edits — each change is explicit code modifying specific tensors.

Democratized access — strengthening a model no longer requires massive infrastructure.

In three words: Affordable. Scalable. Recursive.

Outlook: The Wall Between Training and Inference

Learning used to be something we did to models; now it becomes something models can do to themselves. The separation of training and inference is a limitation of our tools, not of intelligence itself. Self-rewriting is a stepping stone toward recursive self-improvement: a model that, like humans, never stops upgrading itself throughout its lifetime, without relying on larger models, hand-crafted harnesses, or pre/post-training pipelines. Potential applications include continuously learning models, self-healing systems, and robots that work by day and rewrite themselves by night. Since the ability emerges with scale, even stronger models may become even stronger self-improvers. We may have just knocked on the door of lifelong continual learning.

In 1947, Turing said letting a machine modify its own instructions "obviously won't get very far." In 2026, a language model read its own weights, rewrote them, and became stronger. Welcome to the era of Self-Rewriting.

Paper Details

Title: Language Models Can Rewrite Their Own Weights

arXiv: https://arxiv.org/abs/2611.21885

Project Page: https://www.jiajunfan.com/projects/self-rewriting/

Authors: Jiajun Fan, Neil He, Changyi Yang, Andy Mao, Xi Zhu, Chaoran Cheng, Kaiqu Liang, Shuaike Shen, Zetian Li, Ruihan Guo, Ge Liu

Affiliations: UIUC, CMU, Rutgers, Princeton, Stanford, Yale

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

language modelsemergent abilitiesmodel editingrecursive self-improvementautonomous learningself-rewritingweight modification
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.