HLA:通过块级动态混合的表达性混合线性注意力
研究论文 · 2026/10/07
线性注意力通过将历史压缩为循环状态来实现高效的长上下文自回归解码,但这种压缩使得对稀疏且遥远信息的选择性访问变得困难。现有的基于分块的扩展增加了记忆容量,但学习到的分块混合系数可能相对于输入内容是固定的,因此无法针对每个查询自适应地访问历史。我们提出了混合线性注意力(HLA),一种用于门控DeltaNet(GDN)的查询依赖分块级注意力机制。HLA将每个已完成的分块表示为精确的仿射状态转移,并从紧凑的自注意力池化代表中计算内容依赖的路由门。每个门将相应的历史转移与恒等映射进行插值,控制该分块的加性记忆及其对早期状态的变换。有效支持正则化进一步鼓励稀疏推理的集中路由。我们在预训练适配和从头训练两种设置下评估HLA。在0.8B到9B的Qwen3.5模型上,HLA持续优于原生GDN和固定分块混合,在LongBench-V2上提升高达5.57个百分点,在RULER上提升3.97个百分点。在受控的从头训练1.3B设置中,使用4K上下文训练100B token,HLA还改善了从4K到32K的RULER性能,增益从4K的0.83个百分点增加到32K的4.22个百分点。这些结果表明,循环记忆的查询依赖组合改善了长上下文建模,并在训练上下文之外仍然有效,同时使用紧凑的每分块仿射摘要。项目页面:https://caesarhhh.github.io/hla/
该工作通过查询依赖的分块级路由,解决了线性注意力在长上下文中难以选择性访问稀疏遥远信息的问题,并在多个模型规模和训练设置下验证了有效性,对长上下文建模有实际意义。
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/