Self-attention plays a key role in long-sequence modeling, but its quadratic time complexity fundamentally limits the scaling of Large Language Models. Recently, Multi-State Linear Attention (MSLA) mechanisms have been proposed to make sequence modeling more efficient by splitting the context into segments and compressing each in its own memory state. MSLA aggregates the information extracted from each memory state using only the mean alignment between a query and each segment's keys, ignoring how the alignment is distributed within the segment. In order to model the relevance of a segment to a query more comprehensively and incorporate the variance of the alignment in the aggregation, we propose MERLIN (MomEnt Routing for multi-state LINear attention), a method that tracks the first and second moments of each segment's keys. Using the moments of keys, a query can recover both the mean and the variance of its alignment with each segment to perform a more content-aware aggregation of per-state readouts. Experiments on multi-state variants of Gated DeltaNet-1.3B and Mamba-2-780M show that MERLIN consistently outperforms existing aggregation methods on various long-context tasks. In particular, MERLIN outperforms baselines on RULER needle-in-a-haystack and long-context QA (+8.3% for Gated DeltaNet-1.3B and +7.0% for Mamba-2-780M) and diverse subtasks in LongBench (+13.5% and +12.0%). It even outperforms baselines that consume 4x more memory. MERLIN provides a simple and general routing mechanism for improving long-context capabilities of MSLA models.
Block-Sparse Attention with Semantic-Geometric Decoupled Routing
Tsinghua University(清华大学);Alibaba Group(阿里巴巴集团);University of Science and Technology of China(中国科学技术大学);Shanghai Artificial Intelligence Laboratory(上海人工智能实验室)
Mitigating LLM Over-Refusal via Dynamic Semantic Routing Calibration
School of Artificial Intelligence, Jilin University(吉林大学人工智能学院);CSIRO(澳大利亚联邦科学与工业研究组织);Center of Excellence for Generative AI, King Abdullah University of Science and Technology(阿卜杜拉国王科技大学生成式人工智能卓越中心)
CEDAR: Error-Bounded Residual Routing for Efficient Long-Context Attention
School of Computer Science & Technology, Shanghai University(上海大学计算机科学与技术学院);School of Computer Science & Technology, East China Normal University(华东师范大学计算机科学与技术学院);School of Computer Engineering, Jiangsu Ocean University(江苏海洋大学计算机工程学院)
RouteSparse: Input-Conditional Pattern Routing for Budgeted Long-Context Prefilling
College of Computer Science, Chongqing University(重庆大学计算机学院);School of Information Science and Engineering, Chongqing Jiaotong University(重庆交通大学信息科学与工程学院)