wikillm

Paper · 2022-08-18 · cs.CL, cs.AI, cs.LG

Using Large Language Models to Simulate Multiple Humans and Replicate Human Subject Studies

Turing Experiments: a language model is prompted zero-shot to act as many different named participants in a human-subject study, and its outcomes are compared with published human results. Four experiments are simulated with OpenAI models; the recent models reproduce the Ultimatum Game, garden-path and Milgram findings, while on a wisdom-of-crowds task they show a hyper-accuracy distortion.

LLM evaluationAgent-based simulationPrompt engineeringLLM-as-a-judgeevaluationsimulationsocial-scienceprompting

arXivPDFCodeMarkdown13 min read

AI-compiled by claude-haiku-5-5 on 2026-10-18, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.

In plain words

Before running an experiment on people, a researcher can ask whether a text model would behave the way people did. This paper proposes a test of that kind, called a Turing Experiment. The model gets a written setup with a made-up participant, such as a named person who has been given a sum of money to split, and it writes what that person does next. The model is run again for many different names, so the results look like a small group of people instead of one imagined individual.

The authors apply this to four classic studies from economics, psycholinguistics and social psychology. They then compare the simulated group with what real people did in the original studies. In three of the four, the simulated trends match the reported human ones. In the fourth, a wisdom-of-crowds estimation task, the newer models give answers that are too accurate in a way people's answers are not.

TL;DR

Turing Experiments simulate the behaviour of many zero-shot participants with a prompted language model and compare the outcomes with published human data. Four experiments are simulated with OpenAI models. The recent models reproduce the human trends in three of them, and show a hyper-accuracy distortion in the wisdom-of-crowds task. Everything is author-reported, and the released code is archived.

Problem

Simulating human behaviour is hard, and human subject studies are costly and slow. A single-persona "Turing Test" says little about which people and which behaviours a model can simulate. The authors want a test that asks which aspects of human behaviour a model reproduces across a representative sample of participants §1. Each Turing Experiment must be zero-shot: neither the prompt nor the training data should contain prior data for that specific experiment, though the authors note this is hard to enforce with models pretrained on large corpora §1.

Method

A Turing Experiment (TE) is a program that builds prompts, queries a language model (LM) and reconstructs a text record of a simulated run. Its inputs are participant details (for example a title and surname) and optional experimental conditions. Its output is a record with the outcome of interest §1 §2.

  1. Prompt construction. Each TE writes one or more zero-shot prompts with the participant names and the condition filled in §2 fig. 1. The authors stress validating prompts on the validity rate, before any hypothesis is tested, to avoid p-hacking §2.
  2. Querying the LM. Two query types are used §2.
    • Completion: sample a continuation from the LM with temperature 1 and top-p 1 §3.
    • k-choice prompt: score each valid completion c_i after prompt s, and normalize over the valid completions. The normalizing constant Z is the validity rate §2.
  3. Record and outcome. The record is the prompt plus the completion, or a sequence of prompts and completions for multi-step TEs §4 §6.
  4. Validity. Completions that do not follow the required format are counted as invalid. Table 1 reports the valid share for five models tab. 1.

The four TEs are:

  • Ultimatum Game (§4). Two-choice prompts ask whether the responder accepts or rejects an offer out of a $10 endowment, for 11 offers (0 to 10) and 10,000 name pairs §4 fig. 3.
  • Garden-path sentences (§5, app. D). Two-choice prompts ask whether a sentence is grammatical or ungrammatical. The paper compares garden-path sentences with their controls app. D.
  • Milgram shock (§6, app. F). A multi-step loop over 30 shock levels with free-form subject actions, classified by LM judges, and experimenter prods. Details are in the pseudocode below app. F.1 fig. 17.
  • Wisdom of crowds (§7, app. E). Free-response prompts ask for an integer estimate. Estimates are normalized by the true answer fig. 8 app. E.

A novel variant of the Milgram scenario (a driver is "submerged" instead of a learner being shocked) and five authored questions for the wisdom-of-crowds TE test whether the results depend on the original wording §3 §6 app. F.2.

Pseudocode
# k-choice scoring: p_i = p(s c_i) / Z  [§2]
def choice_probabilities(prompt, completions, lm):
    # Unnormalized probability of prompt followed by each choice  [§2]
    scores = [lm.sequence_prob(prompt, c) for c in completions]
    # Z: total mass on the valid completions, i.e. the validity rate  [§2]
    validity_rate = sum(scores)
    # Normalize over the valid completions only  [§2]
    return [score / validity_rate for score in scores]
Pseudocode
# One stage of the Milgram loop  [app. F.1] [fig. 17]
def run_stage(record, subject, stage, lm):
    # Step 2: append the stage text (voltage and learner response)  [fig. 19]
    record += stage_text(subject, stage)
    prods_given = 0
    while True:
        # Step 3: the subject's name starts the next line  [app. F.1]
        prompt = record + "\n" + subject
        # Step 4: free-form completion, keep only its first sentence  [app. F.1]
        completion = lm.complete(prompt)
        sentence = first_sentence(completion)
        # Step 5: stop when the termination judge gives p > 0.5  [app. F.1]
        if lm.judge_stop(record, sentence) > 0.5:
            return record + sentence, "terminated"
        # Step 6: obedience (the subject shocked) ends the stage  [app. F.1]
        if lm.judge_not_shock(record, sentence) <= 0.5:
            return record + sentence, "obeyed"
        # Disobedience after all four prods ends the run  [fig. 21] [fig. 23]
        if prods_given == 4:
            return record + sentence, "terminated"
        # Otherwise append the next prod and re-attempt the stage  [fig. 21]
        prods_given += 1
        record += sentence + "\n" + prod_text(prods_given)

Hyperparameters

LabelEngineWhere
LM-1text-ada-001§3
LM-2text-babbage-001§3
LM-3text-curie-001§3
LM-4text-davinci-001§3
LM-5text-davinci-002§3
LM-6text-davinci-003§3
LM-7gpt-35-turbo§3
LM-8gpt-4§3
NameValueWhereNotes
Model setLM-1 to LM-8, engines in the mapping table below§3Ordered by the authors as increasing price and capability; LM-6 to LM-8 were used only in the later studies §3
Sampling temperature1§3Completions are sampled without modification
Top-p1§3
k-choice normalizationp_i = p(s c_i) / Z over valid completions§2Z is the validity rate. The paper gives no numbered equation
Validity criterion, UG"accept" or "reject" as the completion§4 fig. 3
Validity criterion, WoCinteger; commas and spaces are ignoredapp. E
Judge threshold, Milgram0.5, strict >app. F.1Step 4 of the algorithm
Shock levels, Milgram30 levels, 15 V steps, 15 to 450 Vapp. F fig. 19Grouped in fours with verbal labels app. F fig. 22
Experimenter prods, Milgram4 prods; Prod 1* replaces the first prod at the 315 V levelfig. 21Prod 1* says to treat no response as a wrong answer
Disobedience limit, Milgram5 disobediences end the experimentfig. 22 (table note)
Subjects, Milgram100: top 10 surnames from each of 5 groups, times Mr. and Ms.app. F app. B
Offers, UGintegers 0 to 10 of a $10 endowment§411 offers
Name pairs, UG10,000 pairs; each of 1,000 names is the responder 10 times§4Pairs drawn from 500 surnames with five racial groups §4 §3
Name pool1,000 names: 500 surnames times Mr./Ms.§3Milgram and UG use this pool; WoC adds Mx. app. E
Sentences, GP24 garden-path and 24 controls from prior work; 24 authoredapp. DOT and RAT verb types, 12 each
Questions, WoC10: 5 from prior work, 5 authored§7 tab. 31,500 title and surname combinations app. E
Not statedsamples per prompt; repetitions per condition; a validity threshold ("sufficiently close to 1"); random seed; max tokens for UG, GP and WoC§2 §4 §5 app. ESee Pitfalls

Results

Author-reported. Setup: OpenAI text models through the API, the datasets above and human reference data from the original studies §3 §4 §5 §6 §7.

SettingMetricModelValueSource
UG validityvalid share, %LM-1 / LM-588.0 / 99.5tab. 1
UG name sensitivitycorrelation of acceptance across offersLM-5above 0.9 within offers 1 to 4 and within 6 to 9fig. 4 §4
UG gender effectmean acceptance of a $2 offerLM-560% for a man receiving from a woman; 20% for a woman receiving from a man§4 fig. 5
Garden-path validityvalid share, %LM-595.5tab. 1
Garden-path effectungrammatical rating, garden path vs controlLM-5strongest difference of the five models; no reversed pairs for LM-5§5 app. D fig. 10
Milgramsimulated subjects obedient to the endLM-575 of 100 (human reference: 26 of 40)fig. 7
Milgrambreak-off distribution, percent obedientLM-5 vs human75.0% vs 65.0%fig. 22
Milgram, novel scenarioobedient vs terminated earlyLM-575 vs 25 of 100app. F.2
WoC validityvalid share, %LM-599.0tab. 1
WoC hyper-accuracynormalized median, all 10 questionsLM-6, gpt-35-turbo, gpt-41.0 with IQR 0fig. 8

WoC validity for every model: LM-1 51.0, LM-2 94.4, LM-3 88.0, LM-4 98.0, LM-5 99.0 tab. 1.

Valid share of completions, %; standard error below 0.05% tab. 1

ModelUltimatumGarden pathWisdom of crowds
LM-1 text-ada-00188.097.651.0
LM-2 text-babbage-00193.899.294.4
LM-3 text-curie-00199.497.988.0
LM-4 text-davinci-00198.695.598.0
LM-5 text-davinci-00299.595.599.0

Wisdom of crowds, median (IQR) of estimates, LM-1 to LM-6 tab. 3

The IQR is the difference between the 75th and 25th percentiles. The paper writes the speed of light as "2…" in its table; the exact constant is in Table 4 below tab. 3 tab. 4. Human values are blank where the human study did not include the question tab. 3.

QuestionLM-1LM-2LM-3LM-4LM-5LM-6HumanTruth
Adult human bones10 (21)18 (16)6 (1)206 (0)206 (180)206 (0)190 (108)206
Melting point of aluminum, °C163 (107)133 (135)6 (80)660 (0)660 (0)660 (0)240 (532)660
Degrees F in 100 °C10 (0)27 (55)8 (2)38 (4)212 (0)212 (0)200 (195)212
Earth days in a Mars year10 (3)6 (108)6 (5)365 (254)366 (322)687 (0)365 (376)687
Speed of sound in air, m/s10 (10)67 (115)6 (1)343 (2)340 (2)343 (0)333 (884)343
Ribs in a human, total6 (5)14 (13)5 (2)24 (12)24 (0)24 (0)24
Melting point of gold, °C106 (146)131 (199)8 (218)460 (1020)1064 (0)1064 (0)1064
Speed of light in vacuum, m/s10 (2)1 (3)8 (2)2… (0)2… (0)2… (0)2…
Keys on a typical piano3 (3)14 (18)5 (3)88 (0)88 (0)88 (0)88
Chromosomes in a dog, total4 (4)8 (6)4 (6)54 (24)38 (0)78 (0)78

Wisdom of crowds, median (IQR) for davinci, gpt-35-turbo and gpt-4 tab. 4

Questiondavincigpt-35-turbo (LM-7)gpt-4 (LM-8)Truth
Adult human bones136 (346)206 (0)206 (0)206
Melting point of aluminum, °C435 (887.25)660 (0)660 (0)660
Degrees F in 100 °C100 (132)212 (0)212 (0)212
Earth days in a Mars year327 (658)687 (0)687 (0)687
Speed of sound in air, m/s348 (364.75)343 (0)340 (0)343
Ribs in a human, total12 (38)24 (0)24 (0)24
Melting point of gold, °C935 (1470)1064 (0)1064 (0)1064
Speed of light in vacuum, m/s438431 (299792159)299792458 (0)300000000 (0)299792458
Keys on a typical piano61 (117)88 (0)88 (0)88
Chromosomes in a dog, total16 (38)78 (0)78 (0)78

For the speed of light, most gpt-4 answers are 3 × 10^8 rather than the exact constant, per the paper's note under Table 4 tab. 4. Garden-path ratings, Milgram stage texts and the UG per-offer acceptance rates for all five models are in fig. 9 to fig. 13 and fig. 15 to fig. 23.

Paper vs code

The official repository is microsoft/turing-experiments at commit f00115e793f5f728eccf13044bb299d64901de57, MIT licensed (copyright Microsoft Corporation). The repository is archived on GitHub. The paper names a different repository (GatiAher/...), which holds only a README that links to the Microsoft one. Code that runs experiments lives in scripts/ and src/. Data and prompt templates live in data/. The paper's wording differs from the code in these places. The Garden-path and WoC notebooks were checked only for the points below.

  • Judge probability is not normalized (Milgram). The paper defines the k-choice probability with normalization over valid completions §2. The Milgram judges take exp of the summed log-probabilities of the last two tokens, which is the unnormalized probability of "not shock" or "not stop", and compare it with 0.5 simulate_milgram_experiment.py simulate_milgram_experiment.py. The UG notebook divides by the valid mass before analysis Simulate_Ultimatum_Game_Experiment.ipynb. The Milgram code does not, so the 0.5 rule on raw probabilities is not the normalized rule in §2.
  • Level 27 (315 V) skips "please continue". The first disobedience at this level gets the Prod 1* text and no prod. The next disobedience gets Prod 2, so Prod 1 is never used at this level simulate_milgram_experiment.py fig. 21. The paper says prods are "always made in sequence" app. F.1, so this is a real choice the paper does not describe.
  • Generation settings. Milgram subject turns use text-davinci-002, max_tokens=40, temperature=1, and echo=False simulate_milgram_experiment.py. The paper gives temperature 1 and top-p 1 §3 but no token limit.
  • Judge settings. Milgram judges use temperature=0, max_tokens=0 and echo=True simulate_milgram_experiment.py simulate_milgram_experiment.py.
  • Level table. The code has 36 rows that map to 30 voltages. A correct learner answer keeps the voltage for the next row, and the loop runs up to row 36 DO_level_information_remote-learner.txt simulate_milgram_experiment.py. The paper describes 30 shock levels app. F.
  • First-sentence extraction. The code uses regex (.*?(?<!Mr|Ms)[\.\!\?\;]"?) and replaces a semicolon with a period simulate_milgram_experiment.py. The paper says only "extracted using regex". By reading, a completion with no ., !, ? or ; makes re.search return None and the next line fails. We did not run this.
  • Pronouns. Pronouns come from the title only: "Mr." gives he, anything else gives she simulate_milgram_experiment.py. "Mx." is not handled in the Milgram code. The paper uses Mx. only in the WoC TE.
  • Wisdom of crowds parsing. The integer extractor rejects completions with more than one number, drops digits after a decimal point (so "1.23" becomes 1), and rejects absolute values of 10^100 or more wisdom_of_crowds.ipynb. The paper says only that commas and spaces are ignored app. E. The default max tokens is 100 wisdom_of_crowds.ipynb, and the human WoC call uses stop token ] wisdom_of_crowds.ipynb.
  • Notebook labels. The UG notebook calls text-davinci-001 "LM-3" in one note Simulate_Ultimatum_Game_Experiment.ipynb, but its mapping and heading use "LM-4" Simulate_Ultimatum_Game_Experiment.ipynb Simulate_Ultimatum_Game_Experiment.ipynb. The paper's table uses LM-4 for text-davinci-001 §3 tab. 1. Check the mapping before using labels from the notebook.
  • Release state of the Milgram script. GLOBAL_VAR_MOCKED = True makes the script skip LM calls and return mock values simulate_milgram_experiment.py. run_full_experiment also breaks after the first subject simulate_milgram_experiment.py. Both look like test settings. Reproducing the Milgram results needs them changed, which the code does not document.
  • Engines. src/openai_handler.py lists five engines, from text-ada-001 to text-davinci-002 openai_handler.py. The paper uses more models, including gpt-35-turbo and gpt-4, through a separate chat path in the WoC notebook wisdom_of_crowds.ipynb.
  • Not checked. simulate_milgram_experiment_alternate.py (the novel scenario), the analysis notebooks and the garden-path notebook beyond the normalization cell were not read in full.

Pitfalls

  • Validity is the first thing to check. The paper says to tune the prompt until the validity rate is "sufficiently close to 1" before running the full experiment §2. It gives no threshold. Table 1 shows the range: 51.0% for LM-1 on WoC up to 99.5% for LM-5 on UG tab. 1.
  • Normalize before comparing with 0.5 (judges). A raw probability of "not shock" can be below 0.5 while the normalized probability is above it, when the other completion has mass too. Use the normalized value, as the paper defines §2, or measure the difference in the code as described in Paper vs code.
  • Prompt length. The paper notes that most available LMs cannot handle the Milgram prompt length, which grows with each stage §3. The record is carried forward across all stages app. F.1, so cost and context grow with the level.
  • Calls per attempt. Each attempt uses three calls in the code: one generation and two judges simulate_milgram_experiment.py simulate_milgram_experiment.py simulate_milgram_experiment.py. A stage can repeat up to four prods, so cost depends on the subject's path.
  • Sampling and repeats are not stated. The paper does not say how many completions were drawn per prompt or whether each name was run once. Treat the reported percentages as one draw per prompt unless the authors say otherwise §4 §6.
  • Contamination is a known risk. The authors say models were probably trained on descriptions of these experiments, so they added novel variants for three of four TEs §3 §8 app. F.2. The novel Milgram scenario still follows the same algorithm and shares the Milgram structure app. F.2.
  • Hyper-accuracy has an untested cause. The authors suspect alignment training. They test this on other GPT versions, but say the details of those models are not released app. E fig. 15.
  • Authors' own claims. Results are author-reported on an API with models that the paper dates to 2022 and 2023. The p-value for the UG gender effect is given as below 1e-16 §4. Reproducing the numbers needs the same engines and prompts, and the paper cannot guarantee the same outputs.
  • Garden-path results are qualitative in the text. Only a few exact numbers appear for the garden-path TE. Use the figures for the per-sentence picture fig. 10 fig. 13.
  • Milgram data are one-sided. The paper compares 100 simulated subjects with 40 human subjects from Experiment 1 fig. 7 fig. 22. The experiment design differs from the original in several ways the paper lists app. F.1.

Lineage

  • Builds on: Turing's Imitation Game as a test of one simulated individual §1; the human studies it replicates are from the original papers cited in §4 §5 §6 §7.
  • Compared against: concurrent work on simulating survey respondents from demographic prompts §1. That work is not on the wiki.
  • Superseded by: not stated.

Source and license

Adapted from “Using Large Language Models to Simulate Multiple Humans and Replicate Human Subject Studies” by Gati Aher, Rosa I. Arriaga, Adam Tauman Kalai (arXiv:2208.10264), used under CC BY 4.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors. Code citations refer to https://github.com/microsoft/turing-experiments at commit f00115e793f5 (MIT). Any quoted code is shown under that license.