Attention Layers Add Into Low-Dimensional Residual Subspaces

Junxuan Wang, Xuyang Ge, Wentao Shu, Zhengfu He, Xipeng Qiu
8/23/2025
cs.LGcs.CL

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

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 confined to a surprisingly low-dimensional subspace, where about 60\% of the directions account for 99\% of the variance--a phenomenon that is consistently observed across diverse model families and datasets, and is induced 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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{wang2025attention,
  title  = {Attention Layers Add Into Low-Dimensional Residual Subspaces},
  author = {Junxuan Wang and Xuyang Ge and Wentao Shu and Zhengfu He and Xipeng Qiu},
  year   = {2025},
  eprint = {2508.16929},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2508.16929v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2508.16929.svg)](https://codeofpaper.com/paper/2508.16929)

Discussion