With practice, humans may improve their performance in a task by either optimizing a known strategy or discovering a novel, potentially more fruitful strategy. How does the brain support these two fundamental abilities? In the present experiment, subjects performed a simple perceptual decision-making task. They could either use and progressively optimize an instructed strategy based on stimulus position, or spontaneously devise and then use a new strategy based on stimulus color. We investigated how local and long-range BOLD coherence behave during these two types of strategy learning by applying a recently developed unsupervised fMRI analysis technique that was specifically designed to probe the presence of transient correlations. Converging evidence showed that the posterior portion of the default network, i.e. the precuneus and the angular gyrus bilaterally, has a central role in the optimization of the current strategy: these regions encoded the relevant spatial information, increased the level of local coherence and the strength of connectivity with other relevant regions in the brain (e.g. visual cortex, dorsal attention network). This increase was proportional to the task optimization achieved by subjects, as measured by the reduction of reaction times, and was transiently disrupted when subjects were forced to change strategy. By contrast, the anterior portion of the default network (i.e. medial prefrontal cortex) together with rostral portion of the fronto-parietal network showed an increase in local coherence and connectivity only in subjects that would at some point spontaneously choose the new strategy. Overall, our findings shed light on the dynamic interactions between regions related with attention and with cognitive control, underlying the balance between strategy exploration and exploitation. Results suggest that the default network, far from being "shut-down" during task performance, has a pivotal role in the background exploration and monitoring of potential alternative courses of action.