The human brainโs knack for improvisation is easy to take for granted. Once youโve learned to drive, adapting to a rental carโs unfamiliar controls is mildly annoying, not a multi-week retraining project. Learn to bake bread, and a decent cake is mostly a matter of remixing skills you already have.
A new Nature study from Princeton neuroscientists suggests that this everyday flexibility rests on a very particular kind of neural reuse: the brain snaps together reusable patterns of activityโโcognitive Legosโโto build new tasks on the fly.
Working with two rhesus macaques, Sina Tafazoli, Timothy Buschman and colleagues trained the animals to perform three related but distinct categorization tasks. Each trial showed a colorful, morphing blob that varied independently in shape (between a bunny-like and a T-like figure) and color (between red and green). The monkeys had to decide either โwhich shape?โ or โwhich color?โ and report their judgment with an eye movement to one of four targets. Crucially, the tasks were built from shared components: two tasks used the same color categorization but different eye-movement responses, while another shared the motor responses but switched which feature (shape vs. color) mattered.
By juggling these overlapping demands, the animals were effectively playing cognitive mix-and-match. That set-up allowed the researchers to test a simple question with big implications: does the brain literally reuse the same neural โblocksโ when tasks share ingredients, or does it learn each task as a separate, opaque routine?
While the monkeys worked, the team recorded from hundreds of neurons across five regions, focusing on the lateral prefrontal cortex (LPFC), a hub of cognitive control. All of the regions carried information about the current task, the stimulus features, the chosen movement and whether the animal was rewarded. But in LPFC, patterns of activity corresponding to โred vs. green,โ โbunny vs. T,โ and specific eye-movement directions formed stable, low-dimensional โsubspacesโ that were shared across tasks. A classifier trained on LPFC activity to read out color in one task, for example, could decode color in another task that used different movementsโevidence that the same neural subspace was being reused rather than rebuilt from scratch.
Those shared subspaces werenโt static labels; they were dynamically chained together. During the most compositional taskโcategorizing color but responding with the shape taskโs eye-movement axisโLPFC activity first evolved along the shared โcolorโ subspace and then flowed into the shared โmotorโ subspace corresponding to the appropriate response direction. Trial-by-trial analyses showed that the strength of color encoding at one moment predicted motor encoding tens of milliseconds later, suggesting a true transformation from one building block to the next.

The brain also appeared to regulate which blocks were active based on what the animal believed the current task was. When task contingencies quietly changed between blocks, performance improved gradually as the monkeys inferred which of the three tasks they were now facing. LPFC activity during fixation carried a signature of that โtask belief,โ and as that internal estimate shifted, the relevant sensory subspaceโsay, color rather than shapeโwas amplified, while now-irrelevant information was damped.
โYou repurpose existing skills and combine them with new ones,โ Tafazoli explains in the accompanying press release, describing how the brain leans on old components to meet new demands.
Buschman likens these modules to programmer-style functions that can be wired together as needed. โBy snapping together these โcognitive Legos,โ the brain is able to build new tasks,โ he says. In other words, the prefrontal cortex doesnโt learn a bespoke solution for each situation; it learns a reusable library and a way to call the right functions in sequence.
That picture dovetails with a large body of work positioning prefrontal cortex as the control center for goal-directed behavior and task switching, coordinating what information is relevant and which actions should follow. Cognitive scientists have long argued that human intelligence depends on compositionalityโthe ability to combine known elements into new structures, from sentences to recipes to problem-solving strategies. The new study puts concrete neural machinery under that abstract idea, showing how compositionality might be implemented in real populations of neurons.
The findings also sharpen a contrast with todayโs most powerful AI systems. Deep neural networks can rival humans on individual benchmarks, but when theyโre trained sequentially on different tasks they tend to overwrite what they previously knew, a problem known as catastrophic forgetting or catastrophic interference. โA major issue with machine learning is catastrophic interference,โ Tafazoli notes, arguing that the brainโs modular strategy helps avoid this fate by reusing and selectively activating existing blocks instead of reconfiguring the entire system for each new skill.
Researchers in machine learning are already exploring ways to bake compositionality and modularity into artificial networks, from meta-learning architectures that can recombine learned functions to continual-learning algorithms that protect important parameters. The Princeton work gives those engineering efforts a fresh biological target: shared task subspaces that can be flexibly engaged or suppressed as circumstances change.
Perhaps most tantalizing are the potential clinical echoes. Disorders such as obsessive-compulsive disorder and some forms of schizophrenia are marked by rigid, perseverative behavior and difficulty shifting mental sets, often linked to disrupted function in prefrontal circuits. If flexible behavior depends on being able to reconfigure and recombine cognitive blocks, then understanding how those blocks breakโor fail to switch offโcould ultimately inform new interventions. As Tafazoli puts it, โImagine being able to help people regain the ability to shift strategies, learn new routines, or adapt to change.โ
There are caveats. The tasks here are deliberately stripped-down, far from the messy, multi-layered demands of real life, and the study relies on invasive recordings in monkeys, not humans reporting their thoughts. It remains to be seen how neatly these prefrontal subspaces map onto the constructs psychologists use to measure cognitive flexibility, or whether similar building blocks underlie language, social reasoning and abstract conceptual learning.
Still, by opening a window onto how brains recycle their own activity patterns, the work offers a rare glimpse of general intelligence in actionโnot as a monolithic โIQ,โ but as a smart way of reusing old tools to meet new challenges.
Endnotes
- Sina Tafazoli et al., โBuilding compositional tasks with shared neural subspaces,โ Nature (2025).
- โโCognitive Legosโ help the brain build complex behaviors,โ Princeton University news release via EurekAlert, 26 Nov 2025.
- Naomi P. Friedman & Akira Miyake, โThe role of prefrontal cortex in cognitive control and executive function,โ Molecular Psychiatry 27, 2022.
- Barbara Pomiechowska & Brenden M. Lake, โCompositionality in minds, brains and machines: a unifying framework,โ 2024 preprint; and Brenden M. Lake et al., โBuilding machines that learn and think like people,โ Behavioral and Brain Sciences 40, 2017.
- Ali Behrouz et al., โContinual Learning and Catastrophic Forgetting: A Survey,โ arXiv preprint (2024); and James Kirkpatrick et al., โOvercoming catastrophic forgetting in neural networks,โ PNAS 114, 2017.
- Susanne E. Ahmari & Michael J. Dougherty, โThe prefrontal cortex and OCD,โ Neuropsychopharmacology 46, 2021; and P.L. Remijnse et al., โCognitive Inflexibility in Obsessive-Compulsive Disorder and Major Depression,โ PLOS ONE 8, 2013.





Leave a Reply