Clear Sky Science · en
Cognitive flexibility versus stability via activation-based and weight-based adaptations
Why balancing focus and flexibility matters
Everyday life constantly asks us to juggle between staying locked onto one job and rapidly changing gears. Cooking dinner, for example, means focusing hard while chopping with a sharp knife, yet flexibly switching between checking the pot, stirring a sauce, and grabbing ingredients. This article explores how such mental balancing acts might work by building a computer model that mimics how people decide when to stay on task and when to switch, shedding light on healthy thinking and disorders where this balance goes wrong.
The tug-of-war between sticking and switching
Psychologists describe this tension as a trade-off between cognitive stability (staying focused on one task) and cognitive flexibility (switching tasks when needed). People adjust this trade-off depending on the situation: if switches are frequent, they tend to become more ready to switch; if tasks usually repeat, they settle into a more stable mode. These adjustments can happen quickly within minutes, but also slowly over days as we learn which environments or tasks usually demand more flexibility. The central question of the paper is how these fast and slow forms of adjustment can be understood within a single, coherent mechanism.

A learning model of mental control
The authors introduce the Learning Control Dynamics (LCD) model, built on a popular type of recurrent neural network called long short-term memory (LSTM). Instead of hard-coding a special "control" unit, they let the network learn how to control itself. The model is trained on a classic task-switching setup: on every trial it sees a set of numbers, a cue indicating which one to judge as larger or smaller than a threshold, and sometimes an extra "environment" signal. The model must learn two things: how to perform each individual judgment task, and how to adjust its internal control settings so it can either repeat the same task efficiently or switch smoothly to a different one.
Fast shifts in state versus slow changes in habit
Inside the model, two kinds of change can occur. One is activation-based: the moment-to-moment activity pattern can drift closer to the currently relevant task and away from the previous one. This provides a fast but fragile form of adaptation that depends on what just happened. The other is weight-based: the long-term strength of connections in the network is slowly tuned so that some situations create deeply entrenched "task valleys" that encourage staying put, while others create shallower valleys that make switching easier. The authors show in simulations that fast changes alone can already produce smaller switch costs in high-switch situations, while slow changes in the network’s weights permanently reshape how easily the model switches or stays, even when current conditions are the same.
Learning when flexibility is needed
The study then asks whether the model can learn to use signals from the outside world to decide how flexible to be. In one set of simulations, different artificial "environments" were consistently linked with either frequent or rare task switches. Over time, the model learned to respond to these environment cues: in high-switch environments, its internal task representations became more overlapping and it moved faster between them; in low-switch environments, these representations were more separated and repetition of the same task became especially strong. In another set of simulations, the model learned that certain specific tasks were usually the ones that switched, while others tended to repeat. It then applied its control tweaks in a more fine-grained, task-by-task way that depended not just on the current trial, but also on what task it had just performed.

Linking the model back to human behavior
To test whether these ideas might describe real people, the authors reanalyzed data from more than 100 volunteers who performed a similar task-switching experiment. The human participants, like the model, showed smaller switch costs in contexts and after tasks that were often associated with switching. The reanalysis also supported the model’s prediction that some of the most telling changes show up not simply on a given task, but on the trial that follows it—suggesting that people carry forward task-specific expectations about how likely they are to need flexibility next.
What this means for understanding our thinking
In plain terms, the article argues that our ability to balance focus and flexibility relies on two intertwined processes: a quick, short-term adjustment that depends on what we have just been doing, and a slower, learning-based tuning of our mental "settings" to the environments and tasks we repeatedly encounter. By showing how both can arise in a single neural network model and match human data, the work offers a concrete blueprint for how the mind may sculpt and reshuffle its own habits of thought to meet changing demands.
Citation: Xu, S., Verguts, T. & Braem, S. Cognitive flexibility versus stability via activation-based and weight-based adaptations. Commun Psychol 4, 58 (2026). https://doi.org/10.1038/s44271-026-00397-9
Keywords: cognitive flexibility, task switching, neural network model, cognitive control, adaptive behavior