Introduction
A now-standard analysis in cognitive neuroscience trains a linear classifier to discriminate two task conditions from population activity at time t within a trial, then tests that fixed classifier at every other time t' (King and Dehaene, 2014). The resulting temporal generalization matrix (TGM) is interpreted geometrically: strong off-diagonal generalization is taken as evidence that "the same neural code is maintained" across time, whereas a narrow diagonal band is taken as evidence for a "dynamic" code - a moving sequence of distinct representations (Stokes et al., 2013). This stable-versus-dynamic dichotomy has been used to argue about working memory maintenance, the time course of conscious access, and prefrontal control.
This paper asks a precise question: does the TGM actually identify whether the coding direction changed over time? We work entirely inside the linear-Gaussian, linear-decoder model in which TGMs are computed, and show that the answer is no. The TGM confounds two physically distinct things - a change in the discriminative signal direction and a change in the trial-by-trial noise covariance - because a linear decoder's behavior depends on both. We make the confound exact, give two fully worked counterexamples with explicit numbers, and propose concrete (but unrun) analyses that separate the two sources. The mechanism - that the optimal linear decoder is the noise-whitened signal direction, not the signal direction itself - is classical (Moreno-Bote et al., 2014); our contribution is the sharp identifiability statement for TGM interpretation and the disambiguation recipe.
Setup
Consider a binary discrimination (condition label s in {+1, -1}, equiprobable). At each within-trial time t the population vector x_t in R^N is modeled as
x_t = s * mu_t + e_t, e_t ~ N(0, Sigma_t),
where mu_t in R^N is the class-discriminative mean direction at time t and Sigma_t is the symmetric positive-definite (SPD) trial-by-trial noise covariance at time t. This is the standard signal-plus-Gaussian-noise population model underlying linear decoding and linear RSA (Kriegeskorte et al., 2008; Kriegeskorte and Diedrichsen, 2019). A linear decoder trained at time t is, at the optimum (Fisher LDA), the weight vector
w_t = Sigma_t^{-1} mu_t.
Tested at time t', the scalar decision variable is w_t^T x_{t'}; its class-conditional means are +/- w_t^T mu_{t'} and its variance is w_t^T Sigma_{t'} w_t. The cross-temporal sensitivity (the population d-prime, the natural continuous readout behind decoding accuracy) is therefore
d'(t -> t') = 2 (w_t^T mu_{t'}) / sqrt(w_t^T Sigma_{t'} w_t) = 2 (mu_t^T Sigma_t^{-1} mu_{t'}) / sqrt(mu_t^T Sigma_t^{-1} Sigma_{t'} Sigma_t^{-1} mu_t). (1)
The diagonal is the within-time decodability d'(t -> t) = 2 * sqrt(mu_t^T Sigma_t^{-1} mu_t). Equation (1) is the entire content of a (sensitivity-valued) TGM; everything below is read off it.
The exact confound
Define the whitened coding vector v_t = Sigma_t^{-1/2} mu_t. The diagonal is d'(t -> t) = 2 ||v_t||. For equal-covariance times (Sigma_t = Sigma_{t'} = Sigma) equation (1) collapses to
d'(t -> t') = 2 * (v_t^T v_{t'}) / ||v_t|| = 2 ||v_{t'}|| cos(angle(v_t, v_{t'})),
so under the (usually unstated) assumption of stationary noise, off-diagonal generalization is exactly the geometry of the whitened coding directions. The interpretive leap "off-diagonal generalization = stable code" is the claim that v_t is constant in direction. But v_t = Sigma_t^{-1/2} mu_t entangles the signal mu_t with the noise geometry Sigma_t. When Sigma_t is allowed to vary over time - which it generally does, since attention, arousal, and adaptation reshape noise correlations within a trial - the TGM can no longer attribute a change in v_t to the signal versus the noise. Formally: equation (1) is invariant under any reparametrization (mu_t, Sigma_t) -> (mu_t*, Sigma_t*) that preserves the two bilinear forms mu_t^T Sigma_t^{-1} mu_{t'} and mu_t^T Sigma_t^{-1} Sigma_{t'} Sigma_t^{-1} mu_t for all pairs. Distinct trajectories with the same forms are indistinguishable by the TGM. The next two sections instantiate this with concrete numbers.
Counterexample 1: a constant code that "looks dynamic"
Take N = 2 and a perfectly constant coding direction mu_t = mu_{t'} = (1, 0)^T. Let the training time have isotropic noise Sigma_t = I, and let the test time have a rotated noise covariance whose inverse is
Sigma_{t'}^{-1} = [[1, c], [c, b]], SPD with b > c^2.
This choice fixes (Sigma_{t'}^{-1}){11} = 1, so the within-time decodability is preserved across the two times: d'(t -> t) = 2 and d'(t' -> t') = 2 sqrt(mu^T Sigma{t'}^{-1} mu) = 2 sqrt(1) = 2. Decoding accuracy is therefore flat over time - nothing in the diagonal hints at any change. Now the off-diagonal. With w_t = Sigma_t^{-1} mu = (1, 0)^T and Sigma_{t'} = (Sigma_{t'}^{-1})^{-1} = 1/(b - c^2) * [[b, -c], [-c, 1]], equation (1) gives
d'(t -> t') = 2 / sqrt((Sigma_{t'})_{11}) = 2 sqrt((b - c^2) / b) = 2 sqrt(1 - c^2 / b).
For c = 0.6, b = 1 (det = 0.64 > 0): d'(t -> t') = 2 sqrt(0.64) = 1.6, a generalization index of 0.8 relative to the diagonal of 2.0. The classifier trained at t generalizes visibly worse* to t' - the textbook signature of a "dynamic" or "evolving" code - even though the discriminative signal direction is literally identical at the two times and within-time decodability is unchanged. The entire effect is produced by the off-diagonal noise correlation c appearing at t'. Reduced temporal generalization therefore does NOT imply a non-stationary coding direction.
Counterexample 2: an orthogonal (genuinely dynamic) code that "looks stable"
Now the converse. Take mu_t = (1, 0)^T and mu_{t'} = (0, 1)^T - the coding directions are exactly orthogonal, the strongest possible form of a dynamic code. Naively the decoder trained at t should be at chance at t'. Let training-time noise be anisotropic with
Sigma_t^{-1} = [[1, 3], [3, 10]] (SPD: leading minor 1 > 0, det = 10 - 9 = 1 > 0),
and let test-time noise be isotropic, Sigma_{t'} = I. Then w_t = Sigma_t^{-1} mu_t = (1, 3)^T - the Fisher decoder is rotated away from mu_t toward the high-information axis. The diagonal is d'(t -> t) = 2 sqrt(mu_t^T Sigma_t^{-1} mu_t) = 2 sqrt(1) = 2. The off-diagonal from equation (1):
numerator = 2 w_t^T mu_{t'} = 2 (1, 3) . (0, 1) = 6, denominator = sqrt(w_t^T Sigma_{t'} w_t) = sqrt(1 + 9) = sqrt(10) = 3.1623, d'(t -> t') = 6 / 3.1623 = 1.897,
a generalization index of 0.95 relative to the diagonal. A classifier trained on one representation transfers at 95 percent to an orthogonal representation. The mechanism is transparent: anisotropic training noise tilts the Fisher decoder w_t = Sigma_t^{-1} mu_t off the present coding axis and onto the future one. Strong temporal generalization therefore does NOT imply a stationary coding direction.
What the TGM does and does not identify
Equations (1) and the two examples establish the precise statement: the TGM identifies the family of whitened cross-time forms, not the signal trajectory {mu_t}. Because the linear decoder is w_t = Sigma_t^{-1} mu_t, the cross-temporal readout is a property of the signal direction as seen through the inverse noise covariance. Two regimes the TGM cannot tell apart on its own are (i) a stationary signal viewed through rotating noise (Counterexample 1) and (ii) a rotating signal viewed through anisotropic noise (Counterexample 2). The diagonal of the TGM is equally unreliable as a control, since it can be held constant while the off-diagonal moves (Counterexample 1). The often-implicit premise that rescues the standard interpretation is noise stationarity - Sigma_t constant in time - which is rarely tested and is contradicted by known within-trial dynamics of neural variability.
Proposed disambiguating analyses (proposals, not performed)
These are analysis recipes a data-holding lab could run; we specify them but report no results, as we have no data.
- Signal-only generalization. Estimate the raw class-mean directions mu_t = (mean_{s=+1} x_t - mean_{s=-1} x_t)/2 and compute the correlation-blind generalization cos(angle(mu_t, mu_{t'})) using the raw (unwhitened) means. Divergence between this signal-only matrix and the standard whitened TGM localizes the apparent dynamics to the noise geometry rather than the code.
- Direct covariance-stationarity test. Estimate Sigma_t at each time from residuals and test the null Sigma_t = Sigma_{t'} (e.g., a Box-type or log-Euclidean distance on SPD matrices with a trial-shuffle null). If noise is stationary, the standard TGM interpretation is licensed; if not, off-diagonal structure must be attributed jointly.
- Noise-geometry-invariant readout. Decode with the raw mean-difference direction mu_t (a correlation-blind, non-Fisher decoder) instead of Sigma_t^{-1} mu_t. Its temporal generalization reflects signal geometry alone, at the cost of statistical efficiency; comparing it to the Fisher TGM isolates the noise contribution.
Assumptions and limitations
The analysis is exact within the binary linear-Gaussian model with full-rank covariances and linear decoders - precisely the regime in which TGMs are computed, so the confound is not an artifact of a toy assumption. Regularized decoders replace Sigma_t^{-1} by (Sigma_t + lambda I)^{-1}, which rescales the constants but preserves the qualitative coupling between decoder and noise geometry, so the identifiability failure persists. The argument does not claim that all reported TGM dynamics are noise artifacts - only that the standard interpretation is not entitled to attribute them to the code without separately establishing noise stationarity. Genuinely nonlinear codes, non-Gaussian noise, and multi-class problems are outside the exact derivation, though the decoder-noise coupling that drives the confound is generic. Finally, the proposed analyses are stated, not run; their power on real recordings is an empirical question we flag for prospective work.
Conclusion
Cross-temporal decoding is a sensitivity functional of the noise-whitened coding direction, not of the coding direction. Consequently the temporal generalization matrix cannot, by itself, separate a change in the neural code from a change in the noise covariance: a constant code can present reduced off-diagonal generalization and an orthogonal code can present near-complete generalization, both demonstrated here in closed form. Interpreting the off-diagonal structure of a TGM as evidence about code stationarity requires an explicit, separately tested assumption of noise stationarity, or one of the disambiguating analyses we propose.
References
- King, J.-R., and Dehaene, S. (2014). Characterizing the dynamics of mental representations: the temporal generalization method. Trends in Cognitive Sciences, 18(4), 203-210.
- Stokes, M. G., Kusunoki, M., Sigala, N., Nili, H., Gaffan, D., and Duncan, J. (2013). Dynamic coding for cognitive control in prefrontal cortex. Neuron, 78(2), 364-375.
- Kriegeskorte, N., Mur, M., and Bandettini, P. (2008). Representational similarity analysis - connecting the branches of systems neuroscience. Frontiers in Systems Neuroscience, 2, 4.
- Moreno-Bote, R., Beck, J., Kanitscheider, I., Pitkow, X., Latham, P., and Pouget, A. (2014). Information-limiting correlations. Nature Neuroscience, 17(10), 1410-1417.
- Kriegeskorte, N., and Diedrichsen, J. (2019). Peeling the onion of brain representations. Annual Review of Neuroscience, 42, 407-432.