HyperAIHyperAI

Command Palette

Search for a command to run...

Apprentissage on-policy ou off-policy ? Une étude systématique de la dynamique de distillation

Julianna Piskorz Antonin Berthon Mihaela van der Schaar

Résumé

Il a été avancé que l’apprentissage on-policy réduit l’oubli catastrophique, produit des mises à jour de paramètres plus parcimonieuses et améliore la généralisation. Cependant, les comparaisons existantes entre le fine-tuning supervisé et l’apprentissage par renforcement font varier simultanément de nombreux facteurs, ce qui rend difficile d’isoler la contribution de la politique de rollout. Nous étudions l’effet de la politique de rollout dans un cadre contrôlé de distillation fort-vers-faible, en faisant varier indépendamment la politique de rollout, la direction de la KL au niveau des tokens et le taux d’apprentissage à travers les familles de modèles Llama 3 et Qwen2.5 et des tâches de raisonnement couvrant les domaines scientifique, médical et arithmétique. Notre analyse révèle une image nuancée de la dynamique de distillation, dans laquelle la politique de rollout ne joue pas nécessairement un rôle central. En revanche, la direction de la KL au niveau des tokens façonne plus nettement la performance sur les tâches et la couverture des sorties, tandis que le taux d’apprentissage régit l’oubli et la parcimonie des mises à jour. L’analyse des gradients de la KL et des expériences le long d’un spectre continu de politiques de rollout étudiant–enseignant expliquent ce motif : la KL directe est remarquablement robuste à la politique de rollout, ses performances restant stables et élevées malgré les changements de politique de rollout, tandis que la KL inverse est nettement plus sensible et privilégie les rollouts générés par l’étudiant. Les données on-policy améliorent néanmoins la généralisation à des variantes plus difficiles de la tâche arithmétique Countdown dans les deux directions de KL, bien que cet avantage ne persiste pas de manière fiable après un RLVR ultérieur. Nos conclusions plus larges restent robustes à la suppression de l’écrêtage des gradients, à l’utilisation d’estimateurs de KL échantillonnés et à l’entraînement sur des tâches exigeant des chaînes de raisonnement plus longues. Dans l’ensemble, nos résultats remettent en question l’idée selon laquelle les rollouts on-policy sont intrinsèquement préférables et montrent que leur valeur dépend de manière critique de l’objectif, du cadre d’évaluation et des hyperparamètres d’optimisation.

One-sentence Summary

Researchers at the University of Cambridge systematically investigate strong-to-weak distillation dynamics across Llama 3 and Qwen2.5 model families on reasoning tasks spanning scientific, medical, and arithmetic domains, independently varying rollout policy, token-level \mathrm{\mathrm{KL\mathrm{KL}KL}} direction, and learning rate, and find that forward KL remains robust to rollout policy while reverse KL favors student-generated rollouts, and that on-policy data improves generalization to harder Countdown arithmetic variants although this advantage does not reliably persist after subsequent RLVR.

Key Contributions

  • This paper presents a controlled strong-to-weak distillation study that independently varies rollout policy, token-level KL direction, and learning rate across Llama 3 and Qwen2.5 on scientific, medical, and arithmetic reasoning tasks. The results indicate that token-level KL direction more clearly shapes task performance and output coverage, while learning rate governs forgetting and update sparsity, and rollout policy does not necessarily play a central role.
  • Through KL gradient analysis and experiments along a continuous student-teacher rollout-policy spectrum, the paper shows that forward KL is robust to rollout policy changes, whereas reverse KL is more sensitive and favors student-generated rollouts.
  • On-policy data improves generalization to harder Countdown arithmetic variants under both KL directions, but this advantage does not reliably persist after subsequent RLVR. These conclusions remain robust without gradient clipping, with sampled KL estimators, and on tasks requiring longer reasoning chains, challenging the view that on-policy rollouts are inherently preferable.

Introduction

Post-training is central to developing reasoning capabilities in large language models, and strong-to-weak distillation has become a common way to transfer reasoning behavior from larger teachers to smaller students. On-policy rollouts have been credited with reducing catastrophic forgetting, producing sparser parameter updates, and improving generalization, but prior comparisons often confound rollout policy with changes in the training objective, supervision density, optimization procedure, and learning rate. The authors address this by using strong-to-weak distillation as a controlled testbed, independently varying rollout policy, KL direction, and learning rate across Llama 3 and Qwen2.5 models on scientific, medical, and arithmetic reasoning tasks. They find no consistent advantage from on-policy distillation in final in-distribution accuracy, catastrophic forgetting, or parameter-update sparsity; KL direction more strongly determines task accuracy and coverage, while learning rate governs forgetting and sparsity. Forward KL is robust to rollout policy, whereas reverse KL is substantially more sensitive and favors on-policy rollouts.

Method

5.1 Logit Gradients Reveal Differing Sensitivity to the Rollout Policy

To understand how the rollout policy affects optimization, the authors analyze token-level gradients of forward and reverse KL divergences. Let (zSθ)v,v∈V(z_S^\theta)_v, v \in \mathcal{V}(zSθ​)v​,v∈V denote the logit values produced by the student model at a fixed prefix, with πSθ(v)=softmax(zSθ)v\pi_S^\theta(v) = \mathrm{softmax}(z_S^\theta)_vπSθ​(v)=softmax(zSθ​)v​. Then the parameter gradients can be described as follows:

∇θDF−KL=∑v∈V(πSθ(v)−πT(v))∇θ(zSθ)v,\nabla_{\theta} D_{\mathrm{F-KL}} = \sum_{v \in \mathcal{V}} (\pi_S^\theta(v) - \pi_T(v)) \nabla_{\theta} (z_S^\theta)_v,∇θ​DF−KL​=v∈V∑​(πSθ​(v)−πT​(v))∇θ​(zSθ​)v​, ∇θDR−KL=∑v∈VπSθ(v)[log⁡πSθ(v)πT(v)−DR−KL]∇θ(zSθ)v.\nabla_{\theta} D_{\mathrm{R-KL}} = \sum_{v \in \mathcal{V}} \pi_S^\theta(v) \left[ \log \frac{\pi_S^\theta(v)}{\pi_T(v)} - D_{\mathrm{R-KL}} \right] \nabla_{\theta} (z_S^\theta)_v.∇θ​DR−KL​=v∈V∑​πSθ​(v)[logπT​(v)πSθ​(v)​−DR−KL​]∇θ​(zSθ​)v​.

These expressions reveal an important asymmetry. The forward-KL derivative with respect to the student logits is πSθ(v)−πT(v)\pi_S^\theta(v) - \pi_T(v)πSθ​(v)−πT​(v); it is therefore nonzero whenever the teacher and student next-token distributions differ, and each coordinate lies in [−1,1][-1, 1][−1,1]. Consequently, under bounded student-logit Jacobians ∇θ(zSθ)\nabla_\theta (z_S^\theta)∇θ​(zSθ​), the difference between forward-KL updates induced by two rollout policies is bounded linearly by the total-variation distance between the prefix distributions they induce. Hence, small changes in the trajectories generated by the rollout policy produce proportionally small changes in the forward-KL gradient.

For reverse KL, however, even a small rollout change can produce an arbitrarily large gradient change when the teacher and student assign very different probabilities to some tokens. Its logit derivative is weighted by the student probability πSθ(v)\pi_S^\theta(v)πSθ​(v), so it vanishes as the student probability approaches zero, even when the teacher assigns substantial probability to that token. Reverse KL may therefore struggle to recover teacher modes omitted by the student, reflecting its mode-seeking behavior. Conversely, when the student assigns appreciable probability to a token that the teacher considers extremely unlikely, the log ratio log⁡πSθ(v)/πT(v)\log \pi_S^\theta(v) / \pi_T(v)logπSθ​(v)/πT​(v) can become arbitrarily large, potentially producing sharp, high-variance updates that can destabilize training. Unlike forward KL, reverse KL admits no bound dependent solely on the rollout distance and the student-logit Jacobian.

These properties suggest that reverse KL is more sensitive to the rollout policy. While forward KL provides signal at any visited prefix where the policies disagree, reverse KL emphasizes student-supported, teacher-disfavored tokens and therefore depends more strongly on visiting the student's own prefix distribution.

Experiment

The study runs controlled distillation experiments comparing on-policy and off-policy rollouts while varying token-level KL direction and learning rate across medical, scientific, arithmetic, and longer math reasoning tasks, evaluating task accuracy, catastrophic forgetting, and parameter-update sparsity. The results show that rollout policy provides no consistent advantage for in-distribution performance, forgetting, or sparsity, whereas forward KL is more robust than reverse KL, and learning rate is the main factor governing forgetting and sparsity. A rollout-policy spectrum confirms that forward KL is relatively insensitive to the rollout distribution while reverse KL benefits from student-favored rollouts, and further analyses show that on-policy data can improve generalization to harder tasks and reduce incidental teacher-style transfer, though this advantage does not reliably persist after reinforcement learning. Ablations with sampled KL, no gradient clipping, and longer rollouts indicate that the main conclusions generalize, with only a suggestive on-policy benefit in the long-rollout reverse-KL setting.


Créer de l'IA avec l'IA

De l'idée au lancement — accélérez votre développement IA avec le co-codage IA gratuit, un environnement prêt à l'emploi et le meilleur prix pour les GPU.

Codage assisté par IA
GPU prêts à l’emploi
Tarifs les plus avantageux

HyperAI Newsletters

Abonnez-vous à nos dernières mises à jour
Nous vous enverrons les dernières mises à jour de la semaine dans votre boîte de réception à neuf heures chaque lundi matin
Propulsé par MailChimp