Introducing tomsup: Theory of mind simulations using Python

Behav Res Methods. 2023 Aug;55(5):2197-2231. doi: 10.3758/s13428-022-01827-2. Epub 2022 Aug 11.

Abstract

Theory of mind (ToM) is considered crucial for understanding social-cognitive abilities and impairments. However, verbal theories of the mechanisms underlying ToM are often criticized as under-specified and mutually incompatible. This leads to measures of ToM being unreliable, to the extent that even canonical experimental tasks do not require representation of others' mental states. There have been attempts at making computational models of ToM, but these are not easily available for broad research application. In order to help meet these challenges, we here introduce the Python package tomsup: Theory of mind simulations using Python. The package provides a computational eco-system for investigating and comparing computational models of hypothesized ToM mechanisms and for using them as experimental stimuli. The package notably includes an easy-to-use implementation of the variational recursive Bayesian k-ToM model developed by (Devaine, Hollard, & Daunizeau, 2014b) and of simpler non-recursive decision models, for comparison. We provide a series of tutorials on how to: (i) simulate agents relying on the k-ToM model and on a range of simpler types of mechanisms; (ii) employ those agents to generate online experimental stimuli; (iii) analyze the data generated in such experimental setup, and (iv) specify new custom ToM and heuristic cognitive models.

Keywords: Agent-based simulation; Computational modeling; Game theory; Theory of mind; Variational Bayesian inference.

Publication types

  • Research Support, Non-U.S. Gov't

MeSH terms

  • Bayes Theorem
  • Humans
  • Theory of Mind*