arXiv:2411.02335cs.LGcs.CL2024-11ICML被引 25

发现大模型激活稀疏性的普适规律,助力高效可解释模型设计

Sparsing Law: Towards Large Language Models with Greater Activation Sparsity

  • 提出新型稀疏性度量PPL-p%,精准评估任意激活函数的稀疏程度
  • 发现ReLU比SiLU更易提升稀疏性,且随数据量呈幂律增长
  • 模型宽度深度比决定稀疏性上限,参数规模对稀疏模式影响微弱

激活稀疏性指激活输出中存在大量贡献较弱的元素,可被移除,对大语言模型(LLM)的诸多应用有益。尽管提升激活稀疏性值得深入研究,现有工作缺乏对稀疏性与关键影响因素之间定量关系的系统分析。本文针对仅解码器的Transformer架构大模型,开展激活稀疏性的量化缩放特性与影响因素的全面研究。我们提出一种通用的、性能感知的激活稀疏性度量方法PPL-p%,适用于任意激活函数。通过大量实验,发现若干重要现象:第一,不同激活函数表现相近但训练期间稀疏性趋势相反;对于SiLU激活的模型,激活率(即1-稀疏率)随训练数据量呈收敛的幂律上升;而ReLU激活的模型则呈现对数空间幂律下降,表明ReLU在提升稀疏性方面更高效,能更好利用训练数据。第二,在固定参数量下,激活率随宽度-深度比线性增长,表明更深架构更具优势。第三,在相似宽度-深度比下,激活稀疏性的极限值随参数规模变化微弱,说明大模型的激活模式对参数规模不敏感。这些实证规律为构建更高效、可解释的大语言模型提供了重要指导。

原文摘要 · Abstract (English)

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-\mathrm{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.

大模型优化激活稀疏性模型效率架构设计

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