A Bayesian cognitive model of epistemic language understanding, which translates natural language into an epistemic language-of-thought (ELoT), then evaluates these translations against inferences about an agent's mental states produced by inverse planning with a Bayesian theory of mind (BToM).
This dataset and model were largely authored by Lance Ying and Tan Zhi-Xuan.
See the paper for more details:
Lance Ying*, Tan Zhi-Xuan*, Lionel Wong, Vikash Mansinghka, and Joshua B. Tenenbaum. 2025. “Understanding Epistemic Language with a Language-augmented Bayesian Theory-of-Mind,” in Transactions of the Association for Computational Linguistics (TACL).
Our LaBToM model comprises two interlinked modules:
-
The first module (top), an epistemic language of thought (ELoT), models our capacity to compositionally represent the world (including the contents of others' minds), and how we flexibly translate such thoughts from natural language.
-
The second module (bottom), a Bayesian theory-of-mind (BToM), captures our intuitive inferences about others' minds via Bayesian inference over a generative model of how agents update their beliefs and act towards their goals.
Epistemic language understanding can thus be modeled by mapping language into ELoT formulas, which we evaluate against the inferences produced by rational mentalizing.
To set up the environment for this project, make sure the epistemic_language directory is set as the active environment. In VSCode with the Julia for VSCode extension, you can do this by right-clicking the directory in the file explorer, and selecting Julia: Activate This Environment. Alternatively, you can use the activate command in the Julia REPL's Pkg mode.
Then run the following commands in via Pkg mode in the Julia REPL:
add https://github.com/probcomp/InversePlanning.jl.git#release-0.0.2
instantiateSeveral scripts in this repository (e.g. threshold fitting, analysis, and plotting code) require access to human-provided data. This data can be downloaded from the files tab of https://osf.io/xq9c4/, and placed in results/humans directory.
- The
datasetdirectory contains all plans, problems, and stimuli - The
srcdirectory contains non-top-level source files - The
scriptsdirectory contains the main experiment scripts - The
translationdirectory contains ELoT translation code (seetranslation/README.md) - The
llm_baselinesdirectory contains LLM baselines (seellm_baselines/README.md) - The
assetsdirectory contains image assets used in this README
In the scripts directory, you will find the following scripts:
run_btom_inference.jlgenerates and saves BToM inference results via Bayesian inverse planningrun_elot_evaluation.jlevaluates ELoT translations against saved BToM inference resultsrun_elot_evaluation_full.jlevaluates ELoT translations for the full dataset of human-written statementsrun_inference_and_evaluation.jlruns the BToM and ELoT modules consecutively, without intermediary filesrun_threshold_fitting.jlfits threshold parameters for the ELoT module against human datatestbed.jlis for experimenting with modeling and inference parametersstimuli.jlgenerates stimuli animations and metadata
Scripts for analysis and plotting can also be found in the scripts directory:
analysis.jlgenerates analysis resultsplot_statistics.jlgenerates statistical plots from the analysis resultsplot_storyboards.jlgenerates storyboards with results for each scenario/stimulus
