TL;DR
Recording from the brain using modern multi-electrode probes is like listening to a crowded cocktail party from outside the walls—you get rich electrical echoes, but you don't know who is saying what or where they are standing. Instead of relying on black-box machine learning to guess hidden patterns, this paper builds a fully differentiable physics simulator of neurons and surrounding brain tissue, running it in reverse via gradient descent. By anchoring the math to observed spike times, the method simultaneously pinpoints where individual neurons are in 3D space and reconstructs the invisible input currents driving them.
What Problem Does This Paper Address?
High-density multi-electrode arrays (MEAs), like Neuropixels probes, measure the faint extracellular voltage fields generated by nearby neurons. While machine learning excels at compressing these recordings into abstract, black-box latent vectors to predict behavior, neural engineering requires physically meaningful quantities—actual currents and 3D coordinates that an interface can target or manipulate.
With recent advances in differentiable programming, you might think we could just wire up classical Hodgkin-Huxley membrane equations, simulate the extracellular field, compare the output to real recordings, and use backpropagation to find the input currents. Unfortunately, neurons make terrible optimization landscapes. Below their firing threshold, small input changes barely register on extracellular electrodes, leaving gradients completely flat. Near the threshold, a tiny nudge shifts a spike by a millisecond or deletes it entirely, causing violent jumps in loss dominated by waveform misalignment. Furthermore, tissue physics creates a classic scale ambiguity: a neuron close to the probe receiving a weak input looks remarkably similar to a distant neuron receiving a massive input.
Methods
The authors construct an end-to-end differentiable forward pipeline in JAX that couples reduced biophysical neuron models (via ODE solvers) to a resistive-capacitive volume conductor. This conductor models both the $1/r$ spatial decay of electrical fields and the distance-dependent temporal blurring caused by brain tissue. Rather than training a neural network encoder, they treat each neuron’s 1 kHz input current $I_n(t)$, 3D position $r_n$, and amplitude $A_n$ as free parameters optimized directly per recording.
To tame the hostile loss landscape, they introduce two core innovations:
- Amplitude Reparameterization: They factor each neuron's signal into a normalized 3D spatial profile (anchored to the electrode channel where that neuron spikes loudest) and a single explicit scalar $A_n$. Moving a neuron in space only redistributes its footprint across channels without tangling up overall drive magnitude.
- A Three-Part Anchored Loss: Standard preprocessing ("spike sorting") already identifies when neurons fire. The authors use these spike times as millisecond-scale anchors via three loss terms: a scale-invariant trace loss ($\mathcal{L}_{\text{cont}}$) masked tightly around spikes so gradients flow backward through the membrane ODE; a closed-form template anchor ($\mathcal{L}_{\text{spike}}$) that shapes $A_n$ and $r_n$ without running the ODE; and a drive anchor ($\mathcal{L}_{\text{drive}}$) placing canonical current pulses at spike times to ensure physiological depolarization.
Datasets
- Synthetic LIVN Network Recordings: Simulated excitatory-inhibitory networks of two-compartment motoneurons coupled via thousands of noisy conductance synapses, used to test multi-unit interference against exact ground-truth positions.
- Paired Patch-Clamp / Neuropixels (SPE-1): Naturalistic in vivo mouse recordings featuring simultaneous extracellular Neuropixels arrays and ground-truth single-cell patch pipettes. They evaluate 3D localization on the Zhao et al. (2026) benchmark (11 juxtacellularly patched cells) and perform a held-out modality voltage check on cell
c5(a whole-cell current-clamp recording).
Key Insights and Ideas
- Differentiable $\neq$ Well-Conditioned: Simply translating physics equations into an autodiff framework isn't enough; excitable dynamics actively fight gradient descent until scale degeneracies and threshold cliffs are explicitly engineered away.
- Spike Sorting as Continuous Supervision: Usually viewed as a lossy step that throws away raw voltage traces, discrete spike times act here as crucial temporal anchors. Gradients radiating backward from a spike through the membrane integrator successfully shape the continuous subthreshold current that caused it.
- Marginalizing Physics Shrinks the ML Burden: By baking known membrane dynamics and tissue blurring into the forward pass, optimization isn't wasted re-learning Ohm's law—forcing the learned latents onto named physical quantities.
Key Results
- Synthetic Multi-Unit Localization: On synthetic recordings, single neurons are localized within $19.5 \pm 4.9\ \mu\text{m}$ mean absolute error (MAE), and pairs sharing a primary electrode reach $28.3 \pm 4.8\ \mu\text{m}$ (100% within $50\ \mu\text{m}$). At 4 simultaneous units per electrode, overlapping templates push error to $57.8 \pm 12.9\ \mu\text{m}$.
- In Vivo Localization: On the SPE-1 benchmark, the end-to-end fit achieves a capped-median localization error of $39.7\ \mu\text{m}$ (72.7% accuracy within $50\ \mu\text{m}$), modestly outperforming purpose-built geometric baselines like Center of Mass ($42.8\ \mu\text{m}$) and Grid Convolution ($44.2\ \mu\text{m}$).
- Cross-Modality Voltage Check: Fitting only the extracellular trace of cell
c5recovers intracellular action potential timing and bursts, though inter-spike voltage drifts significantly (subthreshold correlation $r_{\text{sub}} \approx 0.05–0.18$, MAE $>21\ \text{mV}$).
Limitations and Future Work
- Unconstrained Subthreshold Regimes: Because all three loss terms focus around spike times, the inferred current between spikes is largely unconstrained, overfitting to background noise and causing intracellular voltage drift. Adding smoothness regularizers or resting-membrane priors is an immediate next step.
- Compute Cost vs. Amortization: Optimizing latents from scratch ("train-at-test") takes roughly one GPU hour per cell for a 300-second recording. Replacing free current parameters with a neural encoder would amortize inference for real-time applications.
- Simplified Biophysics: Single- and two-compartment models omit complex dendritic morphologies, burst adaptation, and background local field potentials (LFPs), leaving room to fold richer multi-compartment physics into the pipeline.
Summary updated