Personalised Distillation: Empowering Open-Sourced LLMs with Adaptive Learning for Code Generation
作者: Hailin Chen, Amrita Saha, Steven Hoi, Shafiq Joty
分类: cs.CL, cs.LG
发布日期: 2023-10-28 (更新: 2024-01-26)
备注: Accepted to EMNLP 2023; Codes at: https://github.com/SalesforceAIResearch/PersDistill
💡 一句话要点
提出个性化蒸馏以提升开源LLM的代码生成能力
🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture)
关键词: 个性化蒸馏 开源LLM 代码生成 机器学习 模型优化
📋 核心要点
- 现有的蒸馏方法未能充分考虑学生模型的特性,导致学习效率低下。
- 本文提出个性化蒸馏,通过让学生模型先尝试解决任务,再由教师模型提供针对性反馈,提升学习效果。
- 实验结果表明,个性化蒸馏在代码生成任务中,使用仅2.5-3K个个性化示例,显著提升了模型性能。
📝 摘要(中文)
随着强大的闭源大语言模型(如ChatGPT、GPT-4)的崛起,越来越多的研究关注如何将这些模型的能力蒸馏到较小的开源模型中。以往的蒸馏方法通常通过提示ChatGPT生成一系列指令和答案供学生模型学习,但这种标准蒸馏方法忽视了学生模型的优点和条件。本文设计了一种个性化蒸馏过程,学生模型首先尝试解决任务,然后教师模型提供适应性改进。个性化蒸馏使学生模型仅在错误示例上学习,从而提升其自身解决方案的能力。在代码生成任务中,个性化蒸馏在仅使用三分之一数据的情况下,持续超越标准蒸馏方法。
🔬 方法详解
问题定义:本文旨在解决现有蒸馏方法未能充分利用学生模型特性的问题,导致学习效果不佳。标准蒸馏方法通常依赖于教师模型的输出,忽视了学生模型的个体差异。
核心思路:论文提出的个性化蒸馏方法,强调学生模型在尝试解决任务后,教师模型提供适应性反馈。这种方法使得学生模型能够在其错误的基础上进行学习,从而实现个性化的学习过程。
技术框架:个性化蒸馏的整体流程包括两个主要阶段:首先,学生模型独立尝试解决给定任务;其次,教师模型基于学生的表现提供针对性的改进建议。此过程形成了一个循环,学生模型不断优化其解决方案。
关键创新:最重要的创新在于个性化学习机制,学生模型仅在其犯错的示例上进行学习,避免了传统方法中的信息过载。这一设计使得学习过程更加高效和针对性。
关键设计:在实现过程中,论文对数据收集和示例选择进行了精细化设计,确保学生模型在学习时接触到最具挑战性的示例。此外,损失函数的设计也考虑了个性化反馈的有效性,以促进学生模型的快速提升。
🖼️ 关键图片
📊 实验亮点
实验结果显示,个性化蒸馏在代码生成任务中显著提升了模型性能。具体而言,CodeGen-mono-16B在使用仅2.5-3K个个性化示例后,性能提升了7%,达到36.4%的pass@1,而StarCoder的性能提升更是达到了12.2%,达到45.8%的pass@1。这些结果表明个性化蒸馏方法的有效性和优越性。
🎯 应用场景
该研究的潜在应用领域包括软件开发、自动化代码生成及教育领域。通过提升开源大语言模型的代码生成能力,能够降低开发成本,提高开发效率,促进开源社区的技术进步。未来,该方法还可能扩展到其他领域,如自然语言处理和机器学习模型的训练。
📄 摘要(原文)
With the rise of powerful closed-sourced LLMs (ChatGPT, GPT-4), there are increasing interests in distilling the capabilies of close-sourced LLMs to smaller open-sourced LLMs. Previous distillation methods usually prompt ChatGPT to generate a set of instructions and answers, for the student model to learn. However, such standard distillation approach neglects the merits and conditions of the student model. Inspired by modern teaching principles, we design a personalised distillation process, in which the student attempts to solve a task first, then the teacher provides an adaptive refinement for the student to improve. Instead of feeding the student with teacher's prior, personalised distillation enables personalised learning for the student model, as it only learns on examples it makes mistakes upon and learns to improve its own solution. On code generation, personalised distillation consistently outperforms standard distillation with only one third of the data. With only 2.5-3K personalised examples that incur a data-collection cost of 4-6$, we boost CodeGen-mono-16B by 7% to achieve 36.4% pass@1 and StarCoder by 12.2% to achieve 45.8% pass@1 on HumanEval.