用自蒸馏恢复剪枝后大模型的性能,避免遗忘问题。
Self-Data Distillation for Recovering Quality in Pruned Large Language Models
- 用原模型生成数据,自蒸馏恢复剪枝损失的知识
- 剪枝后保留91.2%原始准确率,比SFT高9.5个百分点
- 适合需要高效推理的部署场景,如推测解码
大语言模型在自然语言处理中取得显著进展,但部署需大量计算与内存资源。随着模型规模扩大,压缩技术对平衡性能与效率至关重要。结构化剪枝通过移除次要模块降低复杂度,但一次性剪枝常导致性能大幅下降,尤其在多步推理任务中。传统监督微调(SFT)虽可恢复性能,却可能引发灾难性遗忘,改变模型原有数据分布。为此,本文提出自数据蒸馏微调方法,利用未剪枝原模型生成保持语义丰富的蒸馏数据,有效缓解遗忘问题。实验表明,该方法在HuggingFace OpenLLM Leaderboard v1上平均准确率提升达8%。以Llama3.1-8B Instruct为例,剪掉6个解码器层(从32层降至26层,参数量由8.03B降至6.72B),本方法保留91.2%原始准确率,优于SFT的81.7%,同时减少16.3%实际浮点运算量。结合模型融合可进一步提升质量保留效果,并在推测解码中提高令牌接受率,显著提升推理效率。
原文摘要 · Abstract (English)
Large language models have driven significant progress in natural language processing, but their deployment requires substantial compute and memory resources. As models scale, compression techniques become essential for balancing model quality with computational efficiency. Structured pruning, which removes less critical components of the model, is a promising strategy for reducing complexity. However, one-shot pruning often results in significant quality degradation, particularly in tasks requiring multi-step reasoning. To recover lost quality, supervised fine-tuning (SFT) is commonly applied, but it can lead to catastrophic forgetting by shifting the model's learned data distribution. Therefore, addressing the degradation from both pruning and SFT is essential to preserve the original model's quality. In this work, we utilize self-data distilled fine-tuning to address these challenges. Our approach leverages the original, unpruned model to generate a distilled dataset that preserves semantic richness and mitigates catastrophic forgetting by maintaining alignment with the base model's knowledge. Empirically, we demonstrate that self-data distillation consistently outperforms standard SFT, improving average accuracy by up to 8% on the HuggingFace OpenLLM Leaderboard v1. Specifically, when pruning six decoder blocks on Llama3.1-8B Instruct (i.e., 32 to 26 layers, reducing the model size from 8.03B to 6.72B parameters), our method retains 91.2% of the original model's accuracy compared to 81.7% with SFT, while reducing real-world FLOPs by 16.3%. Furthermore, combining self-data distilled models through model merging yields enhanced quality retention. Additionally, leveraging these pruned models in speculative decoding increases token acceptance rates, thereby improving inference efficiency in applied settings.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。