wikillm

Paper · 2022-06-21 · cs.CL, cs.AI, cs.LG

Using cognitive psychology to understand GPT-3

Tests GPT-3 (Davinci, temperature 0) on classic cognitive-psychology experiments: vignettes, decisions from descriptions, a horizon bandit task, the two-step task and causal reasoning. GPT-3 makes human-like choices on many tasks and shows model-based signatures, but does not explore directedly, is brittle to small prompt changes, and fails the causal task.

LLM evaluationIn-context learningMulti-armed banditCausal inferenceevaluationcognitive-psychologydecision-makingcausal-reasoning

arXivPDFCodeMarkdown13 min read

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

In plain words

The authors wanted to know whether a large language model thinks like a person. They borrowed experiments that psychologists have used for decades to study human judgement, and ran them on GPT-3, a language model that predicts the next word. The experiments cover how people make choices between gambles, how they look for information, how they balance trying new options against sticking with known good ones, how they plan in multi-step problems, and how they reason about cause and effect.

GPT-3 often gives answers that look human, and sometimes better than people. It makes the same kinds of mistakes people make on some classic puzzles. But small rewordings of the same puzzle can push it far off course. It also does not try new options on purpose the way people do, and it fails a cause-and-effect task that people handle.

The point is less the single score than the method: a model's behaviour can be measured with the same tools used for people, and the comparison shows where its apparent reasoning is shallow.

TL;DR

  • Ran classic cognitive-psychology experiments on GPT-3 through its text API, at temperature 0 § Results.
  • Vignette tasks: 6 of 12 answered correctly, and all 12 gave human-like answers; small rewordings changed the answers § Results / Problems with vignette-based investigations.
  • Task-based tests: good at gambles and at a bandit task, shows model-based planning, but no directed exploration and fails the causal task § Results.
  • Author-reported, single model, no variance estimates across repeated runs; the code does not reproduce the vignette results. See Pitfalls.

Problem

Benchmarks report what a model gets right, not how it gets there. The authors argue that a model solving a task does not show it reasons like a person, and that vignette-style questions may have appeared in the training data § Introduction § Results / Problems with vignette-based investigations. Their question is whether tools from cognitive psychology give a more informative picture of GPT-3's decision-making, information search, deliberation and causal reasoning § Introduction.

Method

The paper runs two kinds of experiment on GPT-3 § Introduction:

  1. Vignette-based: short textual scenarios from the literature (for example the Linda problem, cab problem, hospital problem, Wason card task, cognitive reflection test, Blicket and mature-causal-reasoning items) are entered as prompts, and the answer is classified as correct, or as a mistake that people commonly make § Results / Vignette-based investigations fig. 1A. Where there were two options, a third option that is neither correct nor plausibly chosen by people was added § Results / Vignette-based investigations. The vignette prompts and answers are in the SI, not in the main text [SI: Vignettes].
  2. Task-based: experiments are generated programmatically, and the model answers trial by trial. The trial history is updated with the model's earlier answers and the feedback it received § Results / Task-based investigations.

Sampling for all runs: the OpenAI API, the most capable GPT-3 model ("Davinci"), temperature 0 for deterministic answers, and default values for all other parameters § Results, paragraph after fig. 1 (see Pitfalls on the engine id and temperature).

Decisions from descriptions § Results / Decision-making: Decisions from descriptions

Each problem shows two gambles, each a list of outcomes with probabilities (options F and J) fig. 2A. The model's choice is compared with the expected value of each option. The regret of a choice is the expected value of the best option minus the expected value of the chosen option § Results / Decision-making: Decisions from descriptions.

Pseudocode
# Regret of one choice  [§ Results / Decisions from descriptions]
# option_values: expected value of each option, e.g. (F, J)
# chosen: index of the option the model picked
def regret(option_values, chosen):
    # Best expected value minus the expected value of the choice made
    best = max(option_values)
    return best - option_values[chosen]
  • Problems: over 13,000 gamble pairs from an existing benchmark § Results / Decision-making: Decisions from descriptions fig. 2B.
  • Four GPT-3 sizes compared (the "Davinci" model and three smaller ones) § Results / Decision-making: Decisions from descriptions.
  • Cognitive biases: the authors tested six contrasts from Kahneman & Tversky using the choice probabilities of the model, as log-odds ratios between paired problems [SI: Decisions from descriptions] fig. 2C.

Information search: horizon task § Results / Information search: Directed and Random Exploration

A two-armed bandit with forced-choice trials and then free-choice trials fig. 3A. The horizon is either 1 or 6 free choices § Results / Information search: Directed and Random Exploration. The first four trials are forced and give either equal information (two observations per arm) or unequal information (one observation from one arm, three from the other) § Results / Information search: Directed and Random Exploration.

Behavioural classification in the first free-choice trial § Results / Information search: Directed and Random Exploration:

  • Equal-information condition: choosing the arm with the lower estimated mean is random exploration.
  • Unequal-information condition: choosing the less-observed arm is directed exploration.

Analysis: one logistic regression per information condition, with predictors reward difference, horizon, their interaction and a bias term § Results / Information search: Directed and Random Exploration.

Environment as coded (true means and noise are not given in the paper):

Pseudocode
# Horizon task episode  [fig. 3A] [§ Results / Information search]
# Two arms; one arm has mean 40 or 60, the other is shifted by a gap
def sample_episode():
    # Free-choice rounds after the forced ones: 1 or 6  [§ Results]
    horizon = random_choice([1, 6])
    # Better-arm mean is 40 or 60; the other arm is shifted by a gap
    # drawn from a fixed list of values  [code: HorizonTask/envs/bandits.py#L35-L38]
    better_mean = random_choice([40, 60])
    gap = random_choice([-30, -20, -12, -8, -4, 4, 8, 12, 20, 30])
    # Each reward is the mean plus Gaussian noise, rounded  [code: HorizonTask/envs/bandits.py#L40]
    # noise sd is 8  [code: HorizonTask/envs/__init__.py#L6]
    return horizon, better_mean, gap

Forced-choice sequence bandits.py:

Pseudocode
# Four forced trials, shuffled  [code: HorizonTask/envs/bandits.py#L52-L60]
def forced_arms(unequal):
    if unequal:
        # One arm seen once, the other three times
        arms = random_choice([[0, 0, 0, 1], [0, 1, 1, 1]])
    else:
        # Two observations per arm
        arms = [0, 0, 1, 1]
    return shuffle(arms)

Deliberation: two-step task § Results / Deliberation: Model-based and model-free reinforcement learning fig. 4

Two first-stage actions (spaceship to planet X or Y) lead to a second stage with two aliens each. The spaceship reaches the selected planet with probability 0.7 and the other planet with 0.3 § Results / Deliberation: Model-based and model-free reinforcement learning. Each alien pays treasure with some probability; these start uniform between 0.25 and 0.75 and drift slowly § Results / Deliberation: Model-based and model-free reinforcement learning.

Pseudocode
# One simulated run: 20 trials  [§ Results / Deliberation] [fig. 4B]
def simulate_run(num_trials=20):
    # Treasure probability for each of the four aliens  [§ Results]
    # [code: TwoStepTask/query.py#L29]
    alien_probs = uniform(0.25, 0.75, size=4)
    for trial in range(num_trials):
        # The model chooses planet X or Y, given the history so far
        first = ask_model(stage_one_prompt(history))
        # Common transition 0.7, rare 0.3  [code: TwoStepTask/query.py#L16-L20]
        planet = transition(first)
        # The model chooses one of the two aliens on that planet
        second = ask_model(stage_two_prompt(planet))
        # Treasure with the alien's current probability
        treasure = bernoulli(alien_probs[second])
        # Slow random drift, kept inside [0.25, 0.75]
        # [code: TwoStepTask/query.py#L80-L81]
        alien_probs = clip(
            alien_probs + normal(0, 0.025, size=4),
            0.25,
            0.75,
        )

Analysis: stay probability of the first-stage action, split by transition (common or rare) and outcome (treasure or junk) § Results / Deliberation. The paper reports 200 simulations § Results / Deliberation.

Causal reasoning: wine casks § Results / Causal reasoning: Interventions after passive observations fig. 5

The model sees 20 casks with the presence or absence of substances A, B and C (observational data), plus a causal structure: A causes B and A causes C in the common-cause condition, and B causes A which causes C in the causal-chain condition § Results / Causal reasoning fig. 5A. It is then asked how many of 20 new casks will contain C, under an observation (B is known to be present) or an intervention (B is added by hand) § Results / Causal reasoning fig. 5A.

The normative answer for the intervention differs from the observation only in the common-cause condition. Intervention cuts the arrows into the intervened variable (Pearl's do-operator) § Results / Causal reasoning.

Hyperparameters

NameValueWhereNotes
Model"Davinci", GPT-3 family, via the OpenAI API§ Results, paragraph after fig. 1Engine version not stated in the paper. Code uses text-davinci-002 query.py
Smaller modelsAda, Babbage, Curie§ Results / Decision-making: Decisions from descriptionsCode uses text-ada-001, text-babbage-001, text-curie-001 analyze_performance.py
Temperature (global)0§ Results, paragraph after fig. 1Conflicts with code for two-step (1) and with SI for log-odds (1). See Paper vs code
Other API parametersdefault§ Results, paragraph after fig. 1Code sets max_tokens=1 for choices query.py and max_tokens=100 plus suffix casks. for causal query_common.py
Decisions from descriptions: problemsover 13,000§ Results / Decision-making: Decisions from descriptionsSource benchmark: Peterson et al.
Decisions from descriptions: contrast problems17[SI: Decisions from descriptions]Code lists 17 problems query.py
Horizon: forced-choice trials4§ Results / Information search
Horizon: free-choice trials1 or 6§ Results / Information searchUniform choice in code bandits.py
Horizon: reward means40 or 60, other arm shifted by one of {-30,-20,-12,-8,-4,4,8,12,20,30}not stated in paperbandits.py
Horizon: reward noise sd8not stated in paper[code: HorizonTask/envs/init.py#L6]
Horizon: number of tasksnot stated in papernot statedCode runs 3200 tasks query.py
Two-step: simulations200§ Results / Deliberation
Two-step: trials per simulation20§ Results / Deliberation
Two-step: common transition probability0.7§ Results / Deliberationquery.py
Two-step: alien treasure probabilityuniform in [0.25, 0.75] at start§ Results / Deliberation
Two-step: driftnot stated in paper ("slowly")§ Results / DeliberationCode: Gaussian step with sd 0.025, clipped to [0.25, 0.75] query.py
Two-step: sampling temperaturenot stated in paperCode uses 1 query.py
Causal: observations20 casks, fixed table§ Results / Causal reasoningTable not in paper; code query_common.py
Causal: new casks20§ Results / Causal reasoning
Log-odds analysis: temperature1[SI: Decisions from descriptions]Code uses 0 query.py

Results

Author-reported. Model is GPT-3 "Davinci" through the OpenAI API at temperature 0 unless stated § Results, paragraph after fig. 1. Human comparisons are from the cited literature. No confidence intervals beyond the reported statistics.

SettingMetricBaselineThis paperSource
Vignettes (12 standard problems)correct answersnot stated6 of 12 correct§ Results / Problems with vignette-based investigations
Vignettes (12 standard problems)human-like answersnot stated12 of 12§ Results / Problems with vignette-based investigations fig. 1B
Decisions from descriptions (over 13,000 problems)above chancechanceDavinci only: t(29134) = -16.85, p < .001§ Results / Decision-making: Decisions from descriptions fig. 2B
Decisions from descriptionsvs humanshuman regretDavinci worse: t(29134) = -11.50, p < .001§ Results / Decision-making: Decisions from descriptions fig. 2B
Six Kahneman & Tversky biasesbiases reproducedhumans show all six3 of 6 (framing, certainty, overweighting)§ Results / Decision-making: Decisions from descriptions fig. 2C
Horizon task, short horizonregret vs humanshumansnot different: t(5566) = -0.043, p = .97§ Results / Information search fig. 3B
Horizon task, long horizon, initial regretregret vs humanshumanslower than humans: t(5550) = -4.07, p < .001§ Results / Information search fig. 3B
Horizon task, all trialsmean regret (SD)humans 3.24 (10.26)2.72 (5.98); t(38878) = -5.03, p < .001§ Results / Information search
Horizon task, random explorationeffect of reward differencehumans show itβ = 0.18 ± 0.01, z = 14.48, p < .001§ Results / Information search
Horizon task, strategic random explorationreward difference × horizonhumans show itβ = -0.02 ± 0.02, z = -1.47, p = .14 (absent)§ Results / Information search
Horizon task, directed explorationhorizon effect, unequal conditionhumans show itβ = -0.15 ± 0.27, z = -0.56, p = .58 (absent)§ Results / Information search fig. 3D
Two-step taskstay after rare transition and treasuremodel-based: decreasedecrease: t(1982) = -6.16, p < .001§ Results / Deliberation fig. 4C
Two-step taskstay after rare transition and junkmodel-based: increaseincrease: t(1814) = 2.33, p = .01§ Results / Deliberation fig. 4C
Cask causal taskcommon-cause, intervention vs observationnormative and human patternintervention answers match normative prescription for B = 1; for B = 0 not reduced§ Results / Causal reasoning fig. 5B
Cask causal taskcausal-chain, intervention vs observationno difference (normative)identical answers to common-cause condition§ Results / Causal reasoning fig. 5C

The paper's headline claims, as summarised in the Discussion: GPT-3 solves many vignettes, outperforms humans in the bandit task, shows model-based signatures in the two-step task, and fails the causal task § Discussion.

Paper vs code

Official code: https://github.com/marcelbinz/GPT3goesPsychology at commit c1dcdaf309e9b2b40bc5610d1772f2a27282f88c (default branch, shallow clone). The owner is marcelbinz, the first author. The repository has no LICENSE file, so its license is unknown and no code is quoted verbatim below; each item is a pseudocode paraphrase with a citation. Its README links a preprint with the same title (not checked against the arXiv version).

Searched: paper text and the arXiv source (no code link); the GitHub search for the title and for the author's repositories found this one. The repository contains scripts for the decisions-from-descriptions, horizon, two-step and causal experiments and their analyses. It contains no code for the vignette experiments (Linda, cab, hospital, Wason, CRT, Blicket, mature causal) and no code for the SI contrast tables beyond the 17 problems in the query script.

Discrepancies:

  • Temperature. Paper: temperature 0 for all runs § Results, paragraph after fig. 1. Code: two-step queries use temperature 1 query.py. The SI says log-odds analysis used temperature 1 [SI: Decisions from descriptions], but the query scripts use 0.0 query.py query_choice13k.py. Which setting produced each reported number is unclear.
  • Engine. Paper: "Davinci" with no version. Code: text-davinci-002 query.py for every task, and text-ada-001, text-babbage-001, text-curie-001 for the smaller models analyze_performance.py.
  • Horizon regressor. Paper: regression on "estimated reward difference" § Results / Information search. Code: the true generative mean difference from the environment analyze_choice.py analyze_choice.py analyze_choice.py, not the subject's own estimate from observations.
  • Hard-coded plot values. The causal figure bars for GPT-3 and the ideal and human values are typed in, not computed from the query outputs analyze.py. The model-based means for the two-step figure are also typed in analyze_modelbased.py. The human DFD replication probabilities are typed in analyze_contrast.py. These numbers cannot be reproduced from the repository's data alone.
  • Causal dataset. The paper does not list the 20 casks. The code uses a fixed table of 20 rows, shuffled before each prompt query_common.py. The chain condition uses the same table query_chain.py.
  • Causal parsing. The code asks for a number with max_tokens=100 and suffix casks. query_common.py. The paper does not say how the answer was parsed into a count.
  • Two-step drift. The paper says only "drift slowly". The code uses a Gaussian step with sd 0.025, clipped to [0.25, 0.75] query.py.
  • Two-step statistics. The t-tests pool trials across the 200 runs as independent samples analyze.py analyze.py. The degrees of freedom in the paper (1982, 1814) match this pooling.
  • Invalid answers. For the 13k task, if the answer is not in the top two log-probabilities, the code sets the missing option's log-probability to -9999 query_choice13k.py. The paper does not mention this rule.

No discrepancies found for the decisions-from-descriptions problem wording, the horizon prompt text, or the two-step transition probabilities and trial counts (200 simulations, 20 trials).

Pitfalls

  • Model identity. The paper says "Davinci" with no version, and the code names text-davinci-002 query.py. Engine versions change over time; the reported numbers cannot be reproduced exactly with a different or retired engine. Not stated in the paper beyond the family name.
  • Temperature is not one setting. Treat temperature 0 as the paper's default, but check each experiment against its script (two-step at 1, SI log-odds analysis at 0 in code). See Paper vs code.
  • Single run per item. Each experiment is one deterministic answer per prompt at temperature 0. The paper reports no run-to-run variance for the vignettes or the single-prompt tasks, and no seeds. Only the two-step task has repeated simulations.
  • Prompt sensitivity is the paper's own main caveat. Small rewordings changed vignette answers (cab problem, Wason card task, CRT, Blicket) § Results / Problems with vignette-based investigations. Results from the task-based tests may change with the generating program § Discussion.
  • Contamination. The vignettes are famous psychology problems and may be in training data § Results / Problems with vignette-based investigations. The paper cannot rule this out.
  • Horizon parameters. Reward means, the gap set and the noise sd (8) are not in the paper; they come from the environment code bandits.py [code: HorizonTask/envs/init.py#L6]. An implementer reproducing the task must take these from the code.
  • Regression variable. Use the environment's true mean difference, as the code does, not the model's estimate, or the coefficients will not match analyze_choice.py.
  • Pooled tests. Trial-level pooling makes p-values optimistic if trials within a simulation are correlated. The paper does not address this.
  • Causal failure may depend on phrasing. The paper reports only the cask setup; the causal result is one table with one wording query_common.py.
  • Figures are not reproducible from the text alone. For the causal and two-step figures the plotting script uses typed-in values (see Paper vs code).
  • Licensing. The repository has no license, so only paraphrased pseudocode is given here; do not copy code from it.

Lineage

  • Builds on: GPT-3 (Brown et al., 2020) is the model under study; the introduction also cites GPT-2 § GPT-3. No arXiv id is given in this card, and neither paper is in the wiki.
  • Compared against: human data from the cited psychology literature, e.g. Peterson et al. (decisions from descriptions), Wilson et al. (horizon task), Daw et al. (two-step task), Waldmann & Hagmayer (causal cask task) § Results.
  • Superseded by: not stated in the paper.

Source and license

Adapted from “Using cognitive psychology to understand GPT-3” by Marcel Binz, Eric Schulz (arXiv:2206.14576), 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/marcelbinz/GPT3goesPsychology at commit c1dcdaf309e9 (none (no LICENSE file in repository)). Any quoted code is shown under that license.