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
arXiv:2611.21885 · 2026-11-22 공개 · arXiv · PDF
large-language-models language-models benchmarking scaling-laws hidden-states no-gradients self-rewriting weight-editing
Abstract
Language models are trained once, frozen and deployed: improving one again takes another training run, and a prompt, a scaffold or extra computation at inference is gone once the task ends. A frontier model has been shown to edit the weights of a much smaller one. We ask whether a model can rewrite its own weights to make itself better, and find that it can, by its own reasoning, with no gradients and no training; we call this self-rewriting. Given its weights, graded answers and the ability to run itself, a 27B model diagnoses its failure and edits the weights behind it. It surpasses itself: its own edit makes it 6.6 points more accurate on 490 problems it never saw, in a test fixed in advance, and another session's edit also makes it significantly better. It keeps getting better: it submits an edit only when its own tests support it, each edit replacing the last, and over its first eight such sessions its accuracy only rises. Unlike test-time scaling, the gain persists in its weights and adds no cost per answer; unlike training, it needs no pre- or post-training infrastructure, only an open model and hours on one GPU. It repairs a damaged copy of itself: it locates the corrupted matrix and rewrites it with values of its own, never reading the undamaged weights; found on text math problems alone, the repair lifts the copy on six image benchmarks it never saw from 7% to 70% accuracy, 83% of the undamaged model's. And the ability emerges with scale: across four sizes of one family, the 2B model makes no edit and the 4B and 9B models break themselves; only the 27B model works on itself as a human would, comparing its hidden states on answers that finish and on answers that run out of tokens, weakening the direction that separates them. Like a human, a model need not separate training from inference; improving a language model may come to take a conversation rather than a training run.
한국어 요약
한 줄 요약
27B 언어 모델이 자체 추론으로 가중치를 수정해 성능을 6.6점 향상시키는 '셀프-리라이팅(self-rewriting)' 기법이 제시되었다.
핵심 기여도
- 27B 모델이 자체 추론으로 가중치를 수정하여 490개의 미见过 문제에서 6.6점 더 정확하게 풀었다.
- 손상된 모델 복사본을 복구해 이미지 태스크에서 7% → 70% 정확도로 올렸다.
- 2B, 4B, 9B 모델은 수정을 시도하지 못하거나 오히려 성능이 저하되었으며, 27B 모델만 성공적으로 자기 개선했다.
- 수정 과정은 경사도 없이 순전히 순방향 계산으로 이루어졌으며, GPU 1대에서 8세션 동안 실행 가능했다.
핵심 아이디어
기존 언어 모델은 훈련 후 가중치가 고정되고, 이후 개선은 추가 훈련이나 프롬프트 조작에 의존한다. 본 연구는 모델이 **자체 추론**을 통해 **가중치를 직접 수정**함으로써 성능을 향상시킬 수 있음을 보인다. 이는 'self-rewriting'으로 명명된 새로운 패러다임이다.
핵심 아이디어는 다음과 같다:
- 모델이 자신의 가중치와 은닉 상태(hidden states)를 읽고, 특정 문제에서 실패한 원인을 진단한다.
- 실패 원인을 기반으로 가중치를 수정하고, 수정된 모델이 새로운 문제에서 더 나은 성능을 내는지 테스트한다.
- 수정은 경사도 없이 순전히 순방향 계산(forward pass)으로 이루어지며, 수정된 가중치는 영구히 모델에 반영된다.
- 특히, 모델은 손상된 복사본에서 손상된 행렬을 찾아내고, 원본 가중치를 참조하지 않고 자체적으로 복구한다.
기술적 접근법
- **모델**: 27B 파라미터의 오픈 소스 언어 모델.
- **수정 과정**: 모델은 자신의 가중치를 읽고, 은닉 상태를 분석하여 실패 원인을 진단한다.
- **수정 기준**: 수정 후 모델이 새로운 문제에서 더 높은 정확도를 보이면 수정을 유지한다.
- **테스트 방식**: 수정 전/후 모델을 동일한 문제 세트에 대해 비교하는 'paired test'를 수행.
- **수정 범위**: 손상된 복사본의 경우, 특정 행렬(matrix)을 찾아내고, 해당 행렬의 값을 자체적으로 재설정한다.
- **하드웨어**: 수정 과정은 단일 GPU에서 실행되며, 경사도 계산 없이 순방향 계산만 사용된다.
주요 결과
- **490개의 미见过 문제에서 6.6% 정확도 향상** (paired test 기준).
- **손상된 복사본 복구**: 텍스트 문제에서만 학습한 모델이 이미지 태스크에서 7% → 70% 정확도로 올림.
- **모델 크기별 성능 차이**: 2B, 4B, 9B 모델은 수정을 시도하지 못하거나 성능 저하. 27B 모델만 성공.
- **8세션 동안 지속적인 개선**: 수정을 거듭할수록 정확도가 점진적으로 상승.
의의 및 한계
- **의의**:
- 훈련 없이 모델이 자체적으로 가중치를 수정하는 새로운 방식 제시.
- 복잡한 인프라 없이 단일 GPU에서 실행 가능.
- 모델이 스스로 실패를 진단하고 수정함으로써, 인간과 유사한 학습 방식을 시뮬레이션.
- 손상된 복사본을 복구하는 능력은 실용적 응용 가능성을 제시.
- **한계**:
- 27B 이상의 모델만이 효과적으로 작동하며, 2B, 4B, 9B 모델은 실패.
- 수정 과정은 모델이 스스로 실패 원인을 정확히 진단할 때만 성공.
- 수정된 가중치의 내부 메커니즘에 대한 해석 가능성은 제한적.
실용적 활용
- **AI 모델 유지보수**: 모델이 스스로 오류를 수정함으로써, 별도의 훈련 없이 지속적인 성능 개선 가능.
- **로봇 시스템**: 환경 변화에 따라 스스로 가중치를 수정하는 로봇 개발에 활용 가능.
- **실시간 학습 시스템**: 모델이 사용 중에 스스로 개선함으로써, 별도의 훈련 파이프라인 없이 실시간 성능 향상 가능.