TL;DR
The paper introduces NEDS (Neural Encoding and Decoding at Scale), a multimodal transformer model that unifies neural encoding and decoding into a single framework. By leveraging a novel multi-task-masking strategy and pretraining across dozens of animals, NEDS achieves state-of-the-art performance on new, unseen subjects and naturally learns neuron embeddings that map out distinct brain regions without explicit supervision.
What Problem Does This Paper Address?
In systems neuroscience, understanding the relationship between brain activity and behavior typically falls into two categories: encoding (predicting neural spikes from behavioral inputs) and decoding (predicting behavior from neural spikes).
While recent deep learning foundation models have scaled up neural data analysis, existing large-scale models are strictly task-specific—they are engineered to perform either encoding or decoding, but not both. This one-way bottleneck prevents models from capturing the true bidirectional, closed-loop relationship between the brain and behavior. Furthermore, building a unified model is challenging due to the heterogeneous nature of neural recordings (which span different animals, sessions, and brain regions) and behavioral data (which mix continuous signals like velocity with discrete choices).
Methods
To bridge this gap, the authors present NEDS, a multimodal transformer architecture designed to seamlessly translate between neural activity and behavior.
The core innovation is a multi-task-masking strategy applied during self-supervised pretraining. Instead of standard token masking, NEDS alternates between four distinct masking schemes:
- Neural Masking: Completely masks neural activity to force the model to predict spikes from behavior (learning the encoding distribution).
- Behavior Masking: Completely masks behavioral variables to force the model to predict actions from spikes (learning the decoding distribution).
- Within-Modality Random Masking: Randomly masks tokens within a single modality to capture intra-modal dependencies.
- Cross-Modal Random Masking: Randomly masks tokens across both modalities to encourage the model to learn joint representations.
Architecturally, NEDS tokenizes neural spike counts and behavioral variables independently using modality-specific tokenizers. These tokens are augmented with temporal, modality, and session-specific embeddings before being fed into a shared transformer encoder. Modality-specific decoders then reconstruct the original data based on the masking task.
Datasets
The primary dataset used for pretraining and evaluation is the International Brain Laboratory (IBL) repeated site dataset. This massive open-science resource contains Neuropixels recordings from 83 mice performing the same visual decision-making task. The dataset includes:
- Neural data from 27,380 neurons across 225 brain regions.
- Four behavioral task variables: whisker motion, wheel speed, choice (left/right), and the "block" prior.
The model was pretrained on 73 animals (74 sessions) and evaluated on 10 held-out animals. To demonstrate cross-species flexibility, the authors also validated NEDS on the MC-RTT primate motor task dataset, a benchmark involving Utah array recordings from monkeys performing a target-reaching task.
Key Insights and Ideas
- Unification via Masking: NEDS proves that neural encoding and decoding do not require separate architectures. Treating them as conditional probability distributions that can be toggled via targeted masking allows a single transformer to excel at both.
- The Power of Multi-Animal Scaling: Pretraining on data from dozens of animals provides a massive boost when fine-tuning on a completely new subject. The model learns generalized features of the mouse brain that transfer across individuals.
- Emergent Anatomical Mapping: One of the most striking findings is that NEDS's learned neuron embeddings naturally cluster by anatomical brain regions. Even though the model was never given brain region labels during training, the latent space inherently organized itself by functional anatomy.
Key Results
NEDS consistently outperformed linear baselines, unimodal variants, and state-of-the-art large-scale models like POYO+ and NDT2.
- Encoding & Decoding Boost: Multi-session NEDS improved decoding performance by 4–11% and spike encoding by 24% compared to its single-session counterpart.
- Baseline Comparison: When evaluated on held-out animals, NEDS outperformed the self-supervised neural model NDT2 by 11–37% and the multi-task decoding model POYO+ by 1–13% across all decoding metrics.
- Anatomical Classification: Linear classifiers trained on NEDS's emergent neuron embeddings predicted the correct brain region with 83% accuracy (compared to just 45-50% for unimodal versions).
Limitations and Future Work
While NEDS represents a major step toward a neural foundation model, the authors note a few key limitations:
- Trial-Alignment Dependency: The current framework relies entirely on trial-aligned data, which restricts the volume of training data that can be ingested. Future iterations will aim to leverage unaligned, continuous recordings.
- Compute Constraints: Due to high computational costs, extensive hyperparameter tuning was not performed during the full 73-animal pretraining phase.
- Modality Expansion: The authors plan to extend NEDS to incorporate additional neural modalities, such as local field potentials (LFPs) and raw electrophysiological waveforms, which could unlock the ability to identify specific cell types.
Summary updated