通过动态路由跳过低重要性词元,实现大模型高效推理。
FTP: A Fine-grained Token-wise Pruner for Large Language Models via Token Routing
- 设计可学习路由机制,按词元细粒度判断是否跳过计算。
- 在70%以上词元稀疏度下,准确率仍比现有方法高10点左右。
- 无需额外训练即可部署,适合工业级大模型推理加速场景。
近期大语言模型(LLMs)凭借缩放定律在各类任务中表现出色,但推理时巨大的计算开销限制了其在工业应用中的部署。现有压缩方法常需额外训练恢复性能,且在特定加速目标下准确率下降明显。为此,本文提出一种细粒度词元级剪枝方法(FTP),通过可学习的路由机制,在模型各层中自适应识别并跳过不重要的词元以降低计算量。为高效构建路由,我们设计了一种基于搜索的稀疏度调度器,结合四种低维特征输入与三种损失函数的可训练路由模块。在多个不同大模型和基准测试上进行广泛实验,结果表明该方法达到当前最优剪枝效果:在相同词元稀疏度水平下,相比BlockPruner和ShortGPT,LLaMA2-7B和Qwen1.5-7B的准确率提升约10个百分点。
原文摘要 · Abstract (English)
Recently, large language models (LLMs) have demonstrated superior performance across various tasks by adhering to scaling laws, which significantly increase model size. However, the huge computation overhead during inference hinders the deployment in industrial applications. Many works leverage traditional compression approaches to boost model inference, but these always introduce additional training costs to restore the performance and the pruning results typically show noticeable performance drops compared to the original model when aiming for a specific level of acceleration. To address these issues, we propose a fine-grained token-wise pruning approach for the LLMs, which presents a learnable router to adaptively identify the less important tokens and skip them across model blocks to reduce computational cost during inference. To construct the router efficiently, we present a search-based sparsity scheduler for pruning sparsity allocation, a trainable router combined with our proposed four low-dimensional factors as input and three proposed losses. We conduct extensive experiments across different benchmarks on different LLMs to demonstrate the superiority of our method. Our approach achieves state-of-the-art (SOTA) pruning results, surpassing other existing pruning methods. For instance, our method outperforms BlockPruner and ShortGPT by approximately 10 points on both LLaMA2-7B and Qwen1.5-7B in accuracy retention at comparable token sparsity levels.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。