Extending the Context of Pretrained LLMs by Dropping Their Positional Embeddings

Yoav Gelberg, Koshi Eguchi, Takuya Akiba, Edoardo CetinarXiv 2025 · DOI

Introduction

Modern Large Language Models (LLMs) are typically constrained by the context length used during their pretraining phase, often limited to 2,048 or 4,096 tokens due to the quadratic scaling of attention mechanisms. When these models encounter longer sequences at inference time, their performance typically collapses. This failure is primarily attributed to Positional Embeddings (PE), such as the widely used Rotary Positional Embedding (RoPE), which become "out-of-distribution" for lengths exceeding the training window. While scaling methods like YaRN attempt to mitigate this, they often require expensive long-context finetuning and struggle with precise information retrieval in long documents.

The DroPE Framework

DroPE (Dropping Positional Embeddings) introduces a novel paradigm: treating positional embeddings as a temporary "scaffold" necessary for initial training but redundant for long-context inference. The method proceeds in three main stages:

  1. Standard Pretraining: The model is pretrained using RoPE to leverage its inductive bias for rapid convergence.
  2. Embedding Removal: The positional embeddings are completely removed from the architecture.
  3. Recalibration: The model undergoes a brief continued training phase at the original context length without any PEs. This allows the model to shift its reliance to implicit positional cues within the causal attention mask.

To maintain stability during this transition, the authors employ Query-Key Normalization (QKNorm) and logit temperature scaling during inference to manage increased attention scores.

The recalibration process: dropping RoPE at 14k steps causes a temporary NLL spike, followed by rapid recovery to competitive perplexity levels.

Experimental Results

The researchers evaluated DroPE across various scales, including Llama-2-7B and SmolLM models. The results demonstrate that DroPE significantly enhances the model's ability to generalize to unseen context lengths without degrading performance on standard short-context benchmarks.

Superior Information Retrieval

A critical test for long-context models is the "Needle-in-a-Haystack" (NIAH) task. DroPE demonstrates remarkable robustness here. In a 2× context extension (retrieving information at 4k tokens for a model trained on 2k), DroPE achieved a 74.9% success rate, substantially outperforming the 48.2% achieved by the popular YaRN method.

Accuracy on the Needle-in-a-Haystack task as a function of distance. DroPE maintains high accuracy well beyond the original training context, whereas traditional scaling methods collapse.

Efficiency and Stability

One of the most compelling aspects of DroPE is its efficiency. For Llama-2-7B, the recalibration phase required only 20 billion tokens—approximately 0.5% of the original pretraining budget. Furthermore, the model showed no regression on standard reasoning benchmarks like ARC and HellaSwag, indicating that the core capabilities of the LLM remain intact after removing the positional scaffold.

Conclusion

DroPE offers a computationally efficient path to extending the context window of pretrained LLMs. By moving away from explicit positional embeddings and leveraging the inherent capabilities of the attention mechanism, models can achieve superior zero-shot extrapolation. Future work may explore the integration of DroPE with more efficient attention architectures to address the remaining quadratic computational bottleneck of long-sequence processing.

Summary updated

BibTeX
@misc{gelberg2025extending,
  author = {Yoav Gelberg and Koshi Eguchi and Takuya Akiba and Edoardo Cetin},
  title = {{Extending the Context of Pretrained LLMs by Dropping Their Positional Embeddings}},
  year = {2025},
  eprint = {2512.12167},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2512.12167},
}
Figure