This repo contains code, explanations and results of experiments to ascertain the propensity of large-language models to cooperate in social dilemmas. The experiments are described in the following papers.
S. Phelps and Y. I. Russell, Investigating Emergent Goal-Like Behaviour in Large Language Models Using Experimental Economics, working paper, May 2023, arXiv:2305.07970
S. Phelps and R. Rannson, Of Models and Tin Men - a behavioural economics study of principal-agent problems in AI alignment using large-language models, working paper, July 2023, arXiv:2307.11137
- Install miniforge.
- In a shell:
export OPENAI_API_KEY='<my key>'
make install
make run
To run specific experiments and parameter combinations follow instructions below.
- In a shell:
mkdir ~/.llm-cooperation
cat > ~/.llm-cooperation/llm_config.py << EOF
grid = {
"temperature": [0.1, 0.6],
"model": ["gpt-3.5-turbo", "gpt-4"],
"max_tokens": [300]
}
num_replications = 3
experiments = ["dictator", "dilemma"]
EOF
-
Edit
$HOME/.llm-cooperation/llm_config.py
with required values. -
In a shell:
export OPENAI_API_KEY='<key>'
make run
If you have a new experiment then please submit a pull request. All code should have corresponding tests and all experiments should be replicable.