Search the guide

Start with a guide

arXiv

Language Models Can Rewrite Their Own Weights

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

Studies a language model writing edits to its own model weights through reasoning, Python code and forward-pass feedback, with evaluations of self-improvement and repair of corrupted copies.

Editing and evaluation

The study compares Qwen3.5 models from 2B to 27B parameters. In the repair experiment, the undamaged model edits a corrupted copy. The 27B sessions test edits on practice mathematics before evaluation on held-out problems; every session starts from the base weights.

Connection to Program-as-Weights

Both methods produce persistent changes through model weights. PAW specifically trains a neural compiler to generate LoRA adapters that edit a frozen interpreter’s weights from a natural-language function specification. Self-rewriting uses a general-purpose LLM, not specifically trained for this purpose, to write and test edits to its own model weights.

How it works

Construction
A fixed Qwen3.5 editor instance inspects weight tensors, graded practice answers and hidden states, then writes and tests candidate weight edits.
Preparation and training
The editing session blocks gradients and optimizers. The editor uses its existing pretrained weights; candidate edits are evaluated through forward passes.
Execution
The selected weight changes are loaded into the target model for subsequent inference.

Cite this work

BibTeX
@misc{languagemodelsrewriteownweights,
  title = {{Language Models Can Rewrite Their Own Weights}},
  author = {Fan, Jiajun and He, Neil and Yang, Changyi and Mao, Andy and Zhu, Xi and Cheng, Chaoran and Liang, Kaiqu and Shen, Shuaike and Li, Zetian and Guo, Ruihan and Liu, Ge},
  year = {2026},
  date = {2026-11-16},
  eprint = {2611.21885},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.21885}
}

Related reading