学会高效:在大语言模型中构建结构化稀疏性
Learn To be Efficient: Build Structured Sparsity in Large Language Models
AI总结:
针对大语言模型推理开销高的问题,提出训练算法LTE以构建更结构化的激活稀疏性,适配多种激活函数的模型,在多项任务上优于现有基线,结合硬件优化可显著降低推理延迟。
摘要:
大语言模型(LLMs)凭借其十亿级参数取得了显著成功,但也带来了高昂的推理开销。LLMs中激活稀疏性的出现提供了一种降低该成本的天然途径,即仅让部分参数参与推理。然而,现有方法仅专注于在训练后场景下利用这种自然形成的激活稀疏性,忽略了进一步放大这种固有稀疏性的潜力。本文提出假设:LLMs可以通过实现更具结构化的激活稀疏性来学会高效运行。为实现这一目标,我们提出了一种新颖的训练算法——Learn-To-be-Efficient(LTE,学会高效),旨在训练具备效率感知的LLMs,使其学会激活更少的神经元,并在稀疏性与性能之间实现更好的权衡。此外,与主要聚焦于基于ReLU的模型的当前最优(SOTA)MoEfication方法不同,LTE还可应用于使用非ReLU激活函数的LLMs(如LLaMA)。在语言理解、语言生成和指令微调任务上的大量评估表明,LTE始终优于SOTA基线。结合我们的硬件感知自定义内核实现,LTE在50%稀疏度下将LLaMA2-7B的推理延迟降低了25%。
英文摘要:
Large Language Models (LLMs) have achieved remarkable success with their billion-level parameters, yet they incur high inference overheads. The emergence of activation sparsity in LLMs provides a natural approach to reduce this cost by involving only parts of the parameters for inference. However, existing methods only focus on utilizing this naturally formed activation sparsity in a post-training setting, overlooking the potential for further amplifying this inherent sparsity. In this paper, we hypothesize that LLMs can learn to be efficient by achieving more structured activation sparsity. To achieve this, we introduce a novel training algorithm, Learn-To-be-Efficient (LTE), designed to train efficiency-aware LLMs to learn to activate fewer neurons and achieve a better trade-off between sparsity and performance. Furthermore, unlike SOTA MoEfication methods, which mainly focus on ReLU-based models, LTE can also be applied to LLMs like LLaMA using non-ReLU activations. Extensive evaluation on language understanding, language generation, and instruction tuning tasks show that LTE consistently outperforms SOTA baselines. Along with our hardware-aware custom kernel implementation, LTE reduces LLaMA2-7B inference latency by 25% at 50% sparsity.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。