cs.LGNov 22, 2026

Recursive Self-Editing: LLMs Program Their Own Weight Edits for Self-Improvement

Authors: Linghua Zhang, Yunhe Li

Abstract

Recursive self-improvement asks a system to improve the very system that improves it. Today's language models improve themselves through data, training recipes or scaffolds. Whenever their weights change, gradient descent writes the update, not the model. We let the model write its own weights. In SELFWRITE, each generation the current model studies its own reasoning on fresh training problems, inspects its own weights and activations in a persistent Python session, and writes a program that constructs a low-rank weight edit for itself from white-box primitives (singular directions, activation contrasts between its right and wrong answers, rank-one projections, tensor computations), with no training or gradient tool. Every candidate is graded once on a hidden gate set against the current model; the best strictly improving edit is merged into the weights, and the edited model writes the next edit. On Qwen3.8-27B and math problems from DAPO-Math, five generations of SELFWRITE raise gate accuracy from 73.95% to 76.45% and accuracy on a held-out test split that the loop never sees from 76.30% to 77.75% (avg@4) and from 82.60% to 84.80% (pass@4), without a single gradient step. A language model can author useful changes to its own weights without gradients, and the edited model keeps writing useful edits.

Figures & tables

Appendix figures & tables2 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Language Models Can Rewrite Their Own Weights

    Nov 16, 2026Jiajun Fan, Neil He, Changyi Yang +8Language Model Self-ImprovementLanguage Model Editing

  2. Self-WSP: Can Language Models Improve Themselves Through Weight-Space Programming?

    Nov 21, 2026Guoming Ling, Shanshan Zhong, Kaixuan Zhang +1Language Model Self-ImprovementWeight-Space Programming

  3. WeightLoop: Weight-Space Programming with Experimental Feedback

    Nov 5, 2026Mengran Li, Bo Li, Weijing Zhao +6Weight-Space ProgrammingLanguage Model Self-Improvement