Mechanics of Long-Context Hybrid Models Part 1.1: From Hybrid Attention to Hybrid Position
Abstract
The architectural design of Large Language Models (LLMs) is shifting from traditional full-attention-only models to hybrid models, which combine different attention modules to improve long-context efficiency and performance in length extrapolation and context extension. To explain why hybrid models work and how to design them better, we propose Mechanics of Long-Context Hybrid Models. As Part 1.1 of this series, we begin with hybrids of full attention and either sliding-window attention (SWA) or gated variants of linear attention (LA), represented by GLA and GDN. We first observe a Seesaw Effect in Context Extension: LA hybrids benefit more from long-context continual pretraining, whereas SWA hybrids perform better under length extrapolation. We attribute this behavior to differences in the positional inductive biases induced by these attention mechanisms. We find that SWA hybrids suffer from a Short-Context Learning Trap, Short-Window Weariness, and Long-Window Laziness, and require extended windows to enhance performance in continual long-context pretraining. For LA hybrids, we summarize the Matthew Effect of Hybrid Position Extrapolation and propose Sliding-Window Linear Attention, achieving 16 training-free length extrapolation while maintaining 100\% accuracy on NIAH-SK1 in 64k context length.
Create a lesson
Metadata
- Comments
- 60 pages, 36 figures, 25 tables, under review
Related papers
UNREAL: Unifying Retrieval and Long-Context with a Single Model
Shared title terminologycs.CLEdan Kinderman, Elad Hoffer, Yochai Blau et al.
BioBigBird: A Sparse Attention Model for Long-Range Dependency Processing in Biomedical Text
Shared title terminologycs.CLRoshan Balaji, Pavan Kumar S, Vasudev Gupta et al.
Hybrid Latent Attention for Looped Language Models
Shared title terminologycs.CLYuhan Chen, Siyuan Zhang, Nan Wang et al.
ReFold: Training-Free Reversible Inter-Turn Context Folding for Long-Horizon Agents
Shared title terminologycs.CLYupeng Su, Jiayi Tian, Zheng Zhang et al.
Dynamic Positional Attention Modulation for Parameter-Efficient Fine-Tuning of Large Language Models
Shared title terminologycs.CLDayan Pan, Jingyuan Wang, Xie Yu
DiCALM: Converting Autoregressive Convolution-Attention Language Models into Discrete Diffusion Language Models
Shared title terminologycs.CLPhong Le, Ngoc-Quan Pham, Dat Quoc Nguyen