Optimal Transport (OT) is an elegant mathematical framework for comparing probability distributions. By calculating the minimum cost required to morph one distribution into another, it provides a geometrically meaningful distance metric—often called the Wasserstein distance or Earth Mover's Distance.
Despite its theoretical appeal, exact optimal transport historically suffered from a severe practical limitation: computation time. Finding the exact optimal transport plan requires solving a linear program that scales cubically with the number of data points ($O(n^3 \log n)$). This computational wall prevented OT from being applied to large-scale machine learning problems.
The breakthrough that unlocked OT for modern machine learning is entropic regularization. By adding a simple mathematical penalty to the classical optimization objective, researchers transformed a rigid, slow combinatorial problem into a smooth, lightning-fast matrix scaling operation.
The Computational Wall of Exact Transport
To understand why entropic regularization works, we must first look at why classical optimal transport is slow. In the discrete formulation, we have two probability vectors, $a$ and $b$, of size $n$. We want to find a transport plan matrix $P \in \mathbb{R}_+^{n \times n}$, where $P_{ij}$ represents the amount of mass moved from point $i$ to point $j$.
Given a cost matrix $C$ where $C_{ij}$ is the distance between point $i$ and point $j$, the classical Kantorovich problem seeks to minimize the total cost:
$$\min_{P \in \mathcal{U}(a,b)} \sum_{i,j} P_{ij} C_{ij}$$
subject to the marginal constraints $\sum_j P_{ij} = a_i$ and $\sum_i P_{ij} = b_j$.
Because this is a standard linear program, its solution space is a polytope, and the optimal solution typically lies on one of its sharp vertices. This makes the optimal transport plan highly sparse and quasi-deterministic—mass from one point is cleanly assigned to a few specific target points. However, searching for these exact vertices requires combinatorial optimization algorithms, which are notoriously difficult to parallelize on modern hardware like GPUs.
Smoothing the Landscape with Entropy
In a seminal paper, marco cuturi proposed a simple yet radical modification in Sinkhorn Distances: Lightspeed Computation of Optimal Transport. Instead of searching for the absolute minimum of the linear cost, Cuturi added an entropic penalty term to the objective function:
$$\min_{P \in \mathcal{U}(a,b)} \sum_{i,j} P_{ij} C_{ij} - \gamma H(P)$$
where $H(P) = -\sum_{i,j} P_{ij} \log P_{ij}$ is the Shannon entropy of the transport plan, and $\gamma > 0$ is a regularization parameter.
What does this penalty actually do? Entropy measures randomness or diffusion. By subtracting $\gamma H(P)$ (or equivalently, minimizing the negative entropy), the objective function penalizes overly sparse transport plans. It forces the matrix $P$ to hold smoother, more distributed values.
Mathematically, this changes the entire nature of the optimization landscape:
- Strict Convexity: The linear programming objective is flat, but the negative entropy term is strictly convex. Adding it guarantees that the objective function has a unique, globally optimal solution.
- Differentiability: The objective becomes smooth and fully differentiable, allowing gradients to flow effortlessly through the transport plan.
As Meshi et al. demonstrate in Convergence Rate Analysis of MAP Coordinate Minimization Algorithms, adding entropy regularization terms to non-smooth primal objectives transforms the dual problem into a strictly convex and differentiable function, ensuring coordinate descent algorithms converge rapidly to a unique global optimum.
The Mechanism: The Sinkhorn-Knopp Algorithm
The real magic of entropic regularization appears when we look at the first-order optimality conditions of the regularized objective. By taking the derivative of the Lagrangian with respect to $P_{ij}$ and setting it to zero, a surprising algebraic structure emerges. The optimal transport plan $P^*$ must take the form:
$$P_{ij}^* = u_i e^{-C_{ij}/\gamma} v_j$$
where $u$ and $v$ are positive scaling vectors determined by the marginal constraints.
If we define a static kernel matrix $K \in \mathbb{R}^{n \times n}$ such that $K_{ij} = e^{-C_{ij}/\gamma}$, we can rewrite the optimal transport plan compactly as a diagonal scaling of this kernel matrix:
$$P^* = \text{diag}(u) K \text{diag}(v)$$
This formulation completely bypasses the need for linear programming. Finding the optimal transport plan is now mathematically equivalent to the matrix balancing problem: finding two diagonal matrices that scale a known matrix $K$ so that its rows sum to $a$ and its columns sum to $b$.
This can be solved using the classical Sinkhorn-Knopp algorithm, which simply alternates between updating $u$ and $v$:
$$u \leftarrow \frac{a}{Kv}, \quad v \leftarrow \frac{b}{K^T u}$$
Each iteration requires only basic matrix-vector multiplications. This shifts the computational complexity from $O(n^3 \log n)$ down to $O(n^2)$ per iteration. Because matrix multiplication is highly parallelizable, this algorithm can be executed on GPUs at blistering speeds. As Benamou et al. show in Iterative Bregman Projections for Regularized Transportation Problems, transforming these problems into Kullback-Leibler projections allows even high-dimensional or heavily constrained transport problems to be solved efficiently using simple, iterative closed-form updates.
Why "Soft" Matching is a Feature, Not a Bug
While entropic regularization was initially introduced as a computational trick to speed up execution, researchers quickly realized that the resulting "blurriness" offers significant statistical and qualitative advantages.
In real-world data, exact 1-to-1 matching is often fragile. For example, when training machine learning models on noisy web data, rigid assignments cause models to overfit to noise. As Wu et al. demonstrate in Data Efficient Language-Supervised Zero-Shot Recognition with Optimal Transport Distillation, the smooth, probabilistic matching matrix generated by entropic regularization prevents models from collapsing into rigid, binary assignments, providing a more informative training signal.
Similarly, in natural language processing, words rarely map perfectly across languages. In Cross-lingual Document Retrieval using Regularized Wasserstein Distance, Laclau et al. leverage entropic regularization to facilitate soft semantic matching, allowing a single word in a source document to distribute its probability mass across multiple related terms in a target document.
Exact OT (Rigid Polytope) Entropic OT (Smooth Convex Landscape)
[Point A] [Point A]
| / | \
| (Hard Assignment) / | \ (Soft Probabilistic
v v v v Distribution)
[Point B] [Dest 1] [Dest 2] [Dest 3]
This smoothing effect also acts as a numerical stabilizer. In On Rank Energy Statistics via Optimal Transport: Continuity, Convergence, and Change Point Detection, Werenski et al. explain that entropic regularization ensures Lipschitz continuity with respect to the underlying distance metric. This smooths out high-frequency noise and small data perturbations that would otherwise break unregularized transport calculations.
Expanding the Toolbox
The success of entropic regularization has sparked a broad research direction, extending the core intuition of matrix scaling to a wide variety of complex domains:
- Barycenters and Ensembling: Computing the geometric average of multiple distributions (Wasserstein barycenters) was once computationally impossible. Cuturi et al. show in Fast Computation of Wasserstein Barycenters that entropic regularization transforms this heavy task into a fast matrix scaling problem. This capability allows for advanced applications like Wasserstein Barycenter Model Ensembling, where Dognin et al. use Sinkhorn iterations to combine diverse machine learning model predictions while preserving semantic relationships.
- Continuous and High-Dimensional Spaces: To avoid optimizing directly over continuous probability measures, researchers often use smoothed dual formulations. Yaniv Romano applies this in Fast Nonlinear Vector Quantile Regression, using entropic regularization to transform a constrained linear programming problem into an unconstrained convex objective that can scale to large datasets via stochastic gradient descent.
- Alternative Divergences: Shannon entropy is not the only way to smooth an objective. Terjék et al. expand this boundary in Optimal transport with f-divergence regularization and generalized Sinkhorn algorithm, showing how generalized Sinkhorn iterations can be implemented for a wider family of $f$-divergences using Newton's method as an inner loop.
By trading absolute geometric rigidity for a soft, entropic penalty, this research direction provides a profound lesson for machine learning: sometimes, blurring the lines is exactly what makes a problem solvable.