Learning from Interaction Experience via Localized Context Distillation

Zhezheng Hao, Yongkang Yang, Xilin Xia and colleagues (Zhejiang University and Tencent's Workbuddy team) propose Localized Context Distillation (LoCD), in which a teacher with privileged experience rewrites only the spans of a student trajectory that need revision.
Ask this paper
Problem with both existing variants. Off-policy context distillation trains on teacher trajectories and suffers exposure bias. On-policy distillation trains on student rollouts whose states often carry no information about behaviors the student cannot yet produce.
Method. LoCD locates the critical spans in a student trajectory, the teacher regenerates only those spans from the student's own prefix, and the student trains on the regenerated segments.
Results. Over the strongest baselines LoCD gains 5.65% on math reasoning, 2.65% on code generation, 5.60% on WebShop and 7.46% on ALFWorld. Code solve rate is 17.20% against 14.55%.
Smaller updates. At step 100 the parameter update is 28-31% smaller than the on-policy and off-policy baselines, and about 33% of coordinates change visibly against 45-46% for the baselines.
Form of the privileged hint matters. Brief and decisive hints raise mean accuracy on AIME24, AIME25 and HMMT25 by 17.5 and 16.9 points, against 10.6 points when the teacher sees full correct reference solutions.
Abstract
Learning from interaction experience is essential for enabling large language models to continually improve during deployment. Context distillation offers a promising path: privileged information extracted from experience is provided to a teacher, whose behavior is then distilled into a student model that has no access to it. However, both existing forms of context distillation have limitations. Off-policy context distillation trains the student on teacher-generated trajectories and thus suffers from exposure bias; whereas on-policy context distillation trains on the student's own rollouts, whose states are often uninformative and fail to convey behaviors the student cannot yet produce. To resolve this dilemma, we introduce Localized Context Distillation (LoCD). LoCD first localizes the critical spans of a student trajectory that require revision. The teacher then regenerates only these spans from the student's own prefix, and the student is trained on the regenerated segments. LoCD thereby concentrates learning on the most informative states while keeping exposure bias low. Extensive experiments across math reasoning, code generation, and agent tasks demonstrate that LoCD consistently outperforms strong baselines and achieves more stable training with smaller and sparser parameter updates.