Reasoning with programs in replay

Sebastijan Veselič, Nour Mohsen, Lennart Luettgau, Elena M. Gutierrez-Farewik, Maria K. Eckstein, Steven W. Kennerley, Timothy E.j. Behrens, Timothy Müller, Zeb Kurth‐NelsonbioRxiv 2025

TL;DR

This paper investigates how the brain reasons by mentally executing programs, proposing that "replay" – fast neural sequences of past experiences – is a key mechanism. They found that brain activity reflects the mental execution of these programs, with sequences of neural reactivations mirroring the program's steps and their implications, suggesting a temporal "micro-architecture" for reasoning.

What Problem Does This Paper Address?

Humans possess a remarkable ability to reason and solve novel problems by flexibly composing known elements. A prominent theory suggests that the brain achieves this by using "replay" – rapid neural sequences that explore the implications of different compositions. This paper aims to test this theory by examining how the brain mentally executes programs, which are essentially sequences of operations. Specifically, they investigate whether these programs are represented and processed in the brain through fast neural sequences, and how these sequences contribute to the reasoning process, particularly in understanding the implications of program steps.

Methods

The researchers employed magnetoencephalography (MEG) to record brain activity while participants mentally executed programs. Key methods include:

  • Representational Similarity Analysis (RSA): Used to compare the similarity of neural activity patterns with the similarity of program paths.
  • Temporally Delayed Linear Modeling (TDLM): Applied to detect sequential reactivations of program locations and operations, and to link these reactivations to subsequent data updates.
  • Binomial Classifiers: Trained to decode representations of objects, operations (type and attribute), and face attributes from neural data.
  • Cross-validation: Used extensively to ensure that decoding and similarity measures generalized across participants and conditions, and to isolate abstract representations from object-specific features.
  • Functional Localizer Task: Used to train classifiers for objects and face attributes.
  • Operation Localizer Task: Used to train classifiers for operation types and attributes.

Datasets

The study utilized data collected from participants performing a custom-designed reasoning task. No external datasets were explicitly mentioned for training or evaluation.

Key Insights and Ideas

  • Replay as a Reasoning Engine: The study provides strong evidence that replay, characterized by fast neural sequences, is not just for memory recall but actively supports the execution of mental programs and reasoning.
  • Temporal Micro-Architecture of Reasoning: The findings reveal a highly organized temporal sequence in brain activity during reasoning, where program steps are reactivated, followed by their associated operations, and then by the neural patterns reflecting the computed implications.
  • Prefrontal and Parietal Cortex Involvement: These brain regions are shown to represent the inferred program solutions by the end of execution, highlighting their role in maintaining and manipulating the program's state.
  • Abstract Representations of Operations: The brain appears to represent operations not just by their specific form but also by abstract "type" (e.g., swap vs. branch) and "attribute" (e.g., hat, limb, shape), which generalize across different objects.
  • Compositional Nature of Reasoning: The study supports the idea that reasoning involves composing simpler elements (program steps, operations) into more complex structures, mirroring how language is composed.

Key Results

  • Behavioral Performance: Participants' accuracy scaled with program complexity, and thinking time increased with program length.
  • Neural Representation of Solutions: By the end of program execution, prefrontal and parietal cortices showed representations of the inferred program solutions.
  • Sequential Replay: Program locations were reactivated in fast neural sequences (~80 ms lag), consistent with sampling candidate partial solutions.
  • Operation Binding: Replay sequences of program locations were accompanied by reactivations of their associated operations (Type ~30 ms lag, Attribute ~60 ms lag, specific operation ~60 ms lag).
  • Data Updates: Location → Operation sequences were followed by neural patterns reflecting data updates (face attribute changes) approximately 110-120 ms later, specifically for "swap" operations.
  • Program Similarity and Neural Activity: The similarity of program paths across trials predicted neural activity towards the end of the reasoning period.

Limitations and Future Work

  • Restricted Program Set: The programs used in the study were drawn from a restricted set, although the authors note that programs as a class can capture all formal reasoning. Future work could explore more complex and diverse reasoning tasks.
  • Causality of Replay: While the study shows a correlation between replay and program execution, it acknowledges that it doesn't definitively prove causality. Future research could further investigate this causal link.
  • Hippocampal Role: The study suggests a potential role for hippocampal replay in transmitting "instruction sets" to cortical areas. Further research is needed to elucidate this interaction.
  • Generalizability: The authors suggest that their findings might generalize to other domains of cognition, which warrants further investigation.
  • Temporal Resolution: While MEG provides good temporal resolution, future studies with even higher temporal precision could further refine our understanding of the precise timing of these neural processes.

Summary updated

BibTeX
@misc{veselic2025reasoning,
  author = {Sebastijan Veselič and Nour Mohsen and Lennart Luettgau and Elena M. Gutierrez-Farewik and Maria K. Eckstein and Steven W. Kennerley and Timothy E.J. Behrens and Timothy Müller and Zeb Kurth‐Nelson},
  title = {{Reasoning with programs in replay}},
  year = {2025},
  doi = {10.1101/2025.10.10.681671},
  howpublished = {bioRxiv},
}
Figure