根据用户指令动态调整模型参数,让小模型更聪明。
Instruction-Following Pruning for Large Language Models
- 按指令动态选择模型参数,不固定剪枝方式。
- 30亿参数模型在数学、编程任务上超越同规模全连接模型5-8分。
- 适合追求高效推理的开发者和资源受限场景使用。
随着大语言模型的快速扩展,结构化剪枝已成为从大模型中学习高效小型模型的常用技术,其性能优于同等规模模型从零训练的结果。本文突破传统静态剪枝方法(即为模型确定固定剪枝掩码),提出一种动态结构化剪枝方法。该方法使剪枝掩码依赖于输入,能根据用户指令动态调整,激活最相关的模型参数。我们称之为“指令跟随剪枝”,引入一个稀疏掩码预测器,以用户指令为输入,动态选择与当前任务最相关的参数。通过联合优化稀疏掩码预测器与大语言模型,利用指令遵循数据和预训练语料库实现有效参数识别与激活。实验结果表明,该方法在多种评估基准上表现优异:例如,我们的3B激活模型在数学、编程等领域的绝对性能较3B稠密模型提升5-8分,媲美9B模型性能。
原文摘要 · Abstract (English)
With the rapid scaling of large language models (LLMs), structured pruning has become a widely used technique to learn efficient, smaller models from larger ones, delivering superior performance compared to training similarly sized models from scratch. In this paper, we move beyond the traditional static pruning approach of determining a fixed pruning mask for a model, and propose a dynamic approach to structured pruning. In our method, the pruning mask is input-dependent and adapts dynamically based on the information described in a user instruction. Our approach, termed "instruction-following pruning", introduces a sparse mask predictor that takes the user instruction as input and dynamically selects the most relevant model parameters for the given task. To identify and activate effective parameters, we jointly optimize the sparse mask predictor and the LLM, leveraging both instruction-following data and the pre-training corpus. Experimental results demonstrate the effectiveness of our approach on a wide range of evaluation benchmarks. For example, our 3B activated model improves over the 3B dense model by 5-8 points of absolute margin on domains such as math and coding, and rivals the performance of a 9B model.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。