Neural-DISCO: Source-Conditioned Counterfactual Editing of Neural Population Activity

Nico Policzer, James Ho, Joseph Soo, Xin TangNeurIPS 2026

TL;DR

What would a specific brain state look like if a mouse had run faster, or a monkey had reached left instead of right—while keeping its internal mood, arousal, and unmeasured twitches exactly the same? Neural-DISCO lets neuroscientists perform "what-if" edits on recorded neural population activity, cleanly swapping out specific behaviors or sensory stimuli while preserving the unique background signature of that exact moment in time. Better yet, untangling these signals reveals which individual neurons actually care about which behaviors.

What Problem Does This Paper Address?

Modern neuroscience tools let us record thousands of neurons firing simultaneously while an animal sees, moves, and decides. Standard generative models can take a behavioral label—say, "reaching upward"—and dream up plausible-looking neural spikes.

However, those models average out everything you didn't measure: the animal’s alertness, spontaneous fidgeting, or hidden internal states. If you want to ask a source-conditioned counterfactual question—how would this specific recorded neural response change if only one variable were altered?—you face a delicate balancing act. Without access to the original neural recording, you lose the animal's unique internal state. Conversely, if you feed the original neural activity straight into a model without constraints, the model "cheats" by memorizing everything through that neural input and ignoring your edited label altogether.

Methods

To solve this tug-of-war, the authors introduce Neural-DISCO (DISentangled learning for COunterfactual editing), which splits the model's latent space into clean, separate compartments using standard multilayer perceptrons (MLPs) and a Poisson spike-count observation model:

  • Label-Specific Encoders: Each measured variable (e.g., hand velocity, visual grating angle) gets its own dedicated mini-network mapping it to a clean latent block.
  • A Bottlenecked Residual Encoder: A separate network reads the raw source neural spikes to capture everything not explained by the labels.
  • Asymmetric Noise Regularization (The Secret Sauce): Adapted from disentanglement frameworks like LORD, the residual latent is deliberately corrupted with Gaussian noise and hit with an $L_2$ activation penalty during training, while the label latents pass through untouched. Because the residual channel is noisy and "expensive" to use, the generator is forced to route known behavioral info through the clean label blocks, reserving the residual strictly for unmeasured background state.
Fig. 1: Neural-DISCO overview. (a) Neural-DISCO reconstructs source spike counts from super- vised label latents and a bottlenecked residual latent. (b) Counterfactual editing replaces a selected label latent while holding the remaining label blocks and the source residual fixed. (c) The same block-structured generator supports label-specific neuron attribution.

At test time, the training noise is turned off. To make an edit, you swap one label latent for a new target value, hold the other labels and the clean residual fixed, and decode the new firing rates. Finally, the authors apply Integrated Gradients (a standard feature-attribution technique) across these neatly separated blocks to score exactly how much each individual neuron relies on each specific label.

Datasets

No new datasets are introduced, though the authors construct controlled synthetic setups alongside established benchmarks:

  1. RatInABox Simulation: A synthetic 2D foraging agent with 300 neurons split evenly into known functional types (place, head-direction, and speed cells), providing ground-truth counterfactual firing rates.
  2. Macaque Reaching (Neural Latents Benchmark): Electrophysiology recordings of 137 motor/premotor cortical units during a center-out reaching task, paired with hand position, hand velocity, and eye position.
  3. Allen Visual Coding (Neuropixels): 32 recording sessions from mouse visual cortex while mice view drifting gratings (varying in orientation and temporal frequency) and run on a wheel.

Key Insights and Ideas

  • The Goldilocks Bottleneck: Without regularization ($\lambda = 0$), observed labels leak straight into the residual pathway—when you try to edit a reach trajectory, the generated spikes stubbornly decode back to the original reach. Strengthening the bottleneck forces true separation without destroying unmeasured context.
  • Disentanglement Unlocks Better Single-Neuron Biology: Forcing the latent space to separate variables doesn't just enable editing; it sharpens biological interpretability. As the residual bottleneck tightens, feature attribution becomes dramatically better at pinpointing true functional cell types (like distinguishing speed-modulated cells or orientation-selective neurons).
  • Flipping the Script to Probe Brain State: You can reverse the editing trick—holding sensory labels fixed while swapping residuals from different trials. In mouse visual cortex, doing this revealed how much each neuron was modulated by an unmeasured variable (temporal frequency), offering a computational microscope into how hidden brain states shape sensory coding.

Key Results

Since real brains don't give us ground-truth "what-if" spikes, the authors train external decoders on real neural data and test whether edited spikes decode to the new target label while preserving unobserved variables:

  • RatInABox: Neural-DISCO accurately shifts place-cell firing to a new room half or reverses head-direction cells while preserving withheld speed-cell activity via the residual, whereas unregularized baselines fail completely ($R^2$ dropping into negative values).
Fig. 3: Counterfactual editing in macaque reaching electrophysiology. (a) Editing replaces hand- position, hand-velocity and eye-position blocks while retaining the source residual. (b) Trajectories decoded from source spikes, target spikes and Neural-DISCO counterfactual activity. (c,d) Synthetic constant-rate controls test whether attribution distinguishes recorded neurons from controls. (e) Target-decoding R2 comparisons; dotted lines show the empirical target-spike decoding reference.
  • Macaque Reaching: Edited neural activity decodes closely to target reach trajectories: $R^2 = 0.895$ for hand position, $0.772$ for hand velocity, and $0.630$ for eye position (nearly matching real target-spike decoding ceilings of $0.909$, $0.845$, and $0.656$). Attribution also cleanly separates real motor neurons from synthetic constant-rate decoy neurons as regularization increases.
  • Allen Visual Coding: Across 32 sessions, editing running speed hits a target RMSE of $3.629\text{ cm/s}$ (beating a Gaussian GLM baseline at $6.017\text{ cm/s}$) while keeping withheld stimulus temporal frequency decodable above chance ($0.541$ balanced accuracy). When rotating visual grating orientation by $180^\circ$, target-orientation accuracy reaches $0.949$ (vs. $0.714$ for Gaussian GLM) while preserving withheld running speed.

Limitations and Future Work

  • Operational, Not Causal: These are model-based predictions from observational data, not true causal interventions. Edits that violate natural dependencies (e.g., impossible combinations of posture and speed) are extrapolations and shouldn't be over-interpreted.
  • No Guarantees Under Correlation: The noisy channel limits residual capacity, but doesn't mathematically guarantee strict disentanglement—especially when observed and unobserved variables are heavily correlated.
  • Static Snapshots: Neural-DISCO models independent time bins using feed-forward networks, ignoring temporal and transition dynamics across time.
  • Indirect Validation: On real recordings, evaluation relies on downstream decoders rather than ground-truth neural perturbations—making Neural-DISCO best suited as an in-silico hypothesis generator to guide future wet-lab experiments.

Summary updated

Abstract

Understanding how neural activity encodes behavioral and sensory variables is a key challenge in systems neuroscience. This requires models that go beyond predicting activity from labels and instead support source-conditioned counterfactual editing: given a recorded source response, we should be able to edit one measured behavioral or stimulus label and predict how neural activity would change while preserving other observed labels and source-specific variability not explained by the labels. Here, we introduce Neural-DISCO, a disentangled representation learning framework for counterfactual modeling of neural activity. Neural-DISCO partitions the latent space into label-specific components, each associated with an observed behavioral or stimulus label, together with a residual latent that captures variability not supplied through observed labels. Across simulated and real neural recording datasets, we show that this structure enables selective editing of measured labels to generate counterfactual neural responses while preserving the remaining content of the original activity. Further, to gain insight into how behavioral and stimulus labels are encoded at single-neuron resolution, we pair this disentangled framework with feature attribution methods that identify which neurons are most important for each label. We find that disentanglement enhances the recovery of known functional cell roles in both synthetic and real data. Together, these results support Neural-DISCO as a framework for counterfactual modeling of neural activity and provide a practical interface for probing how neural populations encode behavior and sensory information.
BibTeX
@inproceedings{policzer2026neural,
  author = {Nico Policzer and James Ho and Joseph Soo and Xin Tang},
  title = {{Neural-DISCO: Source-Conditioned Counterfactual Editing of Neural Population Activity}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=XVvbIBWBgO},
}
Figure