Abstract
Recurrent neural networks (RNN) are ubiquitously used in neuroscience to capture both neural dynamics and behaviors of living systems. However, when it comes to complex cognitive tasks, training RNNs with traditional methods can prove difficult and fall short of capturing crucial aspects of animal behavior. Here we propose a principled approach for identifying and incorporating compositional tasks as part of RNN training. Taking as target a temporal wagering task previously studied in rats, we design a pretraining curriculum of simpler cognitive tasks that reflect relevant sub-computations. We show that this pretraining substantially improves learning efficacy and is critical for RNNs to adopt similar strategies as rats, including long-timescale inference of latent states, which conventional pretraining approaches fail to capture. Mechanistically, our pretraining supports the development of slow dynamical systems features needed for implementing both inference and value-based decision making. Overall, our approach is an important step for endowing RNNs with relevant inductive biases, which is important when modeling complex behaviors that rely on multiple cognitive computations.
Introduction
In neuroscience, recurrent neural networks (RNNs) serve as the primary framework for modeling how brain circuits generate behavior. However, a persistent "strategy gap" often emerges: while an RNN may learn to solve a complex task, it frequently does so using suboptimal "shortcuts" that do not reflect the computational logic of biological systems. This discrepancy is particularly pronounced in tasks involving latent states—hidden environmental variables that an animal must infer from experience over long timescales. Standard machine learning approaches, such as basic curriculum learning, often fail to instill the necessary inductive biases for such complex inference. This study introduces a "kindergarten" pretraining regimen designed to bridge this gap by mimicking the behavioral shaping used to train animals.
Methods: The "Kindergarten" Approach
The researchers implemented a two-stage training paradigm for a two-layer LSTM network, architecturally designed to mimic the functional segregation of the Orbitofrontal Cortex (OFC) and Striatum.
- Kindergarten Curriculum Learning (CL): Before encountering the target task, the RNN is trained via supervised learning on "building block" tasks. These include fundamental computations like memory, counting time, integrating sensory input, and basic classification. These are not merely simplified versions of the final task, but the essential computational prerequisites for it.
- Behavioral Shaping: Following the kindergarten phase, the network undergoes a multi-stage shaping process used by experimentalists to train rats. This involves transitioning from deterministic rewards to stochastic "catch" trials, and finally introducing a hidden "block" structure where reward probabilities shift over time.
The study utilized behavioral data from 291 Long-Evans rats performing a temporal wagering task as the ground truth for animal-like behavior. The RNN agents were trained in a synthetic Markov Decision Process (MDP) environment simulating this task, requiring them to decide how long to wait for probabilistic water rewards based on auditory cues and hidden environmental states.
Results: Matching Rat Behavior and Strategy
The researchers compared the "Kindergarten + Shaping" approach against "Shaping Only" and "No Shaping" (direct training). Only the kindergarten-trained RNNs successfully matched the specific "wait-time ratios" observed in rats. These networks learned to wait longer in "low-reward" blocks because they correctly inferred the environment was sparse—a hallmark of optimal foraging and sophisticated inference.
Key results include:
- Performance Boost: Kindergarten-trained networks achieved significantly higher reward rates (~6 Hz) compared to shaping alone (~4.5 Hz) or direct training (~3 Hz).
- Neural Realism: The two-layer architecture effectively segregated duties: the "OFC" layer handled slow-timescale inference of hidden blocks, while the "Striatum" layer managed fast-timescale action selection.
- Dynamical Motifs: Kindergarten training fostered specific dynamical systems features, such as "attractors" for certain beliefs and "saddles" (unstable points) for states of uncertainty. Shaping alone typically resulted in simpler, less flexible internal dynamics.
Discussion
This work demonstrates that complex cognition is a composition of simpler, fundamental skills. By training on the computational "puzzle pieces" separately, the network develops the internal dynamical machinery needed to solve the larger task. While the current curriculum was hand-designed, future work could explore automated methods for identifying these building blocks. Tracing the evolution of these "dynamical motifs" during learning provides a promising new path for interpreting how both artificial and biological brains learn to think and make decisions in complex environments.
Summary updated