Language Agents demo

This is a demo of an agent-based model based on the Rational Speech Act (RSA) model[1]. Each agent has knowledge that represents which signal (Sx) the agent thinks can in principle be used to refer to a referent (Rx). The speaker computes per referent a probability distribution over words: "If I want to communicate Rx, what is the probability of Sx getting that message across?" These Theory of Mind (ToM) distributions are computed for a specific theory of mind level according to the RSA model. The speaker also has a probability distribution over referents, representing her (weighted) desire to communicate Rx: "I both want to communicate R1 and R3, therefore P(R1) = 0.5 and P(R2) = 0.5." The posterior signal distribution is computed by integrating the ToM map and the desired referent distribution.

The listener performs this computation in reverse. She computes per word a probability distribution over referents: "If I head Sx, what is the probability of Rx being the correct referent?" Given a probability distribution over words, representing uncertainty in the observed signal, she computes a probability distribution over referents.

Feel free to try it out for yourself. Play around with the agents' knowledge, desires and observations. See if you can make them understand each other; or try to see when communication breaks down. Have fun. For questions, please contact me.


  1. Michael C. Frank and Noah D. Goodman. Predicting pragmatic reasoning in language games. Science, 336(6084):998, 2012