Manuscript Offprint

arXiv:2610.05842

HLA: Expressive Hybrid Linear Attention via Chunk-Wise Dynamic Mixing

Zhuokun Chen, Xi Lin, Xiyu Wu, Jiahao He, Jianfei Cai, Bohan Zhuang

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

Zhuokun Chen 1^{1} Xi Lin 2^{2} Xiyu Wu 2^{2} Jiahao He 2^{2}

Jianfei Cai 1^{1} Bohan Zhuang 2^{2}

1^{1}Monash University 2^{2}Zhejiang University

Abstract. Linear attention enables efficient long-context autoregressive decoding by compressing history into recurrent states, but this compression can make selective access to sparse and distant information difficult. Existing chunk-based extensions increase memory capacity, yet learned chunk-mixing coefficients may remain fixed with respect to input content and therefore cannot adapt historical access to each query. We introduce Hybrid Linear Attention (HLA), a query-dependent chunk-level attention mechanism for Gated DeltaNet (GDN). HLA represents each completed chunk as an exact affine state transition and computes content-dependent routing gates from compact, self-attentively pooled representatives. Each gate interpolates the corresponding historical transition with the identity map, controlling both the chunk's additive memory and its transformation of earlier states. Effective-support regularization further encourages concentrated routing for sparse inference. We evaluate HLA under both pretrained adaptation and from-scratch training. Across Qwen3.5 models from 0.8B to 9B, HLA consistently improves over native GDN and fixed chunk mixing, with gains of up to 5.57 percentage points on LongBench-V2 and 3.97 points on RULER. In a controlled from-scratch 1.3B setting trained for 100B tokens with a 4K context, HLA also improves RULER performance from 4K to 32K, with gains increasing from 0.83 points at 4K to 4.22 points at 32K. These results demonstrate that query-dependent composition of recurrent memory improves long-context modeling and remains effective beyond the training context while using compact per-chunk affine summaries.

Project Page: https://caesarhhh.github.io/hla/

Email: caesard216@gmail.com

Keywords: Linear Attention, Long-Context Modeling, Efficient Inference, Gated DeltaNet

1 Introduction

Softmax attention is the standard mechanism for long-context sequence modeling and remains highly effective for content-dependent retrieval [1–3]. However, in autoregressive generation its KV cache grows with context length, which makes very long-context inference increasingly memory-intensive [4–9, 9–13].

Linear attention offers a different trade-off [14–17]. By removing the nonlinearity operation of softmax, it allows the model to first aggregate key-value interactions into a fixed-size matrix whose dimension does not grow with context length, thereby avoiding the memory-bound behavior of softmax attention in long contexts [18]. However, this efficiency comes at the cost of limited expressivity [6, 19]. In particular, the rank of linear attention is bounded by the feature dimension, which restricts its ability to represent sharp and highly selective attention patterns when the context becomes very long [20]. One useful way to understand this gap is that softmax attention can produce much more concentrated attention distributions, allowing the model to focus strongly on a small subset of relevant context, whereas linear-attention variants often distribute their scores

Figure

Distance from query (% of prompt)

Distance (512-token chunks)

Layer index

(a) Cumulative recurrence retention in (b) Long-range contribution retention (c) Cross-sample chunk-level similarity. GLA. in GDN.

Figure 1 Motivating observations for selective long-context retrieval. (a) In a pretrained GLA model, the cumulative recurrent retention of a state written at each historical position decreases with its distance to the final query position in a 4K-token prompt. The curve reports the median across layers and gate dimensions, with the shaded region denoting the interquartile range (IQR). (b) In pretrained GDN, the affine-state contribution of the chunk containing an early needle is progressively attenuated as it propagates through subsequent 512-token chunks. The curve reports the median normalized contribution over layer-head pairs, with IQR shading. (c) Chunk-level relevance can vary substantially across inputs. For a selected low-similarity LongBench pair, we report, at each layer, the minimum cross-sample cosine similarity over heads for softmax attention and HLA; MHLA remains at one because its chunk weights are input-independent. Together, these observations motivate query-dependent chunk-level attention for preserving and selectively accessing long-range information.

more evenly over the visible history [15, 16]. This difference becomes increasingly important when relevant evidence is sparse and must be selected from a large amount of irrelevant context [21].

Recent work has made substantial progress toward alleviating this limitation through improved memory compression, retrieval, and recurrent state design [15, 16, 22–25]. Gated Linear Attention (GLA) [15] uses data-dependent gating to regulate recurrent memory, while GDN [24] further introduces delta-rule updates for more selective state modification. MHLA [16] instead partitions the sequence into chunks, maintains a separate linear state for each, and combines them with fixed learned weights to increase the effective capacity of linear attention. However, two limitations remain. (1) Sparse information stored early in the sequence can still be progressively attenuated as the context grows. In GLA, each historical state write is repeatedly modulated by subsequent recurrent gates; as shown in Figure 1(a), the cumulative recurrence retention of early source positions, including the inserted needle, is substantially lower than that of more recent positions in a 4K-token prompt. GDN provides more selective memory updates, but early information must still propagate through a long chain of subsequent affine state transitions and can therefore be progressively attenuated or overwritten. Figure 1(b) illustrates this effect: the contribution of the needle-containing chunk decreases by several orders of magnitude as additional chunks are processed. (2) The relevance of historical context is inherently input- and query-dependent [26], whereas fixed chunk mixing cannot adapt to such variation. Figure 1(c) illustrates this issue using a low-similarity pair selected from LongBench [27]: both softmax attention and HLA exhibit substantially different chunk-level patterns across the two inputs, while MHLA applies the same input-independent weights and therefore yields a cross-sample cosine similarity of one. These observations suggest that effective long-context retrieval requires query-dependent mechanisms that can preserve sparse historical information and selectively control its influence on the current query.

In this work, we introduce Hybrid Linear Attention (HLA), which augments Gated DeltaNet with lightweight, query-dependent chunk-level routing. The key idea is to make the influence of historical chunks depend explicitly on the current query. We exploit the affine structure of GDN to summarize each completed chunk as an exact state transition with a multiplicative transformation and an additive memory term. For each query token, HLA predicts chunk-level routing gates from a small set of self-attentively pooled representatives. Rather than using these gates only to combine chunk readouts, HLA applies them to the complete GDN transitions by interpolating each historical transition with the identity map. This allows the query to control both the memory introduced by a chunk and how that chunk transforms earlier information, making the composition of historical GDN transitions explicitly query-dependent.

We evaluate HLA on retrieval-intensive long-context language modeling tasks, with a particular focus on accessing sparse and distant information over long sequences. HLA requires only lightweight adaptation of a pretrained GDN-based model, while directly enhancing the long-range retrieval capability of its recurrent layers.

Our contributions are summarized as follows:

  • We identify a key limitation of recurrent linear attention for long-context retrieval: although modern architectures such as GDN employ content-dependent memory updates, sparse information written early in the sequence can still be progressively attenuated or overwritten as it passes through a long chain of subsequent state transitions.

  • We propose HLA, which augments GDN with query-dependent chunk-level attention over exact chunk-wise affine transitions. The resulting attention weights selectively control the complete transition of each historical chunk, including both its additive memory and its transformation of earlier states.

  • We develop a practical implementation of query-dependent transition composition and evaluate HLA under both pretrained adaptation and from-scratch training. Across LongBench-V2 and RULER, HLA improves long-context performance over native GDN and fixed chunk mixing, including generalization beyond the training context.

References (36)