16Prefrontal Cortex (PFC) exerts control on action selection and mediates behavioral flexibility 17 during working memory (WM) task execution, when integration and retention of sensory 18 information takes place. We used biophysical circuit modelling to investigate the dendritic, 19 neuronal and circuit mechanisms that underlie these computations, aiming to causally link these 20 three processing levels. Our simulations predict that dendritic NMDA non-linearities drive 21 distinct activity dynamics of the same network, thus enabling adaptive coding in the absence of 22 plasticity mechanisms. Specifically, we find that distinct assemblies of mixed-selectivity neurons 23 emerge and fire in stable trajectories in a stimulus-dependent manner. Synaptic inputs that are 24 spatio-temporally clustered, as provided by the structured connectivity of the PFC, facilitate 25 these activity dynamics, thus further increasing the flexibility of the network. Our study suggests 26 that behavioral flexibility may result from the formation of memoranda-specific assemblies in 27 the PFC which are utilized dynamically in relation to the task at hand. 28 29 30 Keywords: prefrontal, working memory, dendritic integration, NMDA, behavioral flexibility, 31 assemblies, dimensionality 32 33Working memory (WM) is the ability to maintain behaviorally relevant stimuli for a short period 35 of time and to integrate them towards a choice/action. Seminal WM studies found that the 36 activity of single neurons increases during the presentation of a to-be-maintained item (stimulus 37 epoch) and persists throughout the blank 'post-stimulus' interval (post-stimulus epoch). This 38 persistent activity constitutes a basic component of decision making by bridging the temporal 39 gap between the item presentation and the subsequent contingent response (Funahashi et al., 40 1989; Fuster and Alexander, 1971) and is involved in the top-down modulation of behavior (Van 41 Kerkoerle et al., 2017). The above findings form the backbone of the so-called fixed selectivity 42 framework that has dominated the WM field. According to this framework, selective tuning of 43 neurons or neuronal populations to the to-be-remembered information can be explained by the 44 formulation of stable attractors: the fine-tuning of the respective network connections creates 45 stable points, whereby individual neurons fire consistently to specific stimuli, both during the 46 stimulus and the post-stimulus epoch (Renart et al., 2003; Wimmer et al., 2014). 47 Recent electrophysiological findings challenge this framework, based on the observation that the 48 dynamics underlying WM in the PFC are more diverse than previously thought. First, individual 49 neurons display time-varying discharge rates (Bernacchia et al., 2011; Brody et al., 2003; Jun et 50 al., 2010; Shafi et al., 2007), leading to the hypothesis that the tuning properties of neurons 51 change throughout the task duration. Second, individual PFC neurons can be selective for a 52 broad range of task variables and stimuli...