arXiv:2409.01366cs.CLcs.AI2024-09EMNLP被引 8

通过通道阈值与选择性稀疏化,让大模型推理更快更省资源。

CHESS: Optimizing LLM Inference via Channel-Wise Thresholding and Selective Sparsification

  • 按通道设置阈值,精准控制每层激活神经元数量。
  • 在8个下游任务中表现更优,参数激活量更低,推理提速最高1.27倍。
  • 适合部署大模型到边缘设备的开发者使用。

将大语言模型(LLM)部署在边缘设备上面临计算开销和内存需求大的挑战。激活稀疏化可通过减少推理时激活的神经元数量来缓解资源压力。现有方法通常基于激活张量的统计信息进行阈值稀疏化,但未建模稀疏化对性能的影响,导致性能下降不理想。本文重新构建激活稀疏化问题,显式捕捉稀疏度与模型性能的关系。提出CHESS方法,通过通道级阈值和选择性稀疏化,在前馈网络(FFN)层为每个通道分配独立阈值,并在注意力模块中选择性应用稀疏化。同时设计稀疏内核以加速推理。实验表明,相比现有方法,CHESS在8个下游任务中性能损失更小,激活参数更少,推理速度最高提升1.27倍。

原文摘要 · Abstract (English)

Deploying large language models (LLMs) on edge devices presents significant challenges due to the substantial computational overhead and memory requirements. Activation sparsification can mitigate these resource challenges by reducing the number of activated neurons during inference. Existing methods typically employ thresholding-based sparsification based on the statistics of activation tensors. However, they do not model the impact of activation sparsification on performance, resulting in suboptimal performance degradation. To address the limitations, this paper reformulates the activation sparsification problem to explicitly capture the relationship between activation sparsity and model performance. Then, this paper proposes CHESS, a general activation sparsification approach via CHannel-wise thrEsholding and Selective Sparsification. First, channel-wise thresholding assigns a unique threshold to each activation channel in the feed-forward network (FFN) layers. Then, selective sparsification involves applying thresholding-based activation sparsification to specific layers within the attention modules. Finally, we detail the implementation of sparse kernels to accelerate LLM inference. Experimental results demonstrate that the proposed CHESS achieves lower performance degradation over eight downstream tasks while activating fewer parameters than existing methods, thus speeding up the LLM inference by up to 1.27x.

大模型优化稀疏化边缘推理

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