Latent Diffusion for Neural Spiking Data

Modern datasets in neuroscience enable unprecedented inquiries into the relationship between complex behaviors and the activity of many simultaneously recorded neurons. While latent variable models can successfully extract low-dimensional embeddings from such recordings, using them to generate realistic spiking data, especially in a behavior-dependent manner, still poses a challenge. Here, we present Latent Diffusion for Neural Spiking data (LDNS), a diffusion-based generative model with a low-dimensional latent space: LDNS employs an autoencoder with structured state-space (S4) layers to project discrete high-dimensional spiking data into continuous time-aligned latents. On these inferred latents, we train expressive (conditional) diffusion models, enabling us to sample neural activity with realistic single-neuron and population spiking statistics. We validate LDNS on synthetic data, accurately recovering latent structure, firing rates, and spiking statistics. Next, we demonstrate its flexibility by generating variable-length data that mimics human cortical activity during attempted speech. We show how to equip LDNS with an expressive observation model that accounts for single-neuron dynamics not mediated by the latent state, further increasing the realism of generated samples. Finally, conditional LDNS trained on motor cortical activity during diverse reaching behaviors can generate realistic spiking data given reach direction or unseen reach trajectories. In summary, LDNS simultaneously enables inference of low-dimensional latents and realistic conditional generation of neural spiking datasets, opening up further possibilities for simulating experimentally testable hypotheses.

Paper

References (64)

Scroll for more · 38 remaining

Similar papers

Peer review

Reviewer mYEj7/10 · confidence 4/52024-07-05

Summary

In their study "Latent Diffusion for Neural Spiking Data", the authors introduce the titular LDNS model for generating realistic neural population activity, and apply it to three datasets: a synthetic dataset with true latents generated from the three-dimensional Lorenz system, and two previously published neuroscientific datasets. The LDNS model is an instance of the latent diffusion model (LDM) introduced by Rombach et al. (2022), which is adapted here by the authors to support generation of variable-length discrete-valued time series. The autoencoder of the LDM in this case is trained with a Poisson loss to account for the discrete nature of neural spiking data. The diffusion model of the LDM operating in latent space here is constructed with layers of structured state space sequence (S4) models of Gu et al. (2021). The diffusion model can be trained to generate samples conditional on certain external covariates by conditioning the reverse mode on the covariates. The split of LDMs between the autoencoder stage and the diffusion stage is particularly convenient for the task of generating spike trains, as it avoids any adjustment to the diffusion model for generating discrete variables. A variant of the LDNS model has additional parameters trained post-hoc to incorporate the spike-time history of individual output neurons to account for refractoriness and other single-cell auto-regressive features. According to the considered neural population statistics, the LDNS model gives an excellent fit to the synthetic data generated from the three-dimensional Lorenz system. For the two neuroscientific datasets, the LDNS performs solid in terms of matching the considered neural population statistics, outperforming the important reference model LFADS (Sussillo, 2016) in one case. On the first neuroscientific dataset comprised of human neural population data sampled during attempted speech, the LDNS is shown to handle variable sequence lengths in the training data and during sampling. The second neuroscientific dataset consists of monkey neural population data recorded during a maze reach task. Here, the LDNS variant with additional spike-history parameters fitted post-hoc is shown to also capture the temporal auto-correlation structure of neural subpopulations. The authors furthermore showcase the ability to generate samples conditionally on experimental covariates, by conditioning sampling on the initial reach angle, respectively the full velocity trajectory.

Strengths

The submitted work is original, in that latent diffusion models (LDMs) to my knowledge have not yet been used to (conditionally) generate neural population activity. I agree that LDMs are indeed a nice idea here, since the separation into autoencoder stage and diffusion model stage means we can try to use denoising diffusion models without much changes. The work seems technically solid to me. The authors make sensible changes to the LDM for the task of generating neural population activity. The adaptations for discreteness (Poisson loss, spike-history terms) show a good understanding of best practices in neural data analysis. The inclusion of S4 layers into autoencoder and diffusion models to handle and generate variable-length sequences is interesting, and could further spread usage of these tools in the computational neuroscience community. The manuscript is well written, explaining not only the key ideas and experiments, but also summarizing the important model parts (autoencoders, denoising diffusion models) next to the non-standard adaptations (Poisson loss, S4 layers, spike-history terms) done by the authors for this study. The figures are high quality and way above what I would expect from a conference paper. This study follows and expands a (small) recent trend of using modern machine learning algorithms for generation of neural population activity. LDNS models / LDMs clearly have some advantages over previously suggested models, in that they combine the low-dimensional representation of autoencoders with the generative fidelity of diffusion models.

Weaknesses

The authors have adapted the latent diffusion model to the task of generating neural population activity. While I believe they did good work on that, I am less convinced of the evaluation and comparison of their model, which is important to judge its overall usefulness. For a generative model of multivariate time-series, I find the evaluation somewhat lacking. I understand that judging spike train generation is still a much harder task than judging image generation, and that one could argue that to date we don't understand all the relevant aspects of neural population activity. But firing rates, pairwise correlations and population spike counts are features that don't take dynamics into account. Average interspike interval and standard deviations of interspike intervals are still very local temporal features. Computational neuroscience has come up with a host of methods for analysing neural population dynamics -- in particular those with low-dimensional structure as assumed by the LDNS model -- which could be used here for comparing the sampled spike trains against the data. The authors already cited both LFADS and Gaussian Process Factor Analysis, but did not compare e.g. the low-dimensional trajectories extracted from their sampled data against the low-dim. trajectories extracted from the neural recordings. If nothing else, a supplementary figure or two with a handful of additional sampled spike trains against real recordings could help readers judge if the model captures the overall neural dynamics of the data. Another aspect that makes it difficult to evaluate the quality of their suggested model is the lack of comparison against direct competitors. The authors do an excellent job of explaining LFADS and its relevance as a comparison, but from what I understand only compare against LFADS on one of the three numerical experiments (I take that figure A4 which isn't mentioned in the text is also about the monkey data?). I understand that autoLFADS is significantly more computationally expensive to run than the LDNS model, (which I would encourage the authors to state more prominently also in the main text!) but especially for the second experiment with human data, the LDNS model seems to perform the worst of the three experiments, and I could find no alternative model for comparison.

Questions

As explained above, analysis of the full population dynamics of their sampled neural population data would be very interesting. The authors could, but do not have to follow my suggestion of analysing the sampled neural population with one of the more commonly used dynamical dimensionality reduction methods. Can we get some comments or additional analysis of the LDNS model in cases where it doesn't work perfectly? There are several interesting supplementary figures for the Lorenz synthetic data, but for the other two experiments I am left wondering whether the non-negligible model errors arise primarily from the autoencoder or from the diffusion model. Those are the cases where I would most appreciate a comparison of the pairwise correlations from autoencoder against those of the full LDNS model, as in Fig A7 for the Lorenz data.

Rating

7

Confidence

4

Soundness

3

Presentation

4

Contribution

2

Limitations

I think the authors have adequately addressed limitations and possible negative societal impacts of their work.

Reviewer pMhd6/10 · confidence 3/52024-07-06

Summary

This paper introduces the Latent Diffusion Model for Neural Spiking data (LDNS). LDNS combines the capacity of autoencoders to extract low-dimensional representations of discrete neural population activity with the capability of denoising diffusion probabilistic models to generate realistic neural spiking data. It achieves this by modeling the inferred low-dimensional continuous representations. Through experiments on three different datasets, LDNS has been proven to achieve low-dimensional latent variable inference and realistic conditional generation of neural spiking datasets, providing possibilities for simulating experimentally testable hypotheses.

Strengths

1. Quality: The paper is comprehensive, with detailed explanations of the model's characteristics and corresponding experimental designs. 2. Clarity: The paper is logically clear and well-structured. 3. Importance: The paper significantly contributes to addressing the modeling challenges of complex datasets in neuroscience.

Weaknesses

1. There is only one comparison method in this paper.

Questions

1. What is the significance of studying the generation of spiking data? Is this generated data of practical value? 2. Have you tried to compare it with other VAE-based methods? Despite the claim of the authors that LFADS is the most successful VAE-based method available, it is clear that no method performs best in all tasks, especially in more cutting-edge tasks like this paper. 3. Can you explain how the stochastic operations in Figure 1 are performed? 4. In the conditional generation experiment of neural activity given the reach direction, the experiment is conducted under conditions of only two directions. Is it possible to conduct the experiment under conditions of three directions?

Rating

6

Confidence

3

Soundness

2

Presentation

3

Contribution

3

Limitations

This paper still has certain limitations. Firstly, the exploration of LDNS in simulating neural activity is currently confined to the abdominal cortex during speech, which leaves the simulation of neural activities under more complex behavioral patterns in other parts of the body unexplored. Secondly, the processing of human-related data in the research raises concerns about privacy protection. In response to these limitations, the following suggestions are offered: 1. This paper has initiated an investigation into the effects of LDNS in simulating neural activities in the abdominal cortex during human speech. To further verify its potential, future research could expand to simulate cortical neural activities in other parts of the body under more complex behavioral patterns, aiming for a comprehensive evaluation of LDNS's applicability and efficacy in the field of neuroscience. 2. Regarding the use of human-related data in the paper, it is suggested that in subsequent research, greater emphasis should be placed on protecting data privacy to avoid negative social impacts.

Reviewer y7Q47/10 · confidence 4/52024-07-08

Summary

This paper proposes a new generative model for neural spiking datasets. The model consists of a deterministic, deep SSM (S4) autoencoder paired with a diffusion model of the learned autoencoder latent sequences. This enables generating accurate neural time series traces across variable length trials lasting up to 10ms and conditional generation given behavioral covariates. The approach is applied to a synthetic dataset and two different neural datasets, where the authors investigate a variety of uses of the model.

Strengths

The proposed generative model of neural activity appears powerful and generally useful of fitting neural responses across a large variety of conditions. Both the unconditional and conditional generative performance of the model is impressive. Many components of the model and training process are well-motivated and clearly described. For these reasons, I find this to be a significant contribution.

Weaknesses

While much of the modeling approach is well-motivated, I do not find that to be the case for the specific implementation of the spike-history component. Additionally, it appears that the spike-history component is responsible for much of the improvement over LFADS, and not the alternative underlying generative model that is the primary novel contribution of this paper (one could imagine also training LFADS with a spike history filter). In particular, it is not well-motivated why the filters are trained post-hoc and why the softplus approximation is preferred over using the exponential function.

Questions

- Why is the spike-history filter trained posthoc instead of during the autoencoder training? Additionally, can the authors provide more details about why they choice the softplus approximation? I do not necessarily agree that the approximation is accurate, and its not clear why this approximation is even necessary during training or why it is used over a numerically stable exponential function. Is this primarily an issue when the model is run in generative mode? - The LDNS overestimates some of the pairwise neural correlations in the attempted speech dataset. Is it typical for LDNS to overestimate pairwise correlations? Could this be improved by increasing the latent dimensionality of the model, to allow for more uncorrelated latent dimensions? - Could the authors comment on the use of S4 as compared to other deep state space models like Mamba? Does one appear to work better than the other? - Have the authors considered using the approach to do conditional generation of the attempted speech neural recordings given the cued sentence? This seems like a challenging but direct application of the proposed method.

Rating

7

Confidence

4

Soundness

2

Presentation

3

Contribution

3

Limitations

Yes.

Reviewer AuW47/10 · confidence 4/52024-07-13

Summary

The authors here propose a new autoencoder style latent variable model for neuroscience which flexibly adapts to variable time-series using S4 encoders and decoders. They then train diffusion based models with option behavioral covariates to generate realistic neural spiking data. Additionally, they use a more flexible spiking likelihood with history-filters which more accurately capture within neuron statistics. They evaluate their model on a synthetic lorenz-attractor example as well as multiple real-work datasets.

Strengths

I see three separate contributions of this paper -- 1) The ability to handle time-varying inputs in VAE based neural models is rare, as the authors point out, yet important in many practical neuroscience applications. 2) Using diffusion-based methods to generate samples from the auto-encoder inferred latents, allowing for the generation of variable length, realistic spiking data on unseen behaviors. I think the results of figure 5 are particularly interesting in this regard. 3) the addition of a history-based poisson likelihood, which better captures individual spiking statistics. This is a somewhat superficial contribution, but is nonetheless important to many of the authors' reported improvements.

Weaknesses

I think the authors could do a better job communicating the disparate contributions and capabilities of this model more clearly to the reader, especially in contrast to existing approaches. For example, I am having a hard time understanding to what extent the spike-history likelihood is important for this model. Many of the reported results in figures 2 and 3 are on the statistics of the spiking. Are these figures using the likelihood with the spike-history filter? I am assuming they are not, as the spike-history filter is explicitly specified as the likelihood used for figure 4, but not in figures 2 and 3. If they are not used here, why not? Further, can the authors demonstrate that this spike-history filter leads to a different scientific result? I.e. are the conditioned latents any more accurate or do they provide any more insight if one likelihood is used compared to another. The evaluations in the supplement demonstrate that the spiking statistics is better captured with this more sophisticated likelihood, but further discussion as to why this is important for scientific insight would be appreciated. Overall, the authors primarily use spiking statistics as their measure of accuracy in this model throughout the paper. While the ability of a model to capture single-level neural statistics is important, it seems to me that the core use this model would have to an experimental practitioner is to visualize latents in an informative way in trial-varying data, potentially conditioned on behavior. Because of this, it would be nice to see more evaluations of the latent space, and not focus as much on the spiking statistics. Similar to the point above, it would be interesting to take a couple existing autoencoding LVMs used in neuroscience (like LFADs and others) and augment them with the same history-based Poisson likelihood. Then we would be able to see more clearly the contributions of the other features of the model such as S4 and diffusion, which I think are quite interesting, and their roles in identifying interpretable scientific latents where other models fail or cannot do so, such as in the trial-varying case or conditioned on behavioral covariates. Lastly, there are many models that use autoencoder based approaches other than LFADS that could be compared to here but are not. It is of course not possible to compare to all of them, but some more thorough evaluation and discussion alongside existing approaches I think would significantly improve the paper. See for example, *Poisson Interpretable VAE, **Targeted neural dynamical modeling, ***PSID and Duncker and Sahani 2018. LFADs alone, especially one without the same history-dependent observation likelihood, does not provide a complete picture of the capabilities of latent identification of this model in relationship to other other approaches. *) "Learning identifiable and interpretable latent models of high-dimensional neural activity using pi-VAE" **) "Targeted Neural Dynamical Modeling" ***) "Modeling behaviorally relevant neural dynamics enabled by preferential subspace identification"

Questions

Are the results reported in figures 2 and 3 using the spike history filter or just Poisson likelihoods? What is the 'kde' in figure 3d?

Rating

7

Confidence

4

Soundness

4

Presentation

2

Contribution

3

Limitations

See above. Further discussion and potential evaluation of this model alongside other approaches, and the dissociating the particular role of the likelihood as compared to the other model features, especially concerning scientific purposes, would be helpful for this paper.

Reviewer AuW42024-08-07

This is a very thorough and impressive response. I think these additional figures paint a much more complete picture of the model's capabilities in a way that now clarifies it's disparate contributions compared to competing approaches. I believe these will substantially increase the work's impact. Particularly, R2 and R3 clearly demonstrate the LDNS addresses something that is lacking in modern generative LVMs for neural data, and I believe they should be highlighted in the main manuscript. R1 also adds important baselines that would be nice to prominently highlight as well (particularly including the LFADS sh). The additional latent space characterizations (R6-R8) helps future model practitioners get an idea of the model's scientific utility. It would be nice if possible to include some of this in the main body of the paper, but I don't believe it is necessary. I have updated my score accordingly and am excited to hopefully see this work at this year's NeurIPs.

Authorsrebuttal2024-08-09

Thank you so much for the prompt and kind response, and now recommending acceptance. We appreciate your thorough engagement with our work and detailed comments, which allowed us to clarify our contributions. We agree that adding these analyses will strengthen the paper.

Reviewer y7Q42024-08-08

Thank you for your thorough response and for running the additional experiments. I especially appreciate the new comparisons of the spike history filter with LFADS, and for the additional baselines and visualizations. Overall, I have decided to increase my score and recommend accepting this paper. Nonetheless, I still remain unconvinced that the spike-history filter should be fit post-hoc and find the need for the softplus approximation unsatisfactory. Perhaps this implies the model should use a softplus nonlinearity rather than exponential during the initial training phase. Alternatively, joint training may alleviate the stability issues. To fit the model jointly with the spike history filter, I suggest using alternative masking schemes -- see e.g. a very recent paper [1] with alternative options that should work with the spike history filter. [1] Towards a "universal translator" for neural dynamics at single-cell, single-spike resolution. Zhang et al., arXiv:2407.14668

Authorsrebuttal2024-08-09

Thank you for the positive response, detailed engagement with our work, and further increasing the score. We really appreciate the thorough questions about the spike history term and agree it would be interesting to see the effect of different nonlinearities in future work and how joint training would interact with coordinated dropout and alternative regularization schemes. Thank you for pointing us toward this paper; combining such approaches is indeed very promising.

Authorsrebuttal2024-08-13

Thank you for taking the time to conduct our ethics review.

Authorsrebuttal2024-08-13

Thank you for taking the time to conduct our ethics review.

Reviewer mYEj2024-08-13

I thank the authors for their in-depth response and the additional analyses they added to address my concerns. I am happy to raise my rating by a point.

Authorsrebuttal2024-08-14

Thank you for the positive response, detailed engagement with our work, and further increasing the score.

Program Chairsdecision2024-09-25

Decision

Accept (spotlight)

© 2026 NYSGPT2525 LLC