Neural Data Needs Semantic Tokenization: Behavioral Events as Boundaries of Session-Transferable Tokens
Organizations: Interdisciplinary Program in Artificial Intelligence Seoul National University Seoul, 08826, South Korea · Department of Psychology Seoul National University Seoul, 08826, South Korea
Abstract
Extracellular electrophysiology records a different set of neurons in every session. Neural foundation models embed each neuron and each session into their tokens, so every new session is an input they have never seen, and they fail to generalize to it. A tokenizer for new sessions needs a unit that every session shares and that carries behavior. Population activity offers such a unit. It evolves on a low-dimensional manifold that persists across neuronal turnover and across animals once sessions are aligned. This manifold changes regime at task events such as stimulus onset and movement onset. Within each regime the population occupies a state, the part of the manifold it spans between two events, and each state carries its own behavioral meaning. We propose Tokenization with States (TWS), which segments each trial, one repetition of the task, at these events and converts every state into tokens of population geometry, with no neuron or session embedding. On held-out International Brain Laboratory (IBL) sessions, TWS decodes movement even from regime boundaries that carry no information about the target, while a per-neuron foundation model pretrained on those sessions decodes at chance. Frozen after training on mice alone, TWS transfers to macaques and Utah arrays with only a linear probe. On reach direction, a target that its boundaries do not define, it achieves a Matthews correlation of 0.23, where the event time alone achieves . For cross-session generalization, the token matters more than the model on top.
Figures & tables
| Type A | Type B | |||
|---|---|---|---|---|
| Method | Movement | RT ( ) | Choice | Block |
| Cross-session (leave-one-session-out) | ||||
| TWS pretrained + finetuned | ||||
| TWS from scratch | ||||
| TWS pretrained | ||||
| TWS (random init) | ||||
| TWS | Event-time information | |||
| Boundary condition | Movement | RT | Movement | RT |
| (a) How many boundaries ( ) | ||||
| : stimulus onset only | – | – | ||
| : stimulus + first movement | ||||
| + transitions between states | ||||
| (b) Where to place the boundary ( fixed) | ||||
| TWS | PerceiverIO | ||||
| Backbone | Movement MCC | RT | Movement MCC | RT | |
| Token mixing | CNN | ||||
| Mamba-1 | |||||
| Mamba-2 | |||||
| Transformer | |||||
| No mixing | MLP | ||||
| Steinmetz 2019 | Gallego et al. | NLB MC_Maze | |||
|---|---|---|---|---|---|
| Method | Choice | Feedback | Movement | Reach direction | Movement |
| TWS from scratch | |||||
| TWS (random init) | |||||
| CEBRA | |||||
| POYO | |||||
| Population Statistics | |||||
Appendix figures & tables34 assets
Supplementary material from the paper’s appendix.
Appendix
| Dataset | Target | Full neurons | Cross-half summary | Index |
|---|---|---|---|---|
| IBL | movement | |||
| choice | ||||
| block | ||||
| Steinmetz | movement | |||
| feedback | ||||
| choice |
| IBL pretraining | IBL behavioral training | New-dataset training | |
|---|---|---|---|
| Objective | Eq. 2 , no labels | six behavioral heads | class-weighted cross-entropy |
| Loss weights | , | – | – |
| State masking | of trials | – | – |
| Learning rate | , constant | , cosine to | encoder , head |
| Weight decay | |||
| Batch | 256 trials from 16 sessions | 128 trials from 8 sessions | 4 sessions 16 trials |
| Movement | Interpretation | |
|---|---|---|
| 1 | 0.864 | Slightly narrow: marginal loss of task-relevant variance |
| 2 | 0.865 | Selected: balances expressiveness and compression |
| 4 | 0.867 | Similar: extra dimensions add little at this scale |
| Tokens | Movement MCC | RT | Choice MCC | Block MCC |
|---|---|---|---|---|
| Orthonormal basis (TWS from scratch) | ||||
| Without Gram–Schmidt |
| Units per session | Movement MCC | RT | Choice MCC | Block MCC |
|---|---|---|---|---|
| 32 | ||||
| 64 | ||||
| 128 (Table 1 ) |
| Variable | Scale | Type | Base rate | Definition |
|---|---|---|---|---|
| Movement | C | A | Whether a first wheel movement (IBL firstMovement_times ) occurs between stimulus onset and s after it. This is the event that also places the first-movement regime boundary, so the boundary alone largely determines the label (Appendix R ). Movement-related neural signals appear “almost everywhere in the brain” ( Musall et al., 2019 ; Stringer et al., 2019 ) . | |
| Reaction time | R | A | — | Time (s) from stimulus onset to the IBL response time, which follows the first movement by a median of s. Trials outside ms– s are excluded. Reflects sensorimotor transformation latency; shorter for higher-contrast stimuli. |
| Choice | C | B | Direction of wheel turn: leftward (CW) or rightward (CCW). Correct when the grating is moved to center ( azimuth). Requires lateralized selectivity in specific neurons ( Steinmetz et al., 2019 ) . | |
| Feedback | C | A ∗ | Trial outcome: correct ( , water reward) or incorrect ( , white-noise burst 2 s timeout). Mechanistically linked to movement: . | |
| Block | C | B | Dominant stimulus side in the current probability block. After 90 unbiased trials, prior probability alternates between 80:20 and 20:80 (left:right) in blocks of 20–100 trials. A latent context variable. | |
| Engagement | C | A | Whether the mouse is actively performing: recent accuracy over a 10-trial rolling window. Near-ceiling base rate reduces discriminative value. |
| Variable | Majority baseline | Explanation | |
| Classification variables | |||
| Movement | 0.760 | 0.760 | Session range ; discriminative |
| Engagement | 0.938 | 0.938 | 93% positive; MCC for all methods |
| Feedback | 0.813 | 0.813 | ; dominated by movement |
| Choice | 0.521 | 0.521 | 69% of sessions in ; Type B, chance |
| Block | 0.518 | 0.518 | Session std ; Type B, chance |
| Method | Movement | Feedback | Choice | Block | Engagement | Wheel ( ) | RT ( ) |
|---|---|---|---|---|---|---|---|
| Cross-session (leave-one-session-out) | |||||||
| TWS pretrained + finetuned | |||||||
| TWS from scratch | |||||||
| TWS pretrained | |||||||
| TWS (random init) | |||||||
| PerceiverIO | |||||||
| TWS | PerceiverIO | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Dataset | Target | Scratch | IBL | Frozen | Frozen, behavior | Scratch | IBL | Frozen | Frozen, behavior |
| Steinmetz | Choice | ||||||||
| Gallego et al. | Reach direction | ||||||||
| NLB | Movement | ||||||||
| Cross-session | Within-session | |||
|---|---|---|---|---|
| Method | Whisker | Pupil | Whisker | Pupil |
| TWS from scratch | ||||
| TWS pretrained + finetuned | ||||
| TWS pretrained | ||||
| TWS (random init) | ||||
| PerceiverIO | ||||
| Condition | (predicting ) | Interpretation |
|---|---|---|
| Real (aligned gate + neural) | Full signal | |
| Gate-only (shuffled ) | Temporal fingerprint | |
| Neural-only (shuffled gate) | Neural temporal content | |
| No-gate (time average) | Firing rate baseline |
| All trials | Without pre-stimulus movements | |||
|---|---|---|---|---|
| Movement MCC | RT | Movement MCC | RT | |
| TWS from scratch | ||||
| PerceiverIO | ||||
| Event-time information | ||||
| Representation + boundary | Movement MCC | RT | Choice MCC | Block MCC |
|---|---|---|---|---|
| Event-time information | ||||
| TWS from scratch | ||||
| TWS pretrained + finetuned | ||||
| PerceiverIO | ||||
| POYO | ||||
| CEBRA |
| Tokenizer (backbone) | Training | (movement) | (session) | |
|---|---|---|---|---|
| TWS (CNN) | random init | |||
| from scratch | ||||
| pretrained + finetuned | ||||
| PerceiverIO (Transformer) | random init | |||
| PerceiverIO (Transformer) | from scratch |
| Dataset | Target | Level | Pattern | Level over time | TWS |
|---|---|---|---|---|---|
| Steinmetz | movement | ||||
| feedback | |||||
| choice | |||||
| NLB | movement | ||||
| Gallego et al. | reach direction |
| Steinmetz 2019 | Gallego et al. | NLB MC_Maze | |||
|---|---|---|---|---|---|
| Method | Choice | Feedback | Movement | Reach direction | Movement |
| TWS from scratch | |||||
| TWS (random init) | |||||
| TWS (random init, random bias) | |||||
| PerceiverIO, trained on IBL | |||||
| PerceiverIO (random init) | |||||
| Task | Intact pretraining | Time-shuffled pretraining | TWS (random init) |
|---|---|---|---|
| NLB movement | |||
| Gallego et al. reach direction | |||
| Steinmetz choice | |||
| Steinmetz feedback | |||
| Steinmetz movement |
| Dataset | Target | Definition | Event-time information |
| IBL | movement | a first movement occurs within s of stimulus onset | |
| RT | stimulus onset to the IBL response time | ||
| Steinmetz | movement | mean wheel speed of the trial above the session median | |
| feedback | reward or no reward | ||
| choice | wheel turned left, against right or no-go | ||
| NLB | movement | mean cursor speed of the trial above the median |
| Dataset | Target | Event-time information | PCA(50) | TWS (random init) | TWS from scratch |
|---|---|---|---|---|---|
| Steinmetz | choice | ||||
| feedback | |||||
| movement | |||||
| Gallego et al. | reach direction | ||||
| NLB | movement |
| Method | All trials | Moved | Did not move | Go trials |
|---|---|---|---|---|
| TWS from scratch | ||||
| TWS (random init) | ||||
| PCA (per session) | ||||
| Event-time information |
| Configuration | Movement | Feedback |
|---|---|---|
| Full (MSE + diversity + geodesic + state masking) | 0.873 | 0.817 |
| MSE + diversity (no geodesic) | 0.875 | 0.822 |
| MSE + geodesic (no diversity) | 0.876 | 0.821 |
| MSE only (no geometric losses) | 0.883 | 0.823 |
| No pretraining (from scratch) | 0.889 | 0.824 |
| + Behavioral supervision during pretraining | 0.887 | 0.825 |
| Model | Original ( ) | Residual ( ) |
|---|---|---|
| TWS pretrained + finetuned | 0.555 | 0.561 |
| TWS from scratch | 0.564 | 0.584 |
| TWS (random init) | 0.301 | 0.294 |
| PerceiverIO | 0.310 | 0.324 |
| POYO | 0.000 | 0.001 |
| CEBRA | 0.000 | 0.000 |
| Movement MCC | RT | |||||
| Comparison | Difference [95% CI] | Sessions | Difference [95% CI] | Sessions | ||
| TWS vs. PerceiverIO | [ , ] | [ , ] | ||||
| TWS vs. aligned PCA | [ , ] | [ , ] | ||||
| TWS + boundary vs. event-time information | [ , ] | [ , ] | ||||
| TWS + boundary vs. PerceiverIO + boundary | [ , ] | [ , ] | ||||
| PerceiverIO + boundary vs. event-time information | [ , ] | [ , ] | ||||
| Remove session directions | Session identification from | ||||
|---|---|---|---|---|---|
| Model | Movement MCC | RT | behavior 2D | random 2D | |
| TWS from scratch | 3 | ||||
| TWS pretrained + finetuned | 3 | ||||
| TWS (random init) | 1 | ||||
| PerceiverIO | 2 | ||||
| Session directions (90% of the variance of session means) | ||||||
| Model | All | Only these | All but these | random | Behavior directions (2D) | |
| TWS from scratch | 8 | |||||
| TWS pretrained + finetuned | 7 | |||||
| TWS (random init) | 3 | |||||
| PerceiverIO | 12 | |||||
| Factor | TWS pretrained + finetuned | TWS from scratch | TWS (random init) | PerceiverIO | POYO | CEBRA |
|---|---|---|---|---|---|---|
| Lab | 0.174 | 0.209 | 0.078 | 0.281 | 0.426 | 0.024 |
| Mouse | 0.334 | 0.361 | 0.111 | 0.570 | 0.809 | 0.113 |
| Session | 0.420 | 0.440 | 0.137 | 0.733 | 0.959 | 0.220 |
| Movement | Reaction time | ||||
|---|---|---|---|---|---|
| Model | Consistency | Five-session MCC | Consistency | Five-session | Session identification |
| TWS from scratch | |||||
| TWS pretrained + finetuned | |||||
| TWS pretrained | |||||
| TWS (random init) | |||||
| PerceiverIO | |||||
Neural Decoding
Neural decoding maps brain activity or error-correction syndromes to stimuli, behavior, language, or corrective actions.
See all 180 papers