DAPE V2: Process Attention Score as Feature Map for Length Extrapolation
Chuanyang Zheng, Yihang Gao, Han Shi, Jing Xiong, Jiankai Sun, Jingyao Li, Minbin Huang, Xiaozhe Ren, Michael Ng, Xin Jiang, Zhenguo Li, Yu Li
Abstract
The attention mechanism is a fundamental component of the Transformer model, contributing to interactions among distinct tokens, in contrast to earlier feed-forward neural networks. In general, the attention scores are determined simply by the key-query products. However, this work's occasional trial (combining DAPE and NoPE) of including additional MLPs on attention scores without position encoding indicates that the classical key-query multiplication may limit the performance of Transformers. In this work, we conceptualize attention as a feature map and apply the convolution operator (for neighboring attention scores across different heads) to mimic the processing methods in computer vision. Specifically, the main contribution of this paper is identifying and interpreting the Transformer length extrapolation problem as a result of the limited expressiveness of the naive query and key dot product, and we successfully translate the length extrapolation issue into a well-understood feature map processing problem. The novel insight, which can be adapted to various attention-related models, reveals that the current Transformer architecture has the potential for further evolution. Extensive experiments demonstrate that treating attention as a feature map and applying convolution as a processing method significantly enhances Transformer performance.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
7 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Efficient Streaming Language Models with Attention Sinks cites Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
- Efficient Streaming Language Models with Attention Sinks cites Language Models are Few-Shot Learners
- PaTH Attention: Position Encoding via Accumulating Householder Transformations cites Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
- Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation cites Language Models are Few-Shot Learners
- Scalable Diffusion Models with Transformers cites Language Models are Few-Shot Learners
- Context-aware Biases for Length Extrapolation cites Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
- Beyond Real: Imaginary Extension of Rotary Position Embeddings for Long-Context LLMs cites PaTH Attention: Position Encoding via Accumulating Householder Transformations
- Beyond Real: Imaginary Extension of Rotary Position Embeddings for Long-Context LLMs cites Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
- SAS: Simulated Attention Score cites Efficient Streaming Language Models with Attention Sinks
- SAS: Simulated Attention Score cites Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
- SAS: Simulated Attention Score cites Language Models are Few-Shot Learners
- SAS: Simulated Attention Score cites PEGASUS: Pre-training with Extracted Gap-sentences for Abstractive Summarization
Cited by top-tier papers7
- PaTH Attention: Position Encoding via Accumulating Householder TransformationsSonglin Yang, Yikang Shen, Kaiyue Wen, Shawn Tan et al.NeurIPS 2025 · 36 citations
- Mixture-of-Scores: Robust Image-Text Data Valuation via Three Lines of CodeSitong Wu, Haoru Tan, Yukang Chen, Shaofeng Zhang et al.ICCV 2025 · 4 citations
- SAS: Simulated Attention ScoreChuanyang Zheng, Jiankai Sun, Yihang Gao, Yuehao Wang et al.NeurIPS 2025 · 3 citations
- Context-aware Biases for Length ExtrapolationAli Veisi, Hamidreza Amirzadeh, Amir MansourianEMNLP 2025 · 2 citations
- Beyond Real: Imaginary Extension of Rotary Position Embeddings for Long-Context LLMsXiaoran Liu, Yuerong Song, Zhigeng Liu, Zengfeng Huang et al.ICLR 2026 · 2 citations
Builds on54
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- Scalable Diffusion Models with TransformersWilliam Peebles, Saining XieICCV 2023 · 5,568 citations
- PEGASUS: Pre-training with Extracted Gap-sentences for Abstractive SummarizationJingqing Zhang, Yao Zhao, Mohammad Saleh, Peter J. LiuICML 2020 · 2,453 citations
- Efficient Streaming Language Models with Attention SinksGuangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han et al.ICLR 2024 · 1,714 citations
- Train Short, Test Long: Attention with Linear Biases Enables Input Length ExtrapolationOfir Press, Noah A. Smith, Mike LewisICLR 2022 · 1,168 citations
Related papers
- Evolving Attention with Residual ConvolutionsYujing Wang, Yaming Yang, Jiangang Bai, Mingliang Zhang et al.ICML 2021 · 43 citations
- A Length-Extrapolatable TransformerYutao Sun, Li Dong, Barun Patra, Shuming Ma et al.ACL 2023 · 45 citations
- Jump Self-attention: Capturing High-order Statistics in TransformersHaoyi Zhou, Siyang Xiao, Shanghang Zhang, Jieqi Peng et al.NeurIPS 2022 · 4 citations
- Transformer Working Memory Enables Regular Language Reasoning And Natural Language Length ExtrapolationTa-Chung Chi, Ting-Han Fan, Alexander Rudnicky, Peter J. RamadgeEMNLP Findings 2023 · 1 citation
- Linear Log-Normal Attention with Unbiased ConcentrationYury Nahshan, Joseph Kampeas, Emir HalevaICLR 2024 · 13 citations
