{"id":37428489,"url":"https://github.com/phelps-sg/llm-cooperation","last_synced_at":"2026-01-16T06:32:49.731Z","repository":{"id":161697536,"uuid":"636358990","full_name":"phelps-sg/llm-cooperation","owner":"phelps-sg","description":"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","archived":false,"fork":false,"pushed_at":"2024-12-10T16:16:18.000Z","size":11721,"stargazers_count":12,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-12-10T17:30:27.983Z","etag":null,"topics":["ai-alignment","ai-safety","behavioral-economics","economics","experimental-economics","experimental-psychology","gametheory","gpt-3","gpt-4","llm","principal-agent-problem","prisoners-dilemma","social-dilemmas"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phelps-sg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["phelps-sg"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2023-05-04T17:12:30.000Z","updated_at":"2024-12-10T16:16:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"799ef5eb-5866-4d4e-8e8e-1b75d28fadf1","html_url":"https://github.com/phelps-sg/llm-cooperation","commit_stats":{"total_commits":526,"total_committers":3,"mean_commits":"175.33333333333334","dds":0.4524714828897338,"last_synced_commit":"7558218a18d45ac2ae19a7076824cc2da414922d"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/phelps-sg/llm-cooperation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phelps-sg%2Fllm-cooperation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phelps-sg%2Fllm-cooperation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phelps-sg%2Fllm-cooperation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phelps-sg%2Fllm-cooperation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phelps-sg","download_url":"https://codeload.github.com/phelps-sg/llm-cooperation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phelps-sg%2Fllm-cooperation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28477810,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-alignment","ai-safety","behavioral-economics","economics","experimental-economics","experimental-psychology","gametheory","gpt-3","gpt-4","llm","principal-agent-problem","prisoners-dilemma","social-dilemmas"],"created_at":"2026-01-16T06:32:49.645Z","updated_at":"2026-01-16T06:32:49.716Z","avatar_url":"https://github.com/phelps-sg.png","language":"Python","funding_links":["https://github.com/sponsors/phelps-sg"],"categories":[],"sub_categories":[],"readme":"# llm-cooperation\n\n[![GitHub Workflow Status](https://github.com/phelps-sg/llm-cooperation/actions/workflows/tests.yaml/badge.svg)](https://github.com/phelps-sg/llm-cooperation/actions/workflows/tests.yaml)\n\n\nThis 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.\n\n\nS. Phelps and Y. I. Russell, *Investigating Emergent Goal-Like Behaviour in Large Language Models Using Experimental Economics*, working paper, May 2023, [arXiv:2305.07970](https://arxiv.org/abs/2305.07970)\n\nS. 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](https://arxiv.org/abs/2307.11137)\n\n\n## Getting started\n\n\n1. Install [miniforge](https://github.com/conda-forge/miniforge#mambaforge).\n2. In a shell:\n~~~bash\nexport OPENAI_API_KEY='\u003cmy key\u003e'\nmake install\nmake run\n~~~\n\n\n## Configuration\n\n\nTo run specific experiments and parameter combinations follow instructions below.\n\n\n1. In a shell:\n\n\n~~~bash\nmkdir ~/.llm-cooperation\ncat \u003e ~/.llm-cooperation/llm_config.py \u003c\u003c EOF\n\n\ngrid = {\n        \"temperature\": [0.1, 0.6],\n        \"model\": [\"gpt-3.5-turbo\", \"gpt-4\"],\n        \"max_tokens\": [300]\n}\n\n\nnum_replications = 3\n\n\nexperiments = [\"dictator\", \"dilemma\"]\nEOF\n~~~\n\n\n2. Edit `$HOME/.llm-cooperation/llm_config.py` with required values.\n\n\n3. In a shell:\n~~~bash\nexport OPENAI_API_KEY='\u003ckey\u003e'\nmake run\n~~~\n\n\n\n\n## Contributing\n\n\nIf you have a new experiment then please submit a pull request.\nAll code should have corresponding tests and all experiments should be replicable.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphelps-sg%2Fllm-cooperation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphelps-sg%2Fllm-cooperation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphelps-sg%2Fllm-cooperation/lists"}