[论文解读] On-Policy Distillation of Language Models: Learning from Self-Generated Mistakes
本文提出广义知识蒸馏(GKD),一种用于自回归语言模型的新颖的在线策略蒸馏方法,该方法利用教师提供的逐 token 概率,对学生自生成的序列进行训练。GKD 减少了训练与推理之间的分布偏移,在摘要任务上实现了最高达 2.1 倍的相对性能提升,并支持与强化学习微调的无缝集成。
Knowledge distillation (KD) is widely used for compressing a teacher model to reduce its inference cost and memory footprint, by training a smaller student model. However, current KD methods for auto-regressive sequence models suffer from distribution mismatch between output sequences seen during training and those generated by the student during inference. To address this issue, we introduce Generalized Knowledge Distillation (GKD). Instead of solely relying on a fixed set of output sequences, GKD trains the student on its self-generated output sequences by leveraging feedback from the teacher on such sequences. Unlike supervised KD approaches, GKD also offers the flexibility to employ alternative loss functions between the student and teacher, which can be useful when the student lacks the expressivity to mimic the teacher's distribution. Furthermore, GKD facilitates the seamless integration of distillation with RL fine-tuning (RLHF). We demonstrate the efficacy of GKD for distilling auto-regressive language models on summarization, translation, and arithmetic reasoning tasks, and task-agnostic distillation for instruction-tuning.
研究动机与目标
- 解决自回归语言模型知识蒸馏中训练与推理之间的分布不匹配问题。
- 克服固定数据集蒸馏与前向 KL 最小化方法的局限性,这些方法在学生无法充分表达教师分布时可能导致泛化性能差。
- 通过使用在线策略学生自生成的序列实现有效蒸馏,提升训练与推理分布之间的一致性。
- 促进蒸馏与强化学习微调的集成,尤其适用于基于奖励的优化。
- 通过使用替代发散度度量(如反向 KL、JSD)展示 GKD 的灵活性,以更好地适应学生模型的表达能力约束。
提出的方法
- 在推理过程中由学生模型生成的序列上训练学生模型,使用教师提供的逐 token 概率作为监督信号。
- 采用在线策略数据收集:学生生成序列,教师提供逐 token 概率以指导蒸馏过程。
- 支持对多种学生与教师分布之间发散度的优化,包括反向 KL、前向 KL 和广义 JSD。
- 将 GKD 与强化学习微调(如 RLAIF)集成,使学生在蒸馏与序列级奖励目标上联合优化。
- 将 GKD 应用于任务特定与任务无关的蒸馏,包括指令微调与推理任务。
- 采用动态加权策略(如带温度缩放的 JSD)在联合训练中平衡蒸馏与奖励目标。
实验结果
研究问题
- RQ1使用自生成序列的在线策略蒸馏是否能有效减少自回归语言模型中训练与推理之间的分布偏移?
- RQ2与依赖固定教师生成或真实标签序列的传统知识蒸馏方法相比,GKD 的表现如何?
- RQ3GKD 是否能与强化学习微调有效结合,以提升策略对齐性与模型性能?
- RQ4在不同学生模型容量与任务约束下,哪种发散度度量(如前向 KL、反向 KL、JSD)能取得最佳性能?
- RQ5GKD 是否能提升任务无关蒸馏中的泛化能力,例如在指令微调或推理基准任务中?
主要发现
- 与基线 KD 方法相比,GKD 在摘要任务上实现了最高达 2.1 倍的相对性能提升,在机器翻译任务上为 1.7 倍,在算术推理任务上为 1.9 倍。
- 在 BBH 和 MMLU 基准测试中,GKD 分别实现了 2% 和 1% 的绝对准确率提升,适用于任务无关蒸馏。
- 与离线策略或固定数据集蒸馏相比,使用 GKD 的在线策略蒸馏显著降低了暴露偏差,并提升了泛化能力。
- GKD 支持与强化学习微调的无缝集成,通过正则化向教师策略对齐,其性能优于标准的 RLHF 方法。
- 当学生模型表达能力有限时,使用反向 KL 或广义 JSD 的 GKD 表现优于前向 KL。
- GKD 在不同规模的 T5 模型上表现出良好的可扩展性与鲁棒性,包括学生模型小至教师模型 1/26 的情况。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。