arXiv:2412.17846cs.CL2024-12中稿 · SoCal NLP Symposiu…

用提示词增强大模型压缩,让小模型更聪明

Enhancing Knowledge Distillation for LLMs with Response-Priming Prompting

  • 在知识蒸馏中引入响应引导提示,提升小模型学习效果
  • 小模型在GSM8K上性能提升55%,超越无提示蒸馏版本
  • 适合想高效部署大模型的开发者和资源受限场景

大语言模型在自然语言处理任务中表现优异,但因计算需求高难以部署。知识蒸馏是将大模型能力迁移到小模型的有效方法。传统方法主要关注教师模型的直接输出,较少关注提示的作用。本文提出一种新型响应引导提示策略,应用于知识蒸馏流程中,以提升学生模型性能。我们通过蒸馏一个量化后的405B参数的Llama 3.1 Instruct教师模型,对8B参数的Llama 3.1 8B Instruct学生模型进行微调,采用LoRA优化,并在GSM8K基准上评估。实验表明,在蒸馏流程中加入推理激发型提示可显著提升学生模型性能。使用真实答案提示时,学生模型在GSM8K上的表现相比无提示蒸馏版本提升55%。对学生模型自注意力层的深入分析显示,表现更优的提示模型在注意力头中表现出特定正向行为,这与准确率提升相关。代码已开源。

原文摘要 · Abstract (English)

Large language models (LLMs) have demonstrated remarkable performance across a wide range of natural language processing (NLP) tasks. However, these models are often difficult to deploy due to significant computational requirements and resource constraints. Knowledge distillation (KD) is an effective technique for transferring the performance of larger LLMs to smaller models. Traditional KD methods primarily focus on the direct output of the teacher model, with little emphasis on the role of prompting during knowledge transfer. In this paper, we propose a set of novel response-priming prompting strategies applied in the knowledge distillation pipeline to enhance the performance of student models. Our approach fine-tunes a smaller Llama 3.1 8B Instruct model by distilling knowledge from a quantized Llama 3.1 405B Instruct teacher model. We apply LoRA optimization and evaluate on the GSM8K benchmark. Experimental results demonstrate that integrating reasoning-eliciting prompting into the proposed KD pipeline significantly improves student model performance, offering an efficient way to deploy powerful models in resource-constrained environments. We find that Ground Truth prompting results in a 55\% performance increase on GSM8K for a distilled Llama 3.1 8B Instruct compared to the same model distilled without prompting. A thorough investigation into the self-attention layers of the student models indicates that the more successful prompted models tend to exhibit certain positive behaviors inside their attention heads which can be tied to their increased accuracy. Our implementation can be found at https://github.com/alonso130r/knowledge-distillation.

知识蒸馏大模型压缩提示工程Llama

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。