Towards Understanding the Nature of Attention with Low-Rank Sparse Decomposition

Zhengfu He, Junxuan Wang, Rui Lin, Xuyang Ge, Wentao Shu +3 more
4/29/2025
cs.LGcs.CL

No official code found. Best implementation: OpenMOSS/Lorsa (30 stars, last commit 2025-11-09).

Abstract

We propose Low-Rank Sparse Attention (Lorsa), a sparse replacement model of Transformer attention layers to disentangle original Multi Head Self Attention (MHSA) into individually comprehensible components. Lorsa is designed to address the challenge of attention superposition to understand attention-mediated interaction between features in different token positions. We show that Lorsa heads find cleaner and finer-grained versions of previously discovered MHSA behaviors like induction heads, successor heads and attention sink behavior (i.e., heavily attending to the first token). Lorsa and Sparse Autoencoder (SAE) are both sparse dictionary learning methods applied to different Transformer components, and lead to consistent findings in many ways. For instance, we discover a comprehensive family of arithmetic-specific Lorsa heads, each corresponding to an atomic operation in Llama-3.1-8B. Automated interpretability analysis indicates that Lorsa achieves parity with SAE in interpretability while Lorsa exhibits superior circuit discovery properties, especially for features computed collectively by multiple MHSA heads. We also conduct extensive experiments on architectural design ablation, Lorsa scaling law and error analysis.

View on arXivView PDF

Code Implementations(1)

OpenMOSS/LorsaCommunity100%
300CSS, HTMLDec 12, 202411 months ago

Similar Papers

Cite this paper

@article{he2025towards,
  title  = {Towards Understanding the Nature of Attention with Low-Rank Sparse Decomposition},
  author = {Zhengfu He and Junxuan Wang and Rui Lin and Xuyang Ge and Wentao Shu and Qiong Tang and Junping Zhang and Xipeng Qiu},
  year   = {2025},
  eprint = {2504.20938},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2504.20938v1}
}

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/2504.20938.svg)](https://codeofpaper.com/paper/2504.20938)

Discussion