Elastic Attention: Test-time Adaptive Sparsity Ratios for Efficient Transformers

📅 2026-01-24
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the limited scalability of large language models in long-context scenarios due to the quadratic complexity of standard attention mechanisms, as well as the inflexibility of existing hybrid attention approaches that employ static sparsity ratios and fail to account for varying sensitivity to sparsity across inputs and tasks. To overcome these limitations, we propose the first elastic attention mechanism capable of dynamically adjusting sparsity ratios at test time. Our approach integrates a lightweight attention router that adaptively assigns each attention head to either a sparse or dense computation path during inference. Trained for only 12 hours on 8×A800 GPUs, the model achieves both efficient inference and state-of-the-art performance across three mainstream long-context benchmarks, significantly enhancing adaptability to diverse tasks.

Technology Category

Application Category

📝 Abstract
The quadratic complexity of standard attention mechanisms poses a significant scalability bottleneck for large language models (LLMs) in long-context scenarios. While hybrid attention strategies that combine sparse and full attention within a single model offer a viable solution, they typically employ static computation ratios (i.e., fixed proportions of sparse versus full attention) and fail to adapt to the varying sparsity sensitivities of downstream tasks during inference. To address this issue, we propose Elastic Attention, which allows the model to dynamically adjust its overall sparsity based on the input. This is achieved by integrating a lightweight Attention Router into the existing pretrained model, which dynamically assigns each attention head to different computation modes. Within only 12 hours of training on 8xA800 GPUs, our method enables models to achieve both strong performance and efficient inference. Experiments across three long-context benchmarks on widely-used LLMs demonstrate the superiority of our method.
Problem

Research questions and friction points this paper is trying to address.

attention mechanism
sparsity
long-context
large language models
test-time adaptation
Innovation

Methods, ideas, or system contributions that make the work stand out.

Elastic Attention
adaptive sparsity
test-time adaptation
efficient Transformers
Attention Router
🔎 Similar Papers
No similar papers found.
Z
Zecheng Tang
Soochow University, China; LCM Laboratory
Quantong Qiu
Quantong Qiu
Soochow University
LLMSparse AttentionKV Cache
Y
Yi Yang
Soochow University, China; LCM Laboratory
Z
Zhiyi Hong
Soochow University, China; LCM Laboratory
H
Haiya Xiang
Soochow University, China; LCM Laboratory
K
Kebin Liu
Baidu Inc, China
Q
Qingqing Dang
Baidu Inc, China
Juntao Li
Juntao Li
Soochow University
Language ModelsText Generation
Min Zhang
Min Zhang
Professor of Computer Science, Soochow University
Statistical Machine TranslationNatural Language Processing and Computational LinguisticsIntelligent ComputingMachine Learning