Switch Attention: Towards Dynamic and Fine-grained Hybrid Transformers
Not on the map. Why?
Abstract (arXiv)
The attention mechanism has been the core component in modern transformer architectures. However, the computation of standard full attention scales quadratically with the sequence length, serving as a major bottleneck in long-context language modeling. Sliding window attention restricts the context length for better efficiency at the cost of narrower receptive fields. While existing efforts attempt to take the benefits from both sides by building hybrid models, they often resort to static, heuristically designed alternating patterns that limit efficient allocation of computation in various scenarios. In this paper, we propose Switch Attention (SwiAttn), a novel hybrid transformer that enables dynamic and fine-grained routing between full attention and sliding window attention. For each token at each transformer layer, SwiAttn dynamically routes the computation to either a full-attention branch for global information aggregation or a sliding-window branch for efficient local pattern matching. An adaptive regularization objective is designed to encourage the model towards efficiency. Moreover, we adopt continual pretraining to optimize the model, transferring the full attention architecture to the hybrid one. Extensive experiments are conducted on twenty-three benchmark datasets across both regular (4K) and long (32K) context lengths, demonstrating the effectiveness of the proposed method.
Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Builds on 68 of its 93 references that are in the map. First posted on arXiv 27 Mar 2026.
Builds on
68 of 93 references.
References · 68
- 2017Attention Is All You Needcited by 60,361
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,944
- 2018Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challengecited by 4,886
- 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,718
- 2019HellaSwag: Can a Machine Really Finish Your Sentence?cited by 4,100
- 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,673
- 2020Longformer: The Long-Document Transformercited by 3,413
- 2016Pointer Sentinel Mixture Modelscited by 3,096
- 2021Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsitycited by 3,073
- 2017TriviaQA: A Large Scale Distantly Supervised Challenge Dataset for Reading Comprehensioncited by 2,955
- 2019PIQA: Reasoning about Physical Commonsense in Natural Languagecited by 2,883
38 more
- 2023Efficient Streaming Language Models with Attention Sinkscited by 2,186
- 2019BoolQ: Exploring the Surprising Difficulty of Natural Yes/No Questionscited by 2,183
- 2018Can a Suit of Armor Conduct Electricity? A New Dataset for Open Book Question Answeringcited by 2,164
- 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 2,022
- 2024Gemma 2: Improving Open Language Models at a Practical Sizecited by 1,998
- 2019Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelismcited by 1,868
- 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,850
- 2020Big Bird: Transformers for Longer Sequencescited by 1,684
- 2020Reformer: The Efficient Transformercited by 1,668
- 2022Fast Inference from Transformers via Speculative Decodingcited by 1,653
- 2018Know What You Don't Know: Unanswerable Questions for SQuADcited by 1,554
- 2019Generating Long Sequences with Sparse Transformerscited by 1,546
- 2019Root Mean Square Layer Normalizationcited by 1,480
- 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,417
- 2023GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpointscited by 1,346
- 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,346
- 2024Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Dualitycited by 1,336
- 2024DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Modelcited by 1,135
- 2016The LAMBADA dataset: Word prediction requiring a broad discourse contextcited by 992
- 2016Deep Variational Information Bottleneckcited by 930
- 2019DROP: A Reading Comprehension Benchmark Requiring Discrete Reasoning Over Paragraphscited by 903
- 2024Medusa: Simple LLM Inference Acceleration Framework with Multiple Decoding Headscited by 843
- 2019Fast Transformer Decoding: One Write-Head is All You Needcited by 717
- 2026GLM-5: from Vibe Coding to Agentic Engineeringcited by 587
- 2019SAMSum Corpus: A Human-annotated Dialogue Dataset for Abstractive Summarizationcited by 535
- 2024Gated Delta Networks: Improving Mamba2 with Delta Rulecited by 532
- 2021A Dataset of Information-Seeking Questions and Answers Anchored in Research Paperscited by 486
- 2023Model Tells You What to Discard: Adaptive KV Cache Compression for LLMscited by 474
- 2019Multi-News: a Large-Scale Multi-Document Summarization Dataset and Abstractive Hierarchical Modelcited by 431
- 2018Lipschitz regularity of deep neural networks: analysis and efficient estimationcited by 415
- 2024MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse Attentioncited by 383
- 2024Better & Faster Large Language Models via Multi-token Predictioncited by 360
- 2021Efficient Attentions for Long Document Summarizationcited by 345
- 2025FlashInfer: Efficient and Customizable Attention Engine for LLM Inference Servingcited by 258
- 2024Retrieval Head Mechanistically Explains Long-Context Factualitycited by 232
- 2019ERNIE 2.0: A Continual Pre-training Framework for Language Understandingcited by 231
- 2023CacheGen: KV Cache Compression and Streaming for Fast Large Language Model Servingcited by 203
- 2025Kimi Linear: An Expressive, Efficient Attention Architecturecited by 196
50 most cited of 68 All 68 (JSON)
Built on by
Citing papers per year: 2026: 4.
4 papers.
- 2026HydraHead: From Head-Level Functional Heterogeneity to Specialized Attention Hybridizationcited by 4
- 2026CoSA: Accelerating Long-Context Inference via Proxy-Kernel Co-Designed Sparse Attentioncited by 1
- 2026ConSA: Controllable Sparsity in Hybrid Attention via Learnable Allocationcited by 0
- 2026On-Demand Attention: Language Models Know When to Recallcited by 0
- 2026On-Demand Attention: Language Models Know When to Recall17 Sep 2026
- 2026CoSA: Accelerating Long-Context Inference via Proxy-Kernel Co-Designed Sparse Attention28 Jul 2026
- 2026HydraHead: From Head-Level Functional Heterogeneity to Specialized Attention Hybridization18 Jun 2026
- 2026ConSA: Controllable Sparsity in Hybrid Attention via Learnable Allocation16 Jun 2026