用大模型教小模型,提升小模型性能并降低推理成本
Knowledge Distillation Using Frontier Open-source LLMs: Generalizability and the Role of Synthetic Data
- 用405B大模型生成数据,训练8B和70B小模型
- 合成数据显著提升小模型准确率,部分任务超405B零样本表现
- 仅标准微调即可让小模型学会大模型的推理能力
领先的开源大语言模型如Llama-3.1-Instruct-405B在文本生成、问答和自然语言理解任务中表现出色,但推理成本和延迟较高。知识蒸馏可通过大模型(教师)输出训练更小的学生模型,实现更低的成本与延迟,同时保持相近精度。本文评估了以Llama-3.1-405B-Instruct为教师,Llama-3.1-8B-Instruct和Llama-3.1-70B-Instruct为学生模型的蒸馏效果。结果表明:(a) 蒸馏在不同任务和数据集上具有良好的泛化性;(b) 使用合成数据能显著提升8B和70B模型的准确率,结合推理链时甚至在某些数据集上达到或超过405B模型的零样本性能;(c) 仅通过标准微调,8B和70B模型即可内化405B的推理能力,无需定制损失函数;(d) 提出任务特定评估方法,包括人工与LLM评分、基于真实答案的传统准确率基准,揭示合成数据质量对蒸馏效果的根本影响,并强调多维度评估的重要性。
原文摘要 · Abstract (English)
Leading open-source large language models (LLMs) such as Llama-3.1-Instruct-405B are extremely capable at generating text, answering questions, and solving a variety of natural language understanding tasks. However, they incur higher inference cost and latency compared to smaller LLMs. Knowledge distillation provides a way to use outputs from these large, capable teacher models to train smaller student models which can be used for inference at lower cost and latency, while retaining comparable accuracy. We investigate the efficacy of distillation using the Llama-3.1-405B-Instruct teacher and the smaller Llama-3.1-8B-Instruct and Llama-3.1-70B-Instruct student models. Contributions of this work include (a) We evaluate the generalizability of distillation with the above Llama-3.1 teacher-student pairs across different tasks and datasets (b) We show that using synthetic data during distillation significantly improves the accuracy of 8B and 70B models, and when used with reasoning chains, even matches or surpasses the zero-shot accuracy of 405B model on some datasets (c) We empirically show that distillation enables 8B and 70B models to internalize 405B's reasoning ability by using only standard fine-tuning (without customizing any loss function). This allows cost and latency-efficient student model inference. (d) We show pitfalls in evaluation of distillation, and present task-specific evaluation, including both human and LLM-grading, and ground-truth based traditional accuracy benchmarks. This methodical study brings out the fundamental importance of synthetic data quality in knowledge distillation, and of combining multiple, task-specific ways of accuracy and quality evaluation in assessing the effectiveness of distillation.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。