SWAN-GPT: An Efficient and Scalable Approach for Long-Context Language Modeling
Not on the map. Why?
Abstract (arXiv)
We present a decoder-only Transformer architecture that robustly generalizes to sequence lengths substantially longer than those seen during training. Our model, SWAN-GPT, interleaves layers without positional encodings (NoPE) and sliding-window attention layers equipped with rotary positional encodings (SWA-RoPE). Experiments demonstrate strong performance on sequence lengths significantly longer than the training length without the need for additional long-context training. This robust length extrapolation is achieved through our novel architecture, enhanced by a straightforward dynamic scaling of attention scores during inference. In addition, SWAN-GPT is more computationally efficient than standard GPT architectures, resulting in cheaper training and higher throughput. Further, we demonstrate that existing pre-trained decoder-only models can be efficiently converted to the SWAN architecture with minimal continued training, enabling longer contexts. Overall, our work presents an effective approach for scaling language models to longer contexts in a robust and efficient manner.
Key facts. Cited by 19 papers in the map (data through 14 Oct 2026). Builds on 35 of its 44 references that are in the map. First posted on arXiv 11 Apr 2025.
Builds on
35 of 44 references.
References · 35
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,944
- 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,718
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
- 2020Longformer: The Long-Document Transformercited by 3,413
- 2023Efficient Streaming Language Models with Attention Sinkscited by 2,186
- 2019Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelismcited by 1,868
- 2025Gemma 3 Technical Reportcited by 1,824
- 2020Big Bird: Transformers for Longer Sequencescited by 1,684
- 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,346
- 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,336
23 more
- 2024DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Modelcited by 1,135
- 2023RWKV: Reinventing RNNs for the Transformer Eracited by 827
- 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 740
- 2023YaRN: Efficient Context Window Extension of Large Language Modelscited by 601
- 2024KVQuant: Towards 10 Million Context Length LLM Inference with KV Cache Quantizationcited by 591
- 2023The Impact of Positional Encoding on Length Generalization in Transformerscited by 327
- 2022Efficient Training of Language Models to Fill in the Middlecited by 255
- 2025Qwen2.5-1M Technical Reportcited by 164
- 2024Nemotron-CC: Transforming Common Crawl into a Refined Long-Horizon Pretraining Datasetcited by 160
- 2022Transformer Language Models without Positional Encodings Still Learn Positional Informationcited by 150
- 2024How to Train Long-Context Language Models (Effectively)cited by 146
- 2024LLM Maybe LongLM: Self-Extend LLM Context Window Without Tuningcited by 136
- 2023Scaling Laws of RoPE-based Extrapolationcited by 125
- 2023LM-Infinite: Zero-Shot Extreme Length Generalization for Large Language Modelscited by 124
- 2024Long Context Compression with Activation Beaconcited by 104
- 2024Training-Free Long-Context Scaling of Large Language Modelscited by 62
- 2024Length Generalization of Causal Transformers without Position Encodingcited by 47
- 2025Rope to Nope and Back Again: A New Hybrid Attention Strategycited by 47
- 2024Challenges in Deploying Long-Context Transformers: A Theoretical Peak Performance Analysiscited by 44
- 2023Latent Positional Information is in the Self-Attention Variance of Transformer Language Models Without Positional Embeddingscited by 23
- 2024What are the Essential Factors in Crafting Effective Long Context Multi-Hop Instruction Datasets? Insights and Best Practicescited by 14
- 2025Thus Spake Long-Context Large Language Modelcited by 12
- 2024LongWanjuan: Towards Systematic Measurement for Long Text Qualitycited by 11
Built on by
Citing papers per year: 2025: 10; 2026: 9.
19 papers.
Sort:
By area:
- 2025Kimi Linear: An Expressive, Efficient Attention Architecturecited by 196
- 2025Four Over Six: More Accurate NVFP4 Quantization with Adaptive Block Scalingcited by 35
- 2025The Mean-Field Dynamics of Transformerscited by 30
- 2025Extending the Context of Pretrained LLMs by Dropping Their Positional Embeddingscited by 26
- 2025Critical attention scaling in long-context transformerscited by 20
- 2026Hybrid Linear Attention Done Right: Efficient Distillation and Effective Architectures for Extremely Long Contextscited by 18
- 2025Optimizing Mixture of Block Attentioncited by 9
- 2025SmallThinker: A Family of Efficient Large Language Models Natively Trained for Local Deploymentcited by 5
- 2026Homogenized Transformerscited by 5
- 2026Rethinking the Role of Efficient Attention in Hybrid Architecturescited by 5
- 2026Periodic RoPE for Infinite Context LLMscited by 2
- 2025Gaussian Equivalence for Self-Attention: Asymptotic Spectral Analysis of Attention Matrixcited by 1
7 more
- 2025Optimizing Native Sparse Attention with Latent Attention and Local Global Alternating Strategiescited by 1
- 2025An empirical study on the limitation of Transformers in program trace generationcited by 0
- 2026Frontier Language Models Struggle to Copy: Text Can Be Better Viewed in 2Dcited by 0
- 2026How Local Mixing Encodes Relative Position in Global NoPE Attentioncited by 0
- 2026Shifting Mechanisms: How Positional Encoding Choice Shapes In-Context Retrievalcited by 0
- 2026Mechanics of Long-Context Hybrid Models Part 1.1: From Hybrid Attention to Hybrid Positioncited by 0
- 2026FreeSolo: Linear-time Sparse Attention with Zero-Shot Length Extrapolationcited by 0
- 2026FreeSolo: Linear-time Sparse Attention with Zero-Shot Length Extrapolation12 Oct 2026
- 2026Mechanics of Long-Context Hybrid Models Part 1.1: From Hybrid Attention to Hybrid Position7 Oct 2026
- 2026Shifting Mechanisms: How Positional Encoding Choice Shapes In-Context Retrieval29 Sep 2026
- 2026How Local Mixing Encodes Relative Position in Global NoPE Attention29 Sep 2026
- 2026Frontier Language Models Struggle to Copy: Text Can Be Better Viewed in 2D17 Jul 2026
- 2026Rethinking the Role of Efficient Attention in Hybrid Architectures13 Jun 2026
- 2026Periodic RoPE for Infinite Context LLMs27 May 2026
- 2026Homogenized Transformers2 Apr 2026
- 2026Hybrid Linear Attention Done Right: Efficient Distillation and Effective Architectures for Extremely Long Contexts29 Jan 2026
- 2025Extending the Context of Pretrained LLMs by Dropping Their Positional Embeddings13 Dec 2025
- 2025Four Over Six: More Accurate NVFP4 Quantization with Adaptive Block Scaling1 Dec 2025
- 2025The Mean-Field Dynamics of Transformers1 Dec 2025
7 more
- 2025Optimizing Mixture of Block Attention14 Nov 2025
- 2025Optimizing Native Sparse Attention with Latent Attention and Local Global Alternating Strategies2 Nov 2025
- 2025Kimi Linear: An Expressive, Efficient Attention Architecture30 Oct 2025
- 2025Gaussian Equivalence for Self-Attention: Asymptotic Spectral Analysis of Attention Matrix8 Oct 2025
- 2025Critical attention scaling in long-context transformers7 Oct 2025
- 2025An empirical study on the limitation of Transformers in program trace generation29 Sep 2025
- 2025SmallThinker: A Family of Efficient Large Language Models Natively Trained for Local Deployment28 Jul 2025
- 2025Kimi Linear: An Expressive, Efficient Attention Architecturecited by 196
- 2025Kimi Linear: An Expressive, Efficient Attention Architecture30 Oct 2025
- 2025Four Over Six: More Accurate NVFP4 Quantization with Adaptive Block Scalingcited by 35
- 2025The Mean-Field Dynamics of Transformerscited by 30
- 2025Extending the Context of Pretrained LLMs by Dropping Their Positional Embeddingscited by 26
- 2025Critical attention scaling in long-context transformerscited by 20
- 2026Hybrid Linear Attention Done Right: Efficient Distillation and Effective Architectures for Extremely Long Contextscited by 18
- 2025Optimizing Mixture of Block Attentioncited by 9
- 2026Homogenized Transformerscited by 5
- 2026Periodic RoPE for Infinite Context LLMscited by 2
- 2025Gaussian Equivalence for Self-Attention: Asymptotic Spectral Analysis of Attention Matrixcited by 1
- 2025Optimizing Native Sparse Attention with Latent Attention and Local Global Alternating Strategiescited by 1
- 2025An empirical study on the limitation of Transformers in program trace generationcited by 0
- 2026How Local Mixing Encodes Relative Position in Global NoPE Attentioncited by 0
12 most cited of 15 All 15 (JSON)
- 2026FreeSolo: Linear-time Sparse Attention with Zero-Shot Length Extrapolation12 Oct 2026
- 2026Mechanics of Long-Context Hybrid Models Part 1.1: From Hybrid Attention to Hybrid Position7 Oct 2026
- 2026Shifting Mechanisms: How Positional Encoding Choice Shapes In-Context Retrieval29 Sep 2026
- 2026How Local Mixing Encodes Relative Position in Global NoPE Attention29 Sep 2026
- 2026Periodic RoPE for Infinite Context LLMs27 May 2026
- 2026Homogenized Transformers2 Apr 2026
- 2026Hybrid Linear Attention Done Right: Efficient Distillation and Effective Architectures for Extremely Long Contexts29 Jan 2026
- 2025Extending the Context of Pretrained LLMs by Dropping Their Positional Embeddings13 Dec 2025
- 2025Four Over Six: More Accurate NVFP4 Quantization with Adaptive Block Scaling1 Dec 2025
- 2025The Mean-Field Dynamics of Transformers1 Dec 2025
- 2025Optimizing Mixture of Block Attention14 Nov 2025
- 2025Optimizing Native Sparse Attention with Latent Attention and Local Global Alternating Strategies2 Nov 2025
12 newest of 15 All 15 (JSON)