Lightning OPD: Efficient Post-Training for Large Reasoning Models with Offline On-Policy Distillation

2026-04-14Machine Learning

Machine LearningArtificial Intelligence
AI summary

The authors study a way to make large language models better after initial training using a method called on-policy distillation (OPD). Normally, OPD needs a live teacher model always running, which is costly. They find that simply using precomputed teacher outputs offline doesn't work well unless the same teacher model is used consistently—this is called teacher consistency. Based on this, they create Lightning OPD, which performs OPD offline without a live teacher, matching the usual OPD's quality but with much faster training. Their experiments show Lightning OPD is efficient and effective for tasks like math reasoning and code generation.

on-policy distillationlarge language modelsteacher consistencysupervised fine-tuninggradient biasoffline trainingpolicy driftlog-probabilitiesmathematical reasoningcode generation
Authors
Yecheng Wu, Song Han, Hai Cai
Abstract
On-policy distillation (OPD) has emerged as an efficient post-training paradigm for large language models. However, standard OPD requires a live teacher inference server throughout training, resulting in substantial infrastructure overhead. In this work, we investigate whether on-policy distillation can be performed offline. A natural approach is to precompute teacher log-probabilities once over SFT rollouts and reuse them during training. In practice, however, this offline variant fails to reliably match the performance of standard OPD. To understand this discrepancy, we identify a previously overlooked condition that is critical for any OPD pipeline, which we term teacher consistency. This condition requires that the same teacher model be used for both supervised fine-tuning and OPD. We show that violating teacher consistency introduces an irreducible gradient bias, causing both offline and online OPD to converge to a suboptimal fixed point regardless of training duration. Building on this insight, we propose Lightning OPD, an offline on-policy distillation framework that enforces teacher consistency by precomputing teacher log-probabilities over SFT rollouts. This design eliminates the need for a live teacher server entirely. We further show that, under teacher consistency, Lightning OPD shares the same optimum as standard OPD, with bounded gradient discrepancy and an implicit regularization effect that helps prevent policy drift. Extensive experiments on mathematical reasoning and code generation demonstrate that Lightning OPD achieves state-of-the-art performance with significantly improved efficiency. Starting from an SFT-initialized Qwen3-8B-Base model, Lightning OPD reaches 69.9% on AIME 2024 in just 30 GPU hours, achieving a 4.0x speedup over standard OPD and substantially lowering the barrier to entry for academic research on LLM post-training.