---
title: 'scDFM: Single-Cell Flow Matching'
url: https://www.emergentmind.com/topics/scdfm
type: topic
---

# scDFM: Single-Cell Flow Matching

Searching arXiv for recent papers on scDFM and closely related single-cell perturbation modeling.
scDFM, short for **single-cell Distributional Flow Matching**, is a conditional generative framework for **single-cell perturbation prediction** that models the **full distribution** of perturbed cells conditioned on control states and perturbation identities, rather than treating perturbation response as a deterministic cell-level mapping [2602.07103]. It is designed for settings in which RNA-seq is destructive, so the same cell is not observed before and after perturbation, and in which perturbations induce **population-level shifts** under sparse, noisy, and high-dimensional measurements. The framework combines **Conditional Flow Matching (CFM)** with a **Maximum Mean Discrepancy (MMD)** objective and uses a **Perturbation-Aware Differential Transformer (PAD-Transformer)** backbone to encode gene-level context, perturbation identity, and control-versus-perturbed differences [2602.07103].

## 1. Problem formulation and conceptual scope

scDFM addresses perturbation prediction in experiments where one observes control cells with gene expression vector $c_x \in \mathbb{R}_+^G$ and post-perturbation cells with expression $x \in \mathbb{R}_+^G$ under perturbation condition $c_p$, where $c_p$ is represented as a multi-hot vector over perturbations [2602.07103]. The central modeling difficulty is that there is **no one-to-one pairing** between $c_x$ and $x$, because single-cell RNA-seq measurements are destructive. In this regime, perturbation effects are population-level rather than cellwise, and conventional per-cell regression objectives can overemphasize mean expression while missing higher-order structure such as variance, skewness, or multimodal subpopulations.

The framework therefore targets the conditional distribution
$$
p_\theta(x \mid c_x, c_p),
$$
with the explicit goal of reproducing the **population-level distribution** of perturbed cells and generalizing to **unseen perturbations** and **combinatorial perturbations** [2602.07103]. The data description emphasizes several practical challenges that motivate this design: dropout and zero inflation, technical noise and batch effects, and non-linear, context-dependent perturbation effects. A plausible implication is that scDFM is intended not merely as a point predictor but as a distribution-aware simulator of perturbation response under realistic single-cell measurement conditions.

## 2. Flow-matching and distribution-level objectives

The core dynamical model is a conditional ODE
$$
\frac{d X_t}{dt} = v_\theta(X_t \mid t, c_x, c_p), \qquad t \in [0,1],
$$
where $v_\theta$ is a time-dependent velocity field conditioned on control profile and perturbation condition [2602.07103]. Training uses **Conditional Flow Matching**. scDFM specifies a **linear interpolation** in expression space,
$$
x_t = (1-t)x_0 + tx_1,
$$
between a source sample $x_0 \sim q_0$ and a target sample $x_1 \sim q_1(\cdot \mid c_x, c_p)$, and minimizes an $L_2$ objective between the learned velocity and the reference velocity along this path [2602.07103]. The source distribution is described as a **noisy gene expression distribution**, while the target is the empirical perturbed expression distribution.

A distinctive element is the addition of **MMD-based endpoint alignment**. The paper argues that CFM enforces local trajectory consistency but does not guarantee that generated terminal states match the real perturbed population. To correct this, scDFM forms a one-step endpoint approximation,
$$
\hat{x}_1 = x_t + (1 - t)\, v_\theta(x_t \mid t, c_x, c_p),
$$
and penalizes the discrepancy between generated endpoints and real perturbed samples using an MMD term [2602.07103]. The kernel is a **mixture of Gaussian RBFs** with bandwidths selected by a **dynamic median heuristic** per batch using factors $\{0.5, 1.0, 2.0, 4.0\}$.

The combined objective is
$$
\mathcal{L}(\theta) = \mathcal{L}_{\mathrm{CFM}}(\theta) + \lambda \,\mathcal{L}_{\mathrm{MMD}}(\theta),
$$
with $\lambda = 0.5$ in the reported experiments [2602.07103]. In the paper’s interpretation, $\mathcal{L}_{\mathrm{CFM}}$ teaches **how cells move**, while $\mathcal{L}_{\mathrm{MMD}}$ teaches **where the population should end up**. This suggests that scDFM is explicitly structured to separate local transport dynamics from global distributional calibration.

## 3. PAD-Transformer backbone

The velocity field $v_\theta$ is parameterized by the **PAD-Transformer**, a backbone designed to integrate perturbation conditioning, control-state context, and gene-level structure [2602.07103]. Because of the large number of genes, training operates on subsets $\mathcal{S} \subseteq \mathcal{G}$ with restricted control and perturbed representations. Initial token representations are formed by adding a **value embedding** $E_v$ for expression values and a **gene identity embedding** $E_g(\mathcal{S})$:
$$
h_c = E_v\!\big(c_x^{(\mathcal{S})}\big) + E_g(\mathcal{S}), \qquad
h_t^0 = E_v\!\big(x_t^{(\mathcal{S})}\big) + E_g(\mathcal{S}).
$$

A central architectural prior is a **gene–gene co-expression graph** used as a sparse attention mask. Edge weights are defined by absolute Pearson correlation,
$$
w_{ij} = \left|\frac{\mathrm{Cov}(x_i, x_j)}{\sigma(x_i)\sigma(x_j)}\right|,
$$
computed over training cells, after which a **kNN graph** is constructed with, for example, $k=30$ neighbors retained [2602.07103]. The resulting sparse adjacency matrix constrains the gene encoder so that tokens attend only to correlated neighbors. The paper frames this as a mechanism for enforcing biologically meaningful locality and suppressing spurious interactions under noise and sparsity.

PAD-Transformer also adopts **differential attention**, in which the effective attention weights are the difference between two softmax distributions,
$$
\alpha_{\text{diff}} = A_1 - \lambda A_2,
$$
with $\lambda$ a learnable scalar [2602.07103]. This mechanism is used in both **self-differential attention** over the perturbed latent and **cross-differential attention** between perturbed latent and control representation. The stated purpose is to suppress nuisance patterns and emphasize perturbation-relevant differences.

Perturbation identity is embedded as $e_p$ and injected at every layer by concatenation and MLP transformation, while time is encoded by a sinusoidal embedding followed by an MLP:
$$
t_{\mathrm{emb}} = \mathrm{MLP}(\mathrm{SinCos}(t)).
$$
Time conditioning modulates differential attention layers via **adaLN-Zero style conditioning** [2602.07103]. After $L$ layers, the final hidden state is decoded into the predicted velocity field. In the reported setup for Norman, the backbone uses hidden size $d=512$, $L=4$ layers, $H=8$ heads, and dropout $0.1$ [2602.07103].

## 4. Training procedure, preprocessing, and inference

The preprocessing pipeline uses **library size normalization to 10,000 counts per cell**, followed by **log1p** transformation [2602.07103]. For the Norman dataset, the workflow selects the top **5,000 highly variable genes**, then includes perturbation target genes, yielding **5029 total** genes. For ComboSciPlex, it uses the top **5,000 highly expressed genes**. Evaluation is reported on the **top 1000 highly expressed genes**, which the paper describes as focusing metrics on robust signals.

The training loop samples time $t \sim \mathcal{U}(0,1)$, samples a gene subset $I$, constructs a subgraph from the co-expression matrix, builds control and perturbed tokens, computes perturbation and time embeddings, runs PAD-Transformer, accumulates the CFM loss, computes batch endpoints $\hat{X}_1$, and then evaluates the batch MMD objective before a gradient update [2602.07103]. The method **re-samples gene subsets each step**, which is presented as a scalability measure and as a way for the gene encoder to observe different subgraphs over training.

Reported training hyperparameters for Norman are: **Adam** optimizer, initial learning rate $5\times 10^{-5}$ with cosine decay to $10^{-6}$, batch size **96**, training for **100,000** steps, and MMD weight $\lambda = 0.5$ [2602.07103]. Inference uses **Euler integration with $K=100$ steps**, starting from $x_0^{(I)} \sim q_0$ and iteratively updating
$$
x_{k+1}^{(I)} = x_k^{(I)} + \Delta t\, v_\theta.
$$
For perturbation conditioning, gene perturbations in Norman share parameters between perturbation embeddings and gene identity embeddings, while drug perturbations in ComboSciPlex use a separate embedding table [2602.07103].

The practical usage description emphasizes **population-level prediction**: for a new condition, one provides control cell profiles $c_x$, encodes the perturbation condition $c_p$, runs the ODE solver, and aggregates predictions across many control cells to obtain the generated perturbed population [2602.07103]. The same mechanism is used for **in silico combinatorial perturbations** by setting multiple entries of the multi-hot perturbation vector to one.

## 5. Benchmarks, metrics, and empirical results

The reported experiments cover two datasets: the **Norman dataset**, described as a Perturb-seq CRISPRa dataset in K562 cells with approximately **100 single-gene activations** and **124 double perturbations**, and **ComboSciPlex**, a drug perturbation dataset in A549 cells with **63,378 cells** and **32 treatment conditions** [2602.07103]. On Norman, results are reported for both an **additive setting**, where single perturbations used in test combinations are seen during training, and a **holdout setting**, where some single perturbations and all combinations involving them are removed from training.

Baselines include **Control**, **Additive**, **scGPT**, **Geneformer**, **GEARS**, **CPA**, **STATE**, and **CellFlow** [2602.07103]. Evaluation uses multiple metric families. Global reconstruction metrics are **L2**, **MSE**, and **MAE**. Distribution-level behavior is assessed by **DS (Discrimination Score / PDS)**. Differential-expression fidelity is assessed by **DE-Spearman $\rho$**. Heterogeneity and correlation structure are assessed by **Pearson $\Delta$**, **Pearson $\hat{\Delta}$**, and **Pearson $\hat{\Delta}_{20}$** [2602.07103].

On **Norman, additive split**, scDFM reports **L2 = 1.7043**, **MSE = 0.00315**, **MAE = 0.02155**, **DE-Spearman = 0.5705**, **DS = 0.9737**, **Pearson $\hat{\Delta}_{20} = 0.9260$**, and **Pearson $\hat{\Delta} = 0.8468$** [2602.07103]. The paper highlights that this corresponds to a **19.6% MSE reduction** relative to CellFlow, whose MSE is **0.00392**. It also notes that the Additive baseline is surprisingly strong, but scDFM still improves both reconstruction and distributional metrics, which the authors interpret as evidence that it captures **non-additive effects**.

On **Norman, holdout split**, scDFM reports the best values across the tabulated methods for both unseen singles and unseen doubles on most metrics [2602.07103]. For **held-out single perturbations**, the reported values are **L2 = 1.6186**, **MSE = 0.0030**, **MAE = 0.0190**, **DE-Spearman = 0.6957**, **Pearson $\Delta = 0.7127$**, **DS = 0.8914**, **Pearson $\hat{\Delta} = 0.6659$**, and **Pearson $\hat{\Delta}_{20} = 0.8116$**. For **held-out double perturbations with unseen singles**, scDFM reports **L2 = 2.0309**, **MSE = 0.0047**, **MAE = 0.0235**, **DE-Spearman = 0.5676**, **Pearson $\Delta = 0.8357$**, **DS = 0.9189**, **Pearson $\hat{\Delta} = 0.7769$**, and **Pearson $\hat{\Delta}_{20} = 0.8688$**.

On **ComboSciPlex**, scDFM reports **L2 = 1.6567**, **MSE = 0.0028**, **MAE = 0.0220**, **DE-Spearman = 0.8289**, **Pearson $\Delta = 0.8933$**, and **DS = 0.8776** [2602.07103]. The paper describes these results as showing generalization across perturbation modality, from CRISPRa to drugs.

Qualitative analyses reinforce the distribution-level claim. UMAP visualizations show that removing the MMD objective causes generated cells to deviate from the ground-truth manifold, while full scDFM better follows the real population geometry [2602.07103]. A case study on **CEBPE+CEBPA** highlights genes such as **CEACAM20** and **LST1**, where scDFM is reported to match directionality and remain within observed variance better than several baselines.

## 6. Interpretation, limitations, and terminological ambiguity

The design of scDFM encodes a specific methodological position: perturbation prediction should be treated as **distribution transport in full expression space**, not merely as latent reconstruction or mean-profile regression [2602.07103]. The use of MMD indicates a preference for sample-based distribution matching under support mismatch, while the PAD-Transformer introduces biological structure through graph masking and differential control-versus-perturbed attention. A plausible implication is that the framework is especially suited to settings where the principal scientific object is a perturbed **population manifold** rather than a single canonical response vector.

The reported limitations are explicit. The interpolation path is **linear** in log-normalized expression space, whereas real biological trajectories may be non-linear, branching, and manifold-constrained [2602.07103]. The co-expression graph is built from **absolute Pearson correlation** and kNN, so it captures only linear dependencies and does not encode causality. Experiments are limited to Norman and ComboSciPlex rather than larger multi-context datasets such as **ARC-state** or **Virtual Cell Challenge**. The method also carries computational cost: attention scales as $O(|I|^2)$ on gene subsets, and MMD scales as $O(B^2)$ in batch size, though the gene-subset sampling strategy partially mitigates this.

Future directions named in the source include manifold-aware paths, learned or causal graphs, scaling to larger multi-cell-type datasets, multi-omics integration, incorporating dose and time-course covariates, and using scDFM as a **digital twin** for in silico screening and optimization in drug discovery [2602.07103]. The implementation is available at the GitHub repository linked by the paper.

The term **scDFM** is also potentially ambiguous in adjacent literature. One source notes that the acronym was not explicitly defined there and could refer informally to **SCDM**, the “Score-Based Channel Denoising Model” for digital semantic communications [2501.17876]. Another source states that the term could plausibly be used for a semantic-feature multiple-access concept that the paper itself names **SFDMA**, “Semantic Feature Division Multiple Access” [2407.08424]. In the dedicated single-cell perturbation context, however, scDFM specifically denotes **single-cell Distributional Flow Matching** [2602.07103].

Source: https://www.emergentmind.com/topics/scdfm