Learning Theory of Mind via Dynamic Traits Attribution

Dung Nguyen, Phuoc Nguyen, Hung Le, Kien Do, Svetha Venkatesh, Truyen Tran

Abstract

In social environments, humans predict others' behavior by inferring both transient mental states and stable character traits. While traditional Theory of Mind (ToM) models treat these traits as simple input features, this paper introduces Trait-ToM, a neural architecture that uses a hypernetwork to dynamically reconfigure its predictive logic based on an agent's observed history. By generating "fast weights" that adapt the model to specific individual personalities, Trait-ToM significantly outperforms existing baselines in social reasoning, intention prediction, and collaborative tasks.

Introduction

Effective social interaction requires a sophisticated "Theory of Mind" (ToM)—the ability to attribute mental states to others. Humans distinguish between transient states (what someone knows or wants now) and stable traits (how someone usually behaves or their cognitive capacity). Existing machine learning models, such as ToMnet, typically treat these stable traits as additional data points in a feature vector. However, the authors of this study argue that a character trait is not just data; it is a lens that fundamentally changes how an agent interprets and interacts with the world.

To address this, the researchers developed Trait-ToM, an architecture designed to fundamentally reconfigure its internal predictive mechanism based on the specific individual it is currently observing.

Methods: The Trait-ToM Architecture

Trait-ToM is composed of four primary modules that work in tandem to model and predict agent behavior:

  1. Trait Model: This module analyzes an actor's past trajectories across various environments. Using an LSTM, it encodes these historical behaviors into a latent "trait embedding."
  2. Hypernetwork: This is the core innovation of the system. Instead of passing the trait embedding as a standard input, it is fed into a hypernetwork that generates the weights and biases for the Prediction Model. These "fast weights" are computed on-the-fly, allowing the system to adapt its logic to the specific "personality" of the observed agent.
  3. Mental Model: This module processes the actor's current trajectory to estimate immediate mental states, such as their current target or focus.
  4. Prediction Model: This network takes the current state and the mental state to predict four key outputs: long-term preferences, current intentions, next actions, and the "Successor Representation" (a predictive map of future locations). Crucially, the logic of this network is defined by the weights provided by the hypernetwork, enabling multiplicative interaction rather than simple additive integration.

Experimental Setup

The model was evaluated using a Key-Door Environment built on the gym-minigrid framework. In this task, actors must find a key and navigate to a door of a specific color. The researchers created a diverse population of 32 distinct actor types defined by:

  • Preferences: Four different color targets.
  • Traits: "Random-actors" (stochastic searchers) vs. "Hypo-actors" (intelligent agents that form and test hypotheses).
  • Field of View (FoV): Four different visibility ranges, from $3\times3$ to $9\times9$.

The model was tested in both "Mixed" settings and "Sequential" settings, the latter of which mimics realistic social learning by introducing the observer to one type of agent at a time.

Key Insights and Results

Multiplicative Interaction and Predictive Power

By using traits to modulate weights via the hypernetwork, Trait-ToM gains a higher capacity to represent diverse behaviors compared to additive models. The system essentially "becomes" a specialized predictor for each specific agent. This is particularly evident when predicting "hard" movements, such as changes in direction. While predicting forward momentum is trivial, predicting a turn requires understanding an agent's internal strategy and visibility—areas where Trait-ToM excels.

Performance Metrics

In the challenging sequential training scenarios, Trait-ToM outperformed the baseline ToMnet by a wide margin. For intention prediction, Trait-ToM achieved approximately 47% accuracy compared to ToMnet's 36%. Furthermore, the model demonstrated superior "Forward Transfer Ability," allowing it to infer the intentions of brand-new, unseen agent types faster than previous models.

Social Reasoning and Helping

The researchers also tested the model on a "Sally-Anne" style false-belief task, where an object is moved while the actor is not looking. Trait-ToM's predictions of the actor's future path were significantly more accurate than the baseline.

When integrated into a "helper" robot, Trait-ToM achieved higher success rates and shorter episode lengths. Notably, it provided less unnecessary assistance than the baseline, demonstrating a nuanced understanding of when an actor was truly lost versus when they were simply following a specific, albeit non-obvious, strategy.

Limitations and Future Work

While Trait-ToM represents a significant step forward, the study notes several limitations:

  • Environment Complexity: The current research is limited to 2D grid-worlds. Real-world social traits like emotional volatility or social hierarchy involve much higher complexity.
  • Trait Stability: The model assumes traits are stable. Future iterations would need to account for "fluid" traits where agents learn and change their strategies over time.
  • Computational Cost: Training hypernetworks is computationally intensive, as the model must output the parameters for an entire secondary network. Scaling this to larger architectures remains a technical challenge.

Conclusion

Trait-ToM demonstrates that treating character traits as dynamic modulators of logic—rather than static inputs—is essential for robust social reasoning. By leveraging hypernetworks to generate agent-specific models, AI can achieve a more human-like understanding of behavior, leading to more efficient and intuitive human-AI collaboration.

Summary updated

BibTeX
@inproceedings{nguyen2022learning,
  author = {Dung Nguyen and Phuoc Nguyen and Hung Le and Kien Do and Svetha Venkatesh and Truyen Tran},
  title = {{Learning Theory of Mind via Dynamic Traits Attribution}},
  booktitle = {AAMAS},
  year = {2022},
  url = {https://openreview.net/forum?id=1KaneZLgbrv},
}
Figure