Abstract
Keeping track of how states of entities change as a text or dialog unfolds is a key prerequisite to discourse understanding. Yet, there have been few systematic investigations into the ability of large language models (LLMs) to track discourse entities. In this work, we present a task probing to what extent a language model can infer the final state of an entity given an English description of the initial state and a series of state-changing operations. We use this task to first investigate whether Flan-T5, GPT-3 and GPT-3.5 can track the state of entities, and find that only GPT-3.5 models, which have been pretrained on large amounts of code, exhibit this ability. We then investigate whether smaller models pretrained primarily on text can learn to track entities, through finetuning T5 on several training/evaluation splits. While performance degrades for more complex splits, we find that even when evaluated on a different set of entities from training or longer operation sequences, a finetuned model can perform non-trivial entity tracking. Taken together, these results suggest that language models can learn to track entities but pretraining on text corpora alone does not make this capacity surface.
Introduction
To comprehend a narrative, follow a recipe, or execute technical instructions, a reader must maintain a dynamic "mental map" of entities and their evolving states. For instance, if a text specifies "put the eggs in the bowl and mix," the reader must infer that the eggs are now located in the bowl and their physical state has changed to "mixed." This capability, known as discourse entity tracking, is fundamental to natural language understanding.
While previous research suggested that models such as T5 and BERT possessed these abilities, recent investigations have identified significant methodological flaws in existing benchmarks. Many datasets contain "shortcuts" or distributional biases; for example, in some benchmarks, an entity's state remains unchanged in 62% of cases. Consequently, a model could achieve high accuracy by simply predicting the initial state. This study introduces a more rigorous "stress test" to determine if LLMs can truly track state changes when such shortcuts are eliminated.
Methodology
The researchers developed the "Boxes and Objects" task, a programmatically generated benchmark designed to evaluate entity tracking without reliance on common-sense priors.
Experimental Setup
The task involves a world containing seven boxes and a pool of 100 possible objects. A scenario consists of an initial state description followed by a sequence of state-changing operations, such as "Move the book from Box 1 to Box 2" or "Put the bell into Box 4." The model is then probed with a question regarding the contents of a specific box.
Design Desiderata
To ensure robust evaluation, the authors implemented several constraints:
- Elimination of Distributional Biases: Objects and boxes are paired randomly to prevent models from using semantic associations (e.g., "eggs belong in a bowl").
- Lexical Diversity: The task uses varied phrasings (e.g., "Pick up the furby" vs. "Move the car") to test linguistic generalization.
- Contextual Ambiguity: Some scenarios include ambiguous descriptions that require knowledge of the current state to resolve (e.g., "Move the big brain" when two brains are present in different locations).
Results and Discussion
The evaluation spanned a variety of models, including GPT-3, GPT-3.5 (the davinci series), GPT-4, and Flan-T5.
The Impact of Code Pretraining
A primary finding of this study is the significant performance gap between models pretrained solely on text and those pretrained on a mixture of text and code. Only GPT-3.5 and GPT-4 demonstrated substantial zero-shot entity tracking capabilities. As shown in Figure 6, models like code-davinci-002 and text-davinci-003 (which incorporates code-training) maintain much higher accuracy as the number of operations increases compared to vanilla text models.
The authors hypothesize that the logic required for code—specifically tracking variable states and control flow—may be the catalyst for emergent entity tracking in natural language. In contrast, models like the original GPT-3 davinci or Flan-T5 often failed by defaulting to the initial state, effectively ignoring the sequence of operations.
Generalization through Finetuning
While smaller models fail zero-shot, the study found that a T5-base model could be finetuned to achieve near-perfect accuracy on simple scenarios. More importantly, these finetuned models showed a "non-trivial" ability to generalize, maintaining approximately 45% accuracy on sequences significantly longer than those encountered during training. This suggests that the underlying logic of state tracking can be learned, even if it does not emerge spontaneously from standard text pretraining.
Conclusion
Entity tracking remains a "brittle" capability in current LLMs, with performance typically degrading as the complexity and length of the discourse increase. While GPT-4 represents a significant step forward, it still faces challenges with high levels of ambiguity.
Future research should aim to establish human baselines for these tasks, as tracking seven boxes over twelve moves is cognitively demanding even for humans. Additionally, exploring entity tracking in multilingual contexts and for more abstract states—such as a character's beliefs or emotional transitions—will be essential for developing models with a deeper, more human-like understanding of discourse.
Summary updated