Flow Matching for Count Data

Ganchao Wei, John Pearson

TL;DR

The authors introduce count-FM, a parameter-efficient flow-matching framework designed specifically for high-dimensional count data like single-cell RNA sequencing (scRNA-seq) and neural spike trains. By modeling data trajectories using a continuous-time birth-death process with local unit jumps, it avoids the pitfalls of treating counts as unrelated categories or blurring them into continuous spaces. The result is a highly efficient generative model that delivers superior sample quality and interpretable transport paths with a fraction of the parameters of standard baselines.

What Problem Does This Paper Address?

High-dimensional count data are ubiquitous in biology and neuroscience. However, modeling them accurately is notoriously difficult due to their discreteness, sparsity, and complex correlation structures.

While deep generative models like diffusion and flow matching have revolutionized continuous domains (images, audio), adapting them to discrete counts has typically forced researchers into one of two compromises:

  1. The Categorical Approach: Treating each count level as an independent category. This completely ignores the ordinal nature of numbers (e.g., a count of 5 is closer to 6 than to 100) and causes the model's output layer to explode in size as the maximum count range increases.
  2. Dequantization: Mapping discrete counts into a continuous space. This adds artificial noise and blurs the intrinsic discrete structure of the data.

The authors address this gap by proposing a method that respects the natural geometry of count data, scales efficiently to large count ranges, and allows distribution transport directly within count space.

Methods

Instead of continuous vector fields or massive categorical transition matrices, count-FM models generative trajectories as a continuous-time Markov chain (CTMC) governed by coordinate-wise birth-death processes with local unit jumps ($\pm 1$).

Key components include:

  • Conditional Count Bridge: The model constructs a conditional binomial bridge between a source count ($x_0$) and a target count ($x_1$). Along this path, the coordinate-wise mean moves linearly over time, ensuring intermediate states remain strictly count-valued.
  • Parameter Efficiency: Because the model only needs to predict the rates of local births ($\lambda$) and deaths ($\mu$) for each dimension, the state-dependent output dimension is always $2d$ (where $d$ is the number of features), completely independent of the maximum count value.
  • Simulation-Free Training: Training leverages a path-space KL divergence objective that elegantly decomposes into an efficient, local rate-matching loss.
  • Endpoint Coupling: The framework supports both independent coupling and minibatch Optimal Transport (count-FM-OT) using a custom symmetric Poisson cost to straighten transport paths and improve sampling efficiency.
  • Classifier-Free Guidance (CFG): Integrated to handle conditional generation tasks by modulating a guidance scale ($w$).

Datasets

The authors evaluated count-FM across several benchmarks:

  • 2D Synthetic Simulation: A mixture of two Gamma-Poisson components to evaluate sample quality and transport geometry.
  • Dentate Gyrus scRNA-seq dataset: 2,930 cells and 13,913 genes across multiple lineages, used for unconditional generation and developmental transport from postnatal day 12 (P12) to day 35 (P35).
  • CRCNS hc-3 dataset: Multi-region hippocampal and entorhinal cortex recordings (62 simultaneously recorded units) from behaving rats on a linear track, used for spatial conditional generation.
  • Piriform Cortex (PCx) odor-response dataset: Multichannel spike trains (84 neurons) from mice, conditioned on respiration waveforms and odor identities.

Key Insights and Ideas

  • Ordinal Geometry Preservation: Traditional discrete diffusion treats counts 99 and 100 as being as distinct as "cat" and "dog". By restricting transitions to local unit jumps ($\pm 1$), count-FM inherently respects the numerical sequence.
  • Constant Output Scaling: The $2d$ output dimension provides massive scalability. For a 10,000-dimensional dataset where counts can reach 100, a categorical model requires over 1,000,000 outputs; count-FM requires only 20,000.
  • Interpretable Intermediate States: Because the trajectory is strictly count-valued, intermediate steps in the generation process represent valid, interpretable count distributions (e.g., intermediate cell states during development), rather than fuzzy fractional counts or random categorical noise.

Key Results

  • Simulation: On the 2D task, count-FM achieved the lowest 2-Wasserstein ($W_2$) distance ($2.879$) while using only 2,372 parameters—significantly outperforming categorical baselines like D3PM or SEDD which required over 15,000 parameters.
Table 1: Simulation performance
  • scRNA-seq: count-FM outperformed specialized single-cell generative models (such as scVI, scDiffusion, and scLDM) in unconditional generation quality.
Table 2: Dentate Gyrus performance

For the transport task (P12 $\rightarrow$ P35), it successfully mapped developmental trajectories that strictly align with known biological lineages.

Figure 1: Transport from P12 to P35. A. Generated transport trajectories in PCA space for the training and test splits. Circles denote the P12 source cells and crosses denote the P35 target cells, with colors indicating cell cluster identity. Black curves show representative generated trajectories, which smoothly connect P12 to P35. B. Inferred fate proportions under P12-to-P35 transport. Rows correspond to source clusters at P12 and columns to inferred endpoint clusters at P35. Entries are row-normalized proportions for the training and test splits.
  • Neural Spikes: On the hc-3 dataset, count-FM ($w=1$) successfully captured complex cross-neuron correlation structures, whereas standard Poisson MLP baselines consistently underestimated population dependencies.
Figure 2: Conditional generation on the hc-3 linear-track session. Summaries are estimated from 100 generated samples per held-out covariate. A. Signed position is constructed from linearized position and running direction. Mean-response heatmaps show bin-wise mean counts for the true held-out data, Poisson MLP, and count-FM with w = 1. B. Population correlation matrices for the same active-neuron set. Count-FM better preserves cross-neuron dependence, while Poisson MLP underestimates population correlations.

Limitations and Future Work

  • Rigid Trajectories: The conditional binomial bridge is deliberately simple and its mean path is deterministic, which might not be stochastic enough to explore highly complex intermediate paths. The authors suggest exploring beta-binomial variants or latent stochastic paths in future work.
  • Sampling Speed: The current sampler relies on a first-order local one-step discretization requiring many small steps. The authors note that developing bridge-aware simulation schemes or accelerated samplers that skip intermediate steps will be crucial next steps.

Summary updated

BibTeX
@inproceedings{wei2026flow,
  author = {Ganchao Wei and John Pearson},
  title = {{Flow Matching for Count Data}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=5N0iGXXzEJ},
}
Figure