Hypothesis-guided discovery of cognitive algorithms via program refinement
Organizations: Department of Psychology University of California, Berkeley · Department of Psychology New York University
Abstract
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.
Figures & tables
| Strategy Family | Size | LLM-generated cluster description |
| ColorBlocking | 161 | Prioritize recent-damage repair before resuming default strategy |
| ColorBlocking | 44 | Damage-aware color-blocking with flexible partial completion |
| ColorBlocking | 8 | Within-color tie-breaking with consistent index order |
| Spatial | 8 | Spatial scanning with temporary damage-repair mode |
| Spatial | 3 | Probabilistic local repair and repeat after events |
| TwoPhase | 106 | Two-phase damage-aware repair and priority policy |
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
| Condition | Finite fits (%) | Mean [CI 95 ] | SD | Avg. traj. length | |
| small-complex | 49 | 100.0 | [ , ] | ||
| small-simple | 51 | 100.0 | [ , ] | ||
| large-simple | 41 | 95.1 | [ , ] |
| Size | Strategy Family | LLM-generated cluster description |
| ColorBlocking Strategy Family | ||
| 161 | Prioritize recent-damage repair before resuming default strategy | After a turn-off/damage event, temporarily focus on repairing or avoiding the most recently damaged color(s) using a stable within-color click order, then resume the default color-blocking policy. |
| 44 | Damage-aware color-blocking with flexible partial completion | A damage-aware color-blocking strategy that maintains memory of recently damaged colors and flexibly switches between continuing a color block and repairing or reordering priorities. |
| 8 | Within-color tie-breaking with consistent index order | When selecting within a color, ties among same-color OFF lights are resolved using a deterministic spatial/index sweep instead of random selection. |
| 4 | Occasional post-completion or late-stage exploratory actions | Rare exploratory deviations from strict termination, such as additional clicks after completion or near-completion, to capture behavioral variability. |
| 3 | Selection stickiness — persist with chosen color until ON_COLOR | A persistence bias that keeps selecting the same color until it is fully ON, only switching when external state changes require it. |
| Strategy Family | Cluster | Variant | Count | % |
| TwoPhase (TP) | ||||
| TP | repair | TP_repair_1 | 22 | 29.3% |
| TP_repair_3 | 2 | 2.7% | ||
| TP | damaged | TP_damaged_2 | 9 | 12.0% |
| TP_damaged_3 | 3 | 4.0% | ||
| TP_damaged_1 | 3 | 4.0% | ||
Computational Cognitive Modeling
Computational cognitive modeling uses formal models and simulations to explain how people perceive, learn, remember, reason, and choose.
See all 126 papers