arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.07019cs.CLcs.AIcs.LG
收藏

原生混合注意力机制用于高效序列建模

Native Hybrid Attention for Efficient Sequence Modeling

Tsinghua University(清华大学);Shanghai AI Laboratory(上海人工智能实验室);The Hong Kong University of Science and Technology (Guangzhou)(香港科学与技术大学(广州));The Chinese University of Hong Kong(香港中文大学)

Jusen Du, Jiaxi Hu, Tao Zhang, Weigao Sun, Yu Cheng

AI总结:

本文提出原生混合注意力机制,结合线性与全注意力,通过滑动窗口和线性RNN实现长上下文保留与短上下文增强,提升效率与召回率。

摘要:

本文提出原生混合注意力机制,结合线性与全注意力,通过滑动窗口和线性RNN实现长上下文保留与短上下文增强,提升效率与召回率。

英文摘要:

Transformers excel at sequence modeling but face quadratic complexity, while linear attention offers improved efficiency but often compromises recall accuracy over long contexts. In this work, we introduce Native Hybrid Attention (NHA), a novel hybrid architecture of linear and full attention that integrates both intra & inter-layer hybridization into a unified layer design. NHA maintains long-term context in key-value slots updated by a linear RNN, and augments them with short-term tokens from a sliding window. A single softmax attention operation is then applied over all keys and values, enabling per-token and per-head context-dependent weighting without requiring additional fusion parameters. The inter-layer behavior is controlled through a single hyperparameter, the sliding window size, which allows smooth adjustment between purely linear and full attention while keeping all layers structurally uniform. Experimental results show that NHA surpasses Transformers and other hybrid baselines on recall-intensive and commonsense reasoning tasks. Furthermore, pretrained LLMs can be structurally hybridized with NHA, achieving competitive accuracy while delivering significant efficiency gains. Code is available at https://github.com/JusenD/NHA.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑