Sparsing Law: Towards Large Language Models with Greater Activation Sparsity
本文提出了一种基于PPL-p%稀疏度的度量方法,全面研究了Transformer解码器仅基于的LLM中激活稀疏度的定量缩放特性和影响因素,为提高LLM效率和可解释性提供了重要启示。
更新于 2024-11-09。作者:Yuqi Luo、Chenyang Song、Xu Han、Yingfa Chen、Chaojun Xiao、Zhiyuan Liu、Maosong Sun。
中文摘要
激活稀疏性指的是激活输出中存在大量贡献微弱的可消除元素,这对许多涉及大型语言模型(LLMs)的重要应用有益。尽管在LLMs中促进更高的激活稀疏性值得深入研究,但现有工作缺乏对激活稀疏性与可能影响因素之间关系的全面和定量研究。在本文中,我们对仅基于解码器Transformer的LLMs中激活稀疏性的定量缩放属性和影响因素进行了全面研究。具体来说,我们提出了PPL-p%稀疏性,这是一种精确且性能感知的激活稀疏性度量,适用于任何激活函数。通过大量实验,我们发现了一些重要现象。首先,不同的激活函数表现出相似的性能,但训练时间的稀疏趋势则相反。对于SiLU激活和ReLU激活的LLMs,激活率(即1-稀疏率)分别随着训练数据量的增加而呈现出收敛的幂律增长和对数空间幂律下降。这表明ReLU作为激活函数比SiLU更有效,并且可以利用更多的训练数据来提高激活稀疏性。其次,在某个瓶颈点以下,激活率与宽度-深度比呈线性增加,表明在固定参数规模下,更深架构的潜在优势。最后,在相似的宽度-深度比下,我们惊讶地发现,激活稀疏性的极限值与参数规模的变化关系微弱,即LLMs中的激活模式对参数规模不敏感。这些针对具有更高激活稀疏性的LLMs的经验法则对使LLMs更高效和可解释具有重要意义。
英文摘要
Activation sparsity denotes the existence of substantial weakly-contributed elements within activation outputs that can be eliminated, benefiting many important applications concerned with large language models (LLMs). Although promoting greater activation sparsity within LLMs deserves deep studies, existing works lack comprehensive and quantitative research on the correlation between activation sparsity and potentially influential factors. In this paper, we present a comprehensive study on the quantitative scaling properties and influential factors of the activation sparsity within decoder-only Transformer-based LLMs. Specifically, we propose PPL-p% sparsity, a precise and performance-aware activation sparsity metric that is applicable to any activation function. Through extensive experiments, we find several important phenomena. Firstly, different activation functions exhibit comparable performance but opposite training-time sparsity trends. The activation ratio (i.e., 1-sparsity ratio) evolves as a convergent increasing power-law and decreasing logspace power-law with the amount of training data for SiLU-activated and ReLU-activated LLMs, respectively. These demonstrate that ReLU is more efficient as the activation function than SiLU and can leverage more training data to improve activation sparsity. Secondly, the activation ratio linearly increases with the width-depth ratio below a certain bottleneck point, indicating the potential advantage of a deeper architecture at a fixed parameter scale. Finally, at similar width-depth ratios, we surprisingly find that the limit value of activation sparsity varies weakly with the parameter scale, i.e., the activation patterns within LLMs are insensitive to the parameter scale. These empirical laws towards LLMs with greater activation sparsity have important implications for making LLMs more efficient and interpretable.
解读
一句话总结
本文提出了一种基于PPL-p%稀疏度的度量方法,全面研究了Transformer解码器仅基于的LLM中激活稀疏度的定量缩放特性和影响因素,为提高LLM效率和可解释性提供了重要启示。
问题1:这篇论文想要解决什么具体问题?
• 问题背景:激活稀疏性在LLM中具有重要意义,但现有研究缺乏对激活稀疏度与潜在影响因素之间关系的全面和定量研究。 • 现有方案不足:现有研究主要依赖于经验设定稀疏度阈值,缺乏灵活性和性能感知,且难以适应不同激活函数。 • 研究目标:提出一种精确、通用、性能感知的激活稀疏度度量方法,并全面研究激活稀疏度与训练数据量、激活函数、宽度-深度比和参数规模等因素之间的关系。
问题2:论文的核心创新点是什么?
• 技术创新:提出了一种名为PPL-p%稀疏度的精确、通用、性能感知的激活稀疏度度量方法,通过引入层自适应阈值和PPL作为性能代理,实现了对弱贡献神经元的精确识别。 • 方法改进:通过大量实验,全面研究了激活稀疏度与训练数据量、激活函数、宽度-深度比和参数规模等因素之间的关系,揭示了激活稀疏度的定量缩放规律。 • 优势:与现有方法相比,PPL-p%稀疏度在提高激活稀疏度的同时,能够保证模型性能,为LLM开发者提供更有效的指导。
问题3:实验结果如何验证了方法的有效性?
• 关键实验:通过大量实验,验证了PPL-p%稀疏度的有效性,并揭示了激活稀疏度与训练数据量、激活函数、宽度-深度比和参数规模等因素之间的关系。 • 性能提升:实验结果表明,与SiLU激活函数相比,ReLU激活函数能够获得更高的激活稀疏度,且性能相当。 • 对比结果:实验结果表明,PPL-p%稀疏度在保证模型性能的前提下,能够显著提高激活稀疏度。
问题4:这个研究的实际应用价值是什么?
• 应用场景:该研究为LLM开发者提供了更有效的指导,有助于构建具有更高激活稀疏度的LLM,从而提高LLM的效率和可解释性。 • 实施建议:建议LLM开发者采用ReLU激活函数,并根据PPL-p%稀疏度的结果调整模型架构和训练策略。 • 局限与展望:该研究主要针对Transformer解码器仅基于的LLM,未来可以进一步研究其他类型的LLM,并探索激活稀疏度与神经元专业化之间的关系。
来源
机器可读索引:llms.txt