arXiv:2508.16929cs.LGcs.CL2025-08被引 5

Transformer注意力输出维数远低于预期,导致稀疏字典学习中特征失效问题。

Dimensional Collapse in Transformer Attention Outputs: A Challenge for Sparse Dictionary Learning

  • 发现注意力输出有效维度仅占全空间60%,远低于MLP的90%。
  • 提出子空间约束训练法,将特征方向初始化至激活主子空间。
  • 使100万特征的注意力稀疏自编码器死特征从87%降至1%以下。

Transformer架构及其注意力机制构成现代大语言模型的基础。尽管普遍认为变换器在高维隐藏空间中运行,我们发现注意力输出实际上受限于一个出人意料的低维子空间,其有效维度仅为完整空间的约60%。相比之下,MLP输出和残差流仍接近满秩,有效秩约为90%。这种显著的维数差异在多种模型族和数据集上持续存在,且强烈受注意力输出投影矩阵影响。关键发现是,这一低秩结构是稀疏字典学习中常见‘死特征’问题的关键因素,因为它导致随机初始化特征与激活空间内在几何结构不匹配。基于此洞察,我们提出了针对稀疏自编码器(SAEs)的子空间约束训练方法,将特征方向初始化至激活主子空间。该方法将具有100万特征的注意力输出SAEs中的死特征从87%降至1%以下,并可推广至其他稀疏字典学习方法。研究为注意力几何提供了新见解,也为改进大语言模型中的稀疏字典学习提供了实用工具。

原文摘要 · Abstract (English)

Transformer architectures, and their attention mechanisms in particular, form the foundation of modern large language models. While transformer models are widely believed to operate in high-dimensional hidden spaces, we show that attention outputs are in fact confined to a surprisingly low-dimensional subspace, with an effective dimensionality of only about $60\%$ of the full space. In contrast, MLP outputs and residual streams remain much closer to full-rank, exhibiting effective ranks around $90\%$. This striking dimensional discrepancy is consistently observed across diverse model families and datasets, and is strongly shaped by the attention output projection matrix. Critically, we find this low-rank structure as a key factor of the prevalent dead feature problem in sparse dictionary learning, where it creates a mismatch between randomly initialized features and the intrinsic geometry of the activation space. Building on this insight, we propose a subspace-constrained training method for sparse autoencoders (SAEs), initializing feature directions into the active subspace of activations. Our approach reduces dead features from 87\% to below 1\% in Attention Output SAEs with 1M features, and can further extend to other sparse dictionary learning methods. Our findings provide both new insights into the geometry of attention and practical tools for improving sparse dictionary learning in large language models.

Transformer稀疏编码低秩结构

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