arXiv:2611.07208cs.LGNov 2026

Manuscript Offprint

arXiv:2611.07208

Structured Machine Theory of Mind from Agent Trajectories

Nigel F. Doering, Rahath Malladi, Arshia Sangwan, M Tanjid Hasan Tonmoy, Jacob Doan, David Danks, Tauhidur Rahman

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Nigel F. Doering†

Halcloğlu School of Data Science and Computing, University of California San Diego

nfdoerin@ucsd.edu

Rahath Malladi†

Halcloğlu School of Data Science and Computing, University of California San Diego

ramalladi@ucsd.edu

Arshia Sangwan

New York University

as22034@nyu.edu

M Tanjid Hasan Tonmoy

Halcloğlu School of Data Science and Computing, University of California San Diego

mtonmoy@ucsd.edu

Jacob Doan

Halcloğlu School of Data Science and Computing, University of California San Diego

j5doan@ucsd.edu

David Danks

Department of Philosophy and School of Data Science, University of Virginia

danks@virginia.edu

Tauhidur Rahman

Halcloğlu School of Data Science and Computing, University of California San Diego

trahman@ucsd.edu

Reviewed on OpenReview: https://openreview.net/forum?id=PfSNLgOzcK

Abstract

Predictive models of human behavior trained on large-scale trajectory data optimize for statistical accuracy without representing the mental states that causally generate behavior. Such models support prediction but not principled intervention: they cannot answer how an agent's behavior would change if its beliefs or preferences were different. We introduce Structured Machine Theory of Mind (SMToM), a framework that addresses this limitation by attributing explicit, independently supervised belief and desire representations from observed trajectories within a Belief-Desire-Intention (BDI) causal structure. The central architectural element is a goal head that consumes only the predicted mental-state channels and a current-trajectory embedding; counterfactual intervention on beliefs and desires is thus a direct operation. We instantiate SMToM on a controlled pedestrian navigation domain where ground-truth mental states are known by construction, enabling evaluation of attribution accuracy, local channel interventions, and trajectory-level counterfactual diagnostics. The resulting model, BDIBottleneck, improves over trajectory-only and unsupervised-context neural baselines. Moreover, it is competitive with a matched auxiliary-supervised context baseline while providing an editable mental-state interface that the unbottlenecked baseline lacks. Counterfactual experiments on desires confirm that substituting an agent's inferred preferences with a different activity type coherently shifts predicted destinations toward relevant locations. Counterfactual experiments on beliefs confirm that marking a location as unavailable in the agent's belief state reduces its predicted probability as a destination, though in a complex way. Together, these results demonstrate, in a controlled navigation setting, that explicit BDI-structured supervision is a viable foundation for interpretable and counterfactual analysis of longitudinal trajectory data.

*All ideas and experiments are from the authors. LLMs were used for editing the writing to improve clarity and conciseness. Code and data are available at https://github.com/NigelDoering/structured-machine-tom.

†Equal contribution.

1 Introduction

Longitudinal datasets of human behavior, including mobility traces, activity logs, and interaction records, are increasingly used to build predictive models of population dynamics. The dominant approach is to train a deep model end-to-end on behavioral sequences and optimize for predictive accuracy on held-out data. These models can capture rich statistical regularities across individuals, but they do so without representing the mental states that actually generate behavior. The consequence is a structural limitation: a model that does not represent beliefs and desires cannot answer causal questions. It can predict that agents with certain historical patterns tend to visit certain locations, but it cannot say what those agents would do if their beliefs about the environment changed, or how a shift in underlying preferences would propagate to observable behavior. In other words, the model supports prediction but not interpretation or planning.

The appropriate framing for this problem is Theory of Mind (ToM), the capacity to attribute beliefs, desires, intentions, and other mental states to explain observed behavior (Premack & Woodruff, 1978; Wimmer & Perner, 1983; Leslie, 1987). Human behavior is causally generated by mental states: an agent goes somewhere because they want something and believe it is available. A model that recovers those components from trajectories does not merely correlate histories with futures; it maintains a causal representation of the agent that supports principled intervention. Formally, this is the problem of Machine Theory of Mind (MToM) (Rabinowitz et al., 2018): building systems that can infer latent mental states from observable behavioral traces. The core difficulty is that mental states are unobservable and the inference is ill-posed: any finite behavioral trace is consistent with many mental state configurations, and no ground-truth labels exist in the wild. A model must simultaneously specify the space of mental states and learn their relationship to behavior.

Prior work has addressed this through two paradigms that are directly comparable in our trajectory-based setting. Model-based approaches, exemplified by Baker et al. (2011), formalize attribution as Bayesian inverse planning: observed actions are explained by the beliefs and desires that make them rational. These methods are interpretable and support counterfactual reasoning by construction, but they require hand-specified dynamics and likelihood functions that rarely hold outside controlled settings. Learning-based approaches, exemplified by ToMnet (Rabinowitz et al., 2018), treat MToM as a meta-learning problem and infer mental states from behavioral context without hand-crafted models. The gain in flexibility comes at the cost of transparency: learned representations are opaque embeddings with no guaranteed correspondence to specific mental state components, and direct intervention on beliefs or desires is not a native operation.

We introduce Structured Machine Theory of Mind (SMToM), a framework that combines the explicit representational structure of model-based methods with the data-driven flexibility of learning-based ones. SMToM dedicates separate neural components to belief and desire attribution and routes their outputs through a structured bottleneck into goal prediction, following the Belief-Desire-Intention (BDI) framework (Bratman, 1987; Rao & Georgeff, 1995). Because beliefs and desires are explicit, independently addressable variables, counterfactual reasoning is a native operation. The model supports augmenting an agent's inferred beliefs or preferences directly and observing the resulting change in predicted behavior: for instance, what if this agent believed a particular location was closed? What would they likely do instead, given their historical behavioral patterns and subject to the causal BDI structure? We instantiate SMToM on a controlled pedestrian navigation domain where ground-truth mental states are known by construction, enabling rigorous evaluation of both attribution accuracy and counterfactual validity. Real-world behavioral datasets contain no ground-truth belief or desire labels; without such labels, a model's claim to infer mental states cannot be distinguished from learning a behavioral correlate, making controlled simulation the necessary starting point before extending to richer environments.

References (25)