BACKGROUND AND AIMS: Impaired cognitive flexibility is associated with the characteristic symptomatology of ADHD and OCD. However, the mechanisms underlying learning and flexibility under uncertainty in adults with OCD or ADHD remain unclear. This study aimed to identify the mechanisms underlying contingency-based flexibility in a sample of adults with ADHD or OCD, using probabilistic learning reversal task, functional near-infrared spectroscopy, and computational modelling. METHODS: 148 Spanish-speaking adults (43 OCD, 53 ADHD and 52 healthy controls) completed a probabilistic learning reversal task. Previously, we obtained a resting-state functional connectivity (rsFC) record between several frontoparietal network regions using functional near-infrared spectroscopy. Contingency-based flexibility was explored by reinforcement learning model in combination with a Bayesian Generalized Logistic Model (GLM). The reinforcement learning parameters included reward and punishment learning rates (feedback sensitivity), and inverse temperature (decision consistency). Bayesian GLM parameters were defined to measure final accuracy, learning and speed of learning. RESULTS: We found that the groups showed optimal performance in the discrimination block and a higher performance of healthy controls compared to patients in the reversal block. Model parameters predicted task performance differently by phase and group. In the discrimination block, while the performance of healthy controls was predicted by a combination of parameters such as high inverse temperature and punishment learning rate together with low values of reward learning rate, in the case of the clinical groups it was only by high inverse temperature. In the reversal block, the performance of OCD was predicted by high punishment learning rate and that of ADHD by low reward learning rate
in contrast, the performance of healthy controls was also predicted by a combination of parameters with high punishment learning rate and inverse temperature as predictors. We found the rsFC between the left and right posterior parietal cortex appears to credibly predict performance in the discrimination block in healthy controls. CONCLUSIONS: These results suggest that OCD and ADHD in adults could be associated with poor behavioral adaptation when reinforcement-punishment contingencies changed. The difficulties observed in ADHD and OCD likely stem from different underlying mechanisms that affect both learning and switching processes. Findings highlighted how OCD appears to show greater sensitivity to punishment when there is uncertainty about the behavior-outcome association. Instead, the ADHD group can be guided by sensitivity to reinforcement. Interhemispheric rsFC posterior parietal cortex could be important for optimal learning of the task.