arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.06415cs.CLcs.AIcs.LG
收藏

大型语言模型中的系统性异常值

Systematic Outliers in Large Language Models

Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所);University of Chinese Academy of Sciences(中国科学院大学);Wuhan AI Research(武汉人工智能研究院);Objecteye Inc.(智视科技)

Yongqi An, Xu Zhao, Tao Yu, Ming Tang, Jinqiao Wang

AI总结:

本研究系统分析大型语言模型中的异常值,将其分类为激活、权重和注意力异常值,证明其源于自注意力softmax操作,并作为隐式缩放因子,结构性消除可加速收敛并改善压缩。

摘要:

异常值在大型语言模型(LLMs)中被广泛观察到,显著影响模型性能并对模型压缩构成挑战。理解这些异常值的功能和形成机制至关重要。然而,现有工作主要从算法角度减少异常值的影响,缺乏对其成因和作用的深入研究。在本工作中,我们对LLMs中异常值的形成过程、根本原因和功能进行了详细分析。我们定义并分类了三种类型的异常值——激活异常值、权重异常值和注意力异常值,并分析了它们在不同维度上的分布,揭示了它们的出现与对注意力机制的最终影响之间的内在联系。基于这些观察,我们假设并探索了这些异常值产生和运作的机制,通过理论推导和实验证明,它们是由于自注意力机制的softmax操作而产生的。这些异常值在注意力机制中充当隐式的上下文感知缩放因子。由于这些异常值源于系统性影响,我们将其称为系统性异常值。我们的研究不仅增强了对基于Transformer的LLMs的理解,还表明结构性消除异常值可以加速收敛并改善模型压缩。代码可在https://github.com/an-yongqi/systematic-outliers获取。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑