Source-linked AI summary

Hypothesis-guided discovery of cognitive algorithms via program refinement

Huiwen Alex Yang, Mark K. Ho, Bill D. Thompson

arXiv:2610.02523v1cs.AI

TL;DR

Cognitive models of algorithmic behavior are difficult to build when fixed model sets miss rich and variable strategies, while de novo LLM discovery lacks human-guided constraints. This paper refines human-created probabilistic programs with LLM agents and evaluates revised models on a problem-solving task. Revised strategies improve fit for many participants and reveal recurring innovations, though the study is limited to one task, one refinement iteration, and one LLM.

  • Problem

    Recovering cognitive algorithms is difficult because plausible algorithms are numerous and richly structured, while human behavior often includes systematic individual deviations from idealized procedures.

    Source: §2 · p. 2
  • Method

    The authors use LLM agents to revise human-created probabilistic programs within researcher-specified structural constraints, then evaluate the revised programs with probabilistic inference.

    Source: §4 · p. 3
  • Results

    Revised strategies provided the overall best fit for 53.2% (74/139) of participants, with improvements observed across all three strategy families.

    Source: §5.3 · p. 7
  • Takeaways & Limitations

    The framework offers a way to integrate human expertise and probabilistic inference with LLMs for recovering algorithmic cognitive models.

    Source: §7 · p. 9

    The study examines one problem-solving paradigm, a single propose-revise iteration, and one underlying LLM.

    Source: §6 · p. 9

Abstract

from arXiv · show

Developing cognitive models of algorithmic reasoning from behavioral data is a central problem in cognitive science that challenges current methods. Traditional approaches to cognitive modeling are interpretable and benefit from human expertise, but lack flexibility and scalability. Emerging techniques using large language models (LLMs) for de novo generation of cognitive models are scalable and flexible, but lack a role for human expertise and have mostly been applied to simpler tasks than algorithm recovery. We propose a hybrid system that treats discovery of cognitive algorithms as a program refinement problem. Human-created cognitive models are expressed as probabilistic programs and provided to a system of LLM agents with a mandate to: identify mismatches between model and behavior; propose code-level modifications within researcher-specified constraints; and verify structural fidelity. Revisions propagate to a probabilistic inference module that performs inference for latent variables and data likelihood computations. We evaluate the pipeline on human behavior in a problem-solving paradigm that exposes a variety of cognitive algorithms. Revised models consistently improve model fit relative to ancestral models and reveal a small set of recurring innovations that capture meaningful behavioral variability in this task.

1 Introduction

The paper addresses limits in cognitive-model discovery by refining human-created probabilistic programs with LLM agents, integrating researcher expertise with probabilistic inference for algorithmic behavior.

1 Introduction

  • The system uses LLM agents to identify model–behavior mismatches and propose constrained code revisions to human-created probabilistic cognitive models.Revised programs are evaluated by a probabilistic inference module that infers latent variables and computes data likelihoods.Source: §1 · p. 1

2 Background

Recovering cognitive algorithms from behavior is difficult because plausible algorithms are numerous and human behavior varies systematically, challenging fixed model sets.

2 Background

  • Algorithmically structured behaviors such as problem-solving require models that capture how actions depend on task features and action history.The target is the latent cognitive algorithm underlying observed behavior.Source: §2 · p. 2
  • The space of plausible cognitive algorithms is large and richly structured, making relevant model variants difficult to anticipate.Source: §2 · p. 2
  • Even when a model is a good hypothesis, people may show systematic individual deviations such as execution errors, rule variations, and alternative tie-breaking.These challenges create a mismatch between fixed model specification and behavioral variability.Source: §2 · p. 2

3 Related Work

Prior approaches include program induction, neural and LLM-based discovery, but often face interpretability, data, language-design, or hypothesis-guidance constraints.

3 Related Work

  • Probabilistic programming offers probabilistic semantics and generic inference, but remains primarily a tool for building hand-crafted models.Earlier program-induction approaches often require complex domain-specific languages and sampling algorithms.Source: §3 · p. 2
  • Neural-network discovery can learn complex models at scale, but is difficult to interpret and data-intensive; fine-tuned LLM models share the latter limitations.Source: §3 · p. 2
  • LLM program-synthesis methods have proposed cognitive models and guided search, while de novo generation may underuse human expertise and yield uninteresting or prior-driven programs.Existing work has focused mainly on canonical problems with limited rich algorithmic structure.Source: §3 · p. 2

4 Key Contribution

The paper presents a hypothesis-guided program-refinement pipeline that adapts probabilistic cognitive models to behavioral trajectories while preserving their hypothesized structure. It applies the pipeline to a problem-solving task and evaluates revised strategies against base models.

4 Key Contribution

  • The framework treats cognitive-model discovery as program refinement, using LLM agents to make targeted, behavior-motivated modifications while preserving the original model structure.Structured program components and revision specifications constrain changes to decision rules, internal state, and other components.Source: §4 · p. 3

4.1 Cognitive models as probabilistic programs

  • Probabilistic programs represent structured problem-solving strategies while combining program expressivity with probabilistic modeling.The paper uses FlipPy, a Python-based probabilistic programming library.Source: §4.1 · p. 3

4.2 Strategy Discovery and Evaluation System

  • The system separates behavioral reasoning and code generation, then audits revised programs before probabilistic inference evaluates their likelihood.Its four modules are Game, Coding, Audit, and Inference.Source: §4.2 · pp. 3–4

4.3 Generation, selection, and validation of revised strategies

  • The authors generate multiple revisions per participant and base strategy, audit executable candidates, cluster similar programs, and test representative variants on original and held-out trials.Source: §4.3 · p. 4

4.4 Human problem-solving algorithms

  • The pipeline is tested on trial-level behavior from 150 participants in a problem-solving paradigm designed to elicit heterogeneous strategies.Source: §4.4 · p. 4

4.4.1 Task Structure

  • Participants solve a colored-light grid task with hidden color dependencies; any color ordering consistent with the DAG can efficiently solve it.The task varies grid size, color count, and DAG structure, and participants are not told the dependencies.Source: §4.4.1 · pp. 4–5

4.5 Base Strategy Models

  • The base models capture spatial heuristics, color-by-color blocking without dependencies, and a two-phase strategy that infers a valid ordering before completing the board.Source: §4.5 · pp. 5–6
  • Revised strategies improve model fit for a substantial subset of participants, as shown by the participant-level base-versus-overall comparison and per-condition gains.Source: Figure 3 · p. 6

5 Results

Revised strategies improve model fit for many participants, including on held-out trials, and the revisions repeatedly capture locally grounded behavioral adjustments. Synthetic recovery is variable, and the analysis is limited to one problem-solving paradigm.

5.1 Baseline Model Fit and Benchmark Quality

  • Base models had finite-fit coverage of 95–100% across conditions, but best-fitting base-strategy log ML varied meaningfully across participants.The baseline analysis included 49 small-complex, 51 small-simple, and 41 large-simple trials.Source: §5.1 · pp. 6–7

5.2 Discovery of Revised Strategies

  • The pipeline generated 846 candidate revisions, audited 733 (86.6%), and selected 24 prototypes from eight recurring clusters across three strategy families.The eight clusters comprised three Color Blocking, two Spatial, and three Two-Phase clusters.Source: §5.2 · p. 7

5.3 Improvement in Model Fit from Revised Models

  • 53.2% (74/139) of participants had a revised strategy provide overall best fit; within-family improvements were ColorBlocking: 54%, Spatial: 76.9%, and TwoPhase: 80.4%.Within-family gains also occurred when the revised strategy did not change a participant’s overall best-fitting model.Source: §5.3 · p. 7
  • In one representative case, CB damaged 2 improved fit by capturing the participant’s return to repair green lights turned off after activating a yellow light.The base ColorBlocking strategy instead predicts completing one color at a time.Source: §5.3 · p. 7, Figure 4 · p. 8

5.4 Generalization and synthetic recovery

  • 52.6% (72/137) of held-out trials showed improved fit under a revised program.The authors interpret this persistence as evidence that revised programs capture behavioral regularities beyond the trajectories used to develop them.Source: §5.4 · p. 7
  • Among 215 valid revisions, 111 (51.6%) beat base mean held-out log likelihood, 18 (8.4%) recovered at least 75% of the predictive gap, and 104 (48.4%) did not improve.Variable recovery may reflect revisions overfitting idiosyncrasies of a single trajectory rather than recovering the underlying strategy.Source: §5.4 · pp. 7–8

5.5 Revised models reveal a small set of recurring algorithmic innovations

  • Across 462 proposals, locally grounded adjustments dominated: about 73% of ColorBlocking revisions (161/222), 67% of Spatial revisions (8/12), and 79% of TwoPhase revisions (180/228).Damage repair, local corrective actions, and deterministic tie-breaking were prominent themes across all three families.Source: §5.5 · p. 8, Table 1 · p. 8

6 Limitations and future work

The study’s scope is narrow, and the authors identify both generalization and theoretical interpretation as unresolved challenges.

6 Limitations and future work

  • The analysis used one problem-solving paradigm, one propose-revise iteration, and one underlying LLM.The authors call for exploration of other algorithmically structured settings and alternative models.Source: §6 · p. 9
  • Program revisions may overfit individual participants, trials, or tasks; the authors identify partial pooling and program compression across contexts as priorities.Source: §6 · p. 9
  • The paper offers no systematic way to relate discovered programs to broader theoretical frameworks, and assesses meaningful innovation heuristically.The authors caution that improved data likelihood alone is insufficient evidence of meaningful innovation.Source: §6 · p. 9

7 Conclusion

The paper presents program refinement as a framework for cognitive modeling and applies it to algorithmically structured sequential decision-making. The authors argue that it extends to recovery of algorithmic models while retaining hypothesized structure and interpretability.

7 Conclusion

  • The framework combines structured probabilistic programs with an LLM-based program revision system.Source: §7 · p. 9
  • The system targets algorithmically structured sequential decision-making models through targeted revisions that preserve hypothesized structure and interpretability.Source: §7 · p. 9
  • The authors present the framework as one way to integrate frontier LLM capabilities with human expertise and probabilistic statistical inference.Source: §7 · p. 9

Ethics statement

The study received institutional review board approval, and participants provided informed consent.

Ethics statement

Reproducibility statement

Base models provide a stable but imperfect fit, while revisions cluster around recurring behavioral adjustments whose specific implementations vary across participants. The supplied materials describe the task and held-out dataset alongside the fit and revision summaries.

Reproducibility statement

  • The paper says code, data, and materials are available in supplementary materials and an anonymous OSF repository, but also says they are not included with this arXiv version.The repository is described as containing source code, experimental data, model programs, and materials for reproducing the analyses.Source: Reproducibility statement · p. 10

A Participant Instructions

  • The task asks participants to turn on all grid lights, then complete five scored trials with different games; they could skip an unsolvable trial but forgo its bonus.Participants first completed two practice trials of the same game.Source: A Participant Instructions · p. 14

B Base strategy model fit summary

  • Base models fit stably but imperfectly: coverage was 95–100% across conditions, and large-simple fit was more negative than the two small conditions.Table 2 reports per-step log-likelihoods with bootstrap confidence intervals.Source: B Base strategy model fit summary · p. 14, Table 2 · p. 14

C Clusters of revisions

  • Revision clusters concentrate on damage detection and repair and prioritizing recently affected lights, with these themes recurring across strategy families.Deterministic tie-breaking and ordering also recur, generally in smaller clusters.Source: C Clusters of revisions · p. 14, Table 3 · p. 15

D Heterogeneity of best-fitting revised strategy implementations

  • Best-fitting revised implementations vary across participants, with multiple variants selected even within a cluster and a diffuse distribution across variants.In the TwoPhase damaged cluster, all three variants are preferred by some participants.Source: D Heterogeneity of best-fitting… · p. 16, Table 4 · p. 16

E.1 Heldout dataset

  • The held-out dataset uses each participant’s second-to-last correctly completed trial; participants without two correctly completed trials were excluded.The resulting condition counts were 49 small-complex, 50 small-simple, and 39 large-simple trials.Source: §E.1 · p. 16

E.2 Held-out Evaluation

On held-out human trials, revised strategies improved fit for over half of cases, with gains across all three strategy families. The section also describes a synthetic recovery setup based on a known strategy and the filtering of generated revisions for evaluation.

E.2 Held-out Evaluation

  • Held-out evaluation selected the highest per-step log marginal likelihood among three base strategies and 24 prototypical revised strategies.One 270-step trial was excluded because all 27 strategies returned −∞, leaving 137 evaluable trials.Source: §E.2 · pp. 16–17
  • 52.6% of 137 evaluable held-out trials showed positive improvement from a revised strategy over the best-fitting base strategy.Improvements occurred across ColorBlocking (52.6%), Spatial (86.7%), and TwoPhase (83.2%) families.Source: §E.2 · p. 17

F.1 Synthetic Dataset

  • The synthetic dataset used the CB damaged 2 strategy, chosen as an example of damage-repair behavior observed in the original study.It used 30 behavioral-task board configurations and five trajectories per configuration with lapse probabilities 0.0, 0.0, 0.1, 0.1, and 0.2.Source: §F.1 · p. 17

F.2 Generating Revised Programs

  • The pipeline generated two candidate revisions per synthetic trajectory; 215 of 300 audited programs had interfaces evaluable with the standardized likelihood procedure.The remaining programs were excluded because their interfaces required additional arguments or otherwise could not be evaluated under that procedure.Source: §F.2 · p. 17

F.3 Synthetic analysis results

In synthetic evaluation, about half of the revised programs outperformed the base model on held-out trajectories, but few matched the known generating strategy. Recovery varied, and predictive gains did not establish exact recovery of the underlying mechanism.

F.3 Synthetic analysis results

  • 111 of 215 revised programs (51.6%) had higher mean held-out log likelihood than the base ColorBlocking model, while 2 (0.9%) matched or exceeded the generating model.Evaluation used 40 held-out trajectories generated from CB damaged 2.Source: §F.3 · p. 17
  • The median predictive-gap recovery was 0.334; 109 programs (50.7%) recovered a positive fraction and 18 (8.4%) recovered at least 75%.Two programs (0.9%) matched or exceeded the generating model.Source: §F.3 · p. 17
  • Recovery was heterogeneous: revisions generated from individual trajectories could overfit trajectory-specific features, and predictive recovery did not imply exact recovery of the generating mechanism.The discovery procedure produced multiple distinct implementations of damage-repair behavior.Source: §F.3 · p. 18
Loading 2610.02523v1…