Recursive Self-Editing: LLMs Program Their Own Weight Edits for Self-Improvement
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
| Observe | screen_results , screen_output (own answers, reasoning included), train_example , diagnostics |
| Read | svd (top- triplets of ), acts (activation statistics on own answers or prompts), tensors , output_matrices |
| Construct | rank1 ( ), from_direction ( ), scale_singular ( ), project_out ( ), direction , unit |
| Compute | tensor_compute : sandboxed CPU PyTorch on up to four FP32 weight tensors statistics, vectors or LoRA factors |
| Operate | scale , interpolate , combine , drop , truncate_rank , intruder_scale , orthogonalize , ties , … |
| Check | inspect , train_loss (forward-only NLL on train problems), compare (fixed / broken problems) |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Tool | Purpose | Cost |
| screen_results(ids, filter, limit, offset) | own screen answers: statement, gold, extracted answers, scores | free |
| screen_output(id, sample, offset) | one full answer, reasoning included, paged | free |
| train_ids , train_example(id) | train problems with gold answers | free |
| modules , tensors , output_matrices | module and tensor names and shapes | free |
| diagnostics(module, layer, top, sort) | per-module norms, singular values, merged-edit norm, effective rank, intruder score, relative change | free |
| svd(module, k) | top- singular triplets of the current weight | free |
| Setting | Value |
| Model and decoding | |
| Model | Qwen3.8-27B, BF16 |
| Editor | current model , thinking mode; temperature 0.6, top- 0.95, top- 20 |
| Editor output caps | 16,384 tokens per tool turn and for the final turn; context 131,072 tokens |
| Editor session limits | 30 tool rounds, 100 tool calls, 160,000 completion tokens, 2,400 s per candidate |
| Screen / gate / test decoding | thinking mode, temperature 0.6, top- 0.95, top- 20, 16,384 tokens, 4 samples (avg@4), seed 42 |
Recursive Self-Improvement
Recursive self-improvement studies AI systems that use feedback from their own work to modify and evaluate future versions.
See all 119 papers