mlsanityData to 7 Oct 2026

Mesa-Extrapolation: A Weave Position Encoding Method for Enhanced Extrapolation in LLMs

arXiv 2410.15859 ↗First posted 21 Oct 2024cs.LG cs.AIcited by 1

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

  1. 2017Attention Is All You Needcited by 59,932
  2. 2020Language Models are Few-Shot Learnerscited by 32,199
  3. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  4. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  5. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  6. 2016Layer Normalizationcited by 5,579
  7. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
  8. 2016Gaussian Error Linear Units (GELUs)cited by 3,431
  9. 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
  10. 2023Efficient Streaming Language Models with Attention Sinkscited by 2,115
  11. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  12. 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,378
19 more
  1. 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,270
  2. 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
  3. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
  4. 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 721
  5. 2022Transformers learn in-context by gradient descentcited by 714
  6. 2023YaRN: Efficient Context Window Extension of Large Language Modelscited by 584
  7. 2021Efficient Attentions for Long Document Summarizationcited by 342
  8. 2023The Impact of Positional Encoding on Length Generalization in Transformerscited by 319
  9. 2022Neural Networks and the Chomsky Hierarchycited by 214
  10. 2023Landmark Attention: Random-Access Infinite Context Length for Transformerscited by 206
  11. 2021Thinking Like Transformerscited by 182
  12. 2022Transformer Language Models without Positional Encodings Still Learn Positional Informationcited by 148
  13. 2023Focused Transformer: Contrastive Training for Context Scalingcited by 133
  14. 2024LLM Maybe LongLM: Self-Extend LLM Context Window Without Tuningcited by 133
  15. 2023Unlimiformer: Long-Range Transformers with Unlimited Length Inputcited by 127
  16. 2023Scaling Laws of RoPE-based Extrapolationcited by 124
  17. 2022Unveiling Transformers with LEGO: a synthetic reasoning taskcited by 105
  18. 2023Tracr: Compiled Transformers as a Laboratory for Interpretabilitycited by 99
  19. 2023LongEval: Guidelines for Human Evaluation of Faithfulness in Long-form Summarizationcited by 96

Built on by

Cited by year

Citing papers per year: 2025: 1.

1 paper.