Mesa-Extrapolation: A Weave Position Encoding Method for Enhanced Extrapolation in LLMs
Not on the map. Why?
Abstract (arXiv)
Large language models (LLMs), although having revolutionized many fields, still suffer from the challenging extrapolation problem, where the inference ability of LLMs sharply declines beyond their max training lengths. In this work, we conduct a theoretical analysis to better understand why No Position Encoding (NoPE) fails outside its effective range, as well as examining the power of Position Encoding (PE) in this context. Our findings reveal that with meticulous weave position, PE can indeed be extended beyond effective range. Our theorems establish that LLMs equipped with weave PE can achieve improved extrapolation performance without additional cost. Furthermore, we introduce a novel weave PE method, Mesa-Extrapolation, which utilizes a chunk-based triangular attention matrix and applies Stair PE to manage the final chunk. This method not only retains competitive performance but also offers substantial benefits such as significantly reduced memory demand and faster inference speed. Extensive experiments validate the effectiveness of Mesa-Extrapolation, demonstrating its potential as a scalable solution to enhancing LLMs applicative reach. Our code is available at urlhttps://github.com/soacker/Mesa-Extrapolation.
Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 31 of its 49 references that are in the map. First posted on arXiv 21 Oct 2024.
Builds on
31 of 49 references.
References · 31
- 2017Attention Is All You Needcited by 59,932
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2016Layer Normalizationcited by 5,579
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
- 2016Gaussian Error Linear Units (GELUs)cited by 3,431
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
- 2023Efficient Streaming Language Models with Attention Sinkscited by 2,115
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,378
19 more
- 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,270
- 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
- 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 721
- 2022Transformers learn in-context by gradient descentcited by 714
- 2023YaRN: Efficient Context Window Extension of Large Language Modelscited by 584
- 2021Efficient Attentions for Long Document Summarizationcited by 342
- 2023The Impact of Positional Encoding on Length Generalization in Transformerscited by 319
- 2022Neural Networks and the Chomsky Hierarchycited by 214
- 2023Landmark Attention: Random-Access Infinite Context Length for Transformerscited by 206
- 2021Thinking Like Transformerscited by 182
- 2022Transformer Language Models without Positional Encodings Still Learn Positional Informationcited by 148
- 2023Focused Transformer: Contrastive Training for Context Scalingcited by 133
- 2024LLM Maybe LongLM: Self-Extend LLM Context Window Without Tuningcited by 133
- 2023Unlimiformer: Long-Range Transformers with Unlimited Length Inputcited by 127
- 2023Scaling Laws of RoPE-based Extrapolationcited by 124
- 2022Unveiling Transformers with LEGO: a synthetic reasoning taskcited by 105
- 2023Tracr: Compiled Transformers as a Laboratory for Interpretabilitycited by 99
- 2023LongEval: Guidelines for Human Evaluation of Faithfulness in Long-form Summarizationcited by 96
Built on by
Citing papers per year: 2025: 1.
1 paper.
- 2025Positional Encoding via Token-Aware Phase Attentioncited by 1
- 2025Positional Encoding via Token-Aware Phase Attention16 Sep 2025