Improving Cooperation in Language Games with Bayesian Inference and the Cognitive Hierarchy

Joseph Bills,Christopher Archibald,Diego Blaylock
2024-12-17
Abstract:In two-player cooperative games, agents can play together effectively when they have accurate assumptions about how their teammate will behave, but may perform poorly when these assumptions are inaccurate. In language games, failure may be due to disagreement in the understanding of either the semantics or pragmatics of an utterance. We model coarse uncertainty in semantics using a prior distribution of language models and uncertainty in pragmatics using the cognitive hierarchy, combining the two aspects into a single prior distribution over possible partner types. Fine-grained uncertainty in semantics is modeled using noise that is added to the embeddings of words in the language. To handle all forms of uncertainty we construct agents that learn the behavior of their partner using Bayesian inference and use this information to maximize the expected value of a heuristic function. We test this approach by constructing Bayesian agents for the game of Codenames, and show that they perform better in experiments where semantics is uncertain
Artificial Intelligence,Computer Science and Game Theory
What problem does this paper attempt to address?
This paper attempts to solve the problem of cooperation failure in cooperative language games due to differences in semantic and pragmatic understanding. Specifically: 1. **Semantic Uncertainty**: Different AI agents may use different language models to represent the relationships between words, which will lead to different ways of using language in the game. 2. **Pragmatic Uncertainty**: Even when using the same language model, an agent's understanding of how to respond to a certain utterance may also be different, especially when the meaning of the utterance is ambiguous due to information - quantity limitations. To solve these problems, the author proposes a method based on Bayesian inference, enabling agents to better cooperate with any teammates in the following ways: - **Modeling Rough Semantic Uncertainty**: Represent semantic uncertainty through a set of language models of prior distribution. - **Modeling Fine - grained Semantic Uncertainty**: Simulate it by adding noise to word embeddings. - **Modeling Pragmatic Uncertainty**: Represent different - level reasoning strategies through the cognitive hierarchy. By combining the above methods, an agent can update its beliefs after observing the behavior of its teammates and then select the best action accordingly to maximize the expected utility. This method was tested in the Codenames game, and the results show that Bayesian agents perform better in dealing with semantic uncertainty. ### Specific Problem Description In cooperative language games, agents need to communicate effectively in order to successfully complete tasks. However, if agents' assumptions about each other's behaviors are inaccurate, the cooperation may fail. In particular, in natural - language games, the failure may be caused by inconsistent semantic or pragmatic understanding of utterances. ### Solution Overview 1. **Bayesian Framework**: Agents are not limited to a single language model but have a set of possible language models and can perform probabilistic inference on them. 2. **Bayesian Inference**: Update agents' beliefs about their teammates' behaviors through Bayes' rule. 3. **Cognitive Hierarchy**: Combine different - level reasoning strategies to deal with pragmatic uncertainty. In this way, the proposed Bayesian agents can adaptively adjust their behaviors in uncertain semantic and pragmatic environments, thereby improving the cooperation efficiency. ### Experimental Verification The author conducted experiments in the Codenames game to verify the performance of the proposed Bayesian agents under different language models and reasoning strategies. The experimental results show that Bayesian agents have better performance in the face of semantic uncertainty. ### Key Formulas - **Bayesian Update Formula**: \[ P(m|a)\propto P(a|m)P(m) \] where \(P(m|a)\) is the posterior probability, \(P(a|m)\) is the likelihood function, and \(P(m)\) is the prior probability. - **Heuristic Utility Function**: \[ u(\text{red}) = 1,\quad u(\text{blue}) = - 1,\quad u(\text{bystander}) = 0,\quad u(\text{assassin}) = -|\text{R}| \] where \(|\text{R}|\) is the total number of red - team cards. Through these methods and formulas, the paper shows how to improve the cooperation effect in cooperative language games through Bayesian inference and the cognitive hierarchy.