In vitro electrophysiological recordings.

All animal experiments were performed using published procedures46,47 in accordance with the rules of the Swiss Federal Veterinary Office. Briefly, somatosensory brain slices were obtained from postnatal day 14–18 wild-type mice (C57BL6/J) and whole-cell patch-clamp recordings were performed at 35 °C from L5 pyramidal neurons. The pipette solution consisted of 135 mM potassium gluconate, 4 mM KCl, 4 mM Mg-ATP, 10 mM sodium phosphocreatine, 0.3 mM Na 3 -GTP and 10 mM HEPES (pH 7.3, 290 mOsm). During the experiments, we blocked all excitatory synaptic transmission by adding CNQX (20 μM) and D-AP5 (50 μM) to the bath solution. All electrophysiological data were low-pass Bessel filtered at 10 kHz and digitized at 20 kHz. Measurements were not corrected for the liquid junction potential. Recordings characterized by instabilities in the action potential shape or large drifts in the baseline firing rate r 0 were excluded from the data set upon visual inspection.

Current injections.

To characterize single neurons with the standard tools of linear system analysis, we performed 64-s-long experiments in which noisy currents modulated by sinusoidal means were delivered in current-clamp mode. The injected current, denoted I ext (t), was generated according to the following equation

where I 0 is a constant offset, ΔI mean controls the amplitude of the sinusoidal mean and ΔI noise defines the s.d. of the noise. The noise N(t) was generated with an Ornstein-Uhlenbeck process with zero mean, unitary variance and a temporal correlation of 3 ms.

Each experiment consisted of many injections of currents generated according to equation (4). In the first half of the experiment (training set), we performed six injections using different periods of modulation T∈{0.5,1,2,4,8,16} in seconds. Stimuli were delivered in random order and, for each of the six injections, a new realization of the noise was used. In the second part of the experiment (test set), one of the two slowest modulations (T = 8 or 16 s) was chosen and more injections were performed. To assess the reliability of single neurons, the same realization of noise was used (frozen noise). Injections were performed with an interstimulus interval of 1 min.

Before and after each injection, we stimulated the neuron with two additional inputs. The first input was a 2.5-s-long current composed of a hyperpolarizing step followed, after 500 ms, by a suprathreshold step. We used the response to this stimulus to identify the neuronal type (L5 burst-generating cells were not included in the data set). The second input was a 4-s-long subthreshold noisy current generated with an Ornstein-Uhlenbeck process with zero mean and temporal correlation of 3 ms. We used this second injection to characterize the electrode response and perform active electrode compensation (see below and Supplementary Data Preprocessing).

At the beginning of each experiment, we tuned the input parameters I 0 , ΔI mean and ΔI noise to obtain a firing rate r mean that oscillated periodically between 2 and 6 Hz. Typical values obtained after calibration were comprised in the range 100–450 pA for I 0 , 15–30 pA for ΔI mean and 50–150 pA for ΔI noise .

Linear analysis.

For each neuron, we estimated the transfer function (Fig. 4h–j) using previously described methods21,38. Briefly, the experimental spike train was built by selecting the times at which the membrane potential V(t) crossed 0 mV from below. We then obtained the firing rate r(t) by building a histogram of the spike times. The bin size was such that each period of modulation T was divided into 30 bins. For each input frequency ω = 2π/T, we finally obtained the transfer function by minimizing the sum of squared errors between the sinusoidal function r linear (t)=C 0 +C 1 ·sin(ωt+φ) and the experimental firing rate r(t), with {C 0 ,C 1 ,φ} being the only free parameters. The transfer functions of GLIF-ξ models (Fig. 4h–j) were obtained with the same method.

GLIF-ξ model.

The spiking neuron models discussed are GLIF models equipped with a spike-triggered mechanism for SFA and with escape-rate noise for stochastic spike emission (Fig. 1). Spikes are produced according to a point process with conditional firing intensity λ(t), which exponentially depends on the momentary distance between the membrane potential V(t) and the effective firing threshold V T (t) (ref. 48)

where λ 0 has units of s−1 so that λ(t) is in Hz and ΔV defines the sharpness of the threshold. Consequently, the probability of a spike occurring at a time is

In the limit of ΔV → 0, the model becomes deterministic and action potentials are emitted at the moment when the membrane potential crosses the firing threshold. For finite ΔV and a membrane potential at threshold (that is, when V = V T ), λ 0 −1 defines the mean latency until a spike is emitted.

The subthreshold dynamics is modeled as a standard leaky integrator defined by the following ordinary differential equation for the membrane potential V

where the three parameters C, g L and E L determine the passive properties of the membrane, the dot denotes the temporal derivative and I ext is the injected current.

The dynamics of the effective firing threshold V T (t) in equation (5) is given by

where is a constant, are the times at which action potentials have been fired and ξ(s) is an effective adaptation filter that accounts for all the biophysical events triggered by the emission of an action potential. According to equation (8), each time a spike is emitted, a threshold movement with stereotypical shape ξ(s) is triggered, after a delay of absolute refractoriness T ref . Threshold movements induced by different spikes accumulate and therefore produce SFA, if ξ > 0. For s < 0, we fixed ξ(s) = 0 so that only spikes in the past can affect the momentary value of the firing threshold. The adaptation filter ξ(s) also accounts for adaptation processes mediated by spike-triggered currents. Consequently, V T (t) does not describe the physiological threshold (that is, the membrane potential at which action potentials are initiated in vitro), but has to be interpreted as a phenomenological model of spike-triggered adaptation. Finally, the functional shape of ξ(s) was not defined a priori, but was obtained by combining the effects of both spike-triggered currents and movements of the physiological threshold, which were in turn extracted from the experimental data.

In principle, an absolute refractory period can be included in the adaptation kernel ξ(s). Instead, we preferred to work with an explicit reset after a dead time. Each time a spike is emitted the membrane potential is reset to V r and the numerical integration is restarted after a short period of absolute refractoriness T ref . The GLIF-ξ model only differs from a generalized linear model49,50 as a result of this explicit reset.

The three GLIF-ξ models discussed differ in the duration and shape of the adaptation filter ξ(s). In GLIF-ξ L and GLIF-ξ S , the functional shape of ξ(s) is directly extracted from intracellular recordings and the duration of the adaptation filters are 22 s and 1 s, respectively. In GLIF-ξ PL , the adaptation filter ξ(s) is modeled as a truncated power law and lasts for 22 s.

Data preprocessing.

In vitro recordings were preprocessed to remove the bias resulting from the voltage drop across the recording electrode. For that, we performed active electrode compensation51 following the procedure described in ref. 52. The electrode response was estimated before, during and after each 64-s-long injection. Consequently, we were able to remove experimental drifts resulting from slow changes in the electrode properties (Supplementary Data Preprocessing and Supplementary Figs. 6–8).

Fitting the GLIF-ξ model on in vitro recordings.

To fit GLIF-ξ models, we extended the method introduced in ref. 33 by adding a hidden variable, I drift (t), able to absorb small drifts that are likely to occur in long recordings.

To get an accurate estimation of the effective adaptation filter ξ(s), we first fitted a two-process GLIF model (Supplementary Fig. 1) that explicitly features both a spike-triggered current η(s) and a spike-triggered movement of the firing threshold γ(s) (Fig. 2). The effective adaptation filter ξ(s), was then obtained by combining η(s) and γ(s) according to the following formula

where is the membrane filter, ΘΘ(s) is the Heaviside step function, and τ m = RC. The functional shapes of η(s) and γ(s) were not assumed a priori, but were directly extracted from the experimental data by the following two-step procedure.

In the first step, we extracted the functional shape of η(s), together with all the parameters that determine the subthreshold dynamics, by fitting to the experimental voltage derivative , where ΔT = 0.05 ms was given by the experimental sampling frequency. Given that adaptation currents directly affect the membrane potential dynamics, we fitted with the following model

where equation (7) was extended with a spike-triggered current η(s) and the additional term I drift (t) is an unknown current that averages out to zero over time and captures experimental drifts during individual injections. To avoid any a priori assumption on the functional shape of the spike-triggered current, we defined η(s) as linear combination of basis functions

where the coefficients α k control the shape of η(s) and are rectangular functions of width Δ k and centered at T k . For GLIF-ξ L , we used K = 45 log-spaced non-overlapping bins with Δ k ranging from 0.5 ms to 4 s. For GLIF-ξ S , we set K = 30 and Δ k ∈ [0.5, 200] ms. Similarly, we defined I drift (t) as a piecewise constant function

For both GLIF-ξ L and GLIF-ξ S , we constrained I drift (t) to vary slowly in time by choosing a small number L = 5 of regularly spaced bins of size Δ = 12.8 s.

As in refs. 33 and 53, given the injected current I ext and the estimate of the membrane potential obtained after electrode compensation V data , optimal parameters (minimizing the sum of squared errors between and of equation (10)) were obtained by solving a multilinear regression problem in discrete time. As GLIF models do not account for the action potential waveform, all of the data points were excluded from the fit. Finally, we fixed the absolute refractory period at T ref = 2 ms and obtained the voltage reset V r by averaging the membrane potential measured T ref milliseconds after the spikes.

Performing parameter extraction in presence of the term I drift (t) slightly improved the predictive power of the model (Supplementary Fig. 3). Note, however, that the term I drift (t) was not part of the model, but was only used in the fitting procedure to absorb slow changes in the subthreshold potential that could not be explained by spike-triggered processes.

Given the subthreshold dynamics, the second step consisted of estimating the parameters of the firing threshold. Given that spike-triggered currents were already captured by the filter η(s), the effective threshold defined in equation (8) was replaced by

where describes the physiological threshold at which action potentials were initiated in vitro. In contrast to ξ(s), γ(s) is not a phenomenological model, but describes physiological changes of the firing threshold triggered by the emission of previous spikes. Similarly to η(s), we defined the moving threshold γ(s) as a linear combination of rectangular basis function

with f k (s) as in equation (11). Finally, the functional shape of γ(s), along with the parameters and ΔV, were extracted from experimental data by maximizing the log-likelihood of the observed spike-train54

where are the threshold parameters, is a set that excludes periods of absolute refractoriness and the conditional firing intensity λ θ (s) is given by

where V(t) was obtained by integrating equation (10) and, without loss of generality, we set λ 0 = ΔT−1. With the exponential function in equation (16), the log-likelihood to maximize is a concave function of θ (ref. 55). Consequently, the fit could be performed in discrete time using standard gradient ascent methods33,49,50.

With this fitting procedure, an inaccurate estimation of the spike-triggered current η(s) would affect the measure of the moving threshold γ(s). To ensure that the estimation of γ(s) that we obtained could indeed be attributed to a movement of the physiological threshold, we also extracted the threshold parameters using the experimental membrane potential V data , rather than V (Fig. 2a).

Power-law fit of the effective adaptation filter ξ(s).

For GLIF-ξ PL , the effective adaptation filter ξ L (s) extracted from the intracellular recordings was fitted with a truncated power-law ξ PL (s) (equation (2)). The fit was performed in two steps. First, we estimated the magnitude α ξ and the scaling exponent β ξ using a least-square linear regression performed in log-log space. For that, data points were logarithmically resampled and excluded from the fit if ξ L (s) < 5 × 10−3 mV or s < 5 ms. Second, we obtained the cutoff T ξ by calculating the intercept between the power-law fitted in the first step and the average value of the extracted kernel ξ L (s) computed on the first 5 ms. A similar procedure (that is, least-square linear regression in log-log space with logarithmically resampled points) was used for the power-law fit of the spike-triggered current η(s) and the spike-triggered movement of the firing threshold γ(s) shown in Figure 2a.

Performance evaluation.

All of the performances reported in this study were evaluated on data sets that have not been used for parameter extraction. For the predictions reported in Figures 3 and 4a–g, the model fitted on the first half of the experiment (training set) was used to predict the responses observed in the second half (test set). Given that, in certain experiments, the average firing rates r 0 observed in the test set were slightly different than the ones of the training set, the parameter was readjusted using the first 16 s of all the test set injections and models were validated on the responses recorded in the remaining 48 s. According to this procedure, models that do not capture SFA on slow timescales were expected to overestimate the average firing rate r 0 . For the predictions reported in Figure 4h–j, a leave-one-out strategy was used. In this case, models fitted on the responses to five different periods of modulation were used to predict the sixth one.

To evaluate spike-timing prediction, we used the similarity measure introduced in ref. 35. quantifies the similarity between two groups of spike trains generated by two stochastic processes and corrects the bias caused by the small number of available repetitions. takes values between 0 and 1, where = 0 indicates that the model is unable to predict any of the observed spikes and = 1 means that the two groups of spike trains have the same instantaneous firing rate and are statistically indistinguishable. can also be interpreted as the number of spikes correctly predicted (here with a precision of ±4 ms) divided by an estimate of the number of reliable spikes.

Estimating the statistical properties of the input current received in vivo by neocortical pyramidal neurons.

To test the hypothesis that power-law adaptation contributes to efficient coding by whitening the single neuron output, we estimated the power spectrum of the currents ΔI(f) received as input at the somata of neocortical pyramidal neurons in vivo. According to equation (10), in the absence of spikes, the membrane potential ΔV(t) is a low pass–filtered version of the input current, where the cutoff frequency is defined by the membrane timescale. Consequently, at all frequencies , we have , with ΔV(f) being the power spectrum of the subthreshold membrane potential fluctuations and R being the cell resistance.

We estimated ΔV(f) using 20-s-long whole-cell recordings (n = 57) of the synaptically driven membrane potential dynamics obtained from seven different L2/3 pyramidal neurons of behaving mice (data from ref. 31). All the in vivo recordings were performed in primary somatosensory barrel cortex during active whisker sensation (see ref. 31 for more details). Spike-triggered currents last for more than 20 s and can in principle affect ΔV(f) even at very low frequencies. For this reason, only trials with low firing rates r 0 < 0.5 Hz were used. However, including recordings with r 0 > 0.5 Hz did not affect the results.

Simulating the population response to in vivo–like inputs.

To obtain the results reported in Figure 5, we simulated a population of N = 100 unconnected GLIF-ξ PL neurons in response to a 4,000-s-long current I(t) characterized by a power spectrum , with β I = 0.67. Model parameters are given in Supplementary Table 1 and input currents were generated by numerically solving the following inverse Fourier transform29

where N(f) is a Gaussian white-noise process, the phases φ(f) were independently sampled from a uniform distribution and the scaling factor Λ was adjusted to fit the power spectrum of the subthreshold membrane potential fluctuations observed in vivo (Fig. 5a). To avoid unrealistically large power at low frequencies, we introduced a cutoff ΔI(f) = 0, for f < 0.025 Hz. The highest frequency in the signal was determined by the time step ΔT = 0.5 ms used for numerical simulations. The mean input I 0 was adjusted to obtain a plausible average activity of A 0 = 4 Hz, which was consistent with the firing rates obtained in vitro. Finally, the population activity A(t) was constructed by counting the number of spikes falling in bins of 50 ms and its power spectrum A(f) was computed using time series of 40 s.

Statistics.

The number of cells used for the analysis (n = 12 or n = 14) was limited by experimental constraints. Data analysis only started after complete data collection and no data were excluded. Two-sided Student t test was used as a standard. Normality was verified using the Anderson-Darling test. Multiple comparison correction was not appropriate and was therefore not used.