Skip to content

Framework for testing strategic reasoning in LLMs using evolutionary Iterated Prisoner’s Dilemma tournaments. Features 28 agents, variable horizons, memory conditions, high-concurrency execution, and detailed analysis of cooperation rates, strategic fingerprints, and LLM decision rationales across providers and temperatures.

License

Notifications You must be signed in to change notification settings

HCSS-Data-Lab/Strategic-LLM-IPD

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Strategic-LLM-IPD

Evaluating Strategic Intelligence in Large Language Models via Evolutionary Iterated Prisoner’s Dilemma

This repository implements the full experimental framework based on work by Payne et al. (2025):
Payne et al. — LLM-IPD-ARXIV GitHub Repository

It also contains the agent implementations and analysis pipeline described in our study “Do LLMs Possess Strategic Intelligence? Testing LLMs in Iterated Prisoner’s Dilemmas.”


Overview

  • Implements a multi-phase evolutionary tournament among a diverse population of agents:
    • 12 LLM-based agents (from major providers)
    • 13 canonical & synthetic rule-based strategies (Tit-for-Tat, Grim Trigger, Prober, etc.)
    • 3 adaptive learning agents (Q-Learning, Thompson Sampling, Gradient Meta-Learner)
  • Supports varying conditions:
    • Shadow-of-the-future (termination probability): δ ∈ {0.02, 0.05, 0.10, 0.25, 0.75}
    • Memory regimes: Anonymous Memory vs. Opponent Tracking
    • LLM temperature settings (where applicable)
  • Provides automated logging of: moves, payoffs, per-round histories, and LLM rationales
  • Includes an analysis module computing: cooperation rates, strategic fingerprints, extended history behaviour, and rationales categorisation

Getting Started

Prerequisites

  • Python ≥ 3.9
  • Required packages (see requirements.txt): e.g., numpy, pandas, matplotlib, seaborn, etc.
  • Access credentials / API keys for LLM providers (if enabling LLM agents)

Installation

git clone https://github.com/HCSS-Data-Lab/Strategic-LLM-IPD.git
cd Strategic-LLM-IPD
pip install -r requirements.txt

About

Framework for testing strategic reasoning in LLMs using evolutionary Iterated Prisoner’s Dilemma tournaments. Features 28 agents, variable horizons, memory conditions, high-concurrency execution, and detailed analysis of cooperation rates, strategic fingerprints, and LLM decision rationales across providers and temperatures.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 91.4%
  • TeX 8.6%