arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2611.01909cs.AI
收藏

谁提问,谁回答:线性注意力在混合语言模型中构建查询

Who Asks, Who Answers: Linear Attention Builds the Query in Hybrid Language Models

The Hong Kong University of Science and Technology(香港科技大学);The Hong Kong Polytechnic University(香港理工大学);The Chinese University of Hong Kong(香港中文大学)

Wenqi Zeng, Chen Feng, YuAng Chen

AI总结:

该研究针对混合语言模型的上下文检索分工,发现线性注意力通过编码-寻址回路构建softmax注意力的查询,跨架构迁移寻址块可恢复检索准确率,揭示了线性注意力在检索中的直接作用

摘要:

混合语言模型将线性注意力层与少量softmax注意力层交错排列。现有研究大多将上下文检索归因于softmax注意力,而把线性注意力主要视为压缩过往上下文的机制。本文重新审视这种分工,证明线性注意力通过构建softmax注意力所用的查询,在检索中发挥直接作用。研究Qwen3.5(门控DeltaNet)和Granite4.0(Mamba-2)时,我们识别出一种编码-寻址回路:早期的编码块保留token身份,而寻址块构建最终位置表示,softmax读取器据此形成注意力查询。在不同查询键的提示间迁移该表示,可在0.97-0.99的案例中重定向检索。寻址块的循环状态承载检索目标,其计算可跨架构迁移:将Granite的寻址块替换为Qwen的,无需更新任一模型权重,即可将检索准确率恢复至0.92-0.94。在6个Qwen3.5模型中,寻址计算随规模扩大分布在多个块链上,每个块引导后续读取器,因查询不再通过注意力在读取器间传递。这些发现揭示了混合检索的分工:线性注意力构建查询,softmax注意力执行查找。代码可在该https URL获取

英文摘要:

Hybrid language models interleave linear-attention layers with a small number of softmax-attention layers. Prior work largely attributes in-context retrieval to softmax attention, treating linear attention primarily as a mechanism for compressing past context. We revisit this division of labor and show that linear attention plays a direct role in retrieval by constructing the query used by softmax attention. Studying Qwen3.5 (Gated DeltaNet) and Granite4.0 (Mamba-2), we identify an Encode--Address circuit. An early Encode block preserves token identity, while an Address block constructs the final-position representation from which a softmax \emph{reader} forms its attention query. Transplanting this representation between prompts with different queried keys redirects retrieval in 0.97--0.99 of cases. The Address block's recurrent state carries the retrieval target, and its computation transfers across architectures: replacing Granite's Address block with Qwen's restores retrieval accuracy to 0.92--0.94 without updating either model's weights. Across six Qwen3.5 models, Address computation becomes distributed at larger scales over a chain of blocks, each guiding a successive reader, as the query no longer passes from one reader to the next through attention. These findings reveal a division of labor in hybrid retrieval: linear attention constructs the query, while softmax attention performs the lookup. Code is available at https://github.com/yuang-chen/LinearQuery

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

↑