Figure $$10.16$$: Hierarchical action selection across multiple prefrontal basal ganglia loops. On the far right, at the most anterior level, the PFC represents contextual information that is gated by its corresponding BG loop based on the probability that maintaining this context for guiding lower level actions is predictive of reward. The middle loop involves both input and output gating. The input gating mechanism allows stimulus representations S to update a PFC_maint layer, while the output gating mechanism gates out a subset of maintained information conditional on the context in anterior PFC. Its associated BG layer learns the reward probability of output gating given the maintained stimulus S and the context. Finally, the left-most motor loop learns to gate simple motor responses based on their reward probabilities conditional on the stimulus, as in the single loop BG model described in the Motor chapter, but where here relevant stimulus features are selected by the more anterior loops. Reproduced from Frank & Badre (2012).