Response-dependent dynamics of cell-specific inhibition in cortical networks in vivo

In the visual cortex, inhibitory neurons alter the computations performed by target cells via combination of two fundamental operations, division and subtraction. The origins of these operations have been variously ascribed to differences in neuron classes, synapse location or receptor conductances. Here, by utilizing specific visual stimuli and single optogenetic probe pulses, we show that the function of parvalbumin-expressing and somatostatin-expressing neurons in mice in vivo is governed by the overlap of response timing between these neurons and their targets. In particular, somatostatin-expressing neurons respond at longer latencies to small visual stimuli compared with their target neurons and provide subtractive inhibition. With large visual stimuli, however, they respond at short latencies coincident with their target cells and switch to provide divisive inhibition. These results indicate that inhibition mediated by these neurons is a dynamic property of cortical circuits rather than an immutable property of neuronal classes.

A rithmetic operations such as division and subtraction are a fundamental and widespread property of inhibition in neuronal networks [1][2][3] . Divisive inhibition, a form of gain control, plays a major part in scaling the response amplitude of neurons while keeping their sensory selectivity or function intact 4,5 . Response scaling has been shown to occur during diverse functions such as directed visual attention [6][7][8] , contrastinvariant orientation selectivity 9,10 , multisensory integration 11 and value estimation 12 . In contrast, subtractive inhibition can sharpen the selectivity of neurons 13,14 , possibly increasing the discrimination capability of cell populations and thereby behavioural performance 15 .
It has been suggested that different cortical inhibitory cell classes provide distinct combinations of divisive or subtractive inhibition during stimulus-mediated synaptic drive in vivo [16][17][18][19] . Although representing a minority of cortical cells, GABAergic neurons are highly diverse in their molecular, morphological and functional properties 20,21 , and can therefore contribute in various ways to the computational capability of cortical circuits [22][23][24] . Recent studies in visual cortex using optogenetic activation of inhibitory neurons have provided important insights into their function. In particular, parvalbumin-expressing (PV þ ) and somatostatin-expressing (SOM þ ) inhibitory neurons-the two key neuron classes that inhibit pyramidal neurons 25 -have been shown to alter responses of layer 2/3 cortical pyramidal neurons with distinct suppressive patterns displaying either divisive or subtractive inhibition 14,15,26 . The specific role of these inhibitory neuron classes, however, remains unclear: two studies found that, in visual cortex, PV þ neurons can alter the response gain of their targets 14,26 but with little effect on orientation tuning width, whereas one study found that PV þ neuron activation could alter tuning width significantly 15 . Similarly, SOM þ neurons have been shown to have either a subtractive effect 14 or a divisive effect 15 , leading in the former case to an increase in orientation selectivity and reduction in tuning width and in the latter case to no change in tuning width. Differences regarding the role of PV þ and SOM þ neurons could be imputed to differences in optogenetic stimulation protocols 27 , suggesting that the functions performed by different inhibitory neurons is not a fixed property of cortical networks but is a consequence of more complex dynamics 28 .
The principles that govern the dynamics of PV þ and SOM þ neurons as well as the mechanisms underlying their function are still unknown. One proposal is that PV þ neurons, which target the soma and proximal dendrites of pyramidal neurons, recruit different conductances compared with SOM þ neurons, which mainly target distal dendrites 21,29,30 . However, to our knowledge, no experimental or theoretical evidence exists demonstrating that these structural or biophysical properties are essential for specific and diverse functional operations of inhibitory neurons. An alternative proposal is that inhibition can dynamically influence excitation depending on the temporal relationship between the two 31,32 ; roles of inhibitory neurons can therefore be altered as a function of their firing coordination with target neurons.
When driven with specific stimulus ensembles, inhibitory neurons can display distinct response modes, as defined by their latency, amplitude and selectivity 33,34 . Here we have examined the hypothesis that different temporal response modes of inhibitory neurons dynamically shape their function. Our study design differed from previous studies of cell-specific function in two important respects. First, to probe the nature and timing of responses, we employed briefly flashed visual stimuli and contrasting stimulus ensembles that evoked different response dynamics in inhibitory neurons. Second, to minimize the additive effects of optogenetic stimulation on visual responses, we employed precisely timed single optogenetic pulses to interrogate the nature of inhibition. By recording from identified target neurons in mouse primary visual cortex (V1), we show that the response timing and profile of inhibitory neurons, and in particular SOM þ neurons, indeed shapes the operations they perform. A computational model shows that such response modes arise from simple rules of network connectivity and synaptic summation, yet enable dynamic switching of function between subtraction and division. These findings help to explain many of the diverse results described previously for inhibitory neuron function.

Results
V1 neuron responses to sparse noise and full-field stimuli. To examine the role of specific inhibitory neuron classes in V1 as a function of stimulus properties and response features, we used two different types of visual stimuli. In a sparse noise protocol, which is conventionally used to map neuronal receptive fields 33,35 (see Methods), the location of the stimulus (a square patch of light) and its polarity (ON or OFF) changed from one frame to the next. In a full-field protocol, stimulus flashes (covering the entire visual field) were displayed at different intensities. These stimuli were thus spatially uniform but had variable contrasts compared with offset periods (Supplementary Fig. 1). Sparse noise and full-field stimuli provide complementary ways to rapidly probe the spatial and temporal summation properties of neurons and their receptive fields.
We first characterized the responses of V1 neurons to these stimuli using 2-photon calcium imaging with the calcium indicator OGB-1AM. Using a fast-scan strategy, we were able to image numerous neurons sequentially at high acquisition rate 14 (Fig. 1a,b, see Methods). To evaluate the spatio-temporal properties of these cells, we estimated their instantaneous firing rate from the calcium traces using a fast deconvolution algorithm 36 . The validity of the estimated firing rate was illustrated through targeted cell-attached recordings of an OGB-filled neuron during simultaneous calcium imaging ( Supplementary Fig. 2). To facilitate the comparison between electrophysiological recordings and calcium imaging, we used normalized unit-less statistics and displayed response magnitudes as Z-scores (see Methods).
In response to sparse noise, neurons displayed a classical receptive field with ON and OFF subfields corresponding to their responses to bright or dark squares, respectively (Fig. 1c). Most of the recorded cells displayed a strong ON field with either no OFF field or a weaker and delayed OFF response (Fig. 1c,d;  Supplementary Fig. 3). Similar asymmetrical representation of ON and OFF sensitivity has been previously observed in mouse V1 (ref. 35) and in adult macaque V1 superficial layers 37 . We therefore based most of our analysis on ON responses. Among all the imaged neurons, 39% (761 out of 1,928 neurons, Z-score 43, 16 animals) responded significantly to sparse noise, with latencies to peak centred around 0.24 s (Fig. 1e). Experiments where a large fraction of cells displayed strong calcium signals revealed details of the retinotopic mapping and functional organization of mouse V1, in line with a previous report where a different stimulus ensemble was used to map receptive fields in mouse V1 (ref. 38) (Supplementary Fig. 4). When full-field flashes were presented, neurons responded in a monotonically increasing way to ON and OFF stimuli. OFF responses were on average weaker and delayed, similar to the responses with sparse noise (Fig. 1f). For this stimulus ensemble, 41% of all neurons (620 out of 1,518 neurons, Z-score 43, 8 animals) responded significantly, and comparable to sparse noise stimulation, latencies to peak were centred around 0.27 s (Fig. 1g). Thus, sparse noise and full-field stimuli provide robust characterization of neuronal receptive fields, along with measures of response magnitude and timing as probes of potential temporal interactions between inhibitory neurons and their targets.
Distinct functional responses of PV þ and SOM þ neurons. We next directly assessed the timing and amplitude of PV þ and SOM þ neuron responses to both sparse noise and full-field stimuli using two-photon targeted, cell-attached recordings. We used the CreLoxP recombination system to express mCherrychannelrhodopsin-2 (ChR2) in specific cell types using PV-Cre and SOM-Cre mouse lines ( Supplementary Fig. 5). Expression of mCherry allowed us to target these inhibitory neuron classes using glass pipettes filled with the dye Alexa 488 (Fig. 2a,f). Successful patch recordings could be assessed by rapid and reliable spiking evoked in the patched neuron by activating ChR2 with blue light pulses and by post hoc identification of the spike waveform as fast-spiking (PV þ neurons) or regular-spiking (SOM þ neurons) (Fig. 2b,g and Supplementary Fig. 6).
PV þ neurons (n ¼ 22 neurons, 8 animals) responded strongly to sparse noise stimuli and displayed receptive fields that were comparable to those observed for putative pyramidal cells (Fig. 1), as also illustrated by cell-attached recordings of adjacent putative pyramidal cells performed during the same experiment ( Fig. 2b-e). The firing pattern of PV þ neurons and pyramidal neurons evoked by the same sequence of sparse noise displayed strong similarity in their spatiotemporal receptive fields properties ( Fig. 2c-e). In contrast, the firing pattern of SOM þ cells during sparse noise stimulation was distinct from the firing pattern of adjacent pyramidal cells ( Fig. 2f-j); SOM þ neurons did not share much similarity in their response magnitude or time-to-peak response (Fig. 2i,j). Overall, compared with PV þ neurons, SOM þ neurons had very low spontaneous and evoked firing rates in response to sparse noise (Fig. 2k,l). Many of the recorded cells (21 out of 37 neurons, 8 animals) did not display significant responses to the sparse noise. The remaining cells (n ¼ 16) displayed weak responses (Fig. 2m) that were significantly delayed 33 with respect to PV þ or pyramidal cells (Fig. 2j,n).
The functional properties of PV þ and SOM þ neurons were also investigated with full-field flashes. PV þ neurons (n ¼ 20 neurons, 4 animals) displayed monotonically increasing responses with contrast for ON and OFF stimuli, with a much weaker response for OFF stimuli (Fig. 3a) similar to the responses found for putative pyramidal cells (Fig. 1f). For these large stimuli, SOM þ neurons responded with a nearly identical monotonic intensity response curve (Fig. 3b). The maximum Z-scores computed for these neurons were significantly higher for full-field flashes compared with sparse noise (Fig. 3c). Virtually all SOM þ neurons (21 out of 23 neurons, 8 animals) responded significantly to full-field flashes. Moreover, they responded with significantly shorter response time-to-peak and onset time (defined as the time at which the Z-score first exceeded the significance threshold, see Methods), comparable to those of pyramidal or PV þ neurons (Fig. 3d, n ¼ 620 for putative pyramidal cells, n ¼ 20 for PV þ neurons and n ¼ 21 for SOM þ neurons). The changes in response strength, onset time and timeto-peak were evident in example PV þ (Fig. 3e) and SOM þ neurons (Fig. 3f,g). These data thus demonstrate that SOM þ neurons display very different response modes to the two stimuli used here: when sparse noise stimuli are presented, they have weaker responses at longer latencies than pyramidal and PV þ neurons, whereas, when full-field flashes are presented, they have stronger responses at latencies compared with pyramidal and PV þ neurons. These stimuli represent extremes of a continuum related to spatial summation by SOM þ cells 34 , and thus enable us to analyse how their response modes relate to their function. SOM þ neurons, we sought to understand how these differences translate to the interaction of PV þ and SOM þ neurons with local pyramidal cells during processing of sparse noise or full-field stimuli. We first ensured that we could evoke spikes from ChR2-expressing PV þ and SOM þ neurons precisely in time. Using targeted cell-attached recording, we applied single pulses of blue light (10 ms duration) that evoked reliable spiking responses in PV þ or SOM þ neurons with millisecond precision during concurrent visual stimulation; importantly, the ChR2-evoked spikes were similar across visual stimulation conditions and were independent of visual responses ( Supplementary Fig. 7). Our goal was to reliably elicit moderate inhibition of visual responses in target cells, without evoking network disinhibition 25,39,40 or circuit-wide changes 41 , so that we could compare effects across different types of inhibitory neurons and large numbers of target cells.
We then studied the suppression strength of the evoked response by systematically varying the timing of the 10-ms long ChR2 pulse between 0.1 s before stimulus onset to beyond the response peak after visual stimulus onset and found that a near-optimal time to activate inhibitory neurons by the ChR2 pulse was at or just before 0.2 s following visual stimulation (f-j) Same as a-e for a SOM þ neuron (pink) and a putative pyramidal neuron (grey). (k-n) Population comparison of spontaneous activity (k, ***Po0.001, two-tailed t-test), maximum evoked activity (l, ***Po0.001, two-tailed t-test), maximum Z-score (m, ***Po0.001, two-tailed t-test) and response time-to-peak (n, **P ¼ 0.005, two-tailed t-test) between PV þ (n ¼ 22) and SOM þ (n ¼ 37) neurons. Cells without significant evoked responses (Z-scoreo3) were not included in the comparison of time-to-peak response (which thus included n ¼ 22 PV þ neurons and n ¼ 16 SOM þ neurons). Error bars indicate s.e.m. The grey bars in l and m, respectively, indicate the maximum firing rate and Z-score computed over all SOM þ neurons that displayed significant responses. ARTICLE NATURE COMMUNICATIONS | DOI: 10.1038/ncomms6689 onset ( Supplementary Fig. 8). This timing falls on the rising phase between the onset and the peak amplitude of visually evoked responses in typical pyramidal cells (Fig. 4a-f). This suppressive effect was evident at the level of individual cells when comparing their control response amplitude with that following the light pulse (Fig. 4g,h, n ¼ 113 for PV þ and n ¼ 104 for SOM þ neurons); the vast majority of cells showed suppression, with very few cells displaying facilitation that would reflect a disinhibitory mechanism. We also performed control experiments in wild-type mice confirming that the effect we observed was exclusively due to ChR2 activation and not caused by other uncontrolled sources ( Supplementary Fig. 9). Thus, stimulating either PV þ or SOM þ neurons with single pulses in effect results in a compound IPSC in postsynaptic neurons, leading to direct suppression of visually evoked responses.
We then measured neuron responses and receptive fields using sparse noise visual stimuli, in the presence or absence of single blue light pulses to stimulate PV þ or SOM þ neuron populations ( Fig. 4i-n). To assess the effect of specific inhibitory neuron classes, we compared point-by-point responses from the spatial receptive field obtained during ChR2-activation of these neurons with the control receptive field (Fig. 4i,l). When PV þ neurons were stimulated, the effect on the target receptive field structure was divisive, as shown by the linear relation between control and post-ChR2 responses with a slope o1 (Fig. 4j). That is, we observed stronger suppression for strongly responsive parts of the receptive field and weaker suppression for regions away from the centre of the receptive field, so that the suppression strength was strongly dependent on the control response (Fig. 4k)-indicating divisive inhibition. In contrast, the suppression evoked by SOM þ neurons rather uniformly affected the target neuron's responses and receptive field (Fig. 4l), shifting all responses uniformly downwards and resulting in a linear relationship between suppression strength and control response with a slope close to 1 (Fig. 4m)-indicating responseindependent subtractive inhibition (Fig. 4n). Other single-cell examples of these distinct suppression patterns are shown in Supplementary Fig. 10.
The suppression patterns of PV þ and SOM þ neurons suggest a network origin of their functions that could potentially be altered with full-field stimuli. Indeed, when we used full-field flashes to probe the properties of PV þ and SOM þ mediated inhibition, we obtained very different effects for SOM þ neurons. By comparing, for each intensity, the luminance response curve of individual pyramidal cells in the control condition with the response when specific inhibitory neurons were stimulated (Fig. 4o,r), we could assess the nature of inhibition evoked by these cell types. While PV þ neurons still showed divisive effects on pyramidal neuron responses (Fig. 4p,q), SOM þ neurons now displayed divisive effects nearly identical to PV þ neurons (Fig. 4s,t). Thus, both PV þ and SOM þ neurons can provide divisive inhibition in response to a stimulus that strongly drives both neuron types along with their target cells, at comparable visual latencies. In response to sparse noise stimuli, however, which drive pyramidal and PV þ neurons effectively at short latencies but not SOM þ neurons, PV þ and SOM þ neurons perform different operations on target pyramidal cells (see Supplementary Fig. 10 for more single-cell examples).
We confirmed these results at the population level. For all visually responsive neurons that displayed a significant (but not complete) suppression in response to PV þ or SOM þ neuron stimulation during the sparse noise protocol, the distribution of the 'suppression slope', or slope of the line relating post-ChR2 response and control response (for example, Fig. 4j,m), was significantly lower for PV þ neurons than for SOM þ neurons (Fig. 5a, n ¼ 87 neurons from 6 animals for PV þ , n ¼ 119 neurons from 6 animals for SOM þ ). It is also worth mentioning that, although these two distributions are significantly different, the effect of PV þ and SOM þ activation is not exclusively divisive or subtractive. Indeed, suppression slopes much smaller than 1 were observed for a small proportion of cells that were strongly suppressed by SOM þ activation ( Supplementary  Fig. 11). Interestingly, these target cells also had long response latencies to sparse noise stimuli ( Supplementary Fig. 11e), comparable to SOM þ latencies (Fig. 3d), indicating that rather than being an exception, these cells were consistent with the hypothesis that the temporal overlap of SOM þ and target responses shapes the effect of SOM þ inhibition. Pooling cells from individual experiments and computing the average Z-score change (between control and ChR2-stimulation) and the s.e.m. in sparse noise experiments nevertheless demonstrated low variability for the effects of PV þ (Fig. 5b, n ¼ 87 neurons from 15 experiments, 6 animals) and SOM þ (Fig. 5c, n ¼ 119 neurons from 15 experiments, 6 animals) neuron activation. Analysis of the average suppression as a function of control Z-score showed that, while PV þ neurons caused a significant scaling of suppression with control response (Fig. 5d), SOM þ neurons showed no dependence on the stimulus strength for large control values ( Fig. 5e; the weaker suppression observed for low Z-scores can be attributed to a floor effect: responses that are close to the spike threshold cannot be suppressed below the threshold, resulting in weaker suppression). Strikingly, the same population analyses applied to full-field flashes did not show any significant differences between PV þ and SOM þ neurons ( Fig. 5f-j, PV þ : n ¼ 30 neurons from 8 experiments, 3 animals; SOM þ : n ¼ 79 neurons from 15 experiments, 4 animals). One-way ANOVA revealed a significant difference between the four groups in Fig. 5a,f (Po0.001 with Bonferroni correction for multiple comparisons). Using post-hoc pairwise t-tests, we found that only SOM þ activation in the sparse noise condition was significantly different from all the other groups.
Several recent studies have shown that the level of inhibition is markedly higher in awake behaving mice 42 , in which SOM þ neurons in particular can display higher firing rates compared with anaesthetized conditions 34,43,44 . To examine the validity and generality of our results, we performed the same experiments in awake head-fixed mice using the genetically encoded calcium indicator GCaMP6f instead of OGB-1AM (see Methods). Our results were similar to the anaesthetized case (Fig. 6) indicating that, at least in awake non-behaving mice, the function of SOM þ neurons remains stimulus-dependent. However, we do not exclude the possibility that changes in brain state, such as during locomotion 43,45 , could alter the function of various inhibitory cell types.

Stimulus-dependent inhibition in a recurrent network model.
To mechanistically understand these experimental findings, we designed a simple network model 46 of layer 2/3 in which the different cell types were randomly distributed in a twodimensional layer. On the basis of the strong response similarity between pyramidal and PV þ neurons and the short delay of PV þ responses to small stimuli 33 , we modelled both these cell types as receiving direct feedforward inputs from a parallel two-dimensional layer depicting thalamorecipient layer 4 neurons (Fig. 7a) to model retinotopic receptive fields. The local recurrent connections of these cell types were sparse and followed a Gaussian distribution. In contrast, the weak and delayed responses of SOM þ neurons to sparse noise, as well as their lack of response during ChR2-stimulation of layer 4 excitatory cells in vitro 34 , suggested that SOM þ neurons do not receive feedforward sensory input but exclusively receive their excitatory drive from local excitatory neurons. We modelled these sparse connections with a uniform connection probability distribution mimicking the long-range interaction with local pyramidal cells 34 . All cell types projected locally according to a distant-dependent Gaussian distribution (Fig. 7b). We also added unidirectional connections from SOM þ to PV þ neurons to replicate intracortical connections 25,40 and size tuning curves 34 , although these connections were not necessary to produce the effects described here (Supplementary Fig. 12). Synaptic interactions were modelled as instantaneous increases in excitatory conductances (from pyramidal neurons) or inhibitory conductances (equivalently from PV þ and SOM þ neurons) followed by exponential decays.
The spontaneous activity observed in our model was comparable to the spontaneous activity observed in our experiments in vivo, displaying low firing rate of SOM þ cells, relatively low firing rate of pyramidal cells and higher firing rate of PV þ cells (Fig. 7c) with highly irregular firing patterns 47 (Fig. 7d) and weak distancedependent correlation (Fig. 7h, light coloured lines) similar to our data ( Supplementary Fig. 4i) and that of others 38 . The spatiotemporal correlation structure was dependent on several parameters of the model including the number of connections per neuron relative to the network size and typical synaptic strength 46 . We used a set of parameters that reproduced important features of the dynamics while keeping the network simple.
To model sparse noise stimuli, we applied a small transient Gaussian 'visual' stimulation pattern in layer 4 and analysed the activity of the network. Using the symmetry of the network (homogeneous connectivity pattern and periodic boundary conditions), receptive fields were obtained by computing the response maps of the network for each population. Because of their local connectivity and feed-forward input, pyramidal cells and PV þ cells displayed a localized and strong response to the small stimulus. In contrast, the lack of feedforward input and the large-scale integration of SOM þ neurons led to a delayed and spatially uniform but weaker response to the stimulus (Fig. 7e,f). (The absolute response latencies generated by the model were arbitrary, because retinal, retinofugal conduction and multiple synaptic latencies were not included.) Note also that SOM þ neuron response variability found in in vivo data (Fig. 3f,g) was not accounted for here since the network was symmetrical and therefore displayed a single average behaviour compared with the average experimental result. Adding some heterogeneity in the connectivity rule of SOM þ neurons could potentially reproduce the range of response profiles observed experimentally. Activating PV þ and SOM þ cells with a pulse of excitation (mimicking a ChR2 pulse) during 'visual' stimulation resulted in divisive inhibition by PV þ neurons and subtractive inhibition by SOM þ neurons (Fig. 7g). This was a consequence of the different sensitivities and delay of PV þ and SOM þ neurons to small, local stimuli. The SOM þ neuron population responded uniformly to small 'visual' stimuli with a significant delay compared with pyramidal neurons; when probed with a single 'ChR2' pulse, the inhibition elicited by this population was homogeneous across pyramidal cells (independent of location) and resulted in a subtractive effect. In contrast, the response of PV þ neurons to small visual stimuli was strongly dependent  (j-k) Same as h-i but during full field-flashes. (j) n ¼ 18 for PV þ and n ¼ 15 for SOM þ , P ¼ 0.11. (k) PV þ (n ¼ 18, slope ¼ 0.51) and SOM þ (n ¼ 15, slope ¼ 0.50). One-way ANOVA revealed a significant difference between the four groups in h and j (Po0.001 with Bonferroni correction for multiple comparisons). Using post-hoc pairwise t-tests, we found that only SOM þ activation in the SN condition was significantly different.
on their location in the network and closely resembled the response profile of nearby pyramidal cells. As a result, the inhibition evoked by these neurons in target cells was stronger for stronger responses (in the center of the receptive field) and resulted in a divisive effect. These effects were not dependent on the strength of stimulation and SOM þ neurons usually required a stronger pulse of activity to produce a significant suppression of pyramidal cells (as also observed experimentally). The stimulus dependence of the various cell types was further evident in their correlation with local pyramidal cells as a function of stimulus parameter (Fig. 7h). The correlation between pyramidal and PV þ cells produced by this stimulus decayed over distance, whereas it was uniform for SOM þ neurons.
Full-field flashes of increasing intensity were reproduced by transiently stimulating the entire network with increasing drive. In this case, the functional properties of all cell types were more comparable, showing a monotonic increase in their response to increasing drive (Fig. 7i) and decrease of SOM þ neuron response latencies compared with sparse noise (Fig. 7f). Stimulating PV þ or SOM þ neurons with a pulse of 'ChR2' during presentation of full-field flashes resulted in divisive inhibition from both neuron types (Fig. 7j). For this stimulus ensemble, the correlation structure with pyramidal cells showed that all neuron types were similarly sensitive to the stimulus parameters, displaying similar temporal correlations and increasing correlation with increasing intensity (Fig. 7k). For SOM þ neurons in particular, the switch between subtraction and division may thus be explained by their connections and their consequent stimulusdependent temporal and spatial relationship to pyramidal neuron responses. Importantly, the effect of SOM þ activation on target pyramidal neurons did not depend on SOM þ to PV þ connections ( Supplementary Fig. 12), indicating that this disinhibitory circuit is unlikely to play a role in the effect of SOM þ neurons on pyramidal cells in vivo 27,40 . This simple computational model reproduced the phenomenology observed in vivo only by using different connectivity rules for PV þ and SOM þ neurons that were otherwise modelled identically. These connectivity rules were inspired by recently published work 34 and were kept as simple as possible. We do not exclude the possibility that the nature of GABA receptors targeted by these different inhibitory neuron types may differ 1 and could also participate in this mechanism, although how this would enable SOM þ neurons to switch their function remains to be clarified.

Discussion
We have shown in this study that PV þ and SOM þ neurons, the two well-defined classes of cortical inhibitory neurons that target pyramidal neurons, have functional effects on their targets that depend on their response modes and the nature of visual stimuli. When probed with small stimuli, the responses of SOM þ neurons are delayed and often weak, and differ significantly from those of pyramidal and PV þ neurons. Under these conditions, when probed with single pulses of ChR2, SOM þ neurons provide subtractive inhibition. With the same stimuli, PV þ neurons are coactive with pyramidal neurons, with similar response latencies, and provide divisive inhibition. Strikingly, when large stimuli are used, both PV þ and SOM þ neurons display comparable response latencies as pyramidal neurons, and both provide divisive inhibition.
It is possible that the function of PV þ and SOM þ neurons also depend on the cortical layer. Our experiments were performed in superficial layers II/III of V1, but we do not exclude the existence of alternative mechanisms in deeper layers. Moreover, although we tried to target superficial layers during viral injections, it is likely that deeper layers were also transfected and therefore the effect observed in our data could in principle include the contribution of interneurons in these layers, which in turn could interact with superficial layers in distinct ways. However, our results were consistent across animals indicating that despite a possible difference in PV þ and SOM þ neurons distribution within the cortical column, their collective effect on target cells in superficial layers is robust and reliable.
Our work differs in important ways from previous studies that examined the role of inhibitory neuron classes 14,15,26,40 . First, these studies used prolonged full-field visual stimulation to drive neurons, which can obscure the temporal relationship between inhibitory and target neuron firing. Second, these studies used prolonged optogenetic stimulation of inhibitory neurons to evaluate their effect on target neurons; such stimulation is superimposed on visual drive to neurons, and alters the magnitude and timing of visually evoked responses in inhibitory neurons and their targets. Moreover, such stimulation invokes not only inhibitory but also disinhibitory interactions in cortical networks 25,40 as reflected by the stronger suppression evoked in pyramidal neurons by SOM þ neurons in our study using single pulse stimulation compared with prolonged pulse trains 40 . Prolonged ChR2 excitation can also result in depolarization block in neurons 48 . By employing briefly flashed visual stimuli, specific stimulus ensembles, and short pulses of optogenetic activation, we were able to define the respective response latencies of PV þ and SOM þ neurons and compare them with pyramidal neurons, as well as isolate the inhibitory effect of these neuron classes on their targets.
Our findings help explain the disagreement in previous reports on the functional role of PV þ and SOM þ neurons 14,15,26 . PV þ neurons are easily excited by ChR2 stimulation and they exert powerful feedforward inhibition: the disagreement regarding PV þ neurons is well explained by considering the intensity of PV þ activation in these studies 27,28,49 . In the case of SOM þ neurons, Lee et al. 15 activated SOM þ cells continuously with prolonged ChR2 stimulation, and the visual stimulation was displayed full-field and completely contained within the ChR2 activation period. We hypothesize that the temporal overlap of pyramidal cell visual activation and SOM þ visual plus ChR2 activation fulfilled the condition for divisive inhibition. We have confirmed this idea by performing additional experiments with full-field drifting gratings and optogenetic pulse activation at the timing of onset response and found divisive inhibition for both PV þ and SOM þ neurons ( Supplementary Fig. 13a,b). Wilson et al. 14 used ChR2 activation only during the first second of the full-field visual stimulation, and probed the effect of inhibition subsequently, during which we hypothesize there was no temporal overlap between pyramidal and SOM þ responses, and hence found subtractive inhibition. This was further verified by performing another set of experiments where the ChR2 activation pulse was delivered in a later time (corresponding to the last stimulation pulse in ref. 14) when the visually evoked response of SOM þ neurons was almost back to baseline. In this protocol, the effect produced by PV þ or SOM þ neuron ChR2 activation was significantly different, with more subtractive inhibition elicited by SOM þ neurons (Supplementary Figs 13a,c and 14a,b). Furthermore, Lee et al. 27 replicated results from Wilson et al. 14 and showed that under different stimulation conditions SOM þ neurons can indeed carry out very different functions (Supplementary Fig. 14c-e). Our findings now demonstrate that the mechanistic basis for this functional switch is the response mode and timing of SOM þ neurons relative to their target cells.
The dynamic switch of neural computations performed by SOM þ neurons provides a basis for context-dependent switching of function. Most SOM þ neurons are insensitive to small stimuli or respond with a significant delay, and therefore evoke stimulus-independent suppression of local pyramidal cells in this sensory context or when activated by other inputs such as cholinergic drive 50 or top-down modulation 51 . This subtractive inhibition can enhance the decoding properties of the cortical network by sharpening the tuning curves or receptive fields of pyramidal cells 13,14 . SOM þ neurons can switch to providing divisive inhibition and gain control when activated by large stimuli. In contrast, PV þ neurons mediate gain control for both small and large stimuli by uniformly evoking strong divisive inhibition in neighbouring pyramidal cells. The dynamics of SOM þ neurons to different sensory stimuli provides an additional gain control mechanism when large stimuli are processed. PV þ and SOM þ cells could then provide complementary functions, respectively, controlling the gain of pyramidal cells in the face of changes in local contrast or overall brightness when presented with scale-invariant stimuli such as natural scenes.
Furthermore, SOM þ neurons provide a way to dynamically integrate top-down inputs with sensory inputs: top-down inputs that activate SOM þ neurons in a temporally distinct manner from visual (bottom-up) inputs would help shape response selectivity, whereas top-down activation that temporally overlaps visual activation would provide gain control. As SOM þ neurons are particularly sensitive to brain states 43,51 , their dynamic response modes provide a rich way to regulate pyramidal cell responses.

Methods
Animals and virus injections. Experiments were carried out in mice under protocols approved by MIT's Animal Care and Use Committee and conformed to NIH guidelines. Heterozygous SOM-Cre and PV-Cre knockin driver mice (Jackson Labs) were backcrossed into a C57BL/6 line and housed 1-5 mice per cage under a 12/12-h light/dark cycle. Adult mice (46-8 weeks old, both genders) were anaesthetized with 4% isoflurane in oxygen. The skull was thinned at a location 3.5 mm posterior and 3 mm lateral to bregma, corresponding to the caudolateral part of V1. A glass micropipette filled with the virus (pAAV-Ef1a-DIO-hChR2(H134R)-mCherry-WPRE-pA from University of North Carolina viral vector core facility) was then inserted in the cortex through the remaining skull and the dura. Two injections of 250 nl were made, respectively, at a depth of 500 and 250 mm below the cortical surface at a rate of 100 nl min À 1 . Immunohistochemistry was performed to ensure the expression of the virus as previously described 14 ( Supplementary Fig. 5).
Animal preparation. In vivo experiments were performed on mice 2 weeks or more post-injection. Mice were first anaesthetized with 1.5% isoflurane in oxygen and subsequently injected with a cocktail containing fentanyl (0.05 mg kg À 1 ), midazolam (5 mg kg À 1 ) and medetomidine (0.5 mg kg À 1 ), supplemented with 0.5% isoflurane. Eyes were protected with ophthalmic ointment. A metal plate was attached to the skull using opaque black superglue and dental acrylic and screwed into a moveable stage. A circular craniotomy (1.5 mm diameter) centred on the injection site was then performed. A thin layer of 3% agarose in ACSF was used to cover the cortex. The stage was then transferred to the microscope where another tube was installed to deliver isoflurane. Throughout the surgery and the entire experiment, the body temperature was maintained at 37.5°C with a heating blanket (Harvard Apparatus) and if necessary additional heating pads.
In vivo-targeted cell-attached recordings. To perform targeted cell-attached recordings, a borosilicate pipette back-filled with 4 ml of either Alexa 488 or Alexa 594 (Molecular Probes) was inserted into the brain at a 30°angle below a Â 25 Olympus water immersion objective. The objective as well as the glass pipette and an Ag/AgCl ground pellet electrode were immersed in ACSF. The glass pipettes (outer diameter ¼ 1.5 mm, inner diameter ¼ 1.17 mm) were pulled using a Sutter P-1000 puller to obtain a baseline resistance of 3-7 MO. Recordings were made using custom software (Network Prism, Sur Lab) written in Matlab (Mathworks, Natick, MA) controlling a MultiClamp 700B Amplifier (Axon Instruments). The pipette was then advanced diagonally towards specific labelled neurons under the guidance of two-photon imaging at 910 nm and with an applied pressure of 15-30 mbar. Small lateral movements of few tens of microns were used to better reach targeted neurons. Cell approach was assessed visually and with a significant increase of resistance (4twofold). After the cell was successfully targeted, pressure was released creating a strong increase in resistance (20-100 MO). Weak negative pressure was applied to hold the cell (about À 10 mbar). For targeted cells that expressed the light-gated ion channel channelrhodopsin (ChR2), we could confirm successful cell-attached patch by triggering spikes with blue light (see below) at 1-ms precision. To ensure that cells with very low firing were still recorded during long recording sessions, we regularly evoked spiking activity in them via ChR2 by applying pulses of blue light. The amplifier was switched to current clamp mode and spikes were recorded with zero injected current under a Bessel filter of 4 kHz and an AC filter of 300 Hz.
Two-photon calcium imaging in anaesthetized mice. A solution containing 50 mg of Oregon Green BAPTA 1-AM (Invitrogen) mixed with 5 ml of pluronic acid (20% in DMSO) wrapped in aluminum foil was centrifuged for 20 min and subsequently mixed with 45 ml of a solution containing 2 ml of Alexa 488 (Invitrogen) diluted in 200 ml of saline. This mixture was then centrifuged through a 0.22 mm filter (Millipore) for 30 s and stored on ice. Glass pipettes identical to the ones used for targeted cell-attached recording were back-filled with 3 ml of the dye. The pipette was then inserted in the cortex under two-photon guidance to the region of interest (virus injection site) where mCherry-ChR2 was expressed in either PV þ or SOM þ neurons. In experiments where no optogenetic manipulations were necessary, we aimed at region of the cortex free of large blood vessels. Once in position, sustained but light positive pressure was incrementally applied using a Picospritzer II until the dye started to leak out of the pipette with a slow and constant flow. The loading was maintained for about a minute. The dye uptake usually enabled imaging 30-60 min after bulk loading.
Imaging was performed with a modified Prairie Ultima two-photon system (Prairie Technologies) driven by a Spectra Physics Mai-Tai eHP laser. All functional imaging was done using a Â 25 Olympus XL Plan N high-numerical index objective lens. The details of the system have been described in detail previously 14 . In brief, a custom all-Matlab system (Network Visor, Sur Lab) was used to detect changes in fluorescence. The red and green PMT cables from the two-photon microscope were forked and fed into a custom A/D acquisition system and graphical user interface (National Instruments and Matlab). The control lines of the two-photon's X and Y galvanometers were in turn substituted with D/A control lines from the custom system. After an initial raster scan that provided an image of the OGB-loaded cells, their positions were detected to establish a scan-path. Using a genetic algorithm, the shortest scan-path between cells was then computed and the imaging was performed along this trajectory. This strategy could yield calcium traces of about a hundred cells imaged sequentially at a 50 Hz sampling rate and high signal-to-noise ratio. All imaging sessions had a duration of 2 min. In between each session, an image of the cortex was taken to ensure that the scan-path was still aligned with the cells. If a movement occurred during a session, the cortex was realigned on the scan-path and the session was discarded.
Two-photon imaging in awake head-fixed mice. We performed calcium imaging experiments in awake head-fixed PV-Cre or SOM-Cre mice expressing GCaMP6f (ref. 52) (UPenn Vector Core: AAV1.Syn.GCaMP6f.WPRE.SV40) in all neurons and mCherry-ChR2 in a Cre-dependent manner. A craniotomy was performed before virus injection and the cortex was then protected by a 3-mm glass coverslip further sealed with Metabond permanent cement mixed with black ink to ensure opacity. A custom-made headplate was implanted on the mouse skull and attached with Metabond permanent cement. After a week-long recovery period, the mouse was habituated to head-fixation by screwing the headplate to an immobile stage and confining the mouse in a tube. Imaging experiments were done at least 2 weeks after virus injection. We performed the same experiments that were done in anaesthetized state except that we used Scanimage (HHMI Janelia Farm) to acquire full frame images with a frame rate of 25 Hz, with high zoom and low resolution so that roughly 25 well-isolated cells could be imaged simultaneously. Movies were movement-corrected before any further analysis.
Optogenetic stimulation protocol. Neurons expressing channelrhodopsin were driven by a diode-pumped solid state blue laser with analogue intensity control (473 nm, 200 mW, MBL-III-473, OptoEngine, LLC) coupled via SMA terminal to a 200 mm fiber (ThorLabs) that was integrated into the microscope light path. Pulse patterns were driven via custom D/A optogenetics software written in Matlab. The stimulation pattern that was used during most in vivo calcium imaging experiments consisted of a single 10-ms-long pulse delivered 200 or 100 ms after stimulus presentation every other trial. The light intensity was adjusted to elicit essentially a single spike in most inhibitory neurons, and a moderate and reliable suppression of pyramidal neuron activity without completely suppressing the network. This moderate perturbation had to be adjusted to the cell type. In particular, SOM þ neurons required stronger light intensity to produce a significant suppression of pyramidal cell responses. The absolute values for individual pulses as measured leaving the objective were 15 mW for PV þ and 35 mW for SOM þ interneurons. These values were established in early pilot experiments and were based on previous published work 14 . The effect of ChR2-mediated stimulation was consistent from one experiment to the next so we could keep the same parameters without recalibrating the laser for each experiment (see Supplementary Fig. 7). Note that the effect was systematically assessed after the experiment by examining the average response suppression. To probe PV þ and SOM þ effects, we used single pulse activation of these cells via ChR2 at variable time points relative to the onset of visual stimulation.
Visual stimulation protocols. Visual stimuli were presented on a 23 00 1080p LCD monitor (Dell) using the software Psychtoolbox-3 on a Windows 7 computer (Dell Precision) with a GeForce 8800 GTS 640 MB graphic card (PNY). The sparse noise stimulus ensemble consisted of black or white squares (150 pixels corresponding to 7.5°in the mouse visual field) displayed at full contrast on a grey background. Each square was presented sequentially in a random location (7 by 12 grid) on the screen for 200 ms followed by a 300 ms duration of background grey before the next stimulation (comprising 2 Hz sparse noise). The location of each square followed a pseudo-random sequence ensuring that two consecutive squares were at least three nodes away from each other to avoid spurious second-order interactions. The polarity of the square (ON or OFF) was random for each square. For experiments including optogenetic stimulation of specific inhibitory neurons, a pulse of blue light was presented every two frames. For the full-field flashes stimulus ensemble, a screen of uniform intensity was displayed for 200 ms followed by a 800 ms duration of background grey (1 Hz). The screen luminance was randomly drawn from 31 values around the background grey ranging from 0 to 100% positive or negative contrast with a maximum luminance of 250 cd m À 2 . Drifting gratings were displayed with a temporal frequency of 2 Hz and a spatial frequency of 0.04 cycles per degree for 36 evenly spaced directions. For each direction, a second of blank screen was followed by 3 s of visual stimulation. Each visual protocol lasted for 40-60 min for calcium imaging and 20-60 min for targeted cell-attached recording.
Data processing. Spike timing was extracted from the voltage traces using a simple threshold and examining the waveform distribution to ensure that only one cell was recorded. The firing rate over time was estimated by binning each spike train with a 20 ms time bin, matching the calcium imaging sampling frequency for the sake of comparability.
The local baseline average calcium signal was first subtracted from the raw calcium traces acquired at 50 Hz sampling frequency as previously described 14 to obtain the relative signal df/f. The resulting signal was high-pass filtered to avoid very slow drift and further deconvolved using a fast non-parametrical algorithm 36 to extract a signal proportional to the neuron's actual firing rate at the sampling frequency. A threshold was then applied to the estimated rate to remove part of the noise. For experiments where 10-ms-long pulses of blue light were used to activate specific inhibitory neurons, the calcium signal was saturated during the stimulation time. This artefact was removed from the traces and a linear interpolation was used to reconstruct the calcium signal during the stimulation time bin. Because of the slow calcium time constant and the high-sampling frequency, this did not degrade the signal quality.
Data analysis. The estimated relative rate as well as the firing rate estimated from cell-attached recordings was used to compute neuronal functional properties in response to sparse noise stimuli or full-field flashes. By averaging these signals following the stimulus onset for each stimulus location and polarity (sparse noise) or luminance (full-field flashes), the spatio-temporal receptive field or the luminance response curve of each recorded neuron could be reconstructed.
To compute the baseline response distribution, we imaged the spontaneous activity of neurons during a 2-min blank screen. We also included imaging data corresponding to stimuli that did not elicit any significant responses (that is, stimuli that were far from receptive fields). We computed the Z-score by subtracting the mean value of the baseline distribution from evoked responses and dividing the result by the s.d. of the baseline distribution.
The time course of ON or OFF responses was obtained by averaging spatiotemporal receptive fields over all possible stimulus locations and was further smoothened. A similar baseline distribution was obtained to compute a Z-score over time. A neuron sensory response was considered significant if the temporal profile of its Z-score crosses the threshold of 3. Response onset was defined as the time point where the response crossed the significance threshold (Z-score 43). The spatial receptive field was obtained by averaging the spatio-temporal receptive fields over times where the response was significantly higher than the baseline activity (Z-score 43). The result was then interpolated and filtered with a Gaussian kernel. Here again, a baseline distribution was used to obtain Z-score values. For experiments where comparisons were made between a control condition and activation of specific inhibitory neurons, a time window following the blue light pulse was used where the response was significant compared with baseline and significantly suppressed compared with control. The suppression slope was obtained by fitting a line to the comparison plot. Suppression strength was computed by examining the normalized difference of values between the two conditions relative to the maximum control value.
Statistical tests. To assess the significance of our results we used paired Wilcoxon signed-rank tests when the same neuron populations were compared between two conditions (in presence or absence of ChR2 stimulation), unpaired t-tests when populations of different sizes were compared and ANOVA when more than two unpaired distributions were compared. All tests used in this paper were two-sided. No blinding or randomization of samples was done in any of our analyses. For each experiment and figure, enough data were collected to guarantee the validity of our statistical test. This was generally reflected by the unimodality of population distributions with low s.d. We also performed the normality test and our samples could be described by a Gaussian distribution whenever we used a t-test to assess the significance of our results. Variances were computed for all groups and were generally in the same order of magnitude. When this was not the case, as for instance when comparing PV þ and SOM þ response properties, any statistical test resulted in highly significant differences.
Network model. The network model was similar in overall structure to one recently described 46 . It consisted of 10,000 neurons randomly distributed in a twodimensional layer. A total of 8,000 of these neurons were excitatory neurons, 1,000 neurons were PV þ neurons and the remaining 1,000 were SOM þ neurons.
All neurons were modelled as conductance-based leaky integrate-and-fire neurons with a membrane time constant t m ¼ 25 ms, a leak conductance of G leak ¼ 10 nS and a resting membrane potential of V rest ¼ À 70 mV. The neuron emitted a spike whenever the membrane potential crossed the threshold V th ¼ À 40 mV after which the voltage was artificially clamped at a reset membrane value V reset ¼ À 65 mV for a refractory period of t ref ¼ 5 ms. All the values used in the model were in the physiological range 53,54 .
Synaptic interactions were modelled as instantaneous increases in excitatory (pyramidal cells) or inhibitory (PV þ and SOM þ neuron) conductances followed by exponential decays with time constants t exc ¼ 6 ms and t inh ¼ 20 ms. The reversal potentials of the corresponding receptors were E exc ¼ À 0 mV and E inh ¼ À 75 mV. The synaptic weights were w exc ¼ 1.5 nS for excitatory synapses and w inh ¼ 30 nS for inhibitory synapses. The equations for the network dynamics were: where iA[1 À 10,000], g PC , g PV þ and g SOM þ are expressed in unit of leak conductances and S PC , S PV þ and S SOM þ are synaptic inputs from pre-synaptic PC, PV þ and SOM þ cells impinging on the post-synaptic neuron i. All neurons in the network had connections with 2% of the rest of the network that were drawn randomly from a distance-dependent distribution. Pyramidal cells and PV þ neurons received inputs and formed projections following a normal distribution with a s.d. of 0.1 mm compared with the network length of 2 mm, whereas SOM þ neurons received inputs from pyramidal cells exclusively and uniformly from the network with four times as many connections compared with other cell types. They also projected their connections to pyramidal cells and PV þ cells with a distance-dependent connectivity rule described by a normal distribution with a s.d. of 0.1 mm. Periodic boundary conditions were assumed for all connections. Interaction delays were also distance dependent with a velocity of 0.1 mm ms À 1 .
To maintain an ongoing regime, all neurons were fed with Poisson processes with an average firing rate of 40 spikes per second and synaptic weights w ext PC ¼ 12nS, w ext PV þ ¼ 15nS and w ext SOM þ ¼ 7:5nS. As SOM þ cells did not receive any inhibitory inputs, an additional Poisson input was added to these cells with an average firing rate of 40 spikes per second and synaptic weight of 1.5 nS.
To mimic the sensory input, a two-dimensional external layer projected onto the pyramidal and PV þ neurons of the recurrent network with a 2% density and following a distance-dependent Gaussian distribution with a s.d. of 0.2 mm. To simulate the sparse noise condition, a small Gaussian pattern with spatial s.d. of 0.2 mm, duration of 50 ms and peak average firing rate of 2,000 spikes per second was applied in the external layer. Full-field flashes were simulated by increasing the spatial s.d. to infinity (uniform distribution) and changing the external drive from 0 to 1,000 spikes per second to mimic different luminances. The sensory stimulation was repeated every 500 ms. To mimic channelrhodopsin activation of various inhibitory neuron types, a fixed conductance was injected to all neurons simultaneously at the onset of the sensory response. Values used for PV þ neurons were 20 or 30 nS, and for SOM þ neurons 40 or 50 nS.
All simulations were performed using the NEST simulator 55 and the PyNN interface 56 .