Abstract
Goal-directed behavior requires the ability to flexibly switch between task sets with changing environmental demands. Switching between tasks generally comes at the cost of slower and less accurate responses. Compared with adults, children often show greater switch costs, presumably reflecting the protracted development of the ability to flexibly update task-set representations. To test whether the distinctiveness of neural task-set representations is more strongly affected by a task switch in children compared with adults, we examined multivoxel patterns of fMRI activation in 88 children (8–11 years, 49 girls, 39 boys) and 52 adults (20–30 years, 27 women, 25 men) during a task-switching paradigm. Using multivariate pattern analysis (MVPA), we investigated whether task-set representations were less distinct on switch than on repeat trials across frontoparietal, cingulo-opercular, and temporo-occipital regions. Children and adults showed lower accuracy and longer response times on switch than on repeat trials. Switch costs were similar across groups. Decoding accuracy was lower on switch than repeat trials, suggesting that switching reduces the distinctiveness of task-set representations. Reliable age differences in switch-related reductions of decoding accuracy were absent. More nuanced analyses using probability measures indicated that the distinctiveness of task sets was more affected by switch demand in children than in adults in a subset of frontal, cingulate, and temporal regions. These results point to a remarkable degree of maturity of neural representations of task-relevant information in late childhood along with more subtle region-specific age differences in the effects of task switching on rule representation.
Significance Statement
The ability to flexibly switch between tasks enables goal-directed behavior but is particularly challenging for children, potentially due to protracted development in the ability to represent multiple and overlapping task rules that link stimuli to appropriate responses. We tested this hypothesis using functional MRI to measure brain activity during task switching in 8–11-year-olds and adults. Activation patterns in frontal, parietal, and temporal regions indicated with above-chance accuracy which task a person was performing when the task remained the same, but not when it had switched. Children showed larger differences in a subset of frontal and temporal regions when tasks switched, suggesting more subtle age differences in the contributions of developing rule representations to flexible behavior.
Introduction
The ability to flexibly switch between tasks is critical for goal-directed behavior (Miyake and Friedman, 2012; Diamond, 2013). Task switching entails costs compared with repeating tasks, such that responses are slower, less accurate, or both. These costs are thought to reflect processes associated with task-set updating, including inhibiting the no-longer relevant task set and retrieving the newly relevant one (Rogers and Monsell, 1995; Meiran, 1996; Mayr and Kliegl, 2000; Vandierendonck et al., 2010). Task switching is associated with frontoparietal (FP) regions, including the inferior frontal junction (IFJ), the superior parietal lobe (SPL), and the dorsolateral prefrontal cortex (dlPFC; Richter and Yeung, 2014; Worringer et al., 2019). The IFJ and SPL are thought to support domain-general processes of task-set updating, as indicated by greater activation on switch than repeat trials (Kim et al., 2012), while the dlPFC has been implicated in the maintenance of multiple task-set representations, as indicated by greater activation for bivalent than univalent rules during task switching (Crone et al., 2006c; Johnston et al., 2007).
Behaviorally, switch costs are more pronounced in children compared with adults (Huizinga et al., 2006; Crone et al., 2006a; Gupta et al., 2009; Cragg and Chevalier, 2012; but see Reimers and Maylor, 2005). Age-related differences in switch costs have been attributed to children's difficulties to inhibit the no-longer relevant task set and to update the task set when rules switch (Crone et al., 2004, 2006a; Gupta et al., 2009; Wendelken et al., 2012). While children recruit similar brain regions during task switching as adults, they demonstrate smaller increases in activation for switch compared with repeat trials in FP regions (Bunge and Wright, 2007; Wendelken et al., 2012; Schwarze et al., 2023). These studies examined univariate activation to inform potential age differences in task-set inhibition and updating but cannot provide information on how distinctly task sets are represented in the brain, a feat that children might particularly struggle with (Zelazo, 2004; Crone et al., 2006b; Lorsbach and Reimer, 2008).
Research in adults has started to feature multivariate pattern analysis (MVPA; Haynes and Rees, 2006) to examine the distinctiveness of neural representations during task switching. Because task-set representations on switch trials have just been updated, they are hypothesized to be less distinct than on repeat trials (Meiran, 1996; Mayr and Kliegl, 2000), resulting in lower decoding accuracy. Decoding accuracy describes how well the currently relevant task can be predicted from the pattern of neural activation. Studies investigating this hypothesis in adults have reported contradictory results. While one study showed greater decoding accuracy on repeat than on switch trials in FP regions (Qiao et al., 2017), other studies showed the opposite pattern (Tsumura et al., 2021) or no differences between conditions (Loose et al., 2017). To date, neural task-set representations have not been examined in children to provide a direct test of representational accounts of children's difficulties in task switching. We used MVPA to assess the distinctiveness of task-set representations in children (N = 88, 8–11 years) and adults (N = 52, 20–30 years) who performed a task-switching paradigm during neuroimaging. We expected that children would show overall lower decoding accuracy and would be disproportionally affected by the demand to switch, resulting in lower decoding accuracy on switch trials compared with adults.
The lingering representation of the previously relevant task (i.e., task-set inertia) may further contribute to less distinct representations on switch compared with repeat trials by diluting the current task-set representation (Rogers and Monsell, 1995; Wylie and Allport, 2000; Rangel et al., 2023). To explore whether age differences in task switching were related to stronger task-set inertia in children (Gupta et al., 2009; Witt and Stevens, 2012), we used three different tasks. We tested whether decoding accuracy for the previously relevant task on switch trials was higher compared with the third task (that was neither relevant on the current nor on the previous trial), which would indicate task-set inertia.
While adult studies have focused primarily on FP regions, the distinctiveness of task-set representations in temporo-occipital (TO) regions (i.e., fusiform gyrus, parahippocampal gyrus, and lateral occipital cortex) may be particularly important for task switching in children. TO regions mature earlier than FP regions (Sydnor et al., 2021) and may contribute to the development of more distinct FP representations during rule-based tasks (Amso and Scerif, 2015; Rosen et al., 2019). Furthermore, regions of the cingulo-opercular (CO) network, including the dorsal anterior cingulate cortex (dACC) and the anterior insula (aI), have been associated with sustained task-set maintenance during switching (Braver et al., 2003; Gratton et al., 2018). Therefore, representations in CO regions may not be updated in a trial-specific fashion. Thus, we explored how the distinctiveness of task-set representations in brain regions associated with different roles during task switching (i.e., FP vs CO) and with different developmental trajectories (i.e., FP/CO vs TO) differed between children and adults.
Materials and Methods
The hypotheses and the analysis plan were preregistered before the start of analysis and are shared on the Open Science Framework (https://osf.io/8mfqx/) along with additional results. We explicitly note deviations from the preregistered analysis plan below. The behavioral performance and univariate analysis of functional neuroimaging data of this sample are described in detail in Schwarze et al. (2023) and are only briefly summarized here.
Participants
Children (N = 117) and adults (N = 53) completed the task-switching paradigm in the MR scanner, as reported previously (Schwarze et al., 2023). All participants were right-handed. Prior to running the analyses of interest, participants were excluded if they showed low accuracy (i.e., below 50% in the fMRI run of single tasking or below 35% in either of the two runs that presented tasks intermixed, see details below; N = 8 children excluded), excessive in-scanner motion [>50% of fMRI volumes with framewise displacement (Power et al., 2012) above 0.4 mm; N = 24 children, 4 of whom also showed poor performance], or fewer than five trials for each class, i.e., each combination of condition (switch vs repeat) and task (face vs scene vs object, see below), in the MVPA analyses (N = 1 child; included in the previous study; Schwarze et al., 2023). One adult was excluded due to a technical issue with the task coding. The final sample included 88 children (8–11 years; mean age, 10.07 years; SD = 0.69; 49 girls, 39 boys) and 52 adults (20–30 years; mean age, 24.69 years; SD = 2.6; 27 women, 25 men). Adult participants, parents, and children provided informed written consent, and the study was approved by the ethics committee of the Freie Universität Berlin and conducted in line with the Declaration of Helsinki.
Experimental design
In the task-switching paradigm performed in the MR scanner, participants had to respond to one of three simultaneously presented stimuli (a face, a scene, and an object) each relevant to a different task (i.e., the face task, the scene task, and the object task). The relevant task was indicated by a simultaneously presented shape in the background, such that, for instance, a diamond-shaped background indicated the face task, which required the classification of the face according to its age (Fig. 1A). On each trial, the spatial arrangement of stimuli varied pseudorandomly independent of the currently relevant stimulus, with each stimulus category (e.g., a child's face) being presented in each location on a roughly equal number of trials across repeat and switch trials. Participants responded via button press.
The fMRI session consisted of three runs: one single run in which the tasks were presented in separate blocks, followed by two mixed runs in which the three tasks were pseudorandomly intermixed. Each run consisted of 99 trials each lasting 2 s, followed by a fixation cross for a jittered time period (range 1–6 s). In the single run, tasks were presented in three separate blocks of 33 trials, interspersed with blocked fixation cross periods (20 s). In the mixed runs, the three tasks were pseudorandomly intermixed, with 50% repeat and 50% switch trials (i.e., a total of 98 trials of each condition across the two runs), again across blocks of 33 trials with blocked fixation cross periods (20 s) to match the single run. Switches were unpredictable, such that participants did not know which task had to be performed on the upcoming trial, and the transitions between tasks on switch trials were balanced, such that every possible transition occurred approximately the same number of times. The first trial of each run was excluded from all analyses as it could not be classified as a switch or repeat trial in the mixed runs. The main MVPA determining representational changes during task switching focused on the two mixed runs. Data from all three runs were used to define regions of interest (ROIs) that were representative of the task-related univariate activation.
Behavioral measures and analysis
Behavioral results were previously reported for essentially the same sample across all three task runs (89 as opposed to 88 children; cf. Schwarze et al., 2023), whereas the present analysis focused on the two mixed runs and thus only on repeat and on switch trials. Individual trials with response times (RT) below 0.2 s or above 3 s were excluded from all analyses, so that responses during stimulus presentation and within the first second of the intertrial interval were accepted. Missed trials were excluded from all analyses; only correct trials were considered for the analysis of RTs. We used Bayesian linear mixed models of trial-level data, using brms (version 2.19.0; Bürkner, 2017) in R (version 4.3.1; R Core Team, 2018), with flat priors to predict correct responses or RT from condition, age group, and their interaction, including random intercepts for participants and random slopes of condition and task. Note that we had preregistered to perform these models on aggregated data but have changed these analyses to modeling trial-level performance, to model trial-level variance appropriately (Barr et al., 2013). For all models, reported effects are based on 95% credible intervals (CI) such that the described effects have a 95% probability in the present data (Bürkner, 2017; see also Morey et al., 2016).
fMRI data acquisition and preprocessing
Functional MR images were collected on a 3 T Siemens Tim Trio MRI scanner using whole-brain echoplanar images (TR, 2,000 ms; TE, 30 ms; 3 mm isotropic voxels). The first five acquired volumes of each run were discarded before analysis to allow for scanner stabilization.
Preprocessing was performed using fMRIprep (version 20.2.0; Esteban et al., 2019; for a detailed description of procedures, see https://fmriprep.org/en/stable/). BOLD images were coregistered to individual anatomical templates using FreeSurfer, which implements boundary-based registration (Greve and Fischl, 2009). Additionally, they were slice-time corrected (using AFNI; Cox and Hyde, 1997) and realigned (using FSL 5.0.9; Jenkinson et al., 2002). For the definition of ROIs based on group-level univariate activation, BOLD images were normalized into MNI152NLin6Asym standard space and spatially smoothed (8 mm FWHM). All multivariate analyses were conducted in individual-specific anatomical space on unsmoothed data. ROIs defined in MNI space were transformed into individual-specific anatomical space using Advanced Normalization Tools (ANTs; Avants et al., 2009) and FSL (version 5.0.9; Jenkinson et al., 2002).
ROI definition
Frontoparietal and cingulo-opercular regions
Previous research has demonstrated that lateral FP regions show enhanced univariate activation during task switching (Kim et al., 2012; Niendam et al., 2012; Richter and Yeung, 2014; Worringer et al., 2019) and represent the currently relevant task in adult studies (Loose et al., 2017; Qiao et al., 2017). As the IFJ, the SPL, and dlPFC are the most commonly identified frontoparietal regions associated with task switching (cf. Richter and Yeung, 2014), we focused on these areas as our main ROIs (see preregistration: https://osf.io/8mfqx/). Along with the expected FP regions, the univariate activation analyses also revealed enhanced activation in the dACC and the aI during task switching. Thus, for exploratory analyses, we defined ROIs of the CO network, including the aI and dACC (Dosenbach et al., 2007, 2008).
The ROI definition procedure was as follows. ROIs were initially defined based on task activation across all three runs relative to baseline and subsequently restricted by anatomical location. To this end, we constructed a general linear model (GLM) of correct single, correct repeat, and correct switch trials as separate regressors with zero duration. Missed trials, error trials, trials with response times below 0.2 s or above 3 s, and the first trial of each run were included in a separate regressor of no interest. Framewise displacement per volume (in mm; Power et al., 2012), realignment parameters (three translation and three rotation parameters), and the first six anatomical CompCor components as provided by fMRIprep were added as regressors of no interest. CompCor identifies patterns of noise using a principal component analysis approach, and the inclusion of the components aids in the removal of noise from fMRI data (Behzadi et al., 2007). To not bias the ROIs to either the switch or repeat condition, we derived a contrast, comparing task (correct single, repeat, and switch trials) with baseline, collapsed across age groups. The resulting whole-brain contrast map was thresholded at familywise error (FWE) corrected p < 0.05, cluster size >50 voxels.
Multiple brain regions in the frontal and parietal cortices showed greater activation for tasks compared with baseline, including bilateral IFJ, dlPFC, SPL, dACC, and aI. Functional activations as determined above were anatomically restricted using the Harvard-Oxford atlas (Makris et al., 2006), thresholded at 30%. The inclusive anatomical masks we used to restrict univariate activation to predefined ROIs were the middle frontal gyrus for the dlPFC, the superior parietal lobe for the SPL, insular cortex for the aI, and the paracingulate gyrus for the dACC. Because no anatomical mask for the restriction of the IFJ is available, we defined it based on coordinates from a meta-analysis of task-switching studies focusing on the IFJ (Derrfuss et al., 2005). See Figure 2A,B for task-based FP and CO ROIs, respectively.
Note that FP and CO regions have been summarized in the multiple demand (MD) network (Duncan, 2010). However, given their distinct roles proposed in task switching (Braver et al., 2003; Dosenbach et al., 2008; Gratton et al., 2018), as well as multiple studies showing differential recruitment of FP and CO regions during different cognitive control tasks including task switching (Wallis et al., 2015; Crittenden et al., 2016; Bhandari and Badre, 2020; Wood and Nee, 2023; Dosenbach et al., 2024), we investigated them as two separate sets of ROIs.
Temporo-occipital ROIs
ROIs in TO were defined on activation maps provided by the NeuroQuery (Dockès et al., 2020) and Neurosynth (Yarkoni et al., 2011) platforms, using the search terms “face,” “object,” and “place.” A probability map was downloaded for each of the search terms from each platform on November 22, 2021. NeuroQuery maps were thresholded with a z-score of 3 as recommended by the developers (Dockès et al., 2020); Neurosynth maps were thresholded at p < 0.01 (FDR corrected; Yarkoni et al., 2011). All negative value voxels were set to zero to keep only positive activation associated with each search term. Next, the Neurosynth and NeuroQuery masks for each search term were multiplied with each other to only include voxels identified across both platforms. Note that for the “place” search term only, the NeuroQuery mask was used in ROI definition, as the map provided by Neurosynth did not include the parahippocampal gyrus, which has consistently been associated with place/scene perception across age groups (Golarai et al., 2007; Scherf et al., 2007).
Finally, following the same approach as for the FP and CO ROIs, the resulting maps were anatomically masked using the Harvard-Oxford atlas (Makris et al., 2006), thresholded at 30%. The temporal occipital fusiform gyrus was used as an anatomical mask for the face-selective ROI (fusiform face area, FFA), the inferior lateral occipital cortex (LOC) for the object-selective ROI, and the anterior and posterior parahippocampal gyrus for the scene/place-selective ROI (parahippocampal place area, PPA). The resulting TO ROIs overlapped with activation in temporo-occipital regions of the task > baseline contrast described above. Figure 2C shows the resulting TO ROIs. Note that we had originally preregistered to define ROIs based on a searchlight MVPA decoding the three tasks (face vs scene vs object) across all runs, but we changed our approach due to updated methods for applying corrections of unequal class counts (see below).
Multivariate pattern analysis
Activation patterns for individual trials in the two mixed runs were extracted using a least squares separate approach (LSS; Mumford et al., 2012), which constructs a trial-specific GLM in which the relevant trial is modeled by one regressor and all remaining trials are included in a separate regressor, yielding the activation estimate for that trial. Simulation studies have shown that LSS is particularly suited for trial-by-trial beta estimation under high collinearity between trials (Mumford et al., 2012, 2014; Abdulrahman and Henson, 2016; Arco et al., 2018), which is particularly relevant in the present event-related design with relatively short time intervals between stimulus presentations. GLMs were constructed using Nipype (version 1.6.0; Gorgolewski et al., 2011) interface to FSL FEAT (using FSL 5.0.9; Jenkinson et al., 2002) and included the same nuisance regressor of no interest (i.e., missed trials, error trials, trials with response times below 0.2 s or above 3 s, the first trial of each run), framewise displacement per volume, six realignment parameters, and the first six anatomical CompCor components as in the GLM for ROI definition.
Next, we conducted MVPA for each participant in each condition separately, using Nilearn (version 0.8.0; see Abraham et al., 2014) and scikit-learn (version 0.24.2; Pedregosa et al., 2011). We used a support vector classifier (LinearSVC, initialized with regularization parameter C = 1 and one-vs-rest multiclass strategy) trained to predict the currently relevant task (scene, object, face) given trial activation patterns in each ROI. Participants with fewer than five trials of each task in each condition were excluded from analysis. To ensure balanced numbers of trials across classes (face, scene, object), we subsampled the majority class(es) without replacement to the class with the least trials across switch and repeat conditions. We adopted this approach as opposed to the preregistered method of the scikit-learn “balanced” option (Pedregosa et al., 2011) as it eliminates possible bias rather than correcting for it post hoc.
Given that our paradigm consisted of three tasks, we used LinearSVC in scikit-learn with a one-vs-rest strategy. This approach trains three different one-vs-rest classifiers and aggregates the classifiers into one decision function. A prediction of the currently relevant task, which could either be correct or incorrect, was made based on this decision function. We performed model training and testing with leave-one-run-out cross-validation for each set of subsampled trials and performed the steps of subsampling, training, and testing 100 times for each condition in each participant. Within each iteration, we summarized prediction accuracy across all trials of that iteration in a decoding accuracy measure, which depicts the average decoding accuracy for that iteration. Finally, the decoding accuracies across iterations were averaged for each condition, resulting in one decoding accuracy measure per condition per participant.
Note that with three different tasks, there are a total of six possible task transitions on a switch trial. On average, each of these possible transitions was included 10.46 times in the subsampled set of switch trials and did not differ substantively across transitions (all p ≥ 0.05). No decoding accuracy data was removed based on the predefined outlier criterion of 3.5 standard deviations (p < 0.001) above or below the group-specific mean.
Analysis of age differences in decoding accuracy
Age and condition differences within ROI sets
To test whether decoding accuracy differed between switch and repeat trials and between the two age groups, analyses in the three sets of ROIs (FP regions: dlPFC, IFJ, SPL; CO regions: dACC, aI; TO regions: FFA [face-selective], PPA [scene-selective], and LOC [object-selective]), we proceeded in two steps: (1) For each ROI, we tested whether it would be appropriate to combine data across hemispheres: that is, we tested whether decoding accuracy differed between hemispheres and whether hemisphere interacted with age group or condition. We did not find main effects or interactions involving hemisphere in any of the ROIs and thus averaged across the two hemispheres for all subsequent analyses. (2) Within each ROI set (FP, CO, TO), we tested a Bayesian linear mixed model across all regions in the corresponding set. Decoding accuracy was predicted by condition (repeat vs switch), region, age group (adults vs children), and their interactions. All linear mixed models included a random intercept for participant and random slopes for condition.
In addition to comparing decoding accuracy between the switch and repeat conditions across all three tasks, we tested whether each of the TO ROIs showed selectivity for the theoretically preferred task on repeat trials. To this end, we compared repeat decoding accuracy of the preferred task (i.e., the face task for the fusiform gyrus) to the two nonpreferred tasks (i.e., the scene and object task for the fusiform gyrus) and whether this effect differed between age groups.
To obtain a more nuanced picture of the distinctiveness of the currently relevant task set, we also conducted exploratory analyses using probability measures that captured the probability with which each task is predicted on a given trial. We then tested whether the predicted task probabilities differed between the switch and repeat conditions. Here, a higher probability for the currently relevant task can be interpreted as higher evidence for this task. Accordingly, we expected that probability measures would be higher for repeat relative to switch trials. Probabilities for each trial were averaged across the MVPA iterations and logit transformed. The logit-transformed probabilities were analyzed on the trial level within each set of ROIs using a linear mixed model with fixed effects of group (children vs adults), region, and condition (repeat vs switch), a random intercept for participant, and random slopes for condition and region.
Finally, we tested whether results differed when we conducted the same analyses within network ROIs based on a child-specific network partition (Tooley et al., 2022) of the Schaefer et al. (2018) parcels. Specifically, we conducted MVPAs within the frontoparietal, ventral attention (which included our cingulo-opercular ROIs), and the visual (which included our temporo-occipital ROIs) networks separately. The results of these analyses based on regions defined on independent data did not differ from the results reported here.
Age and condition differences between ROI sets
To examine whether age group and condition effects differed between the three sets of ROIs, we first modeled decoding accuracy including all ROIs. Specifically, models included fixed effects of condition, age group, and set of ROIs (FP vs CO vs TO), and their interactions, along with random slopes for set of ROI and condition, and random intercepts for participant. Model comparisons were performed using leave-one-out cross-validation in the loo package (Vehtari et al., 2022). The best fitting model included an interaction of condition and ROI set and fitted numerically slightly better than the base model without any interactions (ELPD difference = −2.3, SE = 3.2). However, the standard error of the ELPD difference was larger than the difference itself, suggesting that neither model provided better fit to the data. Below, we therefore report the effects of the base model without any interactions.
Task-set inertia
In a set of exploratory analyses, we explored if the lingering representation of the immediately preceding task set contributed to lower decoding accuracy on switch trials. Specifically, we tested whether incorrect predictions of the classifier on switch trials were more likely to predict the previously relevant task. As described above, the classifier predicted one of the three tasks for each trial. This prediction could either be correct and thus count toward the decoding accuracy measure or incorrect if the prediction indicated one of the other two tasks not relevant on that specific trial. To test the task-set inertia hypothesis within each set of ROIs, we tested whether the classifier was more likely to predict the previously relevant task over the task that was neither relevant on the previous nor current trial. For example, take a switch from a face-task trial to an object-task trial: based on the task-set inertia hypothesis, we would expect the face-task representation to linger, as it was relevant on the immediately preceding trial. In contrast, the scene task (i.e., the third task) was not relevant on the previous trial and there should be no, or at least less, lingering representation of this task during the current object-task trial. Therefore, task-set inertia would be manifested in errors in which the classifier predicts the previously relevant face task, which occur more often than erroneous predictions of the scene task (see also Fig. 4A for depiction of this hypothesis). We tested whether patterns of erroneous task-set predictions differed between age groups. To this end, we modeled the percentage of false predictions as the dependent variable and the type of false prediction (previous vs third task) and age group as the fixed effects, additionally including fixed effects of region, and random intercept of participant.
For a more nuanced picture of the effect of task-set inertia on the distinctiveness of task-set representations, we further investigated a trial-specific probability measure that captured the predicted probability for a given task on each trial. This allowed us to compare the difference in predicted probability between the current task [e.g., for the example above, probability (task = object)] and the immediately preceding one [e.g., probability (task = face)] to the difference between the current [e.g., probability (task = object)] and the third task [e.g., probability (task = scene)]. Before calculating these difference scores, probabilities for each trial were averaged across MVPA iterations; the difference scores were then analyzed on the trial level using a linear mixed model with fixed effects of group and task (previous vs third) and a random intercept of participant.
Individual differences in the effect of switch demand on representations across ROI sets
While analyses up to this point tested whether the effect of switch demand on neural task-set representations differed between children and adults, they did not shed light on the question whether switch demand affected different brain regions similarly within an individual. Thus, to further understand these individual differences across the sets of ROIs, we explored whether individuals who showed a greater difference in decoding accuracy between conditions in one set of ROIs showed a similar pattern in the other sets of ROIs. To this end, we averaged the differences between switch and repeat decoding accuracy across all ROIs in each set. Next, we tested for differences between all pairwise correlations among the three sets of ROIs and whether these differences differed by age group using cocor (version 1.1-4; Diedenhofen and Musch, 2015) in R.
Associations between decoding accuracy and performance
To anticipate the outcome of our analyses, we did not observe any differences in decoding accuracy between individual ROIs within each set. As a result, we deviated from the preregistration and tested whether decoding accuracy across ROIs in a set predicted task performance. We used a linear mixed model with performance accuracy or RT as the dependent variable, average decoding accuracy across the ROIs in one set, condition (repeat vs switch), and age group (adults vs children) as fixed effects, a random intercept modeling the individual participants, and random slopes of condition. We used leave-one-out cross-validation (loo package; Vehtari et al., 2022) to compare the model including all interactions between the fixed effects to models including fewer interaction terms. For the majority of ROI sets, model comparisons indicated no increases in model fit when the interaction of decoding accuracy with either age group or condition was added to the starting model including the main effect of decoding accuracy and the interaction between age group and condition (mean ELPD difference to the next best fitting model = −1.43, mean standard error = 0.88). Two exceptions to this general pattern were the models predicting RT by decoding accuracy in the CO and TO regions, where the best fitting models included an interaction of decoding accuracy and group. Additionally, we tested whether the prediction probabilities were associated with performance accuracy or RT using the same models as for decoding accuracy.
Results
Switch costs in children and adults
Adults exhibited higher overall performance accuracy than children [estimate (est.) = −1.77; 95%-CI: −2.15, −1.41] as well as shorter RTs on correct trials (est. = 0.26; 95%-CI: 0.21, 0.31). Both groups exhibited switch costs, with higher accuracy on repeat than switch trials (est. = −0.67; 95%-CI: −0.86, −0.48); as well as shorter correct RTs on repeat than switch trials (est. = 0.24; 95%-CI: 0.21, 0.27). Contrary to our hypothesis, switch costs did not differ between children and adults (condition × group interaction; accuracy: est. = 0.13; 95%-CI: −0.08, 0.35; RT: est. = 0.00; 95%-CI: −0.03, 0.04; Fig. 1C). In sum, both children and adults showed switch costs in accuracy and RT; these costs did not differ between the groups.
Task-switching paradigm and age differences in performance. A, The task-switching paradigm consisted of three tasks: the face task, the scene task, and the object task. Participants had to perform the task indicated by the simultaneously presented shape in the background. Depending on the stimulus presented, one of three buttons had to be pressed in response (indicated here by the green button). Faces had to be categorized according to the age of the person shown, scenes according to the location (i.e., forest, desert, or sea), and objects according to the color. B, The mixed runs included trials on which the task of the previous trial was repeated (50%) or switched to a different task (50%) in an unpredictable manner. C, Performance accuracy (in %) and response times (in seconds) for repeat (yellow) and switch (orange) trials split by age group. Gray lines connect performance measures for each individual. Analyses were conducted at the trial level; aggregated data for each individual is presented here for visualization purposes only. Image credits: Young and old adult faces were taken from the FACES collection (Ebner et al., 2010). A, B, Adapted from Schwarze et al. (2023), Figure 1, under CC.BY 4.0.
More distinct representations on repeat than on switch trials across age groups
Decoding accuracy
Decoding accuracy for each ROI is shown in Figure 2. We predicted lower decoding accuracy on switch than on repeat trials across groups in all sets of ROIs, with greater reductions in decoding accuracy for children. To test these hypotheses, we used Bayesian linear mixed models for each set of ROIs to predict decoding accuracy by age group, condition, and ROI.
Regions of interest (ROIs) and decoding accuracy results. The dashed line in each plot indicates chance (0.33). A, Decoding accuracy for repeat trials (yellow) and switch trials (orange) in adults and children of frontoparietal (FP) regions: (a) dorsolateral prefrontal cortex (dlPFC), (b) superior parietal lobe (SPL), and (c) inferior frontal junction (IFJ). B, Decoding accuracy of cingulo-opercular (CO) regions: (d) dorsal anterior cingulate cortex (dACC) and (e) anterior insula (aI). C, Decoding accuracy of temporo-occipital (TO) regions: (f) fusiform-face area (FFA, face-selective), (g) lateral occipital cortex (LOC, object-selective), (h) parahippocampal place area (PPA, scene-selective).
In each set of ROIs, we found evidence of a main effect of condition (switch vs repeat; FP ROIs: est. = −0.11; 95%-CI: −0.15, −0.06; CO ROIs: est. = −0.08; 95%-CI: −0.13, −0.04; TO ROIs: est. = −0.15; 95%-CI: −0.19, −0.10), with higher decoding accuracy on repeat than on switch trials. There was no evidence for effects of age group in any of the ROI sets (all 95%-CIs included zero), suggesting that decoding accuracy was comparable between children and adults. Finally, there were no effects of specific ROIs within a set (all 95%-CIs included zero), suggesting that all tested ROIs showed higher decoding accuracy on repeat trials relative to switch trials in both age groups.
Taken together, in line with our hypothesis and with the observed behavioral switch costs, decoding accuracy was greater for repeat than for switch trials across all sets of ROIs. Contrary to our hypothesis, children showed comparably distinct task-set representations as adults.
Given the putative functional specialization of TO ROIs for processing different kinds of stimuli (Cantlon et al., 2011; Natu et al., 2016; Golarai et al., 2017; Tian et al., 2021), we tested decoding accuracy for the preferred compared with the nonpreferred tasks on repeat trials in each ROI. The FFA (i.e., the face-selective ROI) showed greater decoding accuracy on repeat trials for the face task compared with the object and scene tasks (est. = −0.06; 95%-CI: −0.8, −0.03). Note that selectivity of the FFA was observed even though each trial presented a face, an object, and a scene stimulus simultaneously on the screen and at unpredictable locations. The scene-selective ROI showed the opposite effect, such that decoding accuracy on repeat trials was lower for the scene task compared with the object and face tasks (est. = 0.04; 95%-CI: 0.01, 0.07). The object-selective ROI showed no preference for the object task (95%-CI included zero). Thus, in the present paradigm, only the face-selective ROI showed a preference for the stimuli aligned to its functional specialization.
Trial-specific probabilities of correct classification
To provide a more nuanced picture of task-set distinctiveness in both age groups, we next examined trial-specific probabilities. Consistent with the decoding accuracy results above, the probability for the currently relevant task was higher on repeat than switch trials across all three sets of ROIs (switch vs repeat; FP ROIs: est. = −0.27; 95%-CI: −0.35, −0.19; CO ROIs: est. = −0.18; 95%-CI: −0.26, −0.09; TO ROIs: est. = −0.30; 95%-CI: −0.37, −0.23).
The model of the FP regions indicated that the probability difference between switch and repeat trials was smaller in the dlPFC than the IFJ (ROI [dlPFC vs IFJ] × condition [switch vs repeat]: est. = 0.07; 95%-CI: 0.03, 0.12) and that this effect was more pronounced in adults than children (interaction of ROI [dlPFC vs IFJ] × condition [switch vs repeat] × age group [children vs adults]: est. = −0.13; 95%-CI: −0.19, −0.06). A follow-up model in the dlPFC indicated a smaller difference between switch and repeat trials in adults than children (condition [switch vs repeat] × age group [children vs adults]: est. = −0.14; 95%-CI: −0.18, −0.10), due to lower prediction probabilities in the switch condition in children than adults (Fig. 3A).
Prediction probabilities (logit transformed) for the currently relevant task, aggregated across trials. A, Logit-transformed prediction probabilities for repeat trials (yellow) and switch trials (orange) in adults and children in the dorsolateral prefrontal cortex (dlPFC). B, Logit-transformed prediction probabilities in the dorsal anterior cingulate cortex (dACC). C, Logit-transformed prediction probabilities in the parahippocampal place area (PPA, scene-selective).
The model of CO ROIs revealed that compared with adults, children showed a greater difference in probability for the correct task between switch and repeat trials (condition [switch vs repeat] × age group [children vs adults]: est. = −0.14; 95%-CI: −0.25, −0.03). This effect was more pronounced in the dACC than the aI (ROI [aI vs dACC] × condition [switch vs repeat] × age group [children vs adults]: est. = 0.08; 95%-CI: 0.03, 0.01), due to slightly higher probabilities on switch trials in adults and slightly higher probabilities on repeat trials in children (Fig. 3B).
The model of TO ROIs revealed differences between ROIs (ROI [PPA vs FFA] × condition [switch vs repeat]: est. = 0.08; 95%-CI: 0.03, 0.12; ROI [PPA vs FFA] × condition [switch vs repeat] × age group [children vs adults]: est. = −0.07; 95%-CI: −0.13, −0.02). Follow-up models in each ROI revealed greater switch-related decreases in prediction probability in children in the PPA, but not the LOC or FFA (PPA: condition [switch vs repeat] × age group [children vs adults]: est. = −0.04; 95%-CI: −0.11, −0.03), due to slightly higher probabilities on switch trials in adults (Fig. 3C).
Taken together, the probability of the correct task being predicted from the activation pattern was greater on repeat than switch trials across ROI sets. Children showed greater differences in trial-specific probabilities for the relevant task between the switch and repeat condition in the dlPFC, the dACC, and the PPA.
Higher decoding accuracy for temporo-occipital ROIs
As the effect of condition was present in all three sets of ROIs, we next sought to directly compare whether it differed between the sets of ROIs. A model comparing the effects of age group, condition, and ROI set on decoding accuracy revealed that relative to the TO ROIs, decoding accuracy was lower in the FP ROIs (est. = −0.02; 95%-CI: −0.03, −0.01) and CO ROIs (est. = −0.02; 95%-CI: −0.04, −0.01). There was neither evidence for differences between the FP and the CO ROIs nor for any differences between the age groups (all 95%-CI included zero). Thus, while all investigated regions showed greater decoding accuracy on task repetitions compared with task switches, overall decoding accuracy was greater in the TO ROIs than in regions classically associated with cognitive control processes in children and adults.
No evidence for task-set inertia effects on representations
Next, we investigated whether task-set inertia contributed to less distinct task-set representations on switch trials. To this end, we compared the percentage of trials on which the classifier falsely predicted the previously relevant task to the percentage of trials on which it predicted the third task that was neither relevant on the current nor on the previous trial. Separate models for each set of ROIs included the fixed effects of incorrectly predicted task (previous vs third task), age group, and region. None of the investigated sets of ROIs showed a higher probability of predicting the previous task over the third task in both children and adults (all 95%-CI included zero; Fig. 4B–D). Thus, we did not find any evidence that lower decoding accuracy on switch trials was related to task-set inertia, whereby the representation of the task relevant on the immediately preceding trial would linger after ceasing to be relevant.
Percentage of predictions of the previously relevant task and the third task (neither relevant on previous nor current trial) of all false predictions of the currently relevant task (i.e., task-set inertia). A, Illustrates the pattern of results that would suggest task-set inertia and an age difference therein: on trials with incorrect predictions, we would expect the previously relevant task being predicted more often than the third task, with this difference being greater in children. B–D show results of the current study for (B) the frontoparietal (FP) ROIs, (C) the cingulo-opercular (CO) ROIs, and (D) the temporo-occipital (TO) ROIs, neither of which showed any evidence for task-set inertia. As none of the analyses within each set of ROIs indicated differences between regions, data were averaged across ROIs in each set for visualization.
Similarly, the analysis of the probabilities with which each task is predicted by the classifier on a given trial did not reveal any evidence for task-set inertia from one trial to the next. Specifically, we did not find any evidence that the probability difference to the current task differed between previous and third task in any of the three sets of ROIs (effect of task [third vs previous]: all 95%-CI included zero) or that the classifier is more likely to predict the previously relevant task from the pattern of activation in any of the ROIs. Probability differences across tasks did not differ between age groups (interaction of task and age group: all 95%-CI include zero).
Associations in switch-related reductions of distinctiveness among ROIs
Next, to assess whether switch demands affected different brain regions similarly within an individual, we conducted a set of exploratory analyses testing whether individuals showed similar patterns of switch-related reductions in decoding accuracy across ROI sets. To this end, we calculated the average difference in decoding accuracy between switch and repeat trials (i.e., difference scores) across all ROIs of the same set. Across both age groups, the correlation between difference scores in the FP and the CO ROIs was greater than the correlation between difference scores in the CO and TO ROIs (rCO-FP vs rCO-TO: pFDR = 0.005, FDR corrected for multiple comparisons). The difference scores correlation in FP and TO ROIs did not differ from the correlation in the CO and TO ROIs (rTO-FP vs rCO-TO: pFDR = 0.064). The correlation between difference scores in FP and CO regions also did not differ from the correlation in the FP and TO regions (rCO-FP vs rTO-FP: pFDR = 0.23).
With regard to age group differences, we observed a greater correlation between FP and CO in children (r = 0.62; pFDR < 0.001, FDR corrected for multiple comparisons) than in adults (r = 0.32; pFDR = 0.028; pgroup difference = 0.032; Fig. 5A). Difference scores were moderately correlated between FP and TO ROIs in children (r = 0.46; pFDR < 0.001) and in adults (r = 0.40; pFDR = 0.011) and did not differ between age groups (pgroup difference = 0.68; Fig. 5B). Difference scores between CO and TO ROIs showed weak to moderate correlations in both children (r = 0.29; pFDR =0.005) and adults (r = 0.29; pFDR = 0.037) and again did not differ between age groups (pgroup difference = 0.98; Fig. 5C).
Correlations of condition differences in decoding accuracy between sets of ROIs split by age group. A, Correlation of the differences in decoding accuracy between repeat and switch trials among the frontoparietal (FP) ROIs and the cingulo-opercular (CO) ROIs shown for children (in magenta) and adults (in turquoise). B, Correlations among FP and temporo-occipital (TO) ROIs. C, Correlations among TO and CO ROIs.
In sum, representations were more similarly affected by the demand to switch in FP and CO regions compared with CO and TO regions, and this effect was more prominent in children. Specifically, children showed greater similarity than adults in the effect of switching demands on FP and CO ROIs, while there were no group differences for the correlations between FP and TO and between CO and TO.
Finally, we conducted follow-up analyses involving condition-specific decoding accuracy—i.e., baseline correlations for repeat and switch conditions—and tested for age effects. Condition-specific decoding accuracies were positively correlated among the different sets of ROIs (mean correlation across ROI sets, repeat condition: rchildren = 0.44, radults = 0.43; switch condition: rchildren = 0.41, radults = 0.33). For the repeat condition, the correlation of decoding accuracy was greatest among FP and CO ROIs (rFP-CO vs rFP-TO: pFDR = 0.015), followed by the correlation among FP and TO (rFP-TO vs rCO-TO: pFDR = 0.015) and CO and TO (rFP-CO vs rCO-TO: pFDR = 0.001). For the switch conditions, the pairwise correlations between sets of ROIs did not differ among each other (all pFDR > 0.08). Importantly, the strength of the condition-specific correlations between sets of ROIs did not differ between children and adults for either condition (all pFDR > 0.22), indicating that age differences were specific to the switch-related reduction in decoding accuracy (i.e., the difference between the switch and repeat conditions) described above.
Decoding accuracy was not related to task-switching performance
Finally, to investigate whether more distinct neural representations of the currently relevant task set were related to individual differences in task-switching performance, we tested whether decoding accuracy or prediction probabilities averaged across all ROIs within each set was associated with higher performance accuracy and/or lower RTs across participants. Across all participants, none of the ROI sets showed an effect of decoding accuracy or prediction probabilities on either performance accuracy or correct RTs, nor any interactions including decoding accuracy or prediction probability (all 95%-CI included zero). Thus, we found no evidence that more distinct neural task-set representations were associated with better performance during task switching in the present paradigm in either age group.
Discussion
Using MVPA, we examined the extent to which the distinctiveness of neural task-set representations contributed to age differences in task switching. Our findings showed lower decoding accuracy on switch compared with repeat trials across children and adults, suggesting less distinct task-set representations on switch trials. We observed this pattern not only in FP regions associated with task switching (Richter and Yeung, 2014; Worringer et al., 2019), but also CO regions associated with task-set maintenance (Braver et al., 2003; Han et al., 2019; Wood and Nee, 2023) and TO regions associated with the task-relevant stimuli (cf. Tsumura et al., 2021). Contrary to our expectations, we found no evidence that decoding accuracy differed between children and adults. However, exploration of task-specific probabilities showed greater differences between the switch and repeat condition in children than adults in the dlPFC, the dACC, and the PPA, suggesting that age differences might be more nuanced. Finally, our analyses did not provide any evidence that task-set inertia contributed to lower distinctiveness on switch trials.
More distinct representations on repeat than switch trials
The finding that the currently relevant task set could be decoded with above-chance accuracy for repeat but not for switch trials supports the notion that task-set representations in the present task were less stable when they had recently been updated (i.e., on switch trials; Meiran, 1996; Mayr and Kliegl, 2000). The lower distinctiveness on switch trials has partly been attributed to the lingering representation of the (no-longer relevant) task set from the previous trial (Rogers and Monsell, 1995; Wylie and Allport, 2000; Qiao et al., 2017; Rangel et al., 2023). Directly testing this task-set inertia hypothesis in the present study, we did not find evidence for this pattern, contrary to the previous findings reported by Qiao et al. (2017) based on representational similarity between consecutive trials. Note that compared with Qiao et al. (2017), our participants had to switch among three different tasks. This allowed us to compare whether a multivariate pattern of brain activation contained more information of the previously relevant task than a third task (relevant on neither the previous nor the current trial) and thus directly test predictions made by the task-set inertia hypothesis.
Together with previous studies investigating neural representations during task switching (Loose et al., 2017; Qiao et al., 2017), the present results indicate that differences in neural task-set representations may depend on the specific kind of switching demand. Specifically, our paradigm and the one used by Qiao et al. (2017) required switches between different arbitrary rules and their corresponding response mappings that may be more likely to modulate the distinctiveness of task-set representations (cf. Woolgar et al., 2011), as indicated by a condition difference in decoding accuracy. In contrast, the paradigm by Loose et al. (2017) required switches between responses while the task remained the same conceptually, which resulted in comparable (above-chance) decoding for both switch and repeat trials (cf. Brass and De Baene, 2022).
Task-set representations in children and adults: overall similarity and regional differences
By demonstrating that the currently relevant task could be reliably predicted from neural activation patterns on task-repeat trials not only in adults but also in children, our results provide novel insights into children's ability to flexibly switch between rules. Contrary to our expectations based on comparisons of univariate task-based activation during task switching (Crone et al., 2006b; Wendelken et al., 2012), we did not find clear evidence for less distinct neural task-set representations in children compared with adults. While children showed overall lower task performance, their accuracy and RT switch costs were of comparable magnitude to adults (cf. Luca et al., 2003; Reimers and Maylor, 2005). We did not observe any age differences in overall decoding accuracy nor in the effects of switching on decoding accuracy (cf. Fandakova et al., 2019). However, the difference between switch and repeat trials in the predicted probability of the currently relevant task was greater in children than adults in the dlPFC, the dACC, and the PPA. This finding suggests more subtle regional differences, even within functional networks. One factor underlying those age differences may be less focused representations of task-relevant as opposed to task-irrelevant information in children (Jung et al., 2023).
A similar level of decoding accuracy should not be interpreted as evidence that representations were identical or used in the same way across age groups. Even with similar distinctiveness, there may still be differences in the application of task sets (cf. Kriegeskorte and Douglas, 2018). For example, tasks eliciting different levels of performance in adults can show comparable levels of decoding accuracy, suggesting that differences in complexity were not captured by the decoder (Ruge et al., 2019). This lack of difference in decoding in the face of behavioral differences may be especially relevant when comparing different ages, given continuing development of neural systems due to maturation and experience. For instance, univariate analyses of the present sample revealed that children upregulated frontoparietal activation on switch compared with repeat trials to a smaller extent than adults (Schwarze et al., 2023), supporting the idea that children and adults may differ with respect to implementing the newly relevant task-set on switch trials.
An intriguing additional factor concerns individual differences in representational geometry (cf. Vaidya and Badre, 2022). Recently, Bhandari et al. (2024) demonstrated that the PFC carries flexible and high dimensional representations of task-relevant information. Such complexity is likely not captured by the linear classifier applied in the present study (Kriegeskorte and Douglas, 2018) but could very well differ between children and adults (Snyder and Munakata, 2010). Future studies with designs optimized toward characterizing task-set dimensionality can explore age differences with variation in representation dimensions and their contribution to task-switching development.
Finally, associative memory affording the binding of different task features (Mayr, 2006; Frings et al., 2020) may further contribute to task-switching development (Lucenet and Blaye, 2023). While the present paradigm was designed to minimize potential memory effects, their contributions to the development of task-set representations warrant further investigation.
Differences between networks
The present results extend previous studies of neural task-set representations during rule-based tasks (Woolgar et al., 2011; Zhang et al., 2013; Loose et al., 2017; Qiao et al., 2017) with respect to regional heterogeneity. We showed greater decoding accuracy in TO regions compared with FP and CO regions, not only in children but also in adults. TO regions may be more strongly driven by the visual input of the task, support sensory representations within working memory (cf. Olivers and Roelfsema, 2020), or carry representations of lower dimensionality rendering them more distinct in their neural pattern (cf. Buschman, 2021). Our exploration of regional heterogeneity in the difference between switch and repeat decoding accuracy suggested that representations in FP and CO regions were more similarly affected by the demand to switch than when comparing CO and TO regions. This effect was more prominent in children, in line with continued refinement of networks during development (Fair et al., 2009; Keller et al., 2022). The enhanced FP-CO correlations might reflect greater similarity in task-set representations in these regions, especially in children, resulting in similar negative effects of switching (cf. Vaidya and Badre, 2022). Enhanced similarity might enable efficient communication of the FP with CO regions supporting task rule maintenance. It is likely that regional differences in representational geometry (Badre et al., 2021; Vaidya and Badre, 2022; Garner and Dux, 2023; Mill and Cole, 2023) contributed to the observed correlational pattern of switch-related decreases in decoding accuracy, suggesting future research exploring how representational geometry might be relate to communication among cognitive control regions.
Two limitations of the present study that are especially relevant to potential regional differences should be highlighted. First, the present task did not include multiple cues (i.e., a single cue was used for each task) and the cue was presented simultaneously with the stimuli. We can thus not rule out that the cue contributed to the distinctiveness of task-set representations (cf. Loose et al., 2017). Given the relatively earlier position of the TO regions in the ventral visual processing stream (Kravitz et al., 2013), the extent to which the cue might have affected task-set representations may differ between ROIs (see also Bhandari et al., 2018). Second, there are different approaches to derive single-trial beta estimates for MVPA that can result in different patterns of decoding accuracy (Mumford et al., 2012; Prince et al., 2022). We selected an LSS approach that uses iterative fitting of a different model for each trial to minimize the influence of collinearity on single-trial beta estimates. Simulation studies have shown that LSS is particularly well suited to handle collinearity in rapid event-related designs with short intertrial intervals and provides reliable estimates while reducing the influence of the activation of the previous trial on the single-trial beta estimate for the current trial (Mumford et al., 2012, 2014; Abdulrahman and Henson, 2016; Arco et al., 2018). To date, no gold standard for deriving single-trial beta estimates exists, as the best approach depends on specific study features such as the length of the intertrial interval (Mumford et al., 2014), trial variability and scanner noise (Abdulrahman and Henson, 2016), or investigated brain regions (cf. Bhandari et al., 2018). Future methodological investigations of single-trial estimation procedures in task-switching designs and across age groups are warranted.
Conclusion
Taken together, our results demonstrate that task-set representations were affected by switch demands—not only in adults but also in children. More nuanced analyses using a probability measure indicated that in key cognitive control regions (i.e., dlPFC and dACC) task-set distinctiveness was more strongly affected by switch demand in children than in adults. These results raise questions about the role of representations in cognitive control during childhood that merit further study: What is the role of regional heterogeneity for the learning and generalization of task rules in childhood? And how do representations differ between single tasking and task switching? Future work should track developmental changes in neural representations longitudinally to delineate the mechanisms that promote cognitive control development during childhood.
Footnotes
We thank the financial support by the Max Planck Institute for Human Development and by the DFG Priority Program SPP 1772 “Human performance under multiple cognitive task requirements: From basic mechanisms to optimized task scheduling” (Grant No. FA 1196/2-1 to Y.F.). During the work on her dissertation, S.A.S. was a predoctoral fellow of the International Max Planck Research School on the Life Course (LIFE; http://www.imprs-life.mpg.de) at the Max Planck Institute for Human Development, Berlin, Germany. We thank Theodoros Koustakas for support with the analyses and Julia Delius for editorial assistance and helpful comments.
The authors declare no competing financial interests.
- Correspondence should be addressed to Sina A. Schwarze at schwarze{at}mpib-berlin.mpg.de or Yana Fandakova at fandakova{at}uni-trier.de.