Who Asks, Who Answers: Linear Attention Builds the Query in Hybrid Language Models
Organizations: The Hong Kong University of Science and Technology · The Hong Kong Polytechnic University · The Chinese University of Hong Kong
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
Figures & tables
| Patched at swapped tokens | Value swap | Key swap |
| Encode block output | 0.98 | 0.98 |
| Input token embedding | 1.00 | 1.00 |
| Any other block’s output | 0.00 | 0.00 |
| No Patching | 0.00 | 0.00 |
| Output transplant | Block replacement | |||||
| Donor receiver | Cross- model | Same- model | Removed | Linear proj. | Zeroed mixer | Donor Address |
| Qwen3.5-0.8B Granite4.0-1B | 0.98 | 1.00 | 0.01 | 0.24 | 0.28 | 0.92 |
| Granite4.0-1B Qwen3.5-0.8B | 0.91 | 0.97 | 0.30 | 0.28 | 0.28 | 0.95 |
| Qwen3.5-9B Granite4.0-7B a | 0.99 | 1.00 | 0.00 | 0.14 | 0.18 | 0.94 |
| Granite4.0-7B Qwen3.5-9B b | 0.83 | 0.92 | 0.35 | 0.30 | 0.21 | 0.46 |
| Model | Linear / softmax | Address block guided readers | Removal | Transplant |
| Qwen3.5-0.8B | 18 / 6 | L15, L19, L23 | 0.06 | 0.99 |
| Qwen3.5-2B | 18 / 6 | L15, L19, L23 | 0.41 | 1.00 |
| Qwen3.5-4B | 24 / 8 | L19, L23, L27 | 0.94 | 0.70 |
| Qwen3.5-9B | 24 / 8 | L19, L23, L27 | 0.92 | 0.98 |
| Qwen3.5-27B | 48 / 16 | – L39, L43; L51, L59 | 1.00 | 0.98 |
| Qwen3.5-35B-A3B | 30 / 10 | L27; L31; L35 | 0.34 | 0.75 |
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
| Transplant | Removal | Layer 0 | ||||
| Model | Block | whole block | best single layer | whole block | worst single layer | removed |
| Qwen3.5-0.8B | L12–14 | 0.99 (0.84) | 0.00 (0.03, L14) | 0.13 | 0.90 (L14) | 0.00 |
| Qwen3.5-9B | L16–18 | 0.99 (0.78) | 0.00 (0.10, L18) | 1.00 | 0.99 (L17) | 0.05 |
| Granite4.0-1B | L16–24 | 1.00 (0.83) | 0.93 (0.70, L23) | 0.00 | 0.73 (L24) | 0.00 |
| Removal | Transplant | ||||
| Model | Address | Encode | Address | Address | best other block |
| Qwen3.5-0.8B | L12–14 | 0.00 / 0.00 / 0.00 | 0.13 / 0.03 / 0.01 | 0.99 / 1.00 / 0.97 | 0.00 / 0.00 / 0.00 |
| Qwen3.5-9B | L16–18 | 0.01 / 0.00 / 0.00 | 1.00 / 1.00 / 0.76 | 0.99 / 0.97 / 0.98 | 0.00 / 0.00 / 0.00 |
| Granite4.0-1B | L16–24 | 0.00 / 0.00 / 0.00 | 0.00 / 0.01 / 0.00 | 1.00 / 0.98 / 0.92 | 0.00 / 0.00 / 0.00 |
| Granite4.0-7B | L16–24, L26–34 | 0.00 / 0.00 / 0.00 | 0.01 / 0.06 / 0.00 | 1.00 / 1.00 / 0.90 | 0.00 / 0.00 / 0.00 |