Code Monkey home page Code Monkey logo

phelps-sg / llm-cooperation Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 2.0 11.09 MB

Code and materials for the paper S. Phelps and Y. I. Russell, Investigating Emergent Goal-Like Behaviour in Large Language Models Using Experimental Economics, working paper, arXiv:2305.07970, May 2023

License: MIT License

Makefile 0.89% Python 73.12% TeX 14.34% R 11.65%
economics experimental-economics gametheory gpt-3 llm prisoners-dilemma ai-safety ai-alignment behavioral-economics gpt-4

llm-cooperation's Introduction

llm-cooperation

GitHub Workflow Status

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

Getting started

  1. Install miniforge.
  2. In a shell:
export OPENAI_API_KEY='<my key>'
make install
make run

Configuration

To run specific experiments and parameter combinations follow instructions below.

  1. 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
  1. Edit $HOME/.llm-cooperation/llm_config.py with required values.

  2. In a shell:

export OPENAI_API_KEY='<key>'
make run

Contributing

If you have a new experiment then please submit a pull request. All code should have corresponding tests and all experiments should be replicable.

llm-cooperation's People

Contributors

phelps-sg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

llm-cooperation's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.