Do Long-Range Language Models Actually Use Long-Range Context?

Simeng Sun, Kalpesh Krishna, Andrew Mattarella-Micke, Mohit Iyyer

Abstract

Recent advancements in Natural Language Processing have led to the development of Transformer architectures capable of processing sequences exceeding 8,000 tokens. However, the extent to which these models utilize long-range information remains unclear. This study evaluates the Routing Transformer (RT) against a local baseline on the PG-19 dataset. Our findings reveal that performance gains largely plateau after the first 2,000 tokens. Long-range context primarily facilitates surface-level tasks, such as copying rare entities from the distant past, rather than enhancing deep discourse understanding.

Introduction

Standard Transformers are limited by a quadratic computational bottleneck ($O(N^2)$), making long-sequence processing expensive. Efficient variants like the Routing Transformer (RT) use sparse attention mechanisms to scale up to 8,192 tokens. While these models report lower perplexity on long-document benchmarks, it is uncertain whether they are capturing complex narrative structures or merely performing sophisticated local pattern matching. This paper investigates the nature of long-range context usage through fine-grained analysis and stress tests.

Methodology

The researchers compared the Routing Transformer (RT), which employs content-based clustering for attention, with a Local Transformer (LT) baseline that uses a fixed window of recent tokens. Evaluations were conducted on the PG-19 dataset, comprising approximately 29,000 public-domain books. The study utilized context truncation, token-level filtering (by frequency and position), and perturbation analysis (shuffling distant context) to isolate the impact of long-range dependencies.

The 2,000-Token Plateau

A central finding is that for the vast majority of tokens, providing context beyond 2,000 tokens yields negligible improvements in perplexity. As shown in Figure 1, the performance of the Routing Transformer stabilizes significantly after this threshold, suggesting that the "long-range" capabilities are effectively dormant for most text.

Perplexity plateaus for both RT and LT models as prefix length increases beyond 2,000 tokens.

Token Frequency and the "Copy-Paste" Shortcut

The benefit of long-range context is non-uniformly distributed. While frequent tokens see little gain from extended prefixes, infrequent tokens—such as specific character names or rare entities—show a small but measurable improvement.

Infrequent tokens benefit more from long-range context than frequent tokens, though both eventually plateau.

This suggests that models use distant context primarily as a "bag of words" to copy from. Perturbation tests confirmed this: shuffling the word order in the distant context (beyond 2,000 tokens) had almost no impact on perplexity, indicating that the model is not "reading" the narrative but rather checking for keyword presence.

Genre and Sequence-Level Performance

The study also found that fictional narratives benefit more from long-range context than discontinuous texts like magazines. However, this advantage does not translate to higher-level reasoning. In a Suffix Identification task—where the model must choose the correct 128-token continuation of a story—increasing context beyond 2,000 tokens failed to improve accuracy. Surprisingly, the simple Local Transformer performed comparably to the Routing Transformer, further highlighting the lack of deep structural understanding.

Conclusion

While modern Transformers can technically "see" long distances, they primarily use this ability for surface-level memorization and keyword matching. Future research should prioritize training objectives that encourage the modeling of long-range discourse structures, such as entity tracking and plot development, to move beyond simple statistical pattern matching in long-form text.

Summary updated

BibTeX
@inproceedings{sun2021do,
  author = {Simeng Sun and Kalpesh Krishna and Andrew Mattarella-Micke and Mohit Iyyer},
  title = {{Do Long-Range Language Models Actually Use Long-Range Context?}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2021},
  doi = {10.18653/v1/2021.emnlp-main.62},
}
Figure