Flexible Coding of Task Rules in Frontoparietal Cortex: An Adaptive System for Flexible Cognitive Control

How do our brains achieve the cognitive control that is required for flexible behavior? Several models of cognitive control propose a role for frontoparietal cortex in the structure and representation of task sets or rules. For behavior to be flexible, however, the system must also rapidly reorganize as mental focus changes. Here we used multivoxel pattern analysis of fMRI data to demonstrate adaptive reorganization of frontoparietal activity patterns following a change in the complexity of the task rules. When task rules were relatively simple, frontoparietal cortex did not hold detectable information about these rules. In contrast, when the rules were more complex, frontoparietal cortex showed clear and decodable rule discrimination. Our data demonstrate that frontoparietal activity adjusts to task complexity, with better discrimination of rules that are behaviorally more confusable. The change in coding was specific to the rule element of the task and was not mirrored in more specialized cortex (early visual cortex) where coding was independent of difficulty. In line with an adaptive view of frontoparietal function, the data suggest a system that rapidly reconfigures in accordance with the difficulty of a behavioral task. This system may provide a neural basis for the flexible control of human behavior.


INTRODUCTION
Human behavior is remarkably diverse and flexible. How does the brain achieve the flexible cognitive control that is required? Several theories implicate pFC, damage to which results in characteristically inflexible and perseverative behavior (Luria, 1966). In particular, pFC is thought to have a key role in structuring and representing task sets or rules (e.g., Duncan, 2013;Miller & Cohen, 2001). Several theories of prefrontal organization predict the involvement of different prefrontal regions, depending on the characteristics of the rule being used (e.g., O'Reilly, 2010; Badre & D'Esposito, 2009;Botvinick, 2008;Christoff & Keramatian, 2007;Koechlin & Summerfield, 2007;Bunge & Zelazo, 2006;Koechlin & Jubault, 2006). For example, one prominent suggestion is that the pFC follows a rostrocaudal gradient with different regions recruited according to the control demands of the task (Badre & D'Esposito, 2007;Koechlin & Summerfield, 2007). In contrast, the adaptive coding hypothesis (Duncan, 2001) proposes that single prefrontal neurons dynamically adjust their responses to code the task distinctions that are currently relevant for behavior. The suggestion is that a specific network of prefrontal and parietal regions, active in many different tasks, supports flexible behavior by rapidly reconfiguring to represent the information that is currently relevant as mental focus changes (Duncan & Miller, 2013;Duncan, 2001Duncan, , 2010. Similar to other models of prefrontal function (Miller & Cohen, 2001;Dehaene, Kerszberg, & Changeux, 1998;Norman & Shallice, 1980), cognitive control is then exerted through influence over more specialized processing areas, for example, by biasing processing toward task-relevant information (Duncan, 2006;Duncan & Miller, 2002;Desimone & Duncan, 1995).
Recruitment of different brain regions could follow a posterior-anterior pFC axis along which control signals of progressively greater temporal abstraction are organized (Koechlin & Summerfield, 2007;Koechlin, Ody, & Kouneiher, 2003). According to this proposal, rules governing habitual sensorimotor associations are processed in the premotor cortex, whereas contextual rules (e.g., "apply Rule 1 for red and Rule 2 for blue") additionally recruit posterior lateral pFC. Engagement of the more anterior region of the inferior frontal sulcus (IFS) requires episodic control (i.e., control by past events, for example, a cue given at the start of a block of trials). A related organizational scheme was proposed by Badre andD'Esposito (2007, 2009) and Badre (2008), who suggested a caudal-rostral gradient mapping onto increasing layers of conditional dependency. For example, the rule "press 1 for stimulus A, and 2 for stimulus B" has one layer, whereas the rule "if the cue is red, press 1 for stimulus A, and 2 for stimulus B, but if the cue is blue then press 2 for stimulus A, and 1 for stimulus B" has two layers, one governing the mapping between stimulus and response and a second governing which mapping to use. Processing of a single layer rule is proposed to be confined to the caudal part of pFC (dorsal premotor cortex), processing Macquarie University, Sydney, Australia of two layers additionally recruits anterior dorsal premotor cortex and so on, with additional layers recruiting progressively more rostral regions.
These theories account for our ability to flexibly solve a wide range of different tasks by positing the involvement of different brain regions in different tasks, while the response of each brain region is specialized for a particular information type. In contrast, the adaptive coding hypothesis (Duncan, 2001) suggests that individual neurons, capable of supporting behavior in a wide range of different tasks, adjust their response according to task demands. Brain regions showing adaptive coding would therefore be expected to be involved in a wide range of tasks, to code a wide range of task features as necessary for behavior, and to adjust their coding profiles according to the demands of the current task (Duncan, 2010).
Adaptive coding can be seen in the firing rates of single units recorded in nonhuman primates. The activity of single cells in lateral frontal cortex can discriminate a wide range of task features including task rules, cues, stimuli, responses, rewards, and combinations of these features (for a review, see Duncan, 2001). Moreover, the activity profile of many of these cells adjusts to make different task-relevant distinctions during single trials as attentional focus is established (Kadohisa et al., 2013), as dictated by the current phase of the task Sigala, Kusunoki, Nimmo-Smith, Gaffan, & Duncan, 2008;Rao, Rainer, & Miller, 1997) and after retraining (Cromer, Roy, & Miller, 2010;Freedman, Riesenhuber, Poggio, & Miller, 2001). A similar generality of response is seen for certain cells in lateral parietal cortex, which discriminate a range of task features including aspects of cues, stimuli, rules, and responses (e.g., Ibos, Duhamel, & Ben Hamed, 2013;Gail & Andersen, 2006;Stoet & Snyder, 2004;Andersen, Essick, & Siegel, 1985) and adjust their responses after retraining (Freedman & Assad, 2006).
In the human brain, candidate regions for adaptive coding are a set of regions in frontal and parietal cortices that are active for a wide range of task demands (Duncan, 2001(Duncan, , 2006. These encompass the IFS, anterior insula/ frontal operculum (AI/FO), dorsal anterior cingulate/ pre-supplementary motor area (ACC/pre-SMA), and intraparietal sulcus (IPS). In functional imaging, a characteristic pattern of activity in these regions is found for a range of different cognitive demands, including response conflict, task switching, perceptual difficulty, working memory, episodic memory, and semantic memory (e.g., Niendam et al., 2012;Stiers, Mennes, & Sunaert, 2010;Dosenbach et al., 2006;Naghavi & Nyberg, 2005;Owen, McMillan, Laird, & Bullmore, 2005;Nyberg et al., 2003;Duncan & Owen, 2000). The same result is seen across tasks at the level of single subjects (Fedorenko, Duncan, & Kanwisher, 2013). Evidence from neuropsychology suggests that these regions may be critical for fluid intelligence, the aspect of general intelligence that predicts performance on a wide range of tasks, with the extent of behavioral deficit linearly predicted by the extent to which these regions are dam-aged ( Woolgar et al., 2010) and compensatory activity seen throughout the system after frontal lobe damage (Woolgar, Bor, & Duncan, 2013).
The adaptive coding hypothesis predicts that the MD regions dynamically adjust the information they discriminate when task demands change. Information coding has traditionally been difficult to examine in humans, but multivoxel pattern analysis (MVPA) of fMRI data presents an opportunity to test this prediction. MVPA tests for consistency in the fine-grained patterns of BOLD response: Information coding is inferred where patterns can consistently discriminate between different task events (Haynes & Rees, 2005). In line with an adaptive view of MD function, multivoxel patterns of activity in these regions discriminate a range of task-relevant information including stimuli, task rules, and participant responses (e.g., Harel, Kravitz, & Baker, 2014;Woolgar, Thompson, Bor, & Duncan, 2011;Stiers et al., 2010;Bode & Haynes, 2009;Li, Ostwald, Giese, & Kourtzi, 2007).
In addition to coding a range of qualitatively different task features, regions showing adaptive coding should adjust the strength of coding of single task features as task demands change ( Woolgar, Hampshire, Thompson, & Duncan, 2011). Moreover, this adjustment should be in a direction that is adaptive for behavior. This presents a counterintuitive prediction: that information that is more difficult to discriminate on a behavioral level will be better distinguished at the level of multivoxel codes. Consistent with this, we recently demonstrated that MD regions code visual stimuli more strongly under conditions of high, compared to low, perceptual difficulty ( Woolgar, Williams, & Rich, 2015;Woolgar, Hampshire, et al., 2011), suggesting that MD representation of perceptual information adapts to cope with increased perceptual difficulty.
In the current study, we focused on the predictions of the adaptive coding hypothesis. We asked whether MD regions would change their coding of task rules when rule complexity changed. To address this, we compared multivoxel discrimination of two relatively simple stimulusresponse mapping rules previously found to be coded in these regions  with discrimination of two new stimulus-response mapping rules that were more complex and highly confusable (Figure 1). Each rule defined the mapping between four stimulus positions and four button press responses, and on each trial the current rule to use was cued by the background color of the screen.
The adaptive coding hypothesis (Duncan, 2001) predicts stronger coding of the more challenging rules relative to the simple ones as the system responds to the change in difficulty of the task by augmenting the representation of the most challenging task feature.
At the opposite extreme, hierarchical organization accounts predict that, because our rules depend on processing information immediately available when the stimulus is presented (Koechlin & Summerfield, 2007) and consist of only two layers (Badre & D'Esposito, 2007), processing should be confined to the anterior dorsal premotor cortex and not recruit, for example, the IFS MD region. However, given previous observations of activation for (Crittenden & Duncan, 2014) and discrimination of ( Woolgar, Hampshire, et al., 2011; rules of this type throughout the MD system, such an outcome seems unlikely. It is also possible that the MD system always codes rules equally, regardless of complexity. This might be predicted given a specific role for the MD regions in maintaining task rules (Miller & Cohen, 2001), commensurate with previous empirical studies that found the representation of rules in frontoparietal cortex to be stronger than representation of other task features (e.g., Riggall & Postle, 2012;Sigala et al., 2008). Because even our "easy" rules were cognitively challenging and have previously been found to be represented in the MD system , with the strength of representation robust to changes in perceptual difficulty ( Woolgar, Hampshire, et al., 2011), it was possible that both these and the new set of hard rules would be represented equally. Furthermore, because our easy and hard rules do not differ on the number of layers of conditional dependency (Badre & D'Esposito, 2009) nor require integration of information over different timescales (Koechlin & Summerfield, 2007), the accounts of Badre and D'Esposito (2009) and Koechlin and Summerfield (2007) would not predict differential coding of the hard and easy rules.
Finally, if rule decoding depends on the similarity of stimulus-response transformations within each rule, we might see more coding of the easy relative to the hard rules. For example, Rules 1 and 2 can be thought of as Figure 1. Participants learned four stimulus-response mappings governing which of four response keys they should press for each of the four possible stimulus positions. Rules 1 and 2 were simple ("easy", A), whereas Rules 3 and 4 were more complex ("hard", B). The easy rules comprised one consistent position-response transformations and were internally symmetrical, whereas the hard two rules comprised four unique position-response transformations and no internal symmetry. The background color of the screen indicated which rule to use on each trial (red: Rule 1, blue: Rule 2, green: Rule 3, purple: Rule 4). (C) Illustration of three trials at the start of a block of easy rules. The correct responses would be buttons 2, 2, and 3. containing only one stimulus-response transformation operation each (Duncan, 1977; Rule 1: alternate finger within hemisphere, Rule 2: reflection across the midline; Figure 1), whereas Rules 3 and 4 both require the use of four distinct stimulus-response transformations (mirror across the midline, direct mapping, alternate finger of alternate hand, and alternate finger within hemisphere). Because our rule decoding analysis identifies commonalities in multivoxel patterns for one rule as opposed to another, representation of the rules at this level should drive better classification for the easy rules where the transformations are more similar within rule and more distinct between rules.
To preempt our results, the data revealed greater MD discrimination of the two complex rules relative to the simpler rules. That is, multivoxel discrimination in the MD system was greater for rules that behaviorally were more difficult to distinguish. In contrast, visual cortex encoded the two (visually cued) rules equally. The results suggest an adaptive frontoparietal system that reconfigures in response to changing task difficulty, providing a possible mechanism for cognitive control of flexible behavior.

METHODS Participants
Twenty-two participants (14 women, mean age = 24.9 years, SD = 4.51) took part in this study. All participants were right-handed and had normal or corrected-tonormal vision. For multivariate analyses, three participants were rejected because of poor behavioral performance (see Behavioral Thresholding section) leaving 19 participants (12 women, mean age = 23.9 years, SD = 4.25). All participants gave written informed consent and were reimbursed for their time. The study was approved by the Macquarie University Human Research Ethics Committee.

Task Design
Participants were scanned while completing a visual stimulus-response task that we used previously to separate multivoxel coding of visual stimuli, task rules, and button-press responses ( Woolgar, Hampshire, et al., 2011;. On each trial, the stimulus was a blue square measuring 2°× 2°presented on a projector and viewed through a head-coil-mounted mirror in the scanner. It could appear in one of four positions, arranged in a horizontal row in the center of the screen, and separated by 3°middle to middle. Participants responded by pressing one of four response keys using the index and middle fingers from each hand. Participants learnt four incompatible stimulus-response mappings ("rules") between the four stimulus positions and the four response keys (Figure 1). Two of the rules were relatively simple ("easy"), whereas the other two rules were more complex ("hard"). The easy rules each comprised one "consistent" position-response transformation (Rule 1: alternate finger within hemisphere, Rule 2: reflection across the midline; Duncan, 1977Duncan, , 1978, and were internally symmetrical. The two hard rules were "inconsistent" (Duncan, 1977), each comprising four different position-response transformations (mirror across the midline, direct mapping, alternate finger of alternate hand, and alternate finger within hemisphere) with no internal symmetry, and were mirror images of one another. On each trial, the current rule to use was indicated by the background color of the screen (red: Rule 1, blue: Rule 2, green: Rule 3, purple: Rule 4; color rule mappings fixed across participants). Colors were presented at 50% saturation and 70% brightness. The colors for the two easy rules and the two hard rules were each separated by 180°of hue.

Training
Participants learned and practiced each rule outside the scanner. Training order was counterbalanced over participants so that half the participants learned the hard rules first whereas the other half learned the easy rules first, and within this, the order in which the two easy and two hard rules were learned was also counterbalanced across participants. For participants that learned the easy rules first, they first learned (12 trials) and practiced (12 trials) one of the easy rules and then learned (12 trials) and practiced (12 trials) the other easy rule. During the 12 learning trials, participants were shown each stimulus together with a graphical depiction of the correct button to press. For this, trial order was fixed such that the blue square appeared in each of the horizontal positions in sequence from left to right, repeated three times. During the 12 practice trials, the stimuli were presented in random order, and the correct button to press was not shown. Participants then practiced a mixed block (36 trials) in which the four stimulus positions and two easy rules were presented in random order, with the background color on each trial indicating the rule to be applied. The same procedure was then used for the hard rules. Participants were instructed to respond as quickly as possible without making any mistakes. During practice, participants were given feedback on each trial ("CORRECT," for 500 msec; or "INCORRECT! The correct answer was x" where x indicates the number of the correct response button, for 1500 msec). If the participant's response was incorrect, they were shown the stimulus from the previous trial again, together with a graphical depiction of correct button to press, and were required to press the correct response key. At the end of each block, the participant's accuracy and mean RT were displayed for 4 sec. If participants scored below 60% (chance = 25%) on any rule in any practice block, they were required to repeat that block until their performance reached 60%. The same training scheme was used for participants that learned the hard rules first. Training took approximately 20 min.
Acquisition fMRI scans were acquired using a Siemens (Erlangen, Germany) 3-T Verio scanner with 32-channel head coil, at the Macquarie Medical Imaging facility in Macquarie University Hospital, Sydney, Australia. We used a sequential descending T2*-weighted EPI acquisition sequence with the following parameters: repetition time = 2000 msec; echo time = 30 msec; 34 oblique axial slices of 3.0 mm slice thickness with 0.7 mm interslice gap; in-plane resolution = 3.0 × 3.0 mm; field of view = 210 mm; flip angle = 78°. We also acquired T1-weighted MPRAGE structural images for all participants (resolution 1.0 × 1.0 × 1.0 mm).
Stimuli were presented using Matlab with Psychophysics Toolbox-3 (Brainard, 1997) and were back-projected onto a screen viewed through a head-coil mounted mirror in the scanner. Participants performed alternating 2-min blocks of hard and easy rules, separated by 22 sec. Participants performed two EPI acquisition runs each consisting of eight blocks of trials and lasting 19 min 12 sec.
Block order was counterbalanced within participants across runs, and run order was counterbalanced between participants. At the start of each block, a graphical depiction of the two rules to be used in the current block was displayed for 10 sec, after which the screen returned to gray for 1000 msec before the first stimulus was displayed ( Figure 1C). Within each block, the eight stimuli (4 positions * 2 background colors) were presented in random order. Stimuli remained visible for 4000 msec or until the participant responded. There was an intertrial interval of 1000 msec between response and display of the next stimulus, during which time the screen was gray. Block length was fixed at 2 min, in which time participants completed a varying number of trials (mean ± SD total number of trials over experiment, 857.18 ± 89.74). At the end of each block, participants were shown a blank screen for 1000 msec, the message "End of Block" for 1000 msec, followed by a 500-msec blank screen after which feedback (% correct and average RT) was displayed for 4000 msec. After this, there was a further 5000 msec break in which the screen was blank before the next block began.

Analysis
Univariate and multivariate analyses techniques were used to examine complementary aspects of the data. Univariate analyses examined overall differences in BOLD response in hard and easy blocks. MVPA was used to examine whether multivoxel patterns of activation could reliably discriminate task rules, stimulus positions, and responses in the hard and easy conditions separately. Of central interest was whether MD coding of rule was stronger in the hard condition than in the easy condition, as predicted by the adaptive coding hypothesis (Duncan, 2001). Analyses therefore focused on prefrontal and parietal MD ROIs with an additional ROI in the visual cortex included for comparison. Exploratory whole brain (univariate) or searchlight (multivariate) analyses were also included to check the specificity of the ROI effects.

Preprocessing
Preprocessing was carried out using SPM5 ( Wellcome Department of Imaging Neuroscience, London, UK; www.fil.ion.ucl.ac.uk). EPI images were spatially realigned to the first image and slice-time-corrected with the first slice as the reference. The structural image was coregistered to the mean EPI image and normalized (simultaneous gray/white matter segment and normalize) to derive normalization parameters for each participant. For multivariate analyses, the EPI images were additionally smoothed with a 4-mm FWHM Gaussian kernel. For univariate analyses, the EPIs were warped into template space using the derived normalization parameters and smoothed with an 8-mm kernel. The time course of each voxel was high-pass filtered with a cut off of 128 sec.

Behavioral Thresholding
For our main neural analyses we excluded any block of trials where participants scored below 70% correct. 1 This only occurred on hard blocks. To balance the number of blocks contributing to easy and hard rule discrimination, we also rejected the corresponding easy block (e.g., if a participant scored <70% on the third hard block, both the third hard and the third easy block were omitted from analysis). Three participants were excluded entirely as they had <2 hard blocks remaining at this threshold. Neural analyses were based on an average of 5.95 (SD = 2.22) easy and 5.95 (SD = 2.22) hard blocks per participant.

Univariate Analysis
Conventional univariate analyses examined overall differences in BOLD response in blocks of hard and easy rules. The multiple regression approach of SPM5 was used to estimate beta values pertaining to easy and hard blocks. Blocks were modeled using 120-sec box car functions convolved with the canonical hemodynamic response function of SPM5. This yielded beta estimates of the hard and easy conditions at every voxel for each participant separately. Beta estimates were then averaged across voxels in each ROI using the MarsBaR toolbox for SPM5 (Brett, Anton, Valabregue, & Poline, 2002) and entered into a repeated-measures ANOVA with factors Difficulty (easy, hard) and Region (ACC/pre-SMA, IPS, IFS, AI/FO, data collapsed over hemisphere where appropriate). To check for hemispheric differences, we also carried out an ANOVA with factors Hemisphere (left, right), Difficulty (easy, hard) and Region (IPS, IFS, AI/FO; ACC/pre-SMA data omitted as ROI is bilateral). Finally, to check the spatial specificity of the difficulty effect (see Univariate results), we repeated this analysis using a mass-univariate whole-brain approach. For this, beta estimates for the hard and easy conditions for each participant were entered into a second level random effects paired t test with the contrast hard minus easy. The resulting t image was thresholded at p < .05 with false discovery rate (FDR) correction for multiple comparisons and an extent threshold of 20 voxels.

Multivoxel Pattern Analyses
MVPA was used to discriminate patterns of activation pertaining to different rules, stimulus positions, and button press responses on correct trials in the hard and easy blocks separately. For analysis of position and response, we compared the two inner with the two outer positions (which have equal contributions from each of the four responses and each of the two rules), and the two inner with the two outer responses (which have equal contributions from each of the four stimulus positions, each of the two hands, and each of the two rules), as in our previous work ( Woolgar, Hampshire, et al., 2011;. First, the standard multiple regression approach of SPM5 was used to estimate beta values pertaining to the two rules, inner and outer positions and inner and outer responses, in each of the 16 blocks separately. This model was chosen to give optimal estimation of BOLD response associated with each rule independent from that associated with different positions and responses and to allow for separate analysis of rule, position, and response coding. To account for trial by trial differences in RT (Todd, Nystrom, & Cohen, 2013), trials were modeled as epochs lasting from stimulus onset until response ( Woolgar, Golland, & Bode, 2014;Grinband, Wager, Lindquist, Ferrera, & Hirsch, 2008;Henson, 2007), as in our previous work ( Woolgar et al., 2015;Woolgar, Hampshire, et al., 2011;. Each trial contributed to the estimation of three beta values (one of the two rules, inner or outer stimulus position, and inner or outer response). Only correct trials were included.
Next, multivoxel pattern analyses were performed using the Decoding Toolbox (Hebart, Görgen, & Haynes, 2015), which wraps the LIBSVM library (Chang & Lin, 2011). For each participant, the nine ROIs (7 MDs plus left and right BA 17/18) were deformed to native space by applying the inverse of each participant's normalization parameters. This allowed us to perform pattern classification analysis on an ROI basis using the native space data for each participant. For each participant, classification of rule, position, and response was performed in each of the easy and hard conditions separately. To illustrate, the analysis of rule coding in the easy condition proceeded as follows. For a given ROI, the pattern of beta values across the relevant voxels was extracted from each of the 16 relevant beta images (2 rules × 8 easy blocks) yielding 16 multivoxel vectors. All the voxels in each ROI contributed to each vector, without feature selection. A linear support vector machine (LibSVMC, cost parameter C = 1) was trained to discriminate between the vectors pertaining to Rule 1 and those pertaining to Rule 2. Data were split into training and testing chunks using odd and even blocks: The classifier was trained using the data from the first, third, fifth, and seventh easy block and was subsequently tested on its accuracy at classifying the unseen data from the second, fourth, sixth, and eighth easy block. This process was then repeated using the even blocks as training blocks and the odd blocks as testing blocks so that all blocks contributed equally to training and testing, and the two classification accuracies were then averaged to give a single accuracy score for that participant. For participants with less than the full set of 8 easy and 8 hard blocks, the available blocks were split according to their sequence. This whole procedure was repeated for each feature (rule, position, response) at each level of difficulty (easy, hard) separately. Multivoxel coding of each task feature was compared between easy and hard conditions using ANOVA. Each task feature (rule, position, response) was considered separately. First, the classification accuracy for a given task feature, for each condition, participant, and MD ROI, was entered into a repeated-measures ANOVA with factors Difficulty (easy, hard) and Region (ACC/pre-SMA, IFS, AI/FO, and IPS, data collapsed across hemisphere where appropriate), with post hoc paired t tests used as appropriate to examine the effect of difficulty in each region separately. Greenhouse-Geisser correction for nonsphericity was used as needed. Second, because a significant difference in coding between conditions would only be interpretable if coding was also significantly above chance (50%) in at least one of the conditions, coding was compared to chance in each condition separately using planned one-sample t tests. To check for any hemisphere effects, we performed an additional ANOVA with factors Difficulty (easy, hard), hemisphere (left, right) and Region (IPS, IFS, AI/FO; ACC/ pre-SMA data omitted as ROI is bilateral). One-tailed significance tests were used where appropriate for inference: Comparison of rule coding in hard and easy conditions in the MD system was one-tailed because the direction of the effect was prespecified, and comparison of classification accuracy to chance was one-tailed because below chance classification is functionally equivalent to no effect. Visual ROIs were analyzed separately, using ANOVA and t tests to perform the analogous comparisons. Effect sizes are reported using partial eta squared, η 2 p (Keppel, 1991) for ANOVA, and Cohen's d z (Cohen, 2013) for t tests.
To check for additional regions showing multivoxel coding of rule information, we also performed the rule decoding analysis across the whole brain using a roaming searchlight (Kriegeskorte, Goebel, & Bandettini, 2006). For each participant and condition separately, we analyzed the pattern of activation in the local neighborhood (sphere of 5 mm radius) of each voxel in the brain. For each sphere, the linear support vector machine was trained and tested as described above and the classification accuracy value was assigned to the central voxel. The resulting whole-brain classification accuracy maps were normalized by applying each participant's normalization parameters and smoothed (8 mm FWHM Gaussian kernel) to allow for anatomical variability between participants. Classification accuracy for easy and hard rules separately was compared to chance at the group level using a one-sample t test against chance (50%), and rule coding for hard and easy rules was directly contrasted using a paired t test. To be as inclusive as possible, we used a lenient threshold of p < .001 uncorrected (with extent threshold 20 voxels) for this exploratory analysis.

Behavioral Results
Participants were significantly faster and more accurate on the easy rules compared with the hard rules (RT: t(21) = −8.431, p < .0005, Cohen's d z = −1.80; accuracy: t(21) = 6.087, p < .0005, d z = 1.30, Table 1). Participants were significantly faster (t(21) = −3.465, p = .002, d z = −0.74) and tended to be more accurate (t(21) = 2.064, p = .052, d z = 0.44) easy Rule 1 compared with easy Rule 2, whereas there were no significant differences in speed or accuracy for the two hard rules (RT: t(21) = −1.074, p = .30, d z = −0.23; accuracy: t(21) = 0.34, p = .74, d z = 0.07). However, any difference between the two rules in each set did not differ significantly between easy and hard sets (paired t test after subtracting numerically slower from faster rule in each set: RT: t(21) = For our multivariate analyses of the neural data concerning rule, position, and response coding, we rejected any block where participants scored below 70% correct (see Behavioral Thresholding, above). The same pattern of behavioral results was seen for the blocks that were included in this analysis as when no thresholding was applied.

Univariate Results
We carried out a univariate analysis to check for the expected increase in activation in the MD regions in hard relative to easy blocks (Duncan & Owen, 2000). Activation data were analyzed on an ROI basis using ANOVA with factors Difficulty (easy, hard) and Region (ACC/ pre-SMA, IPS, IFS, AI/FO, data collapsed over hemisphere). As expected, there was a main effect of Difficulty (F(1, 21) = 11.67, p = .001, η 2 p = 0.36) indicating that BOLD response was significantly greater in the MD system for hard relative to easy blocks. There was also a Region × Difficulty interaction (F(2.0, 42.0) = 4.36, p = .019, η 2 p = 0.17), but post hoc paired t tests nonetheless revealed significantly more activation in the hard relative to the easy condition in all MD regions separately (ACC/pre-SMA: t(21) = 1.99, p = .030, d z = 0.42; IPS: t(21) = 3.78, p < .001, d z = 0.81; IFS: t(21) = 3.35, p = .002, d z = 0.71; AI/FO: t(21) = 2.65, p = .008, d z = 0.56). An additional ANOVA, included to check for hemispheric effects, with factors Difficulty (easy, hard), Hemisphere (left, right), and Region (IPS, IFS, AI/FO; data from bilateral ACC/pre-SMA ROI omitted) did not reveal any main effect or interaction with Hemisphere (all ps > .067).
To check the specificity of this finding, we repeated the analysis using a mass-univariate approach. As can be seen in Figure 2 and Table 2, the result was a pattern of frontal and parietal activation dominated by the characteristic MD pattern with additional restricted regions in the anterior frontal lobe, FEFs, precuneus, and cerebellum.

Multivoxel Results
We examined multivoxel coding of rules, stimulus position, and button press responses when participants performed the stimulus-response mapping task using easy and hard rules. Of central interest was whether coding of task-relevant information in the MD system would adjust to the increased difficulty of the hard compared to the easy rules. First, based on the adaptive coding hypothesis (Duncan, 2001) and our previous results with manipulations of perceptual difficulty ( Woolgar et al., 2015;Woolgar, Hampshire, et al., 2011), we predicted that when the two rules were more confusable, the MD system would adjust to show a counter intuitive increase in discrimination between the two rules. The decoding results were in line with this prediction (Figure 3). An ANOVA with factors Difficulty (high, low) and Region (ACC/pre-SMA, IPS, IFS, and AI/FO, collapsed across hemisphere where appropriate) revealed a main effect of Difficulty (F(1, 18) = 3.360, p = .042, η 2 p = 0.16), indicating that in the MD system as a whole, there was significantly more coding of rule information for hard compared with easy rules. This is striking, because it indicates increased discrimination between rules that behaviorally are more confusable. There was no Difficulty × Region interaction (F(2.039, 36.7) = 2.310, p = .11, η 2 p = 0.11). When we compared rule classification accuracy to chance (50%) in each region separately, we found that the hard rules were coded in three of the four MD ROIs (ACC/pre-SMA: t(18) = 2.79, p = .004, d z = 0.64; IFS: t(18) = 3.03, p = .004, d z = 0.70; IPS: t(18) = 2.98, p = .004, d z = 0.69) whereas the easy rules could not be discriminated in any MD region (IPS: t(18) = 0.20, p = .16, d z = 0.05, all other classifications not numerically greater than 50%). The small ventral prefrontal region around the AI/FO did not show coding of rule in either condition (classification not numerically greater than 50%).
We performed an additional ANOVA to check for hemispheric differences. This ANOVA had factors Difficulty (easy, hard), Hemisphere (left, right), and Region (IPS, IFS, AI/FO; data from bilateral ACC/pre-SMA ROI omitted). There was no Hemisphere × Difficulty interaction or three-way interaction and no main effect of Hemisphere ( ps > .72). There was a significant Hemisphere × Region interaction (F(2, 36) = 4.38, p = .20, η 2 p = 0.20), which indicated that the hemisphere effect was not the same across regions. To explore this, we performed post hoc ANOVAs (factors: Difficulty and Hemisphere) in each region separately. In the IPS region, there was a significant main effect of Hemisphere (F(1, 18) = 4.59, p = .046, η 2 p = 0.20), indicating that there was more coding overall in the left compared with right IPS region, but again this did not interact with Difficulty (F(1, 18) = 0.022, p = .88, η 2 p < 0.01). There was no main effect of Hemisphere or Hemisphere × Difficulty interaction in the IFS or AI/FO ANOVAs ( ps > .35). There was no evidence that the increase in rule coding for hard rules varied between the two hemispheres.
Next, we asked whether the increase in MD coding under conditions of increased rule complexity was specific to the representation of task rules. One possibility was a general increase in coding of all task features, as might be predicted by a general increase in attention or effort in hard blocks. However, there was no main effect of Difficulty in the ANOVA of position coding (F(1, 18) = 0.12, p = .73, η 2 p = 0.01; Figure 4B) or response coding (F(1, 18) = 1.17, p = .29, η 2 p = 0.06; Figure 4C), nor any interaction with Region ( ps > .66). Moreover, in the MD system considered as a whole, coding of position and response information was not significantly different from chance in either the hard or the easy condition ( ps > .07). In the context of challenging stimulus-response mapping rules, multivoxel codes in the MD system were dominated by rule coding.
Next, we checked the specificity of our result to the MD system. For this, we examined rule coding in the visual cortex (BA 17/18), using an ANOVA with factors Difficulty (easy, hard) and Hemisphere (left, right). This visual region held information about the (visually cued) task rules, but, in contrast to the MD system, there was no difference in rule coding between the easy and hard conditions (no main effect of Difficulty: F(1, 18) = 0.01, p = .93, η 2 p < 0.01, Figure 4D). Rule discrimination was above chance (50%) in both the easy (t(18) = 2.24, p = .019, d z = 0.51) and hard (t(18) = 2.30, p = .017, d z = 0.53) conditions. This ROI also showed above chance discrimination of position information in the easy condition (t(18) = 3.34, p = .002, d z = 0.77), but not in the Regions showing increased activation for hard relative to easy rules (whole-brain univariate analysis). Data are thresholded at p < .05 with FDR correction for multiple comparisons and an extent threshold of 20 voxels. Coordinates of peak activation are given in Table 2. hard condition (t(18) = 1.01, p = .14, d z = 0.23), although the difference between conditions was again not significant (main effect of difficulty, F(1, 18) = 1.33, p = .26, η 2 p = 0.07, Figure 4E). There was no coding of response information in this ROI ( ps > .47, Figure 4F), and no main effect of, or interaction with, Hemisphere in any ANOVA (all ps > .33). The adaptive response to the change in rule difficulty seen in the MD system was not seen in this more specialized cortex.
Finally, to ensure that we had not overlooked any additional brain regions showing rule coding we re-ran the rule decoding analysis on a more exploratory basis using a roaming searchlight (Kriegeskorte et al., 2006). Because this analysis uses data that overlaps with the ROI analyses, converging results would not be surprising but would indicate that discrimination was possible based on local patterns of activation on a substantially smaller spatial scale (0.5 cm 3 spherical searchlight vs. e.g., 17 cm 3 IFS ROI). The advantage of this analysis is in identifying any additional regions that would have been missed by the ROI approach. To be as inclusive as possible, we used a lenient threshold of p < .001 uncorrected with extent threshold 20 voxels. The results are shown in Figure 5 and Table 3. For the easy rules, coding was seen in left and right visual cortex, left middle temporal cortex, left orbital frontal cortex, and the precuneus ( Figure 5A). For the hard rules, coding was seen in left and right lateral frontal cortex, right anterior cingulate, bilateral occipital cortex, right precuneus, left caudate nucleus, and right cerebellum ( Figure 5B). Even at our lenient threshold, the only cortical region to show stronger coding of hard compared with easy rules was a region in right lateral pFC at the location of the IFS ROI ( Figure 5C). However, this analysis also revealed a cluster of subcortical voxels in the dorsal lateral region of the left caudate nucleus where coding was stronger for hard relative to easy rules. There were no significant voxels for the inverse comparison of easy minus hard rules. If a more conservative threshold of p < .05 with FDR correction was applied, a cluster of voxels in the precuneus for rule coding in the easy condition were the only voxels to survive correction.

DISCUSSION
For cognitive control to be flexible to the ever-changing demands of the world around us, we need a neural system that can both represent the rules of our current task and dynamically adjust as mental focus changes. Here we tested candidate regions in frontal and parietal cortex, defined on the basis of being responsive to a wide range of demands, for flexible representation of task rules in a stimulus-response mapping task. In line with the adaptive coding hypothesis (Duncan, 2001), the MD system adjusted to yield a strong representation of task rules when the rules were complex and behaviorally confusable, but showed little or no representation when the rules were simpler. This adjustment was only found for the rule element of the task and was not mirrored in more specialized (visual) cortex, where the information was represented regardless of rule complexity. Our results suggest an adaptive frontoparietal coding system that adjusts to the difficulty of the task at hand. Previous work has demonstrated robust frontoparietal multivoxel discrimination between rules in a vari-ety of fixed experimental contexts (Harel et al., 2014;Waskom et al., 2014;Soon et al., 2013;Zhang et al., 2013;Momennejad, 2012;Reverberi et al., 2012aReverberi et al., , 2012bCole et al., 2011;Woolgar, Hampshire, et al., 2011;Bode & Haynes, 2009;Haynes et al., 2007). In addition, univariate studies have implicated the lateral pFC, ACC/pre-SMA, and IPS in the learning, selection, retrieval, maintenance, and implementation of task rules (e.g., Crittenden & Duncan, 2014;Wendelken, Munakata, Baym, Souza, & Bunge, 2012;Dumontheil, Thompson, & Duncan, 2011;Donohue, Wendelken, & Bunge, 2008;Crone, Wendelken, Donohue, & Bunge, 2006;Dosenbach et al., 2006;Passingham, Toni, & Rushworth, 2000;Brass & von Cramon, 2004;Bunge, 2004), and work in nonhuman primates strongly suggests a role for prefrontal Significance marking between bars indicate increased coding for hard relative to easy rules; significance markings for individual bars indicate coding significantly above chance (50%). *p < .05, **p < .01. Data in A are repeated from Figure 3 for ease of comparison. The change in information coding between hard and easy conditions was unique to the coding of rule and to the MD system. . Rule coding in the MD system in easy and hard rule conditions. Bars represent classification accuracy for the multivoxel discrimination of easy rules (Rule 1 vs. Rule 2, blue bars) and hard rules (Rule 3 vs. Rule 4, red bars). Error bars indicate SEM. Significance marking between bars indicate increased coding for hard relative to easy rules; significance markings for individual bars indicate coding significantly above chance (50%). *p < .05, **p < .01. and parietal cells in rule representation (e.g., Stokes et al., 2013;Buschman, Denovellis, Diogo, Bullock, & Miller, 2012;Sigala et al., 2008;Wallis & Miller, 2003;Wallis, Anderson, & Miller, 2001;White & Wise, 1999;Hoshi, Shima, & Tanji, 1998). However, the adaptive coding hypothesis predicts not only that rules can be represented in this system but also that rule representation will adapt according to task demands. Here we present new data showing that rule coding in the MD regions is sensitive to task difficulty.
Previous evidence for adaptive coding has been drawn primarily from the nonhuman primate literature. For ex-ample, Rao et al. (1997) demonstrated that single lateral prefrontal neurons can discriminate target identity and location at different times within single trials of a task, according to what information is needed in the current task phase. Over a longer timescale, Freedman and colleagues showed that monkey frontal (Freedman et al., 2001) and parietal (Freedman & Assad, 2006) neurons adapt to code new task-relevant distinctions among the same stimuli when the animal is trained to use a new decision boundary (see also Cromer et al., 2010;Roy, Riesenhuber, Poggio, & Miller, 2010). More recent work testing patterns of activation across multiple units has also shown Figure 5. Rule coding assessed with a roaming searchlight. Whole-brain maps show voxels where patterns of activation in the local neighborhood (5 mm sphere) discriminated between the two easy rules (A) or the two hard rules (B). C shows regions where rule coding was stronger for hard rules than for easy rules. Results are thresholded at p < .001 (uncorrected, equivalent to t = 3.61), with an extent threshold of 20 voxels. There were no regions where coding was significantly stronger for easy compared to hard rules. The threshold for p < .05 with FDR correction for easy rules would have been t = 4.40, at which threshold the only significant cluster consisted of 579 voxels around the precuneus. No voxels survived FDR correction for the other comparisons. Coordinates of peak coding are given in Table 3. that population tuning profiles in the monkey pFC adjust to accommodate different task contexts . In human functional imaging, interrogation of single neurons is not possible, but a similar result was found using multivoxel pattern analysis when participants attended to different aspects of moving dot figures (Li et al., 2007). Moreover, we previously demonstrated that the MD system adjusts to give a stronger discrimination of perceptual information under conditions of high, compared to low, perceptual difficulty (Woolgar et al., 2015;Woolgar, Hampshire, et al., 2011). Here we extend this work to a non-perceptual domain, demonstrating that the coding of task rules is sensitive to rule complexity, with a stronger representation of rules that are behaviorally more confusable.
Adaptive rule representation provides a potential mechanism by which cognitive control can adjust as task demands change. Converging evidence comes from the observation that MD coding of task rules is diminished after a week of practice ( Woolgar, Hampshire, et al., 2011). The current data show that rule coding adapts in response to externally imposed changes in difficulty on a much shorter timescale (between 2 min blocks), making a clearer case for this system as supporting cognitive control on the rapid basis required for behavior. Consistent with this interpretation, Waskom et al. (2014) showed that frontoparietal coding of attentional context in the IFS, IPS, and occipital temporal cortex was greatest for trials immediately following a switch in context relative to subsequent nonswitch trials.
The present results cannot easily be accounted for by other major theories of prefrontal function that emphasize fixed functional specialization of prefrontal regions. For example, although our study was not designed to be a direct test of these frameworks, because each rule required contextual control by a cue presented concurrent with the stimulus (Koechlin & Summerfield, 2007;Koechlin et al., 2003) and each had two layers of abstraction (Badre & D'Esposito, 2007, the accounts of Badre and D'Esposito (Badre & D'Esposito, 2007Badre, 2008) and Koechlin and Summerfield (2007) would not predict the involvement of regions anterior to posterior pFC. Yet, significant rule coding was seen here in our IFS ROI, as in our previous studies ( Woolgar, Hampshire, et al., 2011;, and the searchlight analysis suggested this may have been driven by the anterior portion of the IFS in both hemispheres. In this regard, our results parallel a recent univariate study specifically designed to address this question that found activation throughout the MD system, but no frontal lobe hierarchy, for rules similar to ours (Crittenden & Duncan, 2014). Moreover, for our rules the required stimulus-response transformation was always conditional on a cue determining which set of stimulus-response transformations to use, so our easy and hard rules did not differ on the number of layers of conditional dependency (Badre & D'Esposito, 2007, and the cue indicating which rule to use was always presented concurrently with the stimulus to be discriminated, so our easy and hard rules did not differ in the need to integrate information over different timescales (Koechlin & Summerfield, 2007;Koechlin et al., 2003). Given this, it is not clear that these theories would predict our observed difference in rule coding for any given prefrontal area.
What aspect of each rule is encoded in the MD system? Although it does not rule out concurrent representation at other levels, all our analyses examined multivoxel representation at a specific level of encoding: that at which patterns of activation were consistent across the stimulusresponse pairs of one rule and different from the set of pairs in the other rule. This makes the results presented here all the more surprising. If we consider each rule to be a set of stimulus-response transformations (Duncan, 1977;Rabbitt & Vyas, 1973), the coding requirements of the easy and hard rules are clearly distinct. For each of the two easy rules, there is a single transformation to be used across all stimulus positions (Rule 1: alternate finger within hemisphere, Rule 2: reflection across the midline; Figure 1A; Duncan, 1977Duncan, , 1978. This means that, across the different stimulus instances, a code representing the transformation would be consistent within rule and different between the rules, making the two easy rules decodable. In contrast, for the two hard rules there are four separate stimulus-response transformations to encode, and the same transformations are used in both rules ( Figure 1B). Across different stimuli, the code within rule would be inconsistent, whereas across rules the codes consist of the same transformations, making them more confusable and the two hard rules less decodable. Therefore, if these rules were encoded purely at the level of transformations, we would see stronger decoding of the easy rules (internally consistent, distinct across rules) compared to the hard rules (internally inconsistent, similar across rules), not the opposite. Alternatively, if each stimulus-response pair were encoded separately, we would see equal classification for the two rules: because all rules consist of four unique stimulus-response pairs, the two easy and the two hard rules differ in all components. Instead, because our analyses required the classifier to generalize over specific stimulus-response combinations, the observed pattern of results is only possible if the multivoxel patterns reflect representation of the set of stimulus-response transformations in each rule. Further work is needed to understand precisely what combination of factors makes the hard rules more difficult to implement than the easy ones, but our results imply that these rules must at some level be coded as whole sets of transformations, with better discrimination between the more challenging wholes although they consist of more similar parts.
Could behavioral differences have contributed to the difference in neural coding between our conditions? Trial by trial differences in RT were accounted for at the first level of analysis by using a variable epoch model (Grinband et al., 2008;Henson, 2007), in which each trial was modeled as a box car from stimulus onset until response. This model explicitly takes into account the time on task on each trial, which should mitigate the contribution of RT differences to multivoxel patterns (Woolgar et al., 2014). Additionally, the RT differences between the two rules was not significantly different between the two difficulty conditions, and the direction of the numerical difference (a bigger difference between the two easy rules than between the two hard rules) should have acted against our effect, driving more coding in the easy condition (Todd et al., 2013). Participants were also faster and more accurate on the two easy compared to the two hard rules, meaning that there were more correct trials contributing to the analysis of easy rule coding. In terms of amount of data, this should again act against our effect, driving, if anything, stronger decoding in the easy condition. A final possibility is that the increased effort in the hard condition might simply lead to more coding in general in the hard condition. However, the increase in coding was specific to the task feature being manipulated (increased coding of rule whereas coding of position and response was unchanged) and specific to the MD system (no change in coding in the visual ROI), ruling out this alternative explanation.
In our design, each rule was consistently cued by a single background color, meaning that multivoxel discrimination between rules could be based on differential coding of the two visual colors rather than a representation of the set of stimulus-response mappings themselves. We have addressed this question elsewhere  and found the contribution of the background color to be minimal in the MD system. In our previous study, discrimination between two background colors cueing the same rule was weak, and rule information was shown to be extracted away from (and generalize over) cue color. Moreover, it seems unlikely that the visual properties of the different colors could drive the pattern of results seen here in the MD system, whereby rule coding was stronger for the more complex rules. This does, however, offer a simple explanation for the observation that rules could be distinguished in the pattern of activation in the occipital cortex (BA 17/18), because the strength of this classification did not vary with rule difficulty.
The MD representation of the easy rules used here was noticeably weaker than the representation of the same stimulus-response mapping rules in a previous experiment , raising the intriguing possibility that the wider experimental context can influence which aspects of the task are represented in the MD regions. Although one possible interpretation of the data presented here is simply that the MD regions only code rules of the "hard" type, integration of the current data set with the literature and our previous work makes this interpretation unlikely. Here, the inclusion of the more difficult rules in the current study changed the context in which the easy rules were performed. We speculate that, in the context of the (even more) difficult set of rules, processing resources were differentially recruited, resulting in relatively weak MD coding of the easy rules. There are a few caveats, however, which need to be considered. First, in the previous study, each rule was cued by two different screen background colors, whereas here we used only one color per rule. This may, for example, have encouraged participants to generate a more abstract representation of each rule in the previous study. However, strong rule coding was also seen in a subsequent study using very similar rules ( Woolgar, Hampshire, et al., 2011), in which only one color cued each rule. Second, in the current study, participants were somewhat slower and less accurate on the easy rules compared to the participants performing the same rules in the previous study. It is difficult to relate differences in information coding to behavioral success across studies, but this hints at an interesting avenue for future research linking coding in the MD regions to successful task performance. Finally, because there were more conditions, there was substantially less fMRI data contributing to the estimated BOLD response for each rule in the current study than in our previous experiment. Further work is needed to understand the details of this possible redistribution of processing resources with wider task context and its implications for performance.
We were motivated to examine information coding in a specific and well-defined network of brain regions thought to be candidate regions for adaptive coding, therefore our main analyses focused on the MD regions. However, our exploratory searchlight analysis revealed two unexpected findings. First, significant discrimination between the two easy rules was seen for a large cluster of voxels in the dorsal precuneus, which survived voxelwise FDR correction for multiple comparisons. This anatomical region is commonly considered to be a major component of the default mode network (e.g., Fransson & Marrelec, 2008;Cavanna, 2007), and indeed, our cluster of significant rule decoding was almost entirely within the canonical definition of the default mode network given by Power et al. (2011). This was surprising given that activity in the default mode network is usually associated with the task negative or resting state (e.g., Fox et al., 2005;Raichle et al., 2001;Shulman et al., 1997), and with internal modes of cognition such as introspection, episodic memory, thinking about the future, and first-person perspective taking (e.g., Buckner & Carroll, 2007) rather than active maintenance or processing of externally driven task-relevant information. However, recent work has suggested that the functional connectivity of the precuneus may be state dependent, showing functional connectivity to the default mode network at rest but functional connectivity with a frontoparietal network overlapping with the MD network during active task performance (Utevsky, Smith, & Huettel, 2014). Here we show multivoxel discrimination of task-relevant rule information in this region under conditions of active task performance. One interesting possibility is that, in the context of a more challenging task that occupies the MD network, this region may be recruited to represent the relatively simple task information. However, note that in our data there was no evidence that rule coding in this region was stronger for easy compared to hard rules. Additionally, our whole-brain univariate analysis found the opposite result for activation: Along with the MD system, this region was more active for hard than for easy rules. Further work is needed to understand what this region contributes to active tasks of different difficulties.
An additional region identified by our searchlight analysis, which did not survive correction for multiple comparisons, was a dorsal region of the left caudate nucleus, which showed stronger rule coding for hard relative to easy rules. Although rule coding in this region would be consistent with a role in learning, potentiating, and switching between stimulus-response associations (e.g., Helie, Ell, & Ashby, 2015;Packard & Knowlton, 2002;Wise, Murray, & Gerfen, 1996) and dorsolateral region of the caudate nucleus does receive anatomical projections from dorsolateral prefrontal and posterior parietal cortex (Alexander, DeLong, & Strick, 1986, see also e.g., Postuma & Dagher, 2006;Lehericy et al., 2004;Strafella, Paus, Barrett, & Dagher, 2001), we wish to replicate this finding before placing much emphasis on it.
The adaptive coding hypothesis is sometimes misrepresented as suggesting that the pFC is undifferentiated or there is no specificity of function between different prefrontal regions. In fact, the proposal is that adaptive coding is a property of a specific set of prefrontal regions, which are observed to be active in many different tasks (Duncan, 2010(Duncan, , 2013. It allows, for example, the possibility that a distinct set of cognitive functions is associated with the most anterior parts of the pFC (e.g., Roca et al., 2011). In our data, we found that the MD regions showed an adaptive representation of task rules, and our exploratory searchlight analysis did not suggest the involvement of any additional prefrontal regions. However, future work may benefit from inclusion of a priori prefrontal control regions to provide a more powerful test of the proposed regional specificity.
For flexible human behavior we need a cognitive control system that can both represent the rules of our task and dynamically adjust as the demands of our task change. According to the adaptive coding hypothesis (Duncan, 2001(Duncan, , 2010, neurons in specific frontal and parietal regions dynamically adjust their responses to code the information that is currently needed for behavior. Here we demonstrate adaptive coding of rule in the human MD system. Multivoxel representation of stimulusresponse mapping rules was sensitive to current task difficulty, the adjustment occurred dynamically, and the direction of the adjustment was such that MD coding of rule was stronger for rules that were more complex and behaviorally more confusable. The results suggest a frontoparietal system that rapidly and adaptively reorganizes in response to changing demands, providing a possible mechanism for the cognitive control of flexible human behavior.