Nicer Than Humans: How Do Large Language Models Behave in the Prisoner's Dilemma?
- Nicoló Fontana,
- Francesco Pierri,
- Polytechnic University of Milan,
- ,
- ,
- Danish Pioneer Centre for AI
Research Output:
Conference Article in Proceeding or Book/Report chapter
Article in proceedings
Peer-reviewOpen access
Publication Information
Output type
Research Output:
Conference Article in Proceeding or Book/Report chapter
Article in proceedings
Peer-reviewOriginal language
EnglishPages from-to (Number of pages)
Pages 522-535 (14 pages)Publication milestones
- Published - 07/06/2025
Publication status
Published - 07/06/2025
Volume
19Publisher
AAAI Press, United StatesHost publication title
Proceedings of the International AAAI Conference on Web and Social MediaAbstract
The behavior of Large Language Models (LLMs) as artificial social agents is largely unexplored, and we still lack extensive evidence of how these agents react to simple social stimuli. Testing the behavior of AI agents in classic Game Theory experiments provides a promising theoretical framework for evaluating the norms and values of these agents in archetypal social situations. In this work, we investigate the cooperative behavior of three LLMs (Llama2, Llama3, and GPT3. 5) when playing the Iterated Prisoner's Dilemma against random adversaries displaying various levels of hostility. We introduce a systematic methodology to evaluate an LLM's comprehension of the game rules and its capability to parse historical gameplay logs for decision-making. We conducted simulations of games lasting for 100 rounds and analyzed the LLMs' decisions in terms of dimensions defined in the behavioral economics literature. We find that all models tend not to initiate defection but act cautiously, favoring cooperation over defection only when the opponent's defection rate is low. Overall, LLMs behave at least as cooperatively as the typical human player, although our results indicate some substantial differences among models. In particular, Llama2 and GPT3. 5 are more cooperative than humans, and especially forgiving and non-retaliatory for opponent defection rates below 30%. More similar to humans, Llama3 exhibits consistently uncooperative and exploitative behavior unless the opponent always cooperates. Our systematic approach to the study of LLMs in game theoretical scenarios is a step towards using these simulations to inform practices of LLM auditing and alignment.
Publication metrics
PlumX, opens in new tab
Citations
3
Captures
21
Funding Details
This work was partially supported by the Italian Ministryof Education ( PRIN grant DEMON prot. 2022BAXSPY)and the European Union (NextGenerationEU project PNRR-PE-AI FAIR). NF acknowledges the support from the Dan-ish Data Science Academy through the DDSA Visit Grant(Grant ID: 2023-1856) and from Politecnico di Milanothrough the scholarship “Tesi all’estero a.a. 2023/24-Primobando”. LMA acknowledges the support from the CarlsbergFoundation through the COCOONS project (CF21-0432).
Access to documents
Final published version
Final published version, 315.25 KB
Related Event
Title
International AAAI Conference on Web and Social Media
Event type
ConferenceDegree of recognition
International eventDate
23/06/2025 - 26/06/2025Location
CopenhagenDenmark
