mlsanityData to 7 Oct 2026

Layer-Specific Scaling of Positional Encodings for Superior Long-Context Modeling

arXiv 2503.04355 ↗First posted 6 Mar 2025cs.CLcited by 1

Not on the map. Why?

Abstract (arXiv)

Although large language models (LLMs) have achieved significant progress in handling long-context inputs, they still suffer from the ``lost-in-the-middle'' problem, where crucial information in the middle of the context is often underrepresented or lost. Our extensive experiments reveal that this issue may arise from the rapid long-term decay in Rotary Position Embedding (RoPE). To address this problem, we propose a layer-specific positional encoding scaling method that assigns distinct scaling factors to each layer, slowing down the decay rate caused by RoPE to make the model pay more attention to the middle context. A specially designed genetic algorithm is employed to efficiently select the optimal scaling factors for each layer by incorporating Bezier curves to reduce the search space. Through comprehensive experimentation, we demonstrate that our method significantly alleviates the ``lost-in-the-middle'' problem. Our approach results in an average accuracy improvement of up to 20% on the Key-Value Retrieval dataset. Furthermore, we show that layer-specific interpolation, as opposed to uniform interpolation across all layers, enhances the model's extrapolation capabilities when combined with PI and Dynamic-NTK positional encoding schemes.

Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 26 of its 37 references that are in the map. First posted on arXiv 6 Mar 2025.

Builds on

26 of 37 references.

References · 26

  1. 2024The Llama 3 Herd of Modelscited by 14,192
  2. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  3. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
  4. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
  5. 2024Gemini 1.5: Unlocking multimodal understanding across millions of tokens of contextcited by 3,175
  6. 2019ALBERT: A Lite BERT for Self-supervised Learning of Language Representationscited by 2,772
  7. 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
  8. 2018Self-Attention with Relative Position Representationscited by 1,112
  9. 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 721
  10. 2019Compressive Transformers for Long-Range Sequence Modellingcited by 699
  11. 2024ShortGPT: Layers in Large Language Models are More Redundant Than You Expectcited by 369
  12. 2024LongRoPE: Extending LLM Context Window Beyond 2 Million Tokenscited by 302
14 more
  1. 2024Long-context LLMs Struggle with Long In-context Learningcited by 285
  2. 2023LooGLE: Can Long-Context Language Models Understand Long Contexts?cited by 200
  3. 2023ZeroSCROLLS: A Zero-Shot Benchmark for Long Text Understandingcited by 175
  4. 2024LLM Maybe LongLM: Self-Extend LLM Context Window Without Tuningcited by 133
  5. 2024Make Your LLM Fully Utilize the Contextcited by 118
  6. 2024Found in the Middle: Calibrating Positional Attention Bias Improves Long Context Utilizationcited by 97
  7. 2023Attention Sorting Combats Recency Bias In Long Context Language Modelscited by 89
  8. 2020Improve Transformer Models with Better Relative Position Embeddingscited by 73
  9. 2024Found in the Middle: How Language Models Use Long Contexts Better via Plug-and-Play Positional Encodingcited by 72
  10. 2021Summ^N: A Multi-Stage Summarization Framework for Long Input Dialogues and Documentscited by 64
  11. 2021A Survey on Dialogue Summarization: Recent Advances and New Frontierscited by 51
  12. 2023Never Lost in the Middle: Mastering Long-Context Question Answering with Position-Agnostic Decompositional Trainingcited by 31
  13. 2024What Happened in LLMs Layers when Trained for Fast vs. Slow Thinking: A Gradient Perspectivecited by 29
  14. 2023Fortify the Shortest Stave in Attention: Enhancing Context Awareness of Large Language Models for Effective Tool Usecited by 27

Built on by

Cited by year

Citing papers per year: 2025: 1.

1 paper.