Inferensys

Glossary

Optimal Transport

A mathematical framework for finding the most efficient mapping between two probability distributions, applied in single-cell biology to align cells from different batches, time points, or omics modalities by minimizing a cost function based on their feature similarity.
Data engineer managing feature store on laptop, feature definitions visible, casual data engineering session.
MATHEMATICAL FRAMEWORK

What is Optimal Transport?

Optimal Transport (OT) is a mathematical theory for finding the most efficient way to move mass between probability distributions, minimizing a defined cost function. In single-cell biology, it aligns cells across batches, time points, or modalities.

Optimal Transport is the mathematical framework that computes the minimal-cost mapping between two probability distributions. Originating from Gaspard Monge's 18th-century work on moving earth efficiently, OT solves the Kantorovich relaxation problem—finding a coupling matrix that minimizes the total transport cost while preserving marginal constraints. In computational biology, this cost is typically defined by gene expression dissimilarity between cells.

In single-cell multi-omics integration, OT algorithms like Sinkhorn divergences and Gromov-Wasserstein distances align cells from different batches or modalities without requiring shared features. Unlike Canonical Correlation Analysis (CCA), OT preserves local neighborhood structure and handles non-linear correspondences, making it essential for batch effect correction, spatial transcriptomics alignment, and cross-species cell-type matching.

Mathematical Foundations

Core Characteristics of Optimal Transport

Optimal Transport provides a rigorous geometric framework for comparing and aligning probability distributions by finding the most cost-effective way to transform one distribution into another.

01

Monge Formulation

The original formulation of Optimal Transport seeks a deterministic mapping T that pushes forward a source distribution μ to a target distribution ν while minimizing the total transportation cost. The objective is to find T such that for each point x, T(x) specifies its unique destination, minimizing ∫ c(x, T(x))dμ(x). This formulation is non-convex and may not admit a solution, particularly when mass needs to be split—a limitation that motivated Kantorovich's relaxation.

02

Kantorovich Relaxation

Kantorovich generalized the Monge problem by allowing probabilistic coupling through a joint distribution π (the transport plan) with marginals μ and ν. Instead of a deterministic map, mass at x can be split across multiple destinations. The problem becomes a linear program: minimize ∫∫ c(x,y)dπ(x,y) over all couplings π. This convex relaxation guarantees existence and uniqueness under mild conditions, making it computationally tractable for modern applications like domain adaptation and single-cell alignment.

03

Wasserstein Distance

The minimal cost achieved by the optimal transport plan defines the Wasserstein distance (Earth Mover's Distance) between distributions. For p≥1, the p-Wasserstein distance is W_p(μ,ν) = (inf ∫∫ ||x-y||^p dπ(x,y))^(1/p). Unlike f-divergences (KL, JS), the Wasserstein distance:

  • Respects the underlying geometry of the space
  • Provides meaningful gradients even when distributions have disjoint supports
  • Is a true metric satisfying symmetry and triangle inequality This makes it the preferred loss function in Wasserstein GANs and single-cell trajectory inference.
04

Entropic Regularization

Computing exact Optimal Transport scales as O(n³ log n) for discrete distributions with n points, making it prohibitive for large-scale single-cell datasets. Entropic regularization, introduced by Cuturi (2013), adds an entropy term -εH(π) to the objective, making the problem strictly convex and solvable via the Sinkhorn algorithm in O(n²) time. The parameter ε controls the trade-off:

  • Small ε: Sharp, sparse transport plans approximating exact OT
  • Large ε: Diffuse, smoother plans with faster convergence This breakthrough enabled OT to scale to modern single-cell atlases with millions of cells.
05

Gromov-Wasserstein Distance

The Gromov-Wasserstein (GW) distance extends OT to compare distributions defined on different metric spaces by comparing pairwise distances within each domain rather than cross-domain distances. Given distributions on spaces X and Y with distance matrices d_X and d_Y, GW finds a coupling that preserves intrinsic relational structure. In single-cell biology, GW enables:

  • Aligning cells across different species where gene orthologs differ
  • Integrating different omics modalities (scRNA-seq to scATAC-seq) without shared features
  • Matching developmental trajectories across experimental conditions by comparing cellular similarity graphs
06

Unbalanced Optimal Transport

Classical OT requires exact mass conservation: the total mass of source and target distributions must be equal. Unbalanced Optimal Transport relaxes this constraint by allowing mass creation and destruction through divergence penalties (e.g., KL divergence) on the marginals. This is critical for single-cell applications where:

  • Cell populations may proliferate or die between time points
  • Technical dropout in scRNA-seq creates spurious zero counts
  • Different samples contain varying cell-type proportions Unbalanced OT formulations, such as the Wasserstein-Fisher-Rao distance, handle these realistic biological scenarios by jointly optimizing transport and mass variation.
OPTIMAL TRANSPORT

Frequently Asked Questions

Clear, technically precise answers to the most common questions about applying optimal transport theory to single-cell biology and multi-omics data integration.

Optimal transport (OT) is a mathematical framework that finds the most efficient mapping between two probability distributions by minimizing a cost function. In single-cell biology, OT aligns cells from different batches, time points, or omics modalities by treating each cell as a unit of probability mass and computing the minimal-cost transportation plan that maps one cellular distribution onto another. The cost is typically defined by the dissimilarity between cells in a shared feature space, such as gene expression or a latent embedding. The Kantorovich relaxation allows for probabilistic, fractional mappings rather than strict one-to-one assignments, making it ideal for biological scenarios where cell populations expand, contract, or differentiate. Algorithms like Sinkhorn distances add entropic regularization to make the computation tractable for large single-cell datasets containing hundreds of thousands of cells. The resulting coupling matrix directly identifies which cells in one condition correspond to which cells in another, enabling robust batch correction, temporal alignment, and cross-modality translation without requiring paired measurements.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.