Attentional modulation of neuronal variability in circuit models of cortex

The circuit mechanisms behind shared neural variability (noise correlation) and its dependence on neural state are poorly understood. Visual attention is well-suited to constrain cortical models of response variability because attention both increases firing rates and their stimulus sensitivity, as well as decreases noise correlations. We provide a novel analysis of population recordings in rhesus primate visual area V4 showing that a single biophysical mechanism may underlie these diverse neural correlates of attention. We explore model cortical networks where top-down mediated increases in excitability, distributed across excitatory and inhibitory targets, capture the key neuronal correlates of attention. Our models predict that top-down signals primarily affect inhibitory neurons, whereas excitatory neurons are more sensitive to stimulus specific bottom-up inputs. Accounting for trial variability in models of state dependent modulation of neuronal activity is a critical step in building a mechanistic theory of neuronal cognition. DOI: http://dx.doi.org/10.7554/eLife.23978.001


Introduction
The behavioral state of the brain exerts a powerful influence on the cortical responses. For example, electrophysiological recordings from both rodents and primates show that the level of wakefulness (Steriade et al., 1993), active sensory exploration (Crochet et al., 2011), and attentional focus (Treue, 2001;Reynolds and Chelazzi, 2004;Gilbert and Sigman, 2007;Moore and Zirnsak, 2017) all modulate synaptic and spiking activity. Despite the diversity of behavioral contexts, in all of these cases an overall elevation and desynchronization of cortical activity accompanies heightened states of processing (Harris and Thiele, 2011). Exploration of the neuronal mechanisms that underly such state changes has primarily centered around how various neuromodulators shift the cellular and synaptic properties of cortical circuits (Hasselmo, 1995;Lee and Dan, 2012;Noudoost and Moore, 2011;Moore and Zirnsak, 2017) However, a coherent theory linking the modulation of cortical circuits to an active desynchronization of population activity is lacking. In this study we provide a circuit-based theory for the known attention-guided modulations of neuronal activity in the visual cortex of primates performing a stimulus change detection task.
The investigation of the neuronal correlates of attention has a rich history. Attention increases the firing rates of neurons engaged in feature-and spatial-based processing tasks (McAdams and Maunsell, 2000;Reynolds et al., 1999). Attentional modulation of the stimulus-response sensitivity (gain) of firing rates is more complicated, often depending on stimulus specifics such as the size and contrast of a visual image (Williford and Maunsell, 2006;Reynolds and Heeger, 2009;Sanayei et al., 2015). In recent years there has been increased focus on how brain states affect trialto-trial spiking variability (Crochet et al., 2011;Lin et al., 2015;Doiron et al., 2016;Stringer et al., 2016). In particular, attention decreases the shared variability (noise correlations) of the firing rates from pairs of neurons (Cohen and Maunsell, 2009;Mitchell et al., 2009;Cohen and Maunsell, 2011;Herrero et al., 2013;Ruff and Cohen, 2014;Engel et al., 2016). The combination of a reduction in noise correlations and an increase in response gain has potentially important functional consequences through an improved population code (Cohen and Maunsell, 2009;Rabinowitz et al., 2015). In total, there is an emerging picture of the impact of attention on the trial-averaged and trial-variable spiking dynamics of cortical populations.
Phenomenological models of attentional modulation have been popular (Reynolds and Heeger, 2009;Navalpakkam and Itti, 2005;Gilbert and Sigman, 2007;Ecker et al., 2016); however, such analyses cannot provide insight into the circuit mechanics of attentional modulation. Biophysical models of attention circuits are difficult to constrain, due in large part to the diversity of mechanisms which control the firing rate and response gain of neurons (Silver, 2010;Sutherland et al., 2009). Nonetheless, several circuit models for attentional modulation have been proposed (Ardid et al., 2007;Deco and Thiele, 2011;Buia and Tiesinga, 2008), but analysis has been mostly confined to trial-averaged responses. Taking inspiration from these studies, mechanistic models of attentional modulation can be broadly grouped along two hypotheses. First, the circuit mechanisms that control trial-averaged responses may be distinct from those that modulate neuronal variability. This hypothesis has support from experiments in primate V1 showing that N-methyl-D-aspartate receptors have no impact on top-down attentional modulation of firing rates, yet have a strong influence of attentional control of noise correlations (Herrero et al., 2013). A second hypothesis is that the modulations of firing rates and noise correlations are reflections of a single biophysical mechanism. Support for this comes from pairs of V4 neurons that each show strong attentional modulation of firing rates, also show a strong attention mediated reductions in noise correlation (Cohen and Maunsell, 2011). In this study we provide novel analysis of the covariability of V4 population activity engaged in an attention-guided detection task (Cohen and Maunsell, 2009) that is consistent with the second hypothesis. Specifically, the modulation of spike count covariance between unattended and attended states has the same dimensionality as the firing rate modulation.
We use the results from our dimensionality analysis to show that an excitatory-inhibitory recurrent circuit model subject to global fluctuations is sufficient to capture both the increase in firing rate and eLife digest The world around us is complex and our brains need to navigate this complexity.
We must focus on relevant inputs from our senses -such as the bus we need to catch -while ignoring distractions -such as the eye-catching displays in the shop windows we pass on the same street. Selective attention is a tool that enables us to filter complex sensory scenes and focus on whatever is most important at the time. But how does selective attention work?
Our sense of vision results from the activity of cells in a region of the brain called visual cortex. Paying attention to an object affects the activity of visual cortex in two ways. First, it causes the average activity of the brain cells in the visual cortex that respond to that object to increase. Second, it reduces spontaneous moment-to-moment fluctuations in the activity of those brain cells, known as noise. Both of these effects make it easier for the brain to process the object in question.
Kanashiro et al. set out to build a mathematical model of visual cortex that captures these two components of selective attention. The cortex contains two types of brain cells: excitatory neurons, which activate other cells, and inhibitory neurons, which suppress other cells. Experiments suggest that excitatory neurons contribute to the flow of activity within the cortex, whereas inhibitory neurons help cancel out noise. The new mathematical model predicts that paying attention affects inhibitory neurons far more than excitatory ones. According to the model, selective attention works mainly by reducing the noise that would otherwise distort the activity of visual cortex. The next step is to test this prediction directly. This will require measuring the activity of the inhibitory neurons in an animal performing a selective attention task. Such experiments, which should be achievable using existing technologies, will allow scientists to confirm or disprove the current model, and to dissect the mechanisms that underlie visual attention.
response gain as well as population-wide decrease of noise correlations. Our model makes two predictions regarding neuronal modulation: (1) that attentional modulation favors inhibitory neurons, and (2) that stimulus drive favors excitatory neurons. Finally, we show that our model predicts increased informational content in the excitatory population, which would result in improved readout by potential downstream targets. In total, our study provides a simple, parsimonious, and biologically motivated model of attentional modulation in cortical networks.

Results
Attention decreases noise correlations primarily by decreasing covariance Two rhesus monkeys (Macaca mulatta) with microelectrode arrays implanted bilaterally in V4 were trained in an orientation change detection task (Figure 1a; see Materials and methods: Data preparation). A display with oriented Gabor gratings on the left and right flashed on and off. The monkey was cued to attend to either the left or right grating before each block of trials, while keeping fixation on a point between the two gratings. After a random number of presentations, one of the gratings changed orientation. The monkey then had to saccade to that side to obtain a reward. The behavioral task and data collection have been previously reported (Cohen and Maunsell, 2009).
A neuron is considered to be in an 'attended state' when the attended stimulus is in the hemifield containing that neuron's receptive field (contralateral hemifield), and in an 'unattended state' when it is in the other (ipsilateral) hemifield. The trial-averaged firing rates from both attended and unattended neurons displayed a brief transient rise (~100 ms after stimulus onset), and eventually settled to an elevated sustained rate before the trial concluded ( Figure 1b). During the sustained period the mean firing rate of attended neurons (22:0 sp/s) was greater than that of unattended neurons (20:6 sp/s) (t test, P < 10 À5 ). A major finding of Cohen and Maunsell (2009) was that the pairwise trial-to-trial noise correlations of the neuronal responses decreased with attention ( Figure 1c, left, mean unattended 0.065, mean attended 0.045, t test, P < 10 À5 ). The noise correlation between neurons i and j is a normalized where Cov and Var denote spike count covariance and variance respectively. Both spike count variance and covariance significantly change with attention (hVar U i trials ¼ 5:02 spikes 2 , hVar A i trials ¼ 5:10 spikes 2 , t test, P < 10 À3 , hCov A i trials ¼ 0:252, t test, P < 10 À5 ), but the decrease in covariance (34:0%) is much more pronounced than the increase in variance (1:61%; Figure 1c, middle and right). We therefore conclude that the attention mediated decrease in noise correlation is primarily due to decreased covariance.
To further validate this observation, we consider the distributions of pairwise changes in covariance (black) and variance (gray) with attention over the entire data set (Figure 1d). Covariance and variance are normalized by their respective maximal unattended or attended values (see Methods: Comparing change in covariance to change in variance). The change in covariance with attention is concentrated below zero with a large spread, whereas the change in variance is centered on zero with a narrower spread. Taken together these results suggest that to understand the mechanism by which noise correlations decrease it is necessary and sufficient to understand how spike count covariance decreases with attention.

Attention is a low-rank modulation of noise covariance
A reasonable simplification of V4 neurons is that they receive a bottom-up stimulus alongside an attention-mediated top-down modulatory input. However, to properly model top-down attention we need to first understand the dimension of attentional modulation on the V4 circuit as a whole. Let A f : f U 7 ! f A denote the attentional modulation of measure f from its value in the unattended state, f U , to its value in the attended state, f A . For example, the firing rate modulation A r can be written as r A ¼ A r r U , where r A is an N Â 1 vector of neural firing rates in the attended state, r U denotes the firing rate vector in the unattended state, A r is a vector the same size as r, and denotes elementwise multiplication. In this case, the entries a i of A r are the ratios of the firing rates: Figure 2a). A less trivial aspect of attentional modulation is the modulation of covariance matrices: Here C A is the attended spike count covariance matrix, C U the unattended spike count covariance matrix, and A C is a matrix the same size as C U , consisting of entries g ij , which we will call covariance gains. Unlike firing rates, the transformation matrix A C can be of varying rank. On the one hand A C could be constructed from the ratios of the individual elements: g ij ¼ c A ij =c U ij , with each pair of neurons ði; jÞ receiving an individualized attentional modulation g ij of their shared variability (Figure 2b, left). Under this modulation A C is a rank N matrix. A rank N A C will always perfectly (and trivially) capture the matrix mapping in Equation (1). However, it is difficult to conceive of a top-down circuit mechanism that would allow attention to modulate each pair individually. On the other hand, g ij could depend not on the specific pair ði; jÞ, but on the individual neurons of the pairing: g ij ¼ g i g j (Figure 2b, right). In this case, only N values are needed to characterize A C : A C ¼ gg T , where g is a N Â 1 column vector, meaning A C has rank of 1. This is a more parsimonious and biophysically plausible scenario for attentional modulation, since in this case the covariance gain g ij of neurons i and j is simply emergent from the attentional modulation of the individual neurons. To test whether A C is low rank we analyzed the V4 population recordings during the visual attention task (Figure 1), specifically measuring A C under the assumption that A C is rank 1: Equation (2)   High-rank covariance modulation, in which attention modulates the shared variability of each pair of neurons. Right: Low-rank covariance modulation, in which attention modulates each neuron individually rather than in a pairwise manner. (c-e) The measured covariance values plotted against those predicted by the rank-1 model for data collected in one recording session, for c, the actual data ( ¼ 0:77), d, shuffled data ( shuf ¼ 0:22, 100 shuffles), Figure 2 continued on next page ½g 1 ; . . . g N T (we only consider i 6 ¼ j to exclude variance modulation from our analysis). For N>3 this is an overdetermined system, and we solve for g using a nonlinear equation solver. Letĝ be the optimal solution obtained by the solver (measured as a minimization of the L 2 -norm of the error; see Methods: objfxn). ThenĈ A :¼ĝĝ T C U provides an approximation to the attended covariance matrix.
In an example data set from a single recording session with N ¼ 39 units, the correlation coefficient of the actual attended covariance values from C A versus the approximated attended covariance values fromĈ A was 0:77 ( Figure 2c). A shuffled C A matrix provides a reasonable null model, and the example data set produces the lower bound correlation shuf ¼ 0:22 (Figure 2d; see Materials and methods: Shuffled covariance matrices). Finally, a Poisson model that perfectly decomposes as Equation (2), yet sampled with the same number of trials as in the experiment, gives an upper bound for the rank one structure, the example data yields ub ¼ 0:90 ( Figure 2e; see Materials and methods: Upper bound covariance matrices). In total, the combination of , shuf , and ub ( Figure 2f) suggests that the rank one model of attention modulation of covariance A C is well justified. We applied this analysis to 21 recording sessions from the right hemisphere of one monkey ( Figure 2g). For most of the recording sessions is closer to ub than shuf . The averaged performance of all sessions for both hemispheres of two monkeys generally agreed with this trend (Figure 2h). We normalized and shuf by ub for each session to better compare different sessions that were subject to day-to-day variations outside of the experimenter's control, such as the task performance or the internal state of the monkey. To further validate our model we show the distribution of g i s computed from the entire data set ( Figure 3a). The majority of g i values are less than one, consistent with hCov A i trials < hCov U i trials ( Figure 1c). Further, there was little relation between the attentional modulation of firing rates, measured by r A i =r U i , and the attentional modulation of   covariance through g i (Figure 3b). This indicates that the circuit modulation of firing rates and covariance are not trivially related to one another (Doiron et al., 2016).
We additionally tested the validity of our model in Equation (2) with a leave-one-out cross-validation analysis (see Materials and methods: Leave-one-out cross-validation). We accurately predicted an omitted covariance C A ij (Figure 2i and j), consistent with our original analysis (Figure 2g and h). The individual session-by-session performance values for both the standard and leave-one-out setups are provided (Appendix: Model performance for all monkeys and hemispheres).
Finally, we investigated to what extent the actual value of the covariance gain g i of neuron i depends on the population of neurons in which it was computed. We solved the system of equations C A ij ¼ g i g j C U ij using covariance matrices computed from recordings from distinct sets of neurons, overlapping only by neuron i. This gives two estimates of g i , that nevertheless agreed largely with one another (Appendix: Low-dimensional modulation is intrinsic to neurons). This supported the hypothesis that covariance gain g i is an intrinsic property of neuron i.
The standard and cross-validation tests verify that the low-rank model of attentional modulation defined in Equation (2) explains between 66 and 82% (standard), or 56 and 77% (cross-validation) of the data. Taking this to be a positive result, we conclude that the covariance gain modulation depends largely on the modulation of individual neurons.

Network requirements for attentional modulation
Having described attentional modulation statistically our next goal is to develop a circuit model to understand the process mechanistically. Consider a network of N coupled neurons, and let the spike count from neuron i on a given trial be y i . The network output has the covariance matrix C with elements c ij ¼ Covðy i ; y j Þ. In this section we identify the minimal circuit elements so that the attentional mapping A C : C U 7 ! C A satisfies the following two conditions (on average): C1: c A ij ¼ g i g j c U ij ; attentional modulation of covariance is rank one (Figure 2). C2: g i < 1 ; spike count covariance decreases with attention ( Figure 1). What follows is only a sketch of our derivation (a complete treatment is given in Appendix: Network requirements for attentional modulation).
If inputs are weak then y i can be described by a linear perturbation about a background state (Ginzburg and Sompolinsky, 1994;Doiron et al., 2004;Trousdale et al., 2012): Here y iB is the background activity of neuron i, J ik is the coupling strength from neuron k to i, and L i is the input-to-output gain of neuron i. In addition to internal coupling we assume a source of external fluctuations i to neuron i. Here y i , y iB , and i are random variables that vary across trials. The trial-averaged firing rate of neuron i is r i ¼ hy i i=T (where hÁi denotes averaging over trials of length T). The background state has variability b i ¼ Varðy iB Þ which we assume to be independent across neurons, meaning the background network covariance is B ¼ diagðb i Þ. Finally, the external fluctuations have covariance matrix X with element Motivated by our analysis of population recordings ( Figure 2) we study attentional modulations that target individual neurons. This amounts to considering only A r : r U i 7 ! r A i and A L : L U i 7 ! L A i . Additionally, we assume that any model of attentional modulation must result in r A i > r U i (Figure 1b). A widespread property of both cortical pyramidal cells and interneurons is that an increase of firing rate r i causes an increase of input-output gain L (Cardin et al., 2007), thus we will also require L A > L U .
Spiking covariability in recurrent networks can be due to internal interactions (through J ik ) or external fluctuations (through i ), or both (Ocker et al., 2017). Networks with unstructured connectivity have internally generated covariability that vanishes as N grows. This is true if the connectivity is sparse (van Vreeswijk and Sompolinsky, 1998), or dense having weak synapses where J ik~1 =N (Trousdale et al., 2012) or strong synapses where J ik~1 = ffiffiffiffi N p combined with a balance between excitation and inhibition (Renart et al., 2010;Rosenbaum et al., 2017). In these cases spiking covariability requires external fluctuations to be applied and subsequently filtered by the network. We follow this second scenario and choose X so as to provide external covariability to our network.
Recent analysis of cortical population recordings show that the shared spiking variability across the population can be well approximated by a rank one model of covariability (Kelly et al., 2010;Ecker et al., 2014;Lin et al., 2015;Ecker et al., 2016;Rabinowitz et al., 2015;Whiteway and Butts, 2017) (we remark that Rabinowitz et al., 2015 analyzed the same data set that we have in Figures 1 and 2). Thus motivated we take the external fluctuations X to be rank one with x ij ¼ x i x j , reflecting a single source of global external variability with unit variance (neuron i receives i ¼ x i ). Combining this assumption with the linear ansatz in Equation (3) yields: where matrix K has element K ij ¼ L i J ij and L ¼ diagðL i Þ. We have also defined the vectors x ¼ ½x 1 ; . . . ; x N T and c ¼ ½c 1 ; . . . ; c N T with c i ¼ ððI À KÞ À1 LxÞ i . In total, the output covariability C will simply inherit the rank of the input covariability X. Attentional modulation affects c i through K and L and we easily satisfy condition C1 with g i ¼ c A i =c U i . What remains is to find constraints on J and the attentional modulation of L that satisfy condition C2. Let us consider the case where For the sake of mathematical simplicity let us separate the population into qN excitatory neurons and ð1 À qÞN inhibitory neurons (0 < q < 1). Let all excitatory (inhibitory) neurons project with synaptic strength J E (ÀJ I ), have gain L E (L I ), and receive the external inputs of strength x E (x I ). Finally, let the probability for all connections be p, and consider only weak connections (J / 1=N and N large) so that we can ignore the influence of polysynaptic paths in the network (Pernice et al., 2011;Trousdale et al., 2012). Then the attentional modulation of an excitatory neuron decomposes into: The first term is the direct transfer of the external fluctuations, and the second and third terms are indirect transfer of external fluctuations via the excitatory and inhibitory populations, respectively. Recall that L A À L U > 0, meaning that for c A E À c U E < 0 to be satisfied we require the third term to outweigh the combination of the first and second terms. In other words, the inhibitory population must experience a sizable attentional modulation. A similar cancelation of correlations by recurrent inhibition has been recently studied in a variety of cortical models (Renart et al., 2010;Tetzlaff et al., 2012;Ly et al., 2012;Doiron et al., 2016;Rosenbaum et al., 2017).
In the above we considered weak synaptic connections where J ij~1 =N. Rather, if we scale , as would be the case for classical balanced networks (van Vreeswijk and Sompolinsky, 1998), then for very large N the solution no longer depends upon the gain L. Finite N or the inclusion of synaptic nonlinearities through short term plasticity (Mongillo et al., 2012) may be necessary to satisfy condition C2 with large synapses. Furthermore, the large synaptic weights associated with do not allows us to neglect polysynaptic paths, as is needed for Equation (5). Extending our analysis to networks with balanced scaling will be the focus of future work.
In summary our analysis has identified two circuit features that allow recurrent networks to capture conditions C1 and C2 for attentional modulation. First, the network must be subject to a global source of external fluctuations that dominates network covariability (C1). Second, the network must have recurrent inhibitory connections that are subject to a large attentional modulation (C2).

Mean field model of attention
We next apply the intuition gained in the preceding section to propose a cortical model that captures key neural correlates of attentional modulation. We model V4 as a recurrently coupled network of excitatory and inhibitory leaky integrate-and-fire model neurons (Tetzlaff et al., 2012;Ledoux and Brunel, 2011;Trousdale et al., 2012;Doiron et al., 2004) (Figure 4a). In addition to recurrent synaptic inputs, each neuron receives private and global sources of external fluctuating input ( Figure 4b). The global noise is an attention-independent source of input correlation that the network filters and transforms into network-wide output spiking correlations (Figure 4c). (3) is well suited to study large networks of integrate-and-fire neurons driven by weakly correlated inputs (Tetzlaff et al., 2012;Ledoux and Brunel, 2011;Trousdale et al., 2012;Doiron et al., 2004), the analysis offers little analytic insight. Instead, we consider the instantaneous activity across population a : r a ðtÞ ¼ 1 Na P i yiaðtÞ, where y ia ðtÞ is the spike train from neuron i of population a and N a is the population size (a ¼ E or I). This approach reduces the model to just the two dynamic variables, the excitatory population rate r E ðtÞ and the inhibitory population rate r I ðtÞ (r E ðtÞ is shown in Figure 4d). Despite this severe reduction the model retains the key ingredients for attentional modulation identified in the previous sectionrecurrent excitation and inhibition combined with a source of global fluctuations.  We take the population sizes to be large and consider a phenomenological dynamic mean field (Tetzlaff et al., 2012;Ledoux and Brunel, 2011) of the cortical network (see Materials and methods: Mean field model):

While the linear response theory introduced in Equation
The function f a is the input-output transfer of population a, taken to be the mean firing rate for a fixed input ( Figure 4e for the E population and Figure 4f for the I population). The parameter J ab is the coupling strength from population b to population a. Finally, a and s a are the respective strengths of the mean input and the global fluctuation ðtÞ to population a (throughout ðtÞ has a zero mean). To simplify our exposition we take symmetric coupling J EE ¼ J IE J E and J EI ¼ J II J I and symmetric timescales t E ¼ t I ð¼ 1Þ. We set the recurrent coupling so that the model has a stationary mean firing rate ( r E ; r I ), about which ðtÞ induces fluctuations in r E ðtÞ and r I ðtÞ.
Attention is modeled as a top-down influence on the static input: a ¼ aB þ AD a . Here aB is a background input, the parameter A models attention with A ¼ 0 denoting the unattended state and A ¼ 1 the fully attended state, and D a > 0 is the increase in a due to attention. We note that the choice of representing the unattended state by A ¼ 0 and the attended state by A ¼ 1 is only due to convenience, and is not meant to make any statement about particular bounds on these states. In this model attention simply increases the excitability of all of the neurons in the network (Figure 4a). This modulation is consistent with the rank one structure of attentional modulation in the data (Figure 2), since a is a single neuron property. The attention-induced increase in ð E ; I Þ causes an increase in the mean firing rates ð r E ; r I Þ (red paths in Figure 4e,f), consistent with recordings from putative excitatory (McAdams and Maunsell, 2000;Reynolds et al., 1999) and inhibitory neurons (Mitchell et al., 2007) in visual area V4. Since f a is a simple rising function then there is a unique mapping of an attentional path in ð E ; I Þ space to a path in ð r E ; r I Þ space (Figure 4g).
In total, our population model has the core features required to satisfy Conditions C1 and C2 of the previous section. We next use our mean field model to investigate how attentional paths in ð r E ; r I Þ space affect population spiking variability.

Attention modulates population variability
The global input ðtÞ causes fluctuations about the network stationary state: r a ðtÞ ¼ r a þ dr a ðtÞ. The fluctuations dr a ðtÞ are directly related to coordinated spiking activity in population a. In particular, in the limit of large N a we have that V E Varðr E Þ / hCovðy i ; y j Þi, where the expectation is over ði; jÞ pairs in the spiking network. Thus, in our mean field network we require attentional modulation to decrease population variance V E .
For sufficiently small s a the fluctuations dr E ðtÞ and dr I ðtÞ obey linearized mean field equations (see Materials and methods: Mean field model, Equation (17)). The linear system is readily analyzed and we obtain the population variance V E computed over long time windows (see Materials and methods: Computing V E ): Here L a f 0 a is the response gain of neurons in population a. Equation (7) shows that V E depends directly on L a , and we recall that L a changes with attention (the slope of f a in Figure 4e,f). Thus, while the derivation of V E requires linear fluctuations about a steady state, attentional modulation samples the nonlinearity in the transfer f a by changing the state about which we linearize. Any attention-mediated change in V E is not obvious since both L A I > L U I and L A E > L U E , meaning that both the numerator and denominator in Equation (7) will change with attention.
We explore V E by sweeping over ( r E , r I ) space ( Figure 5a). When the network has high r E and low r I then V E is large, while V E is low for the opposite case of high r I and low r E . Along our attention path r E increases while V E decreases (Figure 5b), satisfying our requirements for attentional modulation. The attention path that we highlight is just one potential path that reduces population variability, however all paths which reduce V E share a large attention-mediated recruitment of inhibition. If we start with the unattended state (turquoise dot in Figure 5c) we can label all (D E > 0; D I > 0) points that have a smaller population variance than the unattended point (light green region in Figure 5c). These modulations all share that D I > D E (Figure 5c, green region is below the D E ¼ D I line). While the absolute comparison between D E and D I may depend on model parameters, a robust necessary feature of top-down attentional modulation is that it must significantly recruit the inhibitory population. This observation is a major circuit prediction of our model.
An intuitive way to understand inhibition's role in the decrease in population variance is through the stability analysis of the mean field equations. The eigenvalues of the linearized system are l 1 ¼ À1 À J I L I þ J E L E < 0 and l 2 ¼ À1 (see Materials and methods: Mean field model, Equation (18)). Note that the denominator of the population variance (Equation 7) equals the square of the eigenvalue product l 1 l 2 ¼ 1 þ J I L I À J E L E . The stability of the network activity is determined by l 1 ; the more negative l 1 , the more stable the point ð r E ; r I Þ, and the better the network dampens the perturbations about the point due to input fluctuations ðtÞ. The decrease of l 1 along the example attention path is clear (Figure 5d), and overcomes the increase in the numerator of V E due to increases in L E and L I . The enhanced damping is why V E decreases, explicitly seen in the steeper decline of the excitatory population autocovariance function in the attended compared to the unattended state ( Figure 5e). This enhanced stability due to recurrent inhibition is a reflection of inhibition canceling population variability provided by external fluctuations and recurrent excitation (Renart et al., 2010;Tetzlaff et al., 2012;Ozeki et al., 2009). Indeed, taking the coupling J to be weak allows the The eigenvalue ðlÞ along the attentional path. With increased attention it becomes more negative, indicating that the state ð r E , r I Þ is more stable. e, Autocovariance function of the excitatory population rate r E ðtÞ in the attended and unattended state (computed using Equation (19)). DOI: 10.7554/eLife.23978.007 expansion ð1 þ J I L I À J E L E Þ À2 » 1 þ 2J E L E À 2J I L I in Equation (7), so that the attention mediated increase in L I reduces population variance through cancellation, as in Equation (5). However, this expansion is not formally required to compute the eigenvalues l 1 and l 2 , and these measure the stability of the firing rate dynamics. We mention the expansion only to compare to the original motivation for inhibition.
The expression for V E given above (Equation 7) assumes a symmetry in the network coupling, namely that J EE ¼ J IE J E and J EI ¼ J II J I . This allowed V E to be compactly written, facilitating the analysis of how attention affects both the numerator and denominator of Equation (7). However, the linearization of the mean field equations and the subsequent analysis of population variability do not require this assumption (see Materials and methods: Mean field model Equations (18-20)). To explore the robustness of our main result we let J IE ¼ aJ E and J II ¼ bJ I , thereby breaking the coupling symmetry for a; b 6 ¼ 1. The reduction in V E with attention is robust over a large region of (a; b) ( Figure 6a, green region). Focusing on selected ða; bÞ pairings within the region where V E decreases shows that the attentional path identified for the network with coupling symmetry produces qualitatively similar behavior in the more general network (compare Figure 5c to  inhibitory mechanism for attention mediated reduction in population variability is robust to changes in the recurrent coupling with the network. While the reduced mean field equations are straightforward to analyze, a similar attenuation of pairwise covariance Covðy i ; y j Þ along the same attentional path occurs in the LIF model network (Appendix: Spiking network). Using linear response analysis for the spiking network we can relate the effect of inhibition to previous work in spiking networks (Renart et al., 2010;Tetzlaff et al., 2012;Ly et al., 2012;Doiron et al., 2016). In particular, the attention-mediated decrease of Covðy i ; y j Þ occurs for a wide range of timescale, ranging as low as 20 ms. However, for short timescales that match the higher gamma frequency range (approximately 60-70 Hz) this attentional modulation increases Covðy i ; y j Þ (Appendix 1-figure 6). This finding is consistent with reports of attention-mediated increases of neuronal synchrony on gamma frequency timescales (Fries et al., 2001;Buia and Tiesinga, 2008), particularly when inhibitory circuits are engaged (Kim et al., 2016).

Attention can simultaneously increase stimulus gain and decrease noise covariance
An important neural correlate of attention is enhanced stimulus response gain (McAdams and Maunsell, 2000). The previous section outlines how the recruitment of recurrent inhibitory feedback by attention reduces response variability. However, inhibitory feedback is also a common gain control mechanism, and increased inhibition reduces response gain through the same mechanism that dampens population variability (Sutherland et al., 2009). Thus it is possible that the decorrelating effect of attention in our model may also reduce stimulus response gain as well, which would make the model inconsistent with experimental data.
To insert a bottom-up stimulus s in our model we let the attention-independent background input have a stimulus term: aB ¼ k a s þ aB . Here k a is the feedforward stimulus gain to population a and aB is the background input that is both attention and stimulus independent. Our model captures a bulk firing rate r E rather than a population model with distributed tuning. Because of this the stimulus s should either be conceived as the contrast of an input, or the population conceived as a collection of identically-tuned neurons (i.e a single cortical column).
Straightforward analysis shows that the stimulus response gain of the excitatory population can be written as (Materials and methods: Computing stimulus response gain): If k E ¼ k I then G E / ffiffiffiffiffi ffi V E p , and thus any attentional modulation that reduces population variability will necessarily reduce population stimulus sensitivity. However, for k E > k I the second term in Equation (8) can counteract this effect and decouple stimulus sensitivity and variability modulations.
Consider the example attentional path (Figure 4g) with the extreme choice of k E ¼ 1 and k I ¼ 0. In this case attention causes an increase in G E (Figure 7a,b), while simultaneously causing a decrease in V E (Figure 5a,b). This is a robust effect, as seen by the region in ( r E ; r I ) space for which the change in V E from the unattended state is negative, and the change in G E is positive (green region, Figure 7c). Further, for fixed k I the proportion of the gray rectangle that the green region occupies increases with k E > k I (Figure 7d). Thus, the decoupling of attentional effects on population variability and stimulus sensitivity is robust to both attentional path (D E ; D I ) and feedforward gain (k E ; k I ) choices. The condition that k E > k I implies that feedforward stimuli must directly target excitatory neurons to a larger degree than inhibitory neurons (or at least the inhibitory neurons subject to attentional modulation). This gives us a complementary prediction to the one from the previous section: while top-down attention favors inhibitory neurons, the bottom-up stimulus favors excitatory neurons.
In total, our model of attentional modulation in recurrently coupled excitatory and inhibitory cortical networks subject to global fluctuations satisfies three main neural correlates of attention: (1) increase in excitatory firing rates and in (2) stimulus-response gain, with a (3) decrease in pairwise excitatory neuron co-variability.

Impact of attentional modulation on neural coding
Attention serves to enhance cognitive performance, especially on discrimination tasks that are difficult (Moore and Zirnsak, 2017). Thus, it is expected that the attention-mediated reduction in population variability and increase in stimulus response gain subserve an enhanced stimulus estimation (Cohen and Maunsell, 2009;Ruff and Cohen, 2014). In this section we investigate how the attentional modulation outlined in the previous sections affects stimulus coding by the population.
As mentioned above our simplified mean field model ( Equation 6) considers only a bulk response, where any individual neuron tuning is lost. As such a proper analysis of population coding is not possible. Nonetheless, our model has two basic features often associated with enhanced coding, decreased population variability ( Figure 5) and increased stimulus-response gain (Figure 7).
Fisher information (Averbeck et al., 2006;Beck et al., 2011) gives a lower bound on the variance of a stimulus estimate constructed from noisy population responses, and is an often used metric for population coding. The linear Fisher information (Beck et al., 2011) FI EI computed from our twodimensional recurrent network is: Here V a ¼ Varðr a Þ, G a ¼ d r a =ds, and C EI ¼ Covðr E ; r I Þ. The important result is that FI EI is invariant with attention, meaning that attention does not increase the network's capacity to estimate the stimulus s.
While the proof of Equation (9) is straightforward and applies to our recurrent excitatory-inhibitory population (see Materials and methods: Fisher information), the invariance of the total information F EI with attention is most easily understood by analogy with an uncoupled, one-dimensional Black lines are iso-lines of covariance and gain, along which those quantities do not change. (d) Percent area of the green region in c out of a constant rectangle, as the feedforward stimulus gain k E increases, with k I ¼ 0:2 held constant. DOI: 10.7554/eLife.23978.009 excitatory population (Figure 8a). Without coupling, the input to the population is simply k E s þ s E ðtÞ, which is then passed through the firing rate nonlinearity f E . In this case the gain is G E ¼ k E L E , and assuming a linear transfer the population variance is V E ¼ s 2 E L 2 E . In total the linear Fisher information from the uncoupled population is then: The proportion L 2 E by which attention increases the squared gain (Figure 8a, top) is exactly matched by the attention related increase in population variance (Figure 8a, bottom), resulting in cancellation of any attention-dependent terms in FI E . The majority of projection neurons in the neocortex are excitatory, so we now consider the stimulus estimation from a readout of only the excitatory population. Combining our previous results we obtain: Restricting the readout to be from only the excitatory population drastically reduces the total information (compare FI EI to FI E in Figure 8c). As with the uncoupled population the response gain G E of the excitatory neurons in the coupled population increases with attention (Figure 8b, top). Yet unlike the uncoupled population the net input variability to the E population is reduced by attention through a cancelation of the external variability ðtÞ via inhibition (Figure 8b, bottom). These two components combine so that despite FI E < FI EI , we have that FI E does increase with attention ( Figure 8c). In sum, even though the total stimulus information in the network does not change with attention, the amount of information extractable from the excitatory population increases, which could lead to improved downstream stimulus estimation in the attended state.

Discussion
Using population recordings from visual area V4 we identified rank one structure in the mapping of population spike count covariability between unattended and attended states. We used this finding to motivate an excitatory-inhibitory cortical circuit model that captures both the attention-mediated increases in the firing rate and stimulus response gain, as well as decreases in noise correlations. Our model accomplishes this with only an attention dependent shift in the overall excitability of the cortical population, in contrast to a scheme where distinct biophysical mechanisms would be responsible for respective firing rate and noise correlations modulations. The model makes two key predictions about how stimulus and modulatory inputs are distributed over the excitatory-inhibitory cortical circuit. First, top-down attentional signals must affect inhibitory neurons more than excitatory neurons to allow a better damping of global fluctuations in the attended state. Second, bottom-up stimulus information must be biased towards excitatory cells to permit higher gain in the attended state. In total, the increased response gain and decreased correlations enhance the flow of information when the readout is confined to the excitatory population.

Candidate physiological mechanisms for attentional modulation
Our model does not consider a specific type of inhibitory neuron, and rather models a generic recurrent excitatory-inhibitory circuit. However, inhibitory circuits in cortex are complex, with at least three distinct interneuron types being prominent in many areas: parvalbumin-(PV), somatostatin-(SOM), and vasointestinal peptide-expressing (VIP) interneurons (Rudy et al., 2011;Pfeffer et al., 2013;Kepecs and Fishell, 2014). In mouse visual cortex, both SOM and PV cells form recurrent circuits with pyramidal cells, with PV cells having stronger inhibitory projections to pyramidal cells than those of SOM cells (Pfeffer et al., 2013). Furthermore, PV and SOM neurons directly inhibit one another, with the SOM to PV connection being stronger than the PV to SOM connection (Pfeffer et al., 2013). Finally, VIP cells project strongly to SOM cells (Pfeffer et al., 2013) and are activated from inputs outside of the circuit (Lee et al., 2013;Fu et al., 2014), making them an attractive target for modulation. Recent studies in visual, auditory, and somatosensory cortical circuits show that VIP cell activation provides an active disinhibition of pyramidal cells via a suppression of SOM cells (Kepecs and Fishell, 2014). Basal forebrain (BF) stimulation modulates both muscarinic and nicotinic ACh receptors (mAChRs and nAChRs respectively) in a fashion that mimics attentional modulation (Alitto and Dan, 2012). In particular, the recruitment of VIP cell activity in vivo through BF stimulation is strongly dependent on both the muscarinic and nicotinic cholinergic pathways (Alitto and Dan, 2012;Kuchibhotla et al., 2017;Fu et al., 2014), and it has thus been hypothesized VIP cells activation could be an important component of attentional modulation (Alitto and Dan, 2012;Poorthuis et al., 2014).
If we consider the inhibitory population in our model to be PV interneurons then the recruitment of VIP cell activity via top-down cholinergic pathways is consistent with our attentional model in two ways. First, activation of the VIP ! SOM ! pyramidal cell pathway provides a disinhibition to pyramidal cells, modeled simply as an overall depolarization to pyramidal cells in the attended state ( Figure 4). Second, the activation of the VIP ! SOM ! PV cell pathway disinhibits PV cells, and the strong SOM ! PV projection would suggest that the disinhibition is sizable as required by our model (Figure 5c). Finally, a recent study in mouse medial prefrontal cortex reports that identified PV interneurons show an attention related increase in activity, and that optogenetic silencing of PV neurons impairs attentional processing (Kim et al., 2016).
However, our logic is perhaps overly simplistic and neglects the direct modulation of SOM cells via muscarinic and nicotinic cholinergic pathways (Alitto and Dan, 2012;Kuchibhotla et al., 2017) that could compromise the disinhibitory pathways. Further, there is evidence of a direct ACh modulation of PV cells (Disney et al., 2014) as opposed to through a disinhibitory pathway. Finally, there may be important differences across both species (mouse vs. primate) and visual area (V1 vs. V4) that fundamentally change the pyramidal, PV, SOM, and VIP circuit that is understood from mouse V1 (Pfeffer et al., 2013). Future studies in the inhibitory to excitatory circuitry of primate visual cortex, and its attentional modulation via neuromodulation, are required to navigate these issues.
Finally, the simultaneous increase in response gain and decrease in noise correlations with attention requires excitatory neurons to be more sensitive to bottom-up visual stimulus than inhibitory neurons (k E > k I , Figure 7). In mouse visual cortex, GABAergic interneurons show overall less stimulus selectivity than pyramidal neurons (Sohya et al., 2007), however this involves both direct feedforward and recurrent contributions to stimulus tuning. While our model simplified the feedforward stimulus gain k E and k I to be constant with attention, it is known that attention also modulates feedforward gain through presynaptic nACh receptors (Disney et al., 2007). Notably, nAChRs are found at thalamocortical synapses onto layer 4 excitatory cells and not onto inhibitory neurons, suggesting that k E would increase with attention while k I would not. Thus, k E should also increase with attention while k I should not, further supporting that k E > k I .

Modeling global network fluctuations and their modulation
Our model considered the source of global fluctuations as external to the network. This choice was due in part to difficulties in producing global, long timescale fluctuations through strictly internal coupling (Renart et al., 2010;Rosenbaum et al., 2017). Our model assumed that the intensity of these external input fluctuation were independent of attention. Rather, attention shifted the operating point of the network such that the transfer of input variability to population-wide output activity was attenuated in the attended state.
Recent analysis of population recordings show that generative models of spike trains that consider gain fluctuations in conjunction with standard spike emission variability capture much of the variability of cortical dynamics (Rabinowitz et al., 2015;Lin et al., 2015). Further, these gain fluctuations are well approximated by a one-dimensional, global stochastic process affecting all neurons in the population (Ecker et al., 2014;Rabinowitz et al., 2015;Lin et al., 2015;Ecker et al., 2016;Engel et al., 2016;Whiteway and Butts, 2017). When these techniques are applied to population recordings subject to attentional modulation, the global gain fluctuations are considerably reduced in the attended state (Rabinowitz et al., 2015;Ecker et al., 2016). Our assumption that external input fluctuations to our network are attention-invariant is consistent with this statistical analysis since it is necessarily constructed from only output activity. Nevertheless, another potential model is that the reduction in population variability is simply inherited from an attention-mediated suppression of the global input fluctuations. Unfortunately, it is difficult to distinguish between these two mechanisms when restricted to only output spiking activity. However, a model where output variability reductions are simply inherited from external inputs suffers from two criticisms. First, it begs the question: what is the mechanism behind the shift in input variability? Second, our model requires only an increase in the external depolarization to excitatory and inhibitory populations to account for all attentional correlates. An inheritance model would necessarily decouple the attentional mechanisms behind increases in network firing rate (still requiring a depolarization) and the decrease in global input variability. Thus, our model offers a parsimonious and biologically motivated explanation of these neural correlates of attention. Further work dissecting the various external and internal sources of variability to cortical networks, and their attentional modulation, is needed to properly validate or refute these different models.

Attentional modulation of neural coding through inhibition
Our network model assumed attention-invariant external fluctuations and weak recurrent inputs, permitting a linear analysis of network activity. As a consequence the linear information transfer by the entire population was attention-invariant (Figure 8), because attention modulated the network's transfer of signal and noise equivalently. However, this invariance was only apparent if the decoder had access to both the excitatory and inhibitory populations. However, most of the neurons in cortex that project between areas are excitatory. When the decoder was restricted to only the activity of the excitatory population then our analysis uncovered two main results. First, the excitatory population carried less information than the combined excitatory-inhibitory activity, suggesting an inherently suboptimal coding scheme used by the cortex. Second, the attention-mediated modulation of the inhibitory neurons increased the information carried by the excitatory population. This agrees with the wealth of studies that show that attention improves behavioral performance on stimulus discrimination tasks.
Determining the impact of population-wide spiking variability on neural coding is complicated (Averbeck et al., 2006;Kohn et al., 2016). A recent theoretical study has shown that noise correlations that limit stimulus information must be parallel to the direction in which population activity encodes the stimulus (Moreno-Bote et al., 2014). The fluctuations in our network satisfy this criteria, albeit trivially since all neurons share the same stimulus input. Indeed, in our network the external inputs appear to the network as s þ xðtÞ, meaning that fluctuations from the noise source xðtÞ are indistinguishable from fluctuations in the stimulus s. This is an oversimplified view and assumes that the decoder treats the neurons as indistinguishable from one another, at odds with classic work in population coding (Pouget et al., 2000). Extending our network to include distributed tuning and feature-based recurrent connectivity is a natural next step (Ben-Yishai et al., 1995;Rubin et al., 2015). To do this the spatial scales of feedforward tuning, recurrent projections, external fluctuations, as well as attention modulation must all be specified. It is not clear how noise correlations will depend on these choices yet work in spatially distributed balanced networks shows that solutions can be complex .
The role of inhibition in shaping cortical function is a longstanding topic of study (Isaacson and Scanziani, 2011), including recent work showing inhibition can actively decorrelate cortical responses (Renart et al., 2010;Tetzlaff et al., 2012;Ly et al., 2012). Our work gives a concrete example of how this decorrelation can be gated and used to control the flow of information. Of interest are tasks that probe a distributed population where attention again decreases noise correlations between neurons with similar stimulus preference, yet increases noise correlations between cells with dissimilar stimulus preference (Ruff and Cohen, 2014). The circuit mechanisms underlying this neural correlate of attention are unclear. However, there is ample work in understanding how recurrent inhibition shapes cortical activity in distributed populations (Isaacson and Scanziani, 2011), including in models of attentional circuits (Ardid et al., 2007;Buia and Tiesinga, 2008). Adapting our model to include distributed tuning is an important next step and will be a better framework to discuss the coding consequences of the attentional modulation circuits proposed in our study.

Methods and materials Data preparation
Data was collected by from two rhesus monkeys with microelectrode arrays implanted bilaterally in V4 as they performed an orientation-change detection task (Figure 1a) (Cohen and Maunsell, 2009). All animal procedures were in accordance with the Institutional Animal Care and Use Committee of Harvard Medical School. Two oriented Gabor stimuli flashed on and off several times, until one of them changed orientation. The task of the monkey was to then saccade to the stimulus that changed. Each recording session consisted of at least four blocks of trials in which the monkey's attention was cued to the left or right. We excluded from the analysis instruction trials which occurred at the start of each block to cue the monkey to one side to attend to, catch trials in which the monkey was rewarded just for fixating, and trials in which the monkey did not perform the task correctly. Moreover, the first and last stimulus presentations in each trial were not analyzed, to prevent transients due to stimulus appearance or change from affecting the results. The total number of trials included in the analysis from all the recording sessions was 42; 496. Each trial consisted of between 3 and 12 stimulus presentations, of which all but the first and last were analyzed.
Recordings from the left and right hemispheres of each monkey were analyzed separately because the activities of the neurons in opposite hemispheres had near-zero correlations (Cohen and Maunsell, 2009). Neurons in the right hemisphere were considered to be in the attended state when the attentional cue was on the left, and vice-versa. We note that because our criteria for choosing which trials and units to analyze were based on different needs for data analysis compared to the original study (Cohen and Maunsell, 2009) the specific firing rates and covariances differ quantitatively from those previously reported.
In monkey 1, an average of 51:1 (min 35, max 80) units were analyzed from the right hemisphere, and an average of 27:5 (min 14, max 56) units were analyzed from the left hemisphere. From monkey 2, an average of 56:6 (min 43, max 71) units from the right hemisphere, and an average of 37:7 (min 32, max 46) units from the left hemisphere were analyzed. From each recording, spikes falling between 60 and 260 ms from stimulus onset were considered for the firing rate analysis, to account for the latency of neuronal responses in V4.

Comparing change in covariance to change in variance
Let S U be the matrix containing spike counts of the neurons on trials in which they are in the unattended state, and S A the matrix containing spike counts of the neurons on trials in which they are in the attended state. Denote the unattended spike count covariance matrix by C U ¼ CovðS U Þ, and the attended one by C A ¼ CovðS A Þ. Attentional changes in covariance and variance were measured both on average (Figure 1c) and as distributions (Figure 1d). The distributions of the normalized differences reveal a concentration of negative covariance changes, and a distribution of variance changes symmetric about zero. Here, Cov A and Cov U (Var A and Var U ) are vectors containing covariance (variance) values of the entire data set. Note that the distributions are bounded between À2 and 2 by construction.

Solving systems of equations by error minimization
When solving systems of the form of Equation (2) in order to quantify the fit of the model, a nonlinear equation solver (fminunc) in MATLAB was used. The solver found minima of an objective function which we defined as the Euclidean norm of the difference of the approximation of the attended covariance matrix and the original attended covariance matrix, in other words, the error of the approximation: f ðg 1 ; :::;

Shuffled covariance matrices
For finite population sizes (N < ¥) we expect our algorithm to extract some low-rank structure between arbitrary covariance matrices. Let ffiffiffiffiffiffi C A p be the principal square root of the attended covariance matrix, the unique positive-semidefinite square root of a positive-semidefinite matrix. Consider the symmetric matrix D ¼ permð ffiffiffiffiffiffi C A p Þ computed from the a random permutation of the upper-triangular entries of ffiffiffiffiffiffi C A p . Finally, let C A shuf ¼ realðDDÞ. The square root-permutation-squaring procedure guarantees a positive-semidefinite matrix, as the square of any matrix is positive-semidefinite. Shuffling removes any relation between C U and C A shuf , and any remaining detected structure would be due to finite sampling. The shuffled covariance gainĝ shuf provides the prediction C A shuf :¼ĝ shufĝ T shuf C U , and shuf measures the relation betweenĈ A shuf and C A shuf . Synthetic data shows that as population size N becomes large the coefficient shuf approaches 0 (Appendix: Detected structure in random covariance matrices is a finite-size effect).

Upper bound covariance matrices
The covariance matrices C U and C A are estimates obtained from a finite number of trials, and any estimation error will compromise the ability to detect rank one structure of A C . Here we outline an upper bound for the model performance based on a finite number of trials over which the covariance matrices were originally estimated. LetĈ A :¼ĝĝ T C U withĝ minimizing the L 2 norm of C A :¼ gg T C U . We remark thatĈ A perfectly decomposes according to the statistical model in Equation (2). We usedĈ A to generate an artificial set of N correlated Poisson spike counts, using an algorithm based on a latent multivariate gaussian model (Macke et al., 2009). We sampled these population spike counts with a fixed number of trials (M) with D be the resulting M Â N matrix of Poisson samples for each process. Let C A ub ¼ CovðDÞ be the 'upper bound' covariance matrix: a finite trial sampling approximation to the perfectly decomposable matrixĈ A . Finally, we employ our algorithm to giveĈ A ub :¼ĝ ubĝ T ub C U , where the vectorĝ ub minimizes the L 2 norm of the error. SinceĈ A is perfectly decomposable then for M ! ¥ we haveĈ A ub ¼ C A ub ¼Ĉ A . Thus in the large M limit the coefficient ub between elements ofĈ A ub and C A ub converges to 1 (Appendix: Performance limited by available number of trials). However, for finite M we have that ub < 1, solely due to inaccuracies in estimatingĈ A with C A ub . To account for the possibility of particular strings of realizations D introducing random biases into C A ub , we performed the following analysis on 10 independently generated upper-bound covariance matrices C A ub .

Leave-one-out cross-validation
Instead of solving the system consisting of all Equations (2), we remove one of them. Denote the complete set of equations by S, an individual equation as s ij :¼ fC A ij ¼ g i g j C U ij g and the set of equations with one of them removed as S ab :¼ S À s ab . We then solve the system S ab . Denote the solution by g ab . We can then compare C A ab andĈ A ab ¼ g ab ðaÞg ab ðbÞC U ab . We do this for maxð1000; NðN À 1Þ=2 possible systems S ab . The of the vector of resulting C A ab vsĈ A ab values is a measure of how well the system can predict one of its elements, or in other words, how well the structure holds together when one element is taken out. This leave-one-out cross-validation was performed for the shuffled and the upper-bound cases as well.

Mean field model
The mean spiking activity over the population a ð¼ E or IÞ is where y ia ðtÞ ¼ P nia j¼1 dðt À t j ia Þ is the spike train of excitatory neuron i of population a, n ia is the number of spikes from that neuron, and t j ia is the time of spike j. We follow previous studies (Tetzlaff et al., 2012;Ozeki et al., 2009;Ledoux and Brunel, 2011) and consider the firing rate dynamics of the E and I populations given by the system in Equations (6): Here aB is the attention independent drive to population a, A 2 ½0; 1 is the attention variable, and D a is the maximal drive to population a due to attention. The parameter J ab is the coupling from population b to populations a. The stochastic processes x E ðtÞ, x I ðtÞ, and xðtÞ are the global fluctuations applied to the network. The excitatory and inhibitory populations have private fluctuations x a ðtÞ and also common fluctuations xðtÞ given to both populations; the parameter scales the degree of private versus common fluctuations. We perform calculations for arbitrary and then take ! 1 to match the system given in Equations (6). The total intensity of fluctuations to population a is set by s a . These simplified rate equations give an accurate picture of the long-timescale dynamics of networks of coupled spiking neuron models that are in the fluctuation driven regime (Ledoux and Brunel, 2011). The operative timescale reflects a combination of synaptic and membrane integration; since we are interested in spiking covariance over time windows that are much longer than these, we take them to be unity for simplicity.
To give a quantitative match between the equilibrium statistics of the rate equations and the leaky integrate-and-fire (LIF) network simulations we take the transfer function f to be the inverse first passage time of an LIF neuron driven by white noise (Ledoux and Brunel, 2011): The parameter h a is the intensity of the external fluctuations given to the LIF neurons (Appendix: Spiking model). The membrane timescale t gives the dimensions of 1/s to the firing rate r a . The parameter V T denotes spike threshold while V R is the reset potential. Model parameters are given in Table 1.
If the input fluctuations, xðtÞ, x E ðtÞ, and x I ðtÞ are white noise processes then the nonlinearity in f makes the stochastic dynamics of r E ðtÞ and r I ðtÞ complicated (non-diffusive). To simply the analysis we consider xðtÞ as the limiting process from: for t x ! 0, with h x ðtÞi ¼ 0 and h x ðtÞ x ðt 0 Þi ¼ dðt À t 0 Þ. This makes xðtÞ sufficiently smooth in time (the same is true for x E ðtÞ and x I ðtÞ).
We restrict the coupling J ab such that for s a ¼ 0 the equilibrium point ð r E ; r I Þ is stable and given by: For sufficiently small s a the fluctuations in population activity about the equilibrium firing rate, dr a ðtÞ ¼ r a ðtÞ À r a , obey the linearized stochastic system: Here L a ¼ dfa dI j I¼I eff a is the slope of the transfer function f a evaluated at the equilibrium point I eff a ¼ a þ AD a þ J aE r E À J aI r I . Equation (17) is a two dimensional Ornstein-Uhlenbeck process (Gardiner, 2004) that is readily amenable to analysis.

Computing V E
In matrix form the system Equation (17) is written as: Here dr ¼ ½dr E ; dr I , x ¼ ½x E ; x I ; x, and The stationary autocovariance function is computed as: where s is a time lag and S ¼ ðDetMÞDD is the variance matrix (Det and Tr denote the determinant and trace operations, respectively). Here, 1 is the 2 Â 2 identity matrix.
The covariance between populations a and b over long time scales is given by where the integration is performed over the appropriate element of the matrixCðsÞ. In particular, the long timescale variance of the excitatory population is given by (after some algebra): We remark that the long timescale covariance matrix can alternatively be computed from C ¼ M À1 D½M À1 D T (Gardiner, 2004). To obtain the compact expression for V E we have assumed symmetric coupling: J I :¼ J EI ¼ J II , J E :¼ J EE ¼ J IE , and ! 1. These are not required for the main results of our study and merely ease the analysis of equations.

Computing stimulus response gain
We decompose aB ¼ k a s þ aB and define the gain of population a to stimulus s as G a ¼ d ra ds ¼ L a dIa ds . The term dIa ds is obtained by differentiating Equations (16)) with respect to s: dI a ds ¼ k a þ J E G E À J I G I : Solving the system of two equations for G E yields: For the sake of compactness we set s E ¼ s I to obtain the result in Equation (8).

Fisher information
Linear Fisher Information depends on the stimulus response gains and covariance matrix of the excitatory and inhibitory populations: When the input correlation 0 < 1 we have: and Inserting these expressions and those for G E and G I into Equation (23) and simplifying yields: We remark that FI EI is independent of L E and L I and thus independent of attentional modulation. Notice that we have re-introduced the correlation constant into the equations, rather than only considering the limit ! 1. If ¼ 1, the excitatory and inhibitory populations are receiving completely identical noise. If this is the case, the correlation cancellation would be perfect, leading to infinite informational content, as can be seen in Equation (27).
We tackle this question by dividing a set of N neurons into k sets S ð1Þ i ; S ð2Þ i ; :::; S ðkÞ i of m ðN þ 1Þ=2 neurons each that all contain the neuron n i (m N=2 þ 1 if N is originally even). As an example take k ¼ 2 and consider the set of neurons n 1 ; :::; n 2iÀ1 partitioned into two subsets S ð1Þ i ¼ fn 1 ; :::; n i g and S ð2Þ i ¼ fn i ; :::; n 2iÀ1 g (Appendix 1-figure 5a). We solve Equation (1) using the systems of equations obtained from S ð1Þ i and S ð2Þ i , and obtain two solutions g ð1Þ i and g ð2Þ i . We take the variance of the g-estimations as a metric for how closely the different subsets can estimate an intrinsic value of g. A higher variance would indicate a poorer convergence, and therefore a lower degree of independence from other neurons.
Appendix 1- figure 5b shows the spread of g-estimates from one dataset for the data, as well as the upper (UB) and lower (shuf) bounds. This spread includes estimates for all gvalues for all neurons. The spread in the shuffled case (SEM¼ 7:42) is largest by two orders of magnitude, and the spread of the upper bound (SEM¼ 2:60 Â 10 À3 ) is only one order of magnitude tighter than that of the data (SEM¼ 1:03 Â 10 À2 ), so this case is close to ideal.
Appendix 1-figure 4. Performance of leave-one-out cross-validation on model on data from individual recording sessions from the left hemisphere of Monkey 1, and both hemispheres of Monkey 2. The format and colors match that described in Figure 2 i . (b) Spread of g estimates for the data (black), as well as the upper (blue) and lower (green) bounds, from one day of recordings in one monkey. (c) Mean variance of the g estimates computed from the data (abscissa) vs from the upper bound (ordinate), normalized by the mean shuffled variance. Each color denotes one of the monkeys, circles denote the right hemisphere recordings, and plusses denote the left hemisphere recordings. The gray regions consist of those points that are beyond 0:5, and therefore closer to the lower bound than the upper bound. DOI: 10.7554/eLife.23978.016 For each data set, the analysis is done for each neuron for 100 different permutations of the neurons to generate S ðkÞ i , k ¼ 1; :::; 100. For shuffled and upper-bound analysis, 10 shuffles or Poisson realizations, and 10 permutations were used. In all cases there was a total of 100 Â #neurons points. Appendix 1-figure 5c shows an overview of the performance for all datasets. The abscissa is the mean variance of the g-estimates computed from the data, normalized by the mean variance computed from the shuffled data: 'poiss' subscript denotes averaging over each Poisson realization of the upper bound covariance matrix. We chose to normalize the mean data and upper-bound variances by the mean shuffled variance so that a value of 1 would mean equality to the lower bound, meaning the only detected structure comes from finite-size effects, and a value of 0 would mean perfect convergence of the g-estimates. The gray regions are a visualization for the points which are closer to 1 than 0 (values above 0:5) on the log-axes. Most of the data unsurprisingly falls below the diagonal, so the variance is greater for the data than the upper bound. Less trivially, most of the data falls outside of the gray regions, and are much closer to 0 than 1, indicating excellent performance. This implies a structure in the modulation of the (unshuffled) covariance matrices that is preserved over analysis in the contexts of different groups of other neurons. In other words, attention modulates the individual neurons to a large extent independently, in a low-dimensional manner.
In this section we study a network of N neurons with the spike train output from neuron i being y i ðtÞ ¼ P k dðt À t ik Þ where t ik is the k th spike time from neuron i. We consider multiple trials of the discrimination experiment and model the spike train only over a time period t 2 ð0; TÞ, where we assume that the spike trains to have have reached equilibrium statistics. We abuse notation and take the spike count from neuron i over a trial as y i ¼ R T 0 y i ðtÞdt. The trial-to-trial covariance matrix of the network response is C with element c ij ¼ Covðy i ; y j Þ.
To analyze the network activity we first assume that each spike train is simply perturbed about a background state and employ the linear response ansatz (Ginzburg and Sompolinsky, 1994;Doiron et al., 2004;Trousdale et al., 2012) : Here, J ik is the synaptic coupling from neuron k to neuron i (proportional to the synaptic weight), and i is a fluctuating external input given to neuron i. The background state of neuron i is y iB , and it represents the stochastic output of a neuron that is not due to the recurrence from the network ðJ ¼ 0Þ or the external input ( i ¼ 0). Finally, L i is the input to output gain of a neuron i. In this framework, y i , y iB , and i are random variables, while L i and J ik are parameters that describe the intrinsic and network properties of the system. Without loss of generality we take hy iB i ¼ 0, h i i ¼ 0, making hy i i ¼ 0 a solution for the mean activity. We remark that formally Equation (28) is incorrect as written; y i is a random integer while, for instance, L i J ik y k need not be an integer. Equation (28) is only correct upon taking an expectation (over trials) of y i .
Here we derive the requirements for external fluctuations and internal coupling for network covariability C to satisfy the following two conditions (on average): C1: c A ij ¼ g i g j c U ij ; attentional modulation of covariance is rank one.
It is convenient to write Equation (28) in matrix form and isolate for the population response:ỹ Hereỹ ¼ ½y 1 ; . . . y N T with similar notation forỹ B and. The matrix K has element K ij ¼ L i J ij , while L ¼ diagðL i Þ and I is the identity matrix. Using Equation (29) we can express the covariance matrix C ¼ hỹỹ T i as: where T denotes the transpose operation. Here B ¼ hỹ Bỹ T B i is the background covariance, which we take to be simply B ¼ diagðb i Þ. The input covariance matrix is X ¼ h T i with elements x ij . In the above we assumed that hỹ B T i ¼ 0, meaning that the background state is uncorrelated with the external noisy input.
It is clear that C naturally decomposes into two terms. The first term represents the correlations that are internally generated within the network, via the direct synaptic coupling K acting upon the background state B. The second term is how the direct synaptic coupling K filters the externally applied correlations X.

Satisfying C1
The background matrix B is a diagonal matrix and is hence rank N. The high rank B combined with attentional modulations of both B and K make it impossible to satisfy condition C1. If the spectral radius of K is less than 1, then we can expand I À K ð Þ À1 ¼ I þ P ¥ n¼1 K n (Pernice et al., 2011;Trousdale et al., 2012). Inserting this expansion into the expression for the internally generated covariability yields: Extracting the covariance between neuron i and j (i 6 ¼ j) due to internal coupling within the network gives: If we take J ij~1 =N and the network connectivity to be dense (meaning the connection probability is~Oð1Þ) then each term is Oð1=NÞ. So long as the spectral radius of K is less than one then the series converges and as N ! ¥ we have that c ijB vanishes (Pernice et al., 2011;Trousdale et al., 2012;Helias et al., 2014).
This argument can be extended to networks with J ij~1 = ffiffiffiffi N p when combined with a balance condition between recurrent excitation and inhibition. Such networks also produce an asynchronous state where c ijB~1 =N, vanishing in the large N limit (Renart et al., 2010). However, formally balanced networks in the asynchronous state with N ! ¥ have solutions that do not depend on the firing rate transfer L. The attention dependent modulation A L : L U ! L A is a critical component of our model and care must be taken in ensuring that In contrast, the external covariance X is not a diagonal matrix, so that the contributions from external fluctuations to C scale as N 2 J 2 . This is Oð1Þ for J / 1=N. Thus, while the terms in X must be weak for the linear approximation in Equation (28) to hold, they need not vanish for large N. Indeed, for moderate X and large network size it is reasonable to ignore the contribution of internally generated fluctuations to C. Recent analysis of cortical population recordings show that the shared spiking variability across the population can be well approximated by a rank one model of covariability (Ecker et al., 2014;Lin et al., 2015;Ecker et al., 2015;Rabinowitz et al., 2015). Thus motivated, we take the external fluctuations X ¼ xx T where x ¼ ½x 1 ; . . . ; x N T . In total, we have for large N the approximation: Hence C is rank one matrix with c ¼ ðI À KÞ À1 Lx ¼ ½c 1 ; . . . ; c N T . It is trivial to satisfy condition C1 with g i ¼ c A i =c U i .

Satisfying C2
We again use the expansion I À K ð Þ À1 ¼ I þ P ¥ n¼1 K n . Truncating this expansion at n ¼ 1 yields an approximation considering only synaptic paths of length one in the network, and neglecting higher order paths. This is appropriate for J ij sufficiently small. Truncating after inserting the expansion into Equation (30) yields the following approximation for c: hy i ðtÞy j ðt À sÞidt À r i r j : For simulations, we measure the population-averaged spike train cross-covariance function QðsÞ ¼ N E ðN E À 1Þ ð Þ À1 P NE i;j¼1;i6 ¼j q ij ðsÞ by average a randomly chosen subsample of 100 spike train cross-covariances from pairs of neurons in the same cluster.
In order to calculate the covariance of neuron i and j's spike counts in windows of length T, n T i and n T j , we use the relation Cov n T i ; n T j hn T i n T j i À hn T i ihn T j i ¼ Z T ÀT q ij ðsÞ T À s j j ð Þ The cross-correlation of input currents was averaged over the same random subsample of the network as the spike train covariances. Current cross-correlations were normalized so that each current's autocorrelation at zero lag was 1.

Spiking network analysis
The LIF model simulates voltages and produces spike trains, from which we can compute firing rates and covariances. Appendix 1-figure 6a,b show example voltage traces of individual excitatory neurons, with the spikes they produce shown above. Note that in the attended state, more spikes are produced, corresponding to a higher firing rate. Appendix 1-figure 6c,d show rasters for all the neurons in the unattended (c) and attended (d) states. Higher firing rates can be observed, especially for the inhibitory neurons. Averaging the spike trains over the excitatory population gives us the PSTH of the excitatory neurons. Appendix 1figure 6e, left shows the unattended (turquoise) and attended (orange) PSTH smoothed with a sliding Gaussian window with width (std dev) 10 ms. The histograms on the right demonstrate the decrease in population variance with attention.
attended (orange) states. Right: frequency distributions of population-averaged firing rates. (f) Mean pairwise spike count covariance for different counting windows. Other than an increase in synchrony on very small timescales due to gamma oscillations, the spike count covariance decreases with attention regardless of counting window. (g) Ratio R Cov of attended and unattended spike count covariance, as a function of counting window. (h, i) Derived (solid turquoise) and simulated (muted turquoise) spike train cross-covariance functions of excitatory neurons in the unattended (h) and attended (i) states, averaged over pairs. (j) Spike train cross-covariance functions of excitatory neurons in the unattended and attended states, normalized to peak at 1. (k, l) Normalized input current cross-correlation functions of excitatory inputs to pairs of neurons (dashed green), inhibitory inputs to pairs of neurons (dashed red), excitatory and inhibitory inputs to pairs of neurons (blue), and summed excitatory and inhibitory recurrent inputs to pairs of neurons (black), in the unattended (k) and attended (l) states. (m) Attended (orange) vs unattended (turquoise) recurrent input cross-correlation functions. The excitatory cross-correlation function is narrower, just as for the output cross-covariance function, so the effects are happening on the level of inputs. DOI: 10.7554/eLife.23978.017 The spiking model provides the opportunity to directly compute the pairwise spiking covariance, in addition to the population variance. Appendix 1- figure 6f shows the pairwise spike count covariance computed over counting windows from 0 to 200 ms. For small counting windows, corresponding to high-frequency correlations, neurons in the attended state have slightly higher spike count covariance. This is consistent with the slightly higher peak in the attended autocovariance function from the mean-field theory ( Figure 4e, main text), as well as experimental results (Fries et al., 2001). For counting windows greater than 30 ms, the spike count covariance notably decreases with attention. The experiments we are modeling (Cohen and Maunsell, 2009) measure spike count correlations over 200 ms counting windows, corresponding to the right-most points in Appendix 1-figure 6f. The proportional changes in the spike count covariance are expressed in the covariance ratio R Cov ¼ Cov A ðn 1 ; n 2 Þ=Cov U ðn 1 ; n 2 Þ, shown in Appendix 1-figure 6g. Values of R Cov greater than one indicate increased spike count covariance with attention, and values of R Cov less than one indicate decreased spike count covariance with attention. The crossing of the R Cov ¼ 1 line is apparent at counting windows of approximately 30 ms. The theoretical values were computed using linear response theory (Trousdale et al., 2012).
To dissect the spike count covariance by different time lags, we consider the spike train covariance function (Equation 36), which is the pairwise-neuron analogue of the autocovariance function of the population-averaged activity (Figure 5e, main text). Appendix 1-figure 6h,i show the spike train covariance functions of excitatory neurons in the unattended and attended states. To compare the two, Appendix 1- figure 6j shows them normalized so that their maximum values are 1. In accordance with our mean-field results, the attended spike train covariance decays faster than the unattended spike train covariance, indicating increased stability in the attended state.
The spiking model also provides the opportunity to investigate the inputs to individual neurons, something that is difficult to do experimentally, and does not apply to mean-field models. Appendix 1-figure 6k,l shows the correlation functions of different types of inputs to a pair of excitatory neurons, averaged over pairs of excitatory neurons, in the unattended (k) and attended (l) states. Computing the correlation functions of the total recurrent input (black curves) reveals that correlations between excitatory inputs (EPSC-EPSC, dashed green), and correlations between inhibitory inputs (IPSC-IPSC, dashed red), are canceled by anti-correlations between excitatory and inhibitory inputs (EPSC-IPSC, blue). This is consistent with the idea of correlation cancellation by inhibitory tracking of excitatory activity (Renart et al., 2010;Tetzlaff et al., 2012;Ly et al., 2012). Attention, by shifting the system into a more stable state, allows this cancellation to occur more efficiently, thereby reducing the pairwise covariance. Appendix 1- figure 6m shows the input current correlation functions of the total recurrent inputs to pairs of excitatory neurons, normalized to peak at 1.
We conclude that the correlation cancellation brought about by recurrent inhibitory feedback suppresses correlations of the total recurrent input, which in turn decreases the output correlations.