arXiv:2606.20097cs.CL2026-06

通过头级别混合注意力,实现长序列处理的高效与高性能。

HydraHead: From Head-Level Functional Heterogeneity to Specialized Attention Hybridization

论文配图:HydraHead: From Head-Level Functional Heterogeneity to Specialized Attention Hybridization
图 1 · 摘自论文原文
  • 按注意力头而非层进行混合设计,更精准地结合全连接与线性注意力优势。
  • 在512K上下文长度下性能提升超69%,接近同规模领先模型表现。
  • 仅用150亿词训练,适合资源受限场景下的长文本任务优化。

注意力机制的二次复杂度成为长上下文处理的主要瓶颈,推动了混合注意力架构的研究。现有开源模型多采用层级混合策略,但先前研究指出线性注意力(LA)与全连接注意力(FA)难以有效融合,表明注意力混合设计空间仍有待探索。我们通过可解释性分析发现:不同层间功能相似,而同一层内各注意力头虽共享输入却表现出显著功能分化。这一头级别异质性提示,头维度是融合异构注意力信号的自然且合理粒度。基于此,我们提出HydraHead,一种沿头轴混合FA与LA的新架构。其核心创新包括:(1) 可解释性驱动的选择策略,仅对关键检索头保留FA;(2) 归一化融合模块,缓解FA与LA输出分布差异。通过三阶段迁移训练与参数复用,实现低开销高效率训练。在统一训练设置下,HydraHead在长上下文任务中优于其他混合设计,并保持强泛化推理能力。使用可解释性选头策略,仅需7:1的LA/FA比例即达到3:1层级混合的性能。关键的是,仅在150亿词上训练,其在512K上下文长度下性能超越基线69%以上,逼近同规模领先模型Qwen3.5(原生上下文长度256K),凸显头级别混合的巨大扩展潜力。

原文摘要 · Abstract (English)

The quadratic complexity of attention poses a critical bottleneck for long-context processing, spurring interest in hybrid attention designs. Most open-source hybrid models adopt a layer-wise strategy. Yet, prior work has noted the inherent difficulty of integrating Linear Attention (LA) with Full Attention (FA), suggesting that the design space of attention hybridization remains underexplored. To probe this space, we conduct interpretability analysis and observe that layers exhibit block-wise functional similarity, while individual heads within the same layer display distinct functional specialization despite sharing input features. This head-level heterogeneity suggests that the head dimension provides a natural and principled granularity for fusing heterogeneous attention signals. Building on this insight, we introduce HydraHead, a novel architecture that hybridizes FA and LA along the head axis. HydraHead features two key innovations: (1) an interpretability-driven selection strategy that identifies retrieval-critical heads and preserves FA only for them, and (2) a scale-normalized fusion module that reconciles the distributional gap between FA and LA head outputs. By leveraging a three-stage transfer pipeline with parameter reuse and distillation, we achieve high-performance hybrid models with minimal training overhead. Under a unified training setup, HydraHead outperforms other hybrid designs in long-context tasks while maintaining strong general reasoning. With interpretability-driven head selection, it matches a 3:1 layer-wise hybrid's long-context performance at a 7:1 LA-to-FA ratio. Crucially, trained on only 15B tokens, HydraHead achieves over 69% improvement over the baseline at 512K context length, approaching Qwen3.5, a leading model of comparable size with a native context length of 256K. This highlights the significant scaling potential of head-level hybridization.

注意力机制长序列处理混合架构可解释性

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。