NeurIPS 2026QuestionsPapersAreasAboutMarkdown

A Mechanistic Investigation of Theory of Mind in a Large Language Model

Idil K Sahin, Steven M Frankland, Taylor Webb

NeurIPS page · OpenReview · Open on the map

Category: LLM Agents, Evals & Benchmarks › LLM Mental Modeling · Type: empirical study · Keywords: theory of mind, large language models, attention heads, causal mediation analysis, representational similarity analysis

Areas: LLM Reasoning › Reasoning Mechanisms › Mechanistic Interpretability; Evaluation & Benchmarks › Language Model and Agent Benchmarks › Language Model Probing; Interpretability › Mechanistic Interpretability › Cognitive Concept Interpretation

Summary

The paper investigates how a large language model solves theory-of-mind tasks, discovering that mid-layer attention heads track representation divergence and later-layer heads retrieve answers, concluding that a domain-general mechanism underlies this ability.

Explained to a 5-year-old

A big computer brain tries to guess what other characters think. It looks at stories to see when thoughts don’t match reality. Scientists found two special groups of tiny helpers inside the brain. One group watches for differences, the other group says the answer. Together they help the computer understand that others can have wrong thoughts.

Explained to a 5-year-old, longer

A computer program called a large language model can solve puzzles about what other people think. It reads stories where characters have beliefs that might be true or false. The scientists wanted to know if the program uses special thinking for minds or just remembers patterns. They gave the program many similar stories and watched how it works inside. They found that some hidden parts of the program notice when a thought does not match what is really happening. Other hidden parts help the program say the right answer. These two groups of helpers work together but do different jobs. Even when the story had a picture instead of a belief, the helpers still worked. This shows the program does not need a special mind module; it uses a general way to check facts. The findings help us understand how computers can reason about thoughts.

For a technical reader

The study analyzes how a large language model solves false-belief tasks to understand mental states. Using causal mediation and similarity analyses, the authors identified two groups of attention heads: one that detects mismatches between expected and actual states, and another that outputs the final answer. These heads work together but have distinct roles, showing the model relies on a general divergence-detection mechanism rather than a dedicated theory-of-mind module. The results suggest that similar analyses can be applied to other models for interpretability. This provides a practical roadmap for engineers interested in probing model internals.

Problem

It is unclear whether large language models solve false-belief tasks by deploying specialized mentalizing circuitry, by memorizing common vignette patterns, or by using more domain-general computations. This work seeks to determine which of these mechanisms actually drives the model’s performance.

Method

The authors employ causal mediation and representational similarity analyses on systematically varied prompt sets that manipulate beliefs, world states, and correct answers. They examine mid-layer and later-layer attention heads to see how they track divergence between initial representations and current reality and how they retrieve answer tokens. The two head populations are shown to be functionally dissociable yet combine compositionally.

Results

The approach finds that mid-layer attention heads track divergence between initial representations and current world states, later-layer heads retrieve answer tokens, and both populations are causally relevant and functionally dissociable while combining compositionally.

Contributions

It provides a mechanistic dissection of theory-of-mind performance in a large language model, revealing distinct attention head roles and arguing for a domain-general divergence detection mechanism over specialized mentalizing or memorization accounts.

Research questions this paper is counted under

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction