arXiv:2502.07004cs.CL2025-02ICML被引 1

揭示大模型中高范数令牌的奇异缺陷成因与机制

Demystifying Singular Defects in Large Language Models

  • 通过分析层间奇异方向预测令牌范数突增
  • 负特征值解释令牌范数突然衰减现象
  • 发现初始与非初始令牌路径差异,适合模型优化研究者

大型Transformer模型常产生高范数令牌。在视觉Transformer(ViTs)中,此类令牌可通过层线性近似矩阵的奇异向量进行数学建模。然而,在大语言模型(LLMs)中,高范数令牌的成因仍缺乏深入探索,且其特性与ViTs存在差异,需建立新分析框架。本文在多种近期模型中提供理论洞察与实证验证,得出以下结论:i)层间奇异方向可预测LLM中令牌范数的突增;ii)层的负特征值解释其范数的突然衰减;iii)初始与非初始令牌的高范数生成路径不同;iv)高范数令牌由对应模块矩阵近似右侧主奇异向量触发。我们展示了两项实际应用:改进量化方案与设计LLM签名。研究不仅深化了对LLM奇异缺陷的理解,也为应用开辟新路径。代码已开源(https://github.com/haoqiwang/singular_defect)。

原文摘要 · Abstract (English)

Large transformer models are known to produce high-norm tokens. In vision transformers (ViTs), such tokens have been mathematically modeled through the singular vectors of the linear approximations of layers. However, in large language models (LLMs), the underlying causes of high-norm tokens remain largely unexplored, and their different properties from those of ViTs require a new analysis framework. In this paper, we provide both theoretical insights and empirical validation across a range of recent models, leading to the following observations: i) The layer-wise singular direction predicts the abrupt explosion of token norms in LLMs. ii) The negative eigenvalues of a layer explain its sudden decay. iii) The computational pathways leading to high-norm tokens differ between initial and noninitial tokens. iv) High-norm tokens are triggered by the right leading singular vector of the matrix approximating the corresponding modules. We showcase two practical applications of these findings: the improvement of quantization schemes and the design of LLM signatures. Our findings not only advance the understanding of singular defects in LLMs but also open new avenues for their application. We expect that this work will stimulate further research into the internal mechanisms of LLMs. Code is released at https://github.com/haoqiwang/singular_defect.

大模型奇异缺陷令牌范数模型分析

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