The Derivatives of Sinkhorn-Knopp Converge

Edouard Pauwels, Samuel Vaiter · DOI

TL;DR

This paper provides the first formal proof that the derivatives of the Sinkhorn-Knopp algorithm—the workhorse of modern Optimal Transport (OT) in machine learning—actually converge to the true derivatives of the entropic OT problem. Crucially, it establishes that this convergence happens at a linear rate, mathematically justifying the widespread practice of "backpropagating through Sinkhorn."

What Problem Does This Paper Address?

Optimal Transport has become a cornerstone of machine learning, used for everything from training generative models to calculating Wasserstein barycenters. Because the raw OT problem is computationally expensive, researchers typically use entropic regularization, which makes the problem solvable via the fast, iterative Sinkhorn-Knopp algorithm.

In many ML applications, we don't just need the transport plan; we need its derivative (the Jacobian) to perform gradient descent on model parameters. Practitioners usually get this derivative in one of two ways:

  1. Automatic Differentiation (AD): Differentiating through the steps of the algorithm (backpropagation).
  2. Implicit Differentiation: Differentiating the optimality conditions of the final solution.

While we knew the algorithm's results converged, there was a glaring theoretical gap: Do the derivatives of the iterates actually converge to the derivative of the solution? Standard proofs for AD convergence require the algorithm to be a "strict contraction" (meaning it shrinks the distance between points at every step). Sinkhorn-Knopp fails this requirement because it is invariant to scaling—a property that makes it fast but makes its derivative convergence tricky to prove.

Methods

The authors tackle this by analyzing the Sinkhorn-Knopp algorithm in the "log-domain." Their approach involves several key technical steps:

  • Spectral Analysis: They decompose the Jacobian of the Sinkhorn update. They show that while the Jacobian has an eigenvalue of 1 (preventing strict contraction), the "direction" associated with this eigenvalue is exactly the scaling invariance mentioned above.
  • The "Alignment" Trick: They prove that the derivative of the transport plan is "aligned" such that it ignores the non-contractive directions of the algorithm.
  • Reduced Jacobians: They introduce a "proxy" operator ($G$) that acts like a version of the Jacobian with the problematic eigenvalue removed, allowing them to apply contraction mapping theorems.
  • Spectral Pseudo-inverse: To provide an explicit formula for the final derivative, they utilize the spectral pseudo-inverse, which is better suited for diagonalizable matrices than the more common Moore-Penrose pseudo-inverse.

Datasets

As a theoretical paper, it does not rely on large-scale empirical datasets. However, the authors provide a numerical illustration to verify their proofs:

  • Synthetic Point Clouds: They use two point clouds in $\mathbb{R}^2$ ($n=100$ and $m=50$). One follows a uniform distribution in a square; the other is uniform on a circle.
  • Implementation: They used the jax library to automatically differentiate the Sinkhorn iterations and compared the results against their theoretical predictions.

Key Insights and Ideas

  • Mathematical Justification for AD: The paper confirms that "piggyback" differentiation (calculating the derivative alongside the algorithm) is theoretically sound for Sinkhorn, even though the algorithm isn't a strict contraction.
  • Locally Uniform Linear Convergence: The derivatives don't just converge; they do so at a linear rate. This means that if you run a few more iterations of Sinkhorn, you gain a predictable amount of precision in your gradients.
  • Invariance is the Key: The very property that usually breaks AD convergence proofs—scaling invariance—is what makes the transport plan's derivative well-behaved. The "errors" in the derivative of the scaling factors essentially cancel each other out when calculating the final transport plan.

Key Results

  • Theorem 3.3: This is the core result. It proves that the sequence of derivatives $\frac{dP_k}{d\theta}$ converges to the true derivative $\frac{d\hat{P}}{d\theta}$ at a linear rate.
  • Explicit Formula: The authors provide a closed-form expression for the derivative of the entropic OT solution using the spectral pseudo-inverse of the Jacobian of the Sinkhorn map.
  • Numerical Confirmation: Experiments (shown in Fig. 2 of the paper) confirm that the derivative converges at the same asymptotic rate as the iterates themselves. As the regularization parameter $\epsilon$ decreases (making the problem "sharper"), the number of iterations required for convergence increases proportionally.

Limitations and Future Work

  • Specific to the Transport Plan: The proof guarantees convergence for the derivative of the transport plan ($P_k$), but not necessarily for the derivatives of the individual scaling factors ($u_k, v_k$) or the internal "log-domain" variables ($x_k$).
  • Twice Differentiability: The results assume that all input functions (cost matrices, marginals, etc.) are at least twice continuously differentiable.
  • Pessimistic Bounds: The authors note that their theoretical convergence rate bound ($\sqrt{\rho}$) might be more pessimistic than what is observed in practice, where the derivative seems to converge as fast as the algorithm itself ($\rho$). Future work could focus on tightening these bounds.

Summary updated

BibTeX
@article{pauwels2023derivatives,
  author = {Edouard Pauwels and Samuel Vaiter},
  title = {{The Derivatives of Sinkhorn-Knopp Converge}},
  journal = {SIAM J. Optim.},
  year = {2023},
  doi = {10.1137/22m1512703},
}
Figure