Alleviating Forgetfulness of Linear Attention by Hybrid Sparse Attention and Contextualized Learnable Token Eviction
Mutian He, Philip N. Garner
TL;DR
Linear attention offers $O(1)$ per-step computation but suffers from forgetfulness when past information is compressed into a fixed-size state. The paper proposes contextualized Learnable Token Eviction (LTE) and two hybrids, laLTE and laNSA, to restore selective access to past tokens while preserving constant-time, constant-space operation. LTE uses a lightweight CNN to predict per-head retention scores and drives end-to-end eviction under a budget, while laNSA leverages Native Sparse Attention for input-adaptive selection; both are implemented with efficient Triton/Flash Attention kernels. Across short-context and retrieval-intensive benchmarks, the hybrids substantially close the gap to full transformers under memory and compute constraints, demonstrating the practical value of learned past-token access for retrieval tasks.
Abstract
Linear-attention models that compress the entire input sequence into a fixed-size recurrent state offer an efficient alternative to Transformers, but their finite memory induces forgetfulness that harms retrieval-intensive tasks. To mitigate the issue, we explore a series of hybrid models that restore direct access to past tokens. We interleave token mixers with intermediate time and space complexity between linear and full attention, including sparse attention with token eviction, and the query-aware native sparse attention. Particularly, we propose a novel learnable token eviction approach. Combined with sliding-window attention, an end-to-end trainable lightweight CNN aggregates information from both past and future adjacent tokens to adaptively retain a limited set of critical KV-pairs per head, maintaining linear attention's constant time and space complexity. Efficient Triton kernels for the sparse attention mechanisms are provided. Empirical evaluations on retrieval-intensive benchmarks support the effectiveness of our approaches.
