Papers
Topics
Authors
Recent
Search
2000 character limit reached

Sinkhorn Normalization in Matrix Scaling and OT

Updated 4 July 2026
  • 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 (r,c)(\mathbf r,\mathbf c)-scaling problem. Given a nonnegative matrix AR+n×mA\in\mathbb R_+^{n\times m} and positive target marginals rR+n\mathbf r\in\mathbb R_+^n, cR+m\mathbf c\in\mathbb R_+^m with iri=jcj\sum_i r_i=\sum_j c_j, the goal is to find diagonal scaling matrices DrD_r and DcD_c such that

B=DrADcB=D_r A D_c

has row sums rir_i and column sums cjc_j. Writing AR+n×mA\in\mathbb R_+^{n\times m}0 and AR+n×mA\in\mathbb R_+^{n\times m}1, the standard alternating updates are

AR+n×mA\in\mathbb R_+^{n\times m}2

Equivalently,

AR+n×mA\in\mathbb R_+^{n\times m}3

with entry-wise division denoted by AR+n×mA\in\mathbb R_+^{n\times m}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 AR+n×mA\in\mathbb R_+^{n\times m}5 and AR+n×mA\in\mathbb R_+^{n\times m}6. For a nonnegative matrix AR+n×mA\in\mathbb R_+^{n\times m}7, AR+n×mA\in\mathbb R_+^{n\times m}8 rescales each row to sum to AR+n×mA\in\mathbb R_+^{n\times m}9, and rR+n\mathbf r\in\mathbb R_+^n0 rescales each column to sum to rR+n\mathbf r\in\mathbb R_+^n1. Starting from rR+n\mathbf r\in\mathbb R_+^n2, one alternates rR+n\mathbf r\in\mathbb R_+^n3 and rR+n\mathbf r\in\mathbb R_+^n4, 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 rR+n\mathbf r\in\mathbb R_+^n5-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 rR+n\mathbf r\in\mathbb R_+^n6 with rR+n\mathbf r\in\mathbb R_+^n7, a cost matrix rR+n\mathbf r\in\mathbb R_+^n8, and regularization strength rR+n\mathbf r\in\mathbb R_+^n9, the problem is

cR+m\mathbf c\in\mathbb R_+^m0

The unique minimizer has the scaling form

cR+m\mathbf c\in\mathbb R_+^m1

and enforcing the marginal constraints yields the Sinkhorn updates

cR+m\mathbf c\in\mathbb R_+^m2

For finite cR+m\mathbf c\in\mathbb R_+^m3, the entropy term makes the problem strictly convex and enables fast matrix-scaling methods; as cR+m\mathbf c\in\mathbb R_+^m4, the regularized plan converges to the unregularized optimal transport plan (Tang et al., 2024).

The dual-variable viewpoint makes the dynamics explicit. Defining

cR+m\mathbf c\in\mathbb R_+^m5

the updates become

cR+m\mathbf c\in\mathbb R_+^m6

These iterations alternate maximization of the concave Lyapunov function

cR+m\mathbf c\in\mathbb R_+^m7

whose gradients are cR+m\mathbf c\in\mathbb R_+^m8 and cR+m\mathbf c\in\mathbb R_+^m9 (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-iri=jcj\sum_i r_i=\sum_j c_j0 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 iri=jcj\sum_i r_i=\sum_j c_j1 entrywise and iri=jcj\sum_i r_i=\sum_j c_j2 are prescribed marginals with equal total mass, then there exist unique positive scalings iri=jcj\sum_i r_i=\sum_j c_j3, iri=jcj\sum_i r_i=\sum_j c_j4 such that iri=jcj\sum_i r_i=\sum_j c_j5 has row sums iri=jcj\sum_i r_i=\sum_j c_j6 and column sums iri=jcj\sum_i r_i=\sum_j c_j7. In the Hilbert projective metric,

iri=jcj\sum_i r_i=\sum_j c_j8

the Sinkhorn map is a contraction, and one has

iri=jcj\sum_i r_i=\sum_j c_j9

with

DrD_r0

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

DrD_r1

so driving the marginal KL divergence below DrD_r2 may require

DrD_r3

iterations in worst-case theory. The same source notes that empirical dependence on the tolerance DrD_r4 is often polynomial, such as DrD_r5 or DrD_r6 (Tang et al., 2024). From the geometric viewpoint, as DrD_r7, DrD_r8 becomes increasingly ill-conditioned, the contraction factor approaches DrD_r9, and the number of iterations to reach a fixed accuracy grows like DcD_c0 (Modin, 2023).

A more recent refinement isolates a sharp density threshold. For an DcD_c1 normalized matrix whose density parameter satisfies DcD_c2, Sinkhorn–Knopp reaches DcD_c3-error at most DcD_c4 in

DcD_c5

iterations, yielding DcD_c6 total time. By contrast, for every DcD_c7 there exists a DcD_c8-dense matrix requiring DcD_c9 iterations for B=DrADcB=D_r A D_c0-error and B=DrADcB=D_r A D_c1 iterations for B=DrADcB=D_r A D_c2-error. This establishes a phase transition at B=DrADcB=D_r A D_c3: 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, B=DrADcB=D_r A D_c4 standard Sinkhorn steps provide a warm start close enough to the optimum and produce a transport plan B=DrADcB=D_r A D_c5 that admits a small-error sparse approximation. Second, a Newton-type stage uses the Hessian of the Lyapunov potential,

B=DrADcB=D_r A D_c6

which is dense in principle but approximately sparse in many practical instances because mass concentrates on a small subset of pairs B=DrADcB=D_r A D_c7. Sparsifying the Hessian by thresholding or retaining only the top B=DrADcB=D_r A D_c8 entries yields B=DrADcB=D_r A D_c9 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 rir_i0 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

rir_i1

is invariant under rir_i2, while the unbalanced dual objective is not. Translation invariant Sinkhorn introduces an over-parameterized dual

rir_i3

and the invariant objective

rir_i4

The resulting rir_i5-Sinkhorn removes the drift and yields a provably accelerated algorithm; in the KL-penalty case, the composite update is contractive at rate rir_i6, whereas the standard rir_i7-Sinkhorn rate is described as rir_i8 (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 rir_i9. The method applies incomplete Sinkhorn normalization cjc_j0 to a nonnegative pre-Sinkhorn matrix, computes the expected gain

cjc_j1

and backpropagates through the row and column Jacobians in cjc_j2 time per query (Adams et al., 2011). Closely related, Gumbel–Sinkhorn networks define

cjc_j3

treating SN as a continuous analogue of the softmax operator for latent matchings. As cjc_j4, cjc_j5 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 cjc_j6 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 cjc_j7, slack initialization cjc_j8, and cjc_j9 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 AR+n×mA\in\mathbb R_+^{n\times m}00 by the entropy-regularized transport plan AR+n×mA\in\mathbb R_+^{n\times m}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 AR+n×mA\in\mathbb R_+^{n\times m}02-occurrence distribution is reported as baseline AR+n×mA\in\mathbb R_+^{n\times m}03, IS AR+n×mA\in\mathbb R_+^{n\times m}04, and SN AR+n×mA\in\mathbb R_+^{n\times m}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 AR+n×mA\in\mathbb R_+^{n\times m}06, AR+n×mA\in\mathbb R_+^{n\times m}07, and AR+n×mA\in\mathbb R_+^{n\times m}08. The associated potential

AR+n×mA\in\mathbb R_+^{n\times m}09

yields an energy interpretation in which the relative energy cost

AR+n×mA\in\mathbb R_+^{n\times m}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 AR+n×mA\in\mathbb R_+^{n\times m}11 satisfying AR+n×mA\in\mathbb R_+^{n\times m}12 and AR+n×mA\in\mathbb R_+^{n\times m}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, AR+n×mA\in\mathbb R_+^{n\times m}14–AR+n×mA\in\mathbb R_+^{n\times m}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 AR+n×mA\in\mathbb R_+^{n\times m}16, where AR+n×mA\in\mathbb R_+^{n\times m}17 is symmetric and AR+n×mA\in\mathbb R_+^{n\times m}18 is a mass matrix. The goal is a single positive diagonal scaling AR+n×mA\in\mathbb R_+^{n\times m}19 such that

AR+n×mA\in\mathbb R_+^{n\times m}20

preserves constant signals, remains symmetric with respect to the AR+n×mA\in\mathbb R_+^{n\times m}21-weighted inner product, has nonnegative entries, and has spectrum contained in AR+n×mA\in\mathbb R_+^{n\times m}22. The fixed-point iteration computes

AR+n×mA\in\mathbb R_+^{n\times m}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 AR+n×mA\in\mathbb R_+^{n\times m}24, AR+n×mA\in\mathbb R_+^{n\times m}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 AR+n×mA\in\mathbb R_+^{n\times m}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 AR+n×mA\in\mathbb R_+^{n\times m}27 admits diagonal unitaries AR+n×mA\in\mathbb R_+^{n\times m}28 such that

AR+n×mA\in\mathbb R_+^{n\times m}29

has all row sums and column sums equal to one; equivalently,

AR+n×mA\in\mathbb R_+^{n\times m}30

with AR+n×mA\in\mathbb R_+^{n\times m}31 and AR+n×mA\in\mathbb R_+^{n\times m}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.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Sinkhorn Normalization (SN).