Paper 2604.01193
Embarrassingly Simple Self-Distillation Improves Code Generation
- Published
- Apr 2026
- Research lab
- Independent
- Citations
- 28
- GitHub
- 798 stars
01 In brief
Summary
The paper introduces Simple Self-Distillation (SSD), a method that improves LLM code generation by sampling solutions from the model itself with specific temperature and truncation settings, then fine-tuning on those raw, unverified outputs via standard supervised fine-tuning.
SSD requires no verifier, teacher model, or reinforcement learning.
It improves Qwen3-30B-Instruct from 42.4% to 55.3% pass@1 on LiveCodeBench v6, with gains concentrated on harder problems, and generalizes across six models (Qwen, Llama, GPT-OSS) at 4B–30B scale, including instruct and thinking variants.
The authors attribute the gains to a 'precision-exploration conflict' in decoding: 'lock' positions demand precision, while 'fork' positions demand exploration.
SSD reshapes token distributions context-dependently, suppressing distractor tails at locks while preserving useful diversity at forks.
Theoretical analysis decomposes the SSD objective into support compression, within-support reshaping, and alignment terms.
A stress test with gibberish training data still yields improvements, indicating the benefit comes from distributional reshaping rather than sample quality.
Decode-only tuning cannot match SSD's gains, as it cannot alter the model's distribution itself.
02 From the paper
Abstract
Can a large language model (LLM) improve at code generation using only its own raw outputs, without a verifier, a teacher model, or reinforcement learning? We answer in the affirmative with simple self-distillation (SSD): sample solutions from the model with certain temperature and truncation configurations, then fine-tune on those samples with standard supervised fine-tuning. SSD improves Qwen3-30B-Instruct from 42.4% to 55.3% pass@1 on LiveCodeBench v6, with gains concentrating on harder problems, and it generalizes across Qwen and Llama models at 4B, 8B, and 30B scale, including both instruct and thinking variants. To understand why such a simple method can work, we trace these gains to a precision-exploration conflict in LLM decoding and show that SSD reshapes token distributions in a context-dependent way, suppressing distractor tails where precision matters while preserving useful diversity where exploration matters. Taken together, SSD offers a complementary post-training direction for improving LLM code generation. Our code is available at https://github.com/apple/ml-ssd