What Context Features Can Transformer Language Models Use?

Joe O'Connor, Jacob Andreas

Abstract

While Transformer language models (LMs) benefit significantly from long-range context, the specific features they utilize remain poorly understood. This paper investigates the "usable information" in context by training models on ablated data. We find that long-range context is primarily used as a "bag of nouns," where syntactic structure and sentence-level word order are largely irrelevant. Surprisingly, removing function words from distant context can act as a regularizer, improving model performance.

Introduction

The context window of modern language models has expanded from a few words to thousands of tokens. While it is well-established that increased context improves predictive performance (lower perplexity), the nature of the information extracted from distant tokens is unclear. Are models tracking complex syntactic dependencies, or are they merely identifying topical keywords? This study distinguishes between a model's sensitivity to context and its actual usage of that information.

Methodology: The $\mathcal{V}$-information Framework

To isolate usable information, the authors employ the $\mathcal{V}$-information framework. Rather than perturbing context at test time—which often conflates information loss with distributional shift—they train models from scratch on "ablated" context. This allows the researchers to measure how much information is truly "usable" by the model architecture when it is forced to learn from damaged inputs.

The experimental setup involves feeding the Transformer LM an ablated context (e.g., shuffled or filtered by part-of-speech) and measuring the loss in predictive power compared to an ordered context.

Context is divided into mid-range (0–256 tokens) and long-range (256–512 tokens). Two primary ablation types are used:

  1. Structural Ablations: Shuffling words at various granularities (trigrams, sentences, or global).
  2. Lexical Ablations: Filtering by part-of-speech (e.g., nouns only, content words only).

Key Results

The "Bag of Nouns" Hypothesis

In long-range context, nouns and verbs carry the vast majority of usable information. In the mid-range, retaining only nouns preserves approximately 80% of the information gain provided by the context. As the distance increases, the model relies even more heavily on these semantic anchors, while adjectives, adverbs, and prepositions become increasingly irrelevant to the final prediction.

Ablation as Regularization

A striking finding is that for long-range context (256–512 tokens), models trained on only content words (nouns, verbs, adjectives, and adverbs) can actually outperform those trained on the full, original text.

Lexical ablation results for long-range context. Negative values indicate that the ablated context (e.g., content words only) provided more usable information than the full text, likely by removing syntactic noise.

This suggests that function words in distant history act as "noise" that can lead to overfitting. Removing them helps the model focus on the actual semantic signal required for long-range topical consistency.

Syntax is Local

Structural ablations reveal that syntax is primarily a local phenomenon for Transformers. Shuffling word order within sentences in the long-range context removes only 14% of usable information. While models are highly sensitive to shuffled text at test time (perplexity spikes), they can recover nearly all performance if trained on shuffled data, proving that the specific word order was never the primary feature being utilized for distant tokens.

Discussion and Future Work

The results suggest a significant gap between how humans process long-range dependencies and how current LMs operate. Transformers appear to treat distant context as a sophisticated bag-of-words rather than a structured narrative.

This insight opens avenues for more efficient architectures. Instead of maintaining a full token-by-token history, future models might use compressed representations focusing on entities and nouns. However, further research is needed to determine if these findings hold for generative coherence and logic, beyond simple next-token prediction accuracy.

Summary updated

BibTeX
@inproceedings{oconnor2021what,
  author = {Joe O'Connor and Jacob Andreas},
  title = {{What Context Features Can Transformer Language Models Use?}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.acl-long.70},
}
Figure