Sinkhorn Normalization in Matrix Scaling and OT
- Sinkhorn Normalization is a method that scales nonnegative matrices via alternating row and column normalizations to achieve prescribed marginals and form doubly stochastic matrices.
- It computes regularized transport plans through diagonal scaling of a Gibbs kernel, with convergence analyzed under the Hilbert projective metric and geometric contraction rates.
- The technique underpins several applications in machine learning, retrieval, and networked data by serving as a differentiable surrogate for permutations, matchings, and constrained assignments.
Sinkhorn Normalization (SN), also called the Sinkhorn–Knopp algorithm, matrix scaling, or iterative proportional fitting, is the alternating row/column normalization procedure that rescales a nonnegative matrix to satisfy prescribed marginals. In the square uniform case, the limit is a doubly stochastic matrix in the Birkhoff polytope; in entropic optimal transport, the same iteration computes the regularized transport plan through diagonal scalings of a Gibbs kernel; and in modern machine learning it serves as a differentiable surrogate for permutations, matchings, and constrained attention or assignment matrices (Mazzilli et al., 2022, Tang et al., 2024, Adams et al., 2011).
1. Classical matrix scaling problem
Classically, SN solves the -scaling problem. Given a nonnegative matrix and positive target marginals , with , the goal is to find diagonal scaling matrices and such that
has row sums and column sums . Writing 0 and 1, the standard alternating updates are
2
Equivalently,
3
with entry-wise division denoted by 4. Under the total support condition, the scaling factors remain strictly positive and the scaled matrix converges to the unique doubly stochastic solution (Mazzilli et al., 2022).
The same procedure can be written as alternate row- and column-scaling operators 5 and 6. For a nonnegative matrix 7, 8 rescales each row to sum to 9, and 0 rescales each column to sum to 1. Starting from 2, one alternates 3 and 4, obtaining the familiar row/column normalization sequence (Cohen et al., 2019).
A recurring misconception is that exact finite termination can happen after an arbitrary number of alternations. The sharp finite-step result is stricter: if an alternating sequence reaches an 5-doubly stochastic matrix in finitely many steps, then it does so in at most two scalings (Cohen et al., 2019).
2. Entropic optimal transport formulation
In optimal transport, SN appears as the solver for the entropically regularized transport problem. Given histograms 6 with 7, a cost matrix 8, and regularization strength 9, the problem is
0
The unique minimizer has the scaling form
1
and enforcing the marginal constraints yields the Sinkhorn updates
2
For finite 3, the entropy term makes the problem strictly convex and enables fast matrix-scaling methods; as 4, the regularized plan converges to the unregularized optimal transport plan (Tang et al., 2024).
The dual-variable viewpoint makes the dynamics explicit. Defining
5
the updates become
6
These iterations alternate maximization of the concave Lyapunov function
7
whose gradients are 8 and 9 (Tang et al., 2024).
A complementary geometric interpretation views SN as alternating projection in Kullback–Leibler divergence onto the row-sum and column-sum affine constraints of the transport polytope. In the continuum formulation, it is the time-0 Euler, or Trotter–Euler, discretization of coupled nonlinear integral equations for Schrödinger potentials; after semi-discretization, these flows reduce exactly to the discrete Sinkhorn updates (Modin, 2023).
3. Convergence theory, rates, and complexity regimes
The classical global convergence statement is projective: if 1 entrywise and 2 are prescribed marginals with equal total mass, then there exist unique positive scalings 3, 4 such that 5 has row sums 6 and column sums 7. In the Hilbert projective metric,
8
the Sinkhorn map is a contraction, and one has
9
with
0
This is the standard global geometric convergence mechanism (Modin, 2023).
For entropic OT, the same linear behavior can be slow in practice when the regularization is small. One explicit rate statement is
1
so driving the marginal KL divergence below 2 may require
3
iterations in worst-case theory. The same source notes that empirical dependence on the tolerance 4 is often polynomial, such as 5 or 6 (Tang et al., 2024). From the geometric viewpoint, as 7, 8 becomes increasingly ill-conditioned, the contraction factor approaches 9, and the number of iterations to reach a fixed accuracy grows like 0 (Modin, 2023).
A more recent refinement isolates a sharp density threshold. For an 1 normalized matrix whose density parameter satisfies 2, Sinkhorn–Knopp reaches 3-error at most 4 in
5
iterations, yielding 6 total time. By contrast, for every 7 there exists a 8-dense matrix requiring 9 iterations for 0-error and 1 iterations for 2-error. This establishes a phase transition at 3: logarithmic iteration complexity above the threshold and polynomial dependence below it (He, 13 Jul 2025).
4. Accelerated and generalized algorithms
The most direct acceleration in the provided literature is "Accelerating Sinkhorn Algorithm with Sparse Newton Iterations" (Tang et al., 2024). The proposed Sinkhorn-Newton-Sparse (SNS) algorithm is explicitly two-stage. First, 4 standard Sinkhorn steps provide a warm start close enough to the optimum and produce a transport plan 5 that admits a small-error sparse approximation. Second, a Newton-type stage uses the Hessian of the Lyapunov potential,
6
which is dense in principle but approximately sparse in many practical instances because mass concentrates on a small subset of pairs 7. Sparsifying the Hessian by thresholding or retaining only the top 8 entries yields 9 per-iteration complexity, the same order as Sinkhorn. The paper reports that SNS converges orders of magnitude faster across empirical transport tasks, and once in the Newton regime the convergence in 0 becomes super-linear, indeed super-exponential in practice (Tang et al., 2024).
A different generalization arises in unbalanced optimal transport. There, classical Sinkhorn may be slow because the dual potentials drift: the coupling
1
is invariant under 2, while the unbalanced dual objective is not. Translation invariant Sinkhorn introduces an over-parameterized dual
3
and the invariant objective
4
The resulting 5-Sinkhorn removes the drift and yields a provably accelerated algorithm; in the KL-penalty case, the composite update is contractive at rate 6, whereas the standard 7-Sinkhorn rate is described as 8 (Séjourné et al., 2022).
These developments clarify an important methodological point. SN is not a single fixed algorithmic object but a scaling framework whose core invariants are preserved while the update rule is modified to exploit problem structure: sparse Hessians in regularized OT, translation invariance in unbalanced OT, or other domain-specific symmetries. This suggests why recent work frequently treats SN both as a classical iterative procedure and as a template for designing faster or more stable normalization dynamics.
5. Applications in machine learning, retrieval, and networked data
In learning to rank, SN is used as a differentiable route into the Birkhoff polytope. "Ranking via Sinkhorn Propagation" observes that expectations of rank-linear gains depend only on the marginals of a distribution over permutation matrices, hence only on a doubly stochastic matrix 9. The method applies incomplete Sinkhorn normalization 0 to a nonnegative pre-Sinkhorn matrix, computes the expected gain
1
and backpropagates through the row and column Jacobians in 2 time per query (Adams et al., 2011). Closely related, Gumbel–Sinkhorn networks define
3
treating SN as a continuous analogue of the softmax operator for latent matchings. As 4, 5 approaches a hard permutation, and the method is demonstrated on sorting numbers, solving jigsaw puzzles, and identifying neural signals in worms (Mena et al., 2018).
In structured matching, GCNNMatch embeds a Sinkhorn block directly into online multi-object tracking. After feature extraction and affinity scoring, the method forms a raw score matrix 6 with a slack row and column to model births and deaths, then alternates row and column softmax normalizations with prescribed slack margins. The reported hyperparameters are entropic weight 7, slack initialization 8, and 9 Sinkhorn iterations (Papakis et al., 2020).
In cross-modal retrieval, SN is used to balance retrieval probabilities and reduce hubness. The formulation replaces a similarity matrix 00 by the entropy-regularized transport plan 01 with uniform marginals, equivalently balancing both queries and targets. The same work proves that Inverted Softmax is the single-marginal version obtained by dropping the row constraint. On Flickr30k, the skewness of the 02-occurrence distribution is reported as baseline 03, IS 04, and SN 05; the Dual Bank Sinkhorn Normalization (DBSN) extension augments the query bank with a target bank in query-agnostic settings (Pan et al., 4 Aug 2025).
In economic complexity, the Fitness–Complexity algorithm is shown to be algebraically equivalent to Sinkhorn–Knopp under 06, 07, and 08. The associated potential
09
yields an energy interpretation in which the relative energy cost
10
acts as a barrier separating feasible from infeasible exports. The equivalence also clarifies the scale invariance of the algorithm and the role of normalization choices in time-series comparisons (Mazzilli et al., 2022).
In Transformer models, SN has been proposed as a replacement for row-stochastic softmax attention. Alternating row and column normalizers produces a doubly stochastic attention matrix 11 satisfying 12 and 13. The reported analysis shows that SN preserves rank more effectively than standard Softmax attention, although pure self-attention without skips still exhibits doubly-exponential rank decay to one with depth. The same source emphasizes that skip connections are crucial and notes that, in practice, 14–15 Sinkhorn iterations suffice for the normalization step (Lapenna et al., 9 Apr 2026).
6. Structural extensions beyond the standard setting
One line of work modifies the target structure rather than the application domain. "Normalizing Diffusion Kernels with Optimal Transport" introduces symmetric Sinkhorn normalization for a positive symmetric smoothing operator 16, where 17 is symmetric and 18 is a mass matrix. The goal is a single positive diagonal scaling 19 such that
20
preserves constant signals, remains symmetric with respect to the 21-weighted inner product, has nonnegative entries, and has spectrum contained in 22. The fixed-point iteration computes
23
and the paper states that 5–10 iterations typically suffice (Kessler et al., 8 Jul 2025). This contrasts with standard alternating row/column normalization, which generally breaks symmetry during the intermediate steps.
Another extension treats continuous-state Gaussian models exactly. In "Gaussian entropic optimal transport: Schrödinger bridges and the Sinkhorn algorithm," the iterative proportional fitting procedure remains finite-dimensional when 24, 25, and the reference kernel are Gaussian. The iterates stay Gaussian, the covariance updates reduce to Riccati-type recursions related to the Kalman filter, and the per-iteration cost is 26. At the limit, the Schrödinger bridge and the entropic transport map admit closed-form Gaussian expressions (Akyildiz et al., 2024).
Distributed and asynchronous variants further broaden the framework. "From Local Updates to Global Balance" studies arbitrary sequences in which only one row or one column is normalized at each step. If every row and every column is visited infinitely often and the initial matrix has support, the iterates converge to a doubly stochastic matrix. The same paper uses this fact to analyze a Decentralized Random Walk on a directed graph, where a local walker rescales only the row and column of its current vertex; the limiting transition matrix is doubly stochastic, so the uniform distribution is invariant (Aletti et al., 3 Jun 2025).
A more radical structural extension replaces positivity-preserving diagonal scalings by phase-preserving ones. "Sinkhorn normal form for unitary matrices" proves that every unitary 27 admits diagonal unitaries 28 such that
29
has all row sums and column sums equal to one; equivalently,
30
with 31 and 32 diagonal unitaries. The proof is non-constructive and uses symplectic topology via the non-displaceability of the Clifford torus. The same work notes that, unlike the classical positive case, no elementary convergence proof of an alternating algorithm is known in the unitary setting (Idel et al., 2014).
Taken together, these variants show that SN is best understood as a family of normalization principles centered on diagonal rescaling, marginal constraints, and fixed-point geometry. The standard doubly stochastic matrix-scaling problem remains the canonical case, but the same logic extends to sparse Newton acceleration, unbalanced transport, diffusion operators, Gaussian Schrödinger bridges, asynchronous local updates, and even unitary normal forms.