TL;DR
Can a large language model significantly improve its code generation capabilities using only its own raw, unverified outputs? This paper introduces Simple Self-Distillation (SSD), a remarkably straightforward method that fine-tunes an LLM on its own temperature-shifted, truncated samples via standard supervised fine-tuning. Without relying on external teachers, verifiers, or reinforcement learning, SSD achieves massive performance boosts by elegantly resolving the fundamental tension between precision and exploration during decoding.
What Problem Does This Paper Address?
State-of-the-art code LLMs typically require heavy post-training optimization. Current approaches rely on expensive human-written data, synthetic data generated by a stronger "teacher" model, or complex reinforcement learning (RL) pipelines with execution-based verifiers.
The authors investigate a compelling question: Can a model improve itself without any external data, rewards, or verification signals?
They identify a core bottleneck in standard LLM decoding called the precision-exploration conflict. When generating code, a model constantly alternates between two types of token contexts:
- Locks: Highly predictable positions where syntax or semantics leave little ambiguity (e.g., standard keywords or closing brackets). These require high precision to suppress low-probability distractor tokens.
- Forks: Creative decision points where multiple algorithmic paths are genuinely plausible (e.g., choosing between different sorting algorithms). These require exploration to maintain useful diversity.
Because standard inference applies a single global temperature, decoding is always an imperfect compromise: lowering the temperature secures the locks but starves the forks of diversity, while raising it enables exploration but allows errors to flood into the locks.
Methods
The proposed method, Simple Self-Distillation (SSD), consists of three simple phases:
- Data Synthesis: The authors take a pool of unlabeled programming prompts and sample exactly one candidate solution per prompt from the base model. Crucially, they use a specific training-time temperature ($T_{\text{train}} \neq 1$) and truncation configuration (top-$k$ and top-$p$), and perform absolutely no filtering or correctness verification on the raw outputs.
- Training: The base model is fine-tuned on these unverified self-generated samples using standard cross-entropy supervised fine-tuning (SFT) loss.
- Inference: The fine-tuned model is deployed using optimized evaluation-time decoding parameters ($T_{\text{eval}}, \rho_{\text{eval}}$).
Mathematically, the authors prove that training on temperature-shifted, truncated samples splits the learning objective into two context-adaptive behaviors: support compression (which aggressively drives out distractor tails at lock positions) and within-support reshaping (which flattens the distribution head at fork positions to preserve diversity).
Datasets
- Training: Synthesized using ~10,168 unique competitive programming prompts from the seed subset of the rSTARcoder dataset.
- Evaluation:
- LiveCodeBench v6 (LCB v6; Feb–May 2025 split) and LiveCodeBench v5 served as the primary benchmarks.
- AIME (math reasoning), HumanEval (general coding), CruxEval (code understanding), and MMLU (general knowledge) were used to test out-of-domain transfer stability.
Key Insights and Ideas
- Training and Decoding are Complementary: You cannot achieve these gains simply by tweaking decoding parameters at inference time on a base model. Inference sweeps on base models yield flat performance curves. SSD alters the model's underlying distribution so that locks become structurally safer, which subsequently unlocks the ability to use higher evaluation temperatures to explore forks effectively.
- Context-Adaptive Reshaping from a Global Rule: Even though the SFT training rule is applied uniformly, its effect is highly asymmetric. At locks, where only one or two tokens survive truncation, support compression dominates. At forks, where many tokens survive, the model learns to distribute mass more evenly across viable branches.
- "Bad Data" Still Yields Good Results: In a striking stress test, the authors trained a model at a very high temperature ($T_{\text{train}} = 2.0$) without truncation. The resulting training data was absolute gibberish—62% contained no extractable code at all. Yet, the fine-tuned model still beat the base model baseline. This confirms that SSD's benefits stem from structural distribution reshaping rather than learning "correct" code patterns.
Key Results
- Significant Performance Boosts: SSD improved Qwen3-30B-Instruct from 42.4% to 55.3% pass@1 on LiveCodeBench v6, representing a +30% relative gain.
- Concentration on Hard Problems: The absolute largest improvements occurred on the hardest coding problems. For Qwen3-30B-Instruct, pass@1 on hard problems jumped by +15.3 percentage points (pp), while pass@5 on hard problems surged by +23.0 pp (from 31.1% to 54.1%), proving that the model preserves generation diversity.
- Broad Generalization: The approach successfully generalized across six distinct models from three model families (Llama 8B, Qwen 4B/30B, and GPT-OSS 20B), benefiting both standard instruct models and reasoning ("thinking") variants.
- Out-of-Domain Stability: For larger models (30B), performance on non-coding tasks like MMLU and math reasoning remained stable, showing no signs of catastrophic forgetting.
Limitations and Future Work
- Scale-Dependent Tradeoffs: While the 30B models maintained excellent out-of-domain stability, smaller models (4B and 8B) showed more volatile benchmark-dependent tradeoffs, occasionally regressing on mathematical reasoning tasks like AIME.
- Hyperparameter Sensitivity: Achieving optimal performance requires carefully balancing the relationship between $T_{\text{train}}$ and $T_{\text{eval}}$, which typically interact along a specific diagonal band ($T_{\text{eff}} = T_{\text{train}} \times T_{\text{eval}} \approx 1.2$).
- Future Directions: The authors suggest exploring how SSD can be integrated as a complementary pre-computation step for more complex reinforcement learning pipelines (like GRPO) or extended into multi-turn iterative self-distillation loops.
Summary updated