This paper, originally presented at NeurIPS 2022, introduces STNDT (SpatioTemporal Neural Data Transformer), a novel architecture designed to decode the "language" of the brain by modeling how populations of neurons interact across both time and space.
The Challenge of Noisy Neural Data
In systems neuroscience, a primary goal is to understand how the collective activity of thousands of neurons (a "population") drives behavior. However, recording this activity is inherently messy. Single-trial spiking data is incredibly noisy and stochastic; a neuron might fire at one millisecond and stay silent the next, even if the animal is performing the exact same movement.
To find the signal in the noise, researchers try to infer the underlying "firing rate"—the smooth, latent probability of a neuron spiking. Previous methods like Neural Data Transformers (NDT) were a breakthrough because they leveraged the parallel processing power of Transformers to model these dynamics quickly. However, standard NDTs primarily focused on the temporal dimension (how activity changes over time), treating different neurons simply as features in a vector. This approach ignored the "spatial" relationship—the rich, complex ways that individual neurons influence and correlate with one another.
Introducing the SpatioTemporal Neural Data Transformer
To address this limitation, the authors introduce STNDT. Its architecture is built on two main pillars:
- Dual Attention Mechanism: Unlike standard Transformers that only attend over time, STNDT interleaves Temporal Attention (modeling how a population's state evolves) and Spatial Attention (modeling how individual neurons relate to each other). This allows the model to learn which neurons "listen" to which others.
- Contrastive Learning Loss: In addition to the standard "mask modeling" task (where the model tries to predict missing spikes, similar to how language models predict missing words), the authors added a contrastive loss (NT-XEnt). This forces the model to produce similar latent representations for different "views" of the same trial (e.g., the same data with different random noise or dropped neurons), making the model much more robust to the inherent jitter of neural data.
Crucially, the model remains unsupervised and behavior-agnostic, meaning it learns the structure of the neural activity without needing to know what the animal was actually doing (e.g., moving a joystick or looking at a screen).
Key Insights: Mapping the Brain's "Drivers"
- Spatial Attention as a Biological Map: The most striking finding is that the spatial attention weights are highly interpretable. In early layers, the model consistently attends to a small, specific subset of neurons across different trials.
- Identifying "Driver" Neurons: When the authors "silenced" the neurons that the model flagged as important (those with high attention weights), the model's performance plummeted. Dropping the same number of random neurons had almost no effect. This suggests STNDT can identify the "heavy lifters" or driver neurons in a population.
- Cross-Model Generalization: Interestingly, the neurons identified as important by STNDT were also critical for a vanilla NDT model. This implies STNDT is uncovering fundamental biological properties of the neural population, not just artifacts of its own architecture.
Performance and Results
The model was evaluated using the Neural Latents Benchmark (NLB), a standardized suite of four datasets recorded from rhesus macaques (MC_Maze, MC_RTT, Area2_Bump, and DMFC_RSG). These datasets represent a wide variety of neural dynamics, from autonomous (internal) to non-autonomous (input-driven) systems.
- State-of-the-Art Performance: STNDT (specifically the ensemble version) achieved SOTA results on the primary metric, co-bps (co-smoothing bits per spike), across all four benchmark datasets. On the MC_Maze dataset, STNDT achieved a co-bps of 0.3862, outperforming the previous best at 0.3676.
- Behavioral Decoding: Firing rates inferred by STNDT could be used to accurately reconstruct the animal's hand trajectories, even though the model was never trained on behavioral data.
Limitations and Future Work
While STNDT dominates in predicting neural activity (co-bps), its performance on secondary metrics like velocity decoding ($R^2$) is often on par with, rather than significantly better than, existing methods like MINT or AutoLFADS. Additionally, like many Transformer-based models, STNDT requires careful hyperparameter tuning to reach peak performance.
Looking forward, the authors suggest that incorporating physical electrode location data (actual 3D space in the brain) into the spatial attention mechanism could further improve the model's biological interpretability.
Summary updated