Hostname: page-component-77f85d65b8-242vh Total loading time: 0 Render date: 2026-03-26T08:18:28.001Z Has data issue: false hasContentIssue false

Integrating machine behavior into human subject experiments: a user-friendly toolkit and an application to framed prisoner’s dilemmas

Published online by Cambridge University Press:  24 March 2026

Christoph Engel
Affiliation:
Max Planck Institute for Behavioral Economics, Bonn, Germany
Max Rainer Pascal Großmann
Affiliation:
Department of Economics, Faculty of Business and Economics, The University of Melbourne, Carlton VIC, Australia
Axel Ockenfels*
Affiliation:
Max Planck Institute for Behavioral Economics, Bonn, Germany Department of Economics and Adenauer School of Government, University of Cologne, Cologne, Germany
*
Corresponding author: Axel Ockenfels; Email: ockenfels@uni-koeln.de
Rights & Permissions [Opens in a new window]

Abstract

Large Language Models (LLMs) have the potential to profoundly transform and enrich experimental economic research. We propose a new software framework, “alter_ego”, which makes it easy to design experiments between LLMs and to integrate LLMs into oTree-based experiments with human subjects. Our toolkit is freely available at github.com/mrpg/ego. To illustrate, we run differently framed prisoner’s dilemmas with interacting machines as well as with human-machine interaction. Framing effects in machine-only treatments are strong and similar to those expected from previous human-only experiments, yet less pronounced and qualitatively different if machines interact with human participants.

Information

Type
Original Paper
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (http://creativecommons.org/licenses/by/4.0), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited.
Copyright
© The Author(s), 2026. Published by Cambridge University Press on behalf of the Economic Science Association.
Figure 0

Table 1. Results of the code in Figure 1 (temperature$=1$, 5 repetitions)

Figure 1

Figure 1. Complete code for a machine microexperiment

Figure 2

Figure 2. Architecture of the tool—these elements represent Python classes

Figure 3

Table 2. Payoffs

Figure 4

Figure 3. Cooperation conditional on platform and round

Mean choices, with 95% confidence interval.
Figure 5

Table 3. Mean percentage of cooperative choices per platform and frame, aggregated over all rounds

Figure 6

Figure 4. Cooperation conditional on platform, round, and identity of the player (machine vs. human)

Mean choices, with 95% confidence interval
Supplementary material: Link

Engel et al. Dataset

Link