Computational Neuroscience
Dynamic Reaction-Time Modeling
A reaction time is one number. The sequence of them, over a whole task, is a fingerprint of how a mind holds itself together.
Switch tasks and you pay a small tax. Your next response comes a little slower while your mind reconfigures. Hold your focus against a distraction and you pay a different tax, slower again while you keep the current goal in place. For a long time cognitive science treated these two costs, switching and shielding, as opposite ends of one dial. Get better at one and you give up ground on the other.
The dial is not just a lab idea. People with ADHD tend to sit at the unstable end, with reaction times that jump around as they fight to hold a goal steady. People on the autism spectrum often sit at the other extreme, so anchored in stability that ordinary switching becomes hard. A newer line of work questions the dial itself and argues that stability and flexibility are separate systems that only look like a single tradeoff. The strongest case for that came from Task-DyVa, a model trained on thousands of hours of play from a commercial brain-training app, far more reaction-time data than a lab usually gathers.
This project sought to apply a similar modeling approach as Task-DyVa, but to a standard task-switching dataset from a lab environment, with just 40,000 trials from 65 people.
The task behind the data
The data comes from a task-switching study. Sixty-five people sorted numbers either by parity, odd or even, or by magnitude, above or below five, with the active rule shown by a colored frame around the number. Two things varied on their own from trial to trial. Whether the rule had just changed, a switch versus a repeat, and whether the two rules happened to point to the same answer for that number, congruent versus incongruent. The reaction-time gap between switch and repeat trials stands in for flexibility. The gap between incongruent and congruent trials stands in for stability.
Three ways to model a sequence
I trained three networks to predict a person’s reaction time on a trial from that trial and the ones before it. A plain feedforward network as a baseline. An LSTM that reads ten trials at a time to catch short-range patterns. And a dynamical variational autoencoder, a DVAE, that folds each sequence into a low-dimensional latent path and rebuilds it. The DVAE is the one I cared about most, because its latent space is the kind of thing that could show whether the model had found flexibility and stability as separate internal axes on its own, the way the brain is thought to.
What the models could and couldn’t do
None of the three predicted reaction times well. The best test-set correlation sat under a third, and the three models landed close together. The DVAE was still worth a closer look, because nothing in training told it to sort trials by type. When I plotted its learned trajectories by condition, the four combinations fell into fairly distinct regions, cleanest along the switch versus non-switch line. That echoes what Task-DyVa found with a dataset thousands of times bigger. Seeing a trace of the same structure at ordinary lab scale is a nice sign that the effect is not only a product of enormous data.
References & notes
- Jaffe, P. I., Poldrack, R. A., Schafer, R. J., Bissett, P. G. (2023). Modelling human behaviour in cognitive tasks with latent dynamical systems. Nature Human Behaviour.
- Geddert, R., Egner, T. (2022). No need to choose: Independent regulation of cognitive stability and flexibility challenges the stability-flexibility trade-off. Journal of Experimental Psychology: General.
- Model code available on request.