arXiv:2611.01909cs.AINov 2026

Manuscript Offprint

arXiv:2611.01909

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

Wenqi Zeng, Chen Feng, YuAng Chen

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

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 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.

1 Introduction

Hybrid language models combine linear-attention layers with a small number of softmax-attention layers. Linear attention, such as Gated DeltaNet [Yang et al., 2025] or Mamba-2 [Dao and Gu, 2024], compresses past context into a fixed-size state and scales linearly with sequence length, while softmax attention retains an explicit cache of past tokens. The combination aims to provide both the efficiency of recurrent state and the ability to retrieve exact information from earlier in the context, such as the value associated with a key introduced several paragraphs before. Recent open models, including Qwen3.5 and Granite-4.0-H, adopt this design with only one softmax layer for every few linear-attention layers [Qwen Team, 2026, IBM, 2025].

Prior work has shown that linear attention struggles with in-context retrieval [Jelassi et al., 2024, Arora et al., 2024a], while softmax attention plays a central role in retrieval within hybrid models [Bick et al., 2025]. However, identifying where retrieval occurs does not explain how the surrounding linear-attention layers contribute to it. We therefore ask: What do linear-attention layers compute to support retrieval by softmax attention?

We investigate this question through in-context key-value retrieval, where a model is given a dictionary (e.g., cherry=steel, mango=wood") and must answer a question such as "What is the value of mango?" with "wood". Although softmax attention can directly access the dictionary, we find that linear-attention layers are essential: removing the earliest linear-attention layer reduces retrieval accuracy to at most 0.05 across the models studied, even with all softmax layers intact.

To understand why, we first identify where retrieval emerges. Progressive layer pruning reveals a sharp increase in retrieval accuracy at a particular softmax layer, which we call the reader. We then use two causal interventions on linear-attention blocks: removal tests whether a block is necessary for retrieval, while transplantation tests whether its output can redirect retrieval between prompts with different queried keys.

These interventions reveal an Encode-Address circuit with two distinct roles (Fig. 1a). The earliest linear-attention block, which we call Encode, preserves token identity needed for retrieval. Its contribution to this task can be reproduced by a simple token-wise linear projection. The Address block, immediately preceding the reader, constructs a

Figure

Figure 1: Overview. (a) The Encode block re-encodes token identity, the Address block constructs the retrieval query, and softmax attention retrieves the matching value. (b) Transplanting the address from prompt A into prompt B makes the model answer A's question. (c) Addresses transfer between Qwen3.5 (Gated DeltaNet) and Granite4.0 (Mamba-2)

representation at the final position that determines which dictionary entry the reader selects. Transplanting this output from one prompt into another redirects retrieval in 0.97–0.99 of cases in Qwen3.5-9B, even though the dictionary and question in the receiving prompt remain unchanged (Fig. 1b).

We further investigate how the Address block performs this computation. Query-key interventions show that it primarily determines the reader's attention query rather than the dictionary keys. Transplanting its recurrent state also redirects retrieval. These results indicate that the Address block carries the retrieval target in its recurrent state and uses it to construct the representation from which the softmax reader forms its query.

Strikingly, the Address block's computation transfers across independently pretrained hybrid model families. Replacing the Address blocks of Granite-4.0-H (Mamba-2) with those from Qwen3.5-9B (Gated DeltaNet) restores retrieval accuracy to 0.94, without updating either model's weights (Figure 1c). This suggests that the role of the Address block in guiding retrieval is a general property of hybrid language models, rather than one specific to a particular recurrent architecture. Across six Qwen3.5 models with growing sizes, we also find that Address computation becomes distributed at larger scales across a chain of linear-attention blocks, each guiding a successive softmax reader, because the query no longer passes from one reader to the next through attention.

Our contributions are:

  1. The Encode-Address circuit. We identify two roles of linear attention in hybrid retrieval: an early Encode block supporting token identity and an Address block that determines which entry the softmax reader retrieves.

  2. The Address mechanism. We show that the Address block uses its recurrent state to construct the representation that determines the reader's attention query, with upstream blocks providing redundant contributions.

  3. Cross-architecture transfer. We demonstrate that the Address block can transfer between Gated DeltaNet and Mamba-2 without updating model weights, suggesting a shared retrieval mechanism across hybrid architectures.

  4. Scaling. We show that larger models distribute Address computation over a chain of blocks, each guiding a successive reader, and trace this to how the query reaches the later readers.

References (21)