arXiv:2502.06415cs.CLcs.AI2025-02ICLR被引 37

发现大模型中的异常值由注意力机制引发,可提升压缩效率。

Systematic Outliers in Large Language Models

论文配图:Systematic Outliers in Large Language Models
图 1 · 摘自论文原文
  • 识别三类系统性异常值:激活、权重与注意力异常。
  • 异常值源于Softmax操作,具上下文感知缩放作用。
  • 去除异常值可加速收敛,适合模型压缩研究者参考。

大型语言模型(LLMs)中的异常值广泛存在,严重影响性能并给模型压缩带来挑战。现有工作多从算法层面降低异常值影响,却缺乏对其成因与作用的深入探究。本文系统分析了异常值的形成过程、内在原因及功能,定义并分类三种异常值——激活异常值、权重异常值和注意力异常值,并分析其在不同维度上的分布,揭示其与注意力机制的内在关联。基于观察,我们提出并验证了异常值源于自注意力机制中Softmax运算的理论,表明它们在注意力机制中充当隐式的上下文感知缩放因子。由于这些异常值具有系统性来源,故称其为系统性异常值。本研究不仅深化了对Transformer架构的理解,还表明结构化消除异常值可加速收敛并提升模型压缩效果。代码已开源:https://github.com/an-yongqi/systematic-outliers。

原文摘要 · Abstract (English)

Outliers have been widely observed in Large Language Models (LLMs), significantly impacting model performance and posing challenges for model compression. Understanding the functionality and formation mechanisms of these outliers is critically important. Existing works, however, largely focus on reducing the impact of outliers from an algorithmic perspective, lacking an in-depth investigation into their causes and roles. In this work, we provide a detailed analysis of the formation process, underlying causes, and functions of outliers in LLMs. We define and categorize three types of outliers-activation outliers, weight outliers, and attention outliers-and analyze their distributions across different dimensions, uncovering inherent connections between their occurrences and their ultimate influence on the attention mechanism. Based on these observations, we hypothesize and explore the mechanisms by which these outliers arise and function, demonstrating through theoretical derivations and experiments that they emerge due to the self-attention mechanism's softmax operation. These outliers act as implicit context-aware scaling factors within the attention mechanism. As these outliers stem from systematic influences, we term them systematic outliers. Our study not only enhances the understanding of Transformer-based LLMs but also shows that structurally eliminating outliers can accelerate convergence and improve model compression. The code is avilable at https://github.com/an-yongqi/systematic-outliers.

大模型异常值注意力机制模型压缩

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