This repository contains source code for the paper Modeling Cross-Cultural Pragmatic Inference with Codenames Duet by Omar Shaikh*, Caleb Ziems*, Will Held, Aryan J. Pariani, Fred Morstatter, and Diyi Yang. Feel free to reach out to Omar Shaikh with any questions!
[Read the Paper] | [Download the Data] | [Demo (coming soon!)]
Sociocultural variation holds significant influence over how we communicate with eachother. Our referents depend heavily on sociocultural priors. For example, depending on who you ask, football might refer to American football or soccer.
Rigorously modeling how socioculture affects pragmatic inference on all axes is understandably challenging. The board game Codenames offers a more restricted setting of turn-based word reference between two players. In each round, THE CLUE GIVER provides a single-word clue; then THE GUESSER must interpret this clue to select the intended word references on the game board. Ideal inferences come from the players’ common ground—the set of shared beliefs between them (Clark, 1996). In practice, however, a player’s behavior can be idiosyncratic. Each player has knowledge and experience that shape how they interpret clues and make guesses.
Our experiments show that accounting for background characteristics significantly improves model performance for tasks related to both clue giving and guessing, indicating that sociocultural priors play a vital role in gameplay decisions.
Our dataset consists of 794 games with 7,703 turns, distributed across 153 unique players. Alongside gameplay, we collect information about players' personalities, values, and demographics. We deconstruct games into 6 tasks, shown below.
We additionally open-source our data collection code, including a modified Codenames Duet frontend and backend. This is under the duet folder.
1. Dataset Preparation
The datasets are under the data folder. Each task above is split into its own folder, named after each gameplay task above.
Dataset splits have their own .csv file. Each file has 6 columns, described below.
base_text: Thebase_textfield properties of the game state, like words remaining on the board, avoid words, green words, etc. All below fields encodebase_text, and their additional values.leaning_onlyencodes variables about political leaning.event_onlyencodes demographic information collected from the UI (age, country of origin, native English speaker).demo_onlyencodes several more demographic variables (see paper for details).personality_onlyencodes results from the Big 5 personality traits.all_textencodes all variables from the above fields.outputencodes the output from the specific gameplay task.
2. Baseline Models
Running train_all_best.sh will reproduce the best-performing models on the validation set. To isolate the best model, run select_best_model.py. Additionally, models will be uploaded to HuggingFace Hub.
BibTeX:
@article{shaikh2023modeling,
title={Modeling Cross-Cultural Pragmatic Inference with Codenames Duet},
author={Omar Shaikh and Caleb Ziems and William Held and Aryan J. Pariani and Fred Morstatter and Diyi Yang},
year={2023},
eprint={2306.02475},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
