the histograms, positive entries summing to 1; the papers write r,c
C
the n×n cost matrix, entries in [0,L]
U(μ,ν)
the plans: nonnegative matrices with row sums μ and column sums ν
⟨P,C⟩
the cost of a plan, ∑i,jPijCij
H
entropy, H(P)=−∑i,jPijlogPij
KL(p∥q)
Kullback-Leibler divergence ∑ipilog(pi/qi)
OT
the optimal transport cost
P∗
an optimal plan of the linear program
ε
the entropy weight; Cuturi writes λ=1/ε, Altschuler et al. η=1/ε
Pε
the entropic optimum, argminU(μ,ν)⟨P,C⟩−εH(P)
f,g
multipliers for the row and column constraints
Scaling (as in Sinkhorn's theorem)
K
e−C/ε, entrywise
x,y
row and column scalings; Dx is diagonal with x
A
K/s, the starting matrix, entries aij
u,v
logx, logy, entrywise
B
the current matrix, bij=aijeui+vj
F
the potential ∑i,jaijeui+vj−μ⊤u−ν⊤v
F∗,u∗,v∗
the minimum of F and where it is reached, the scaling of Pε
k
the number of steps until the marginal error is at most δ
Rounding
μ′,ν′
the marginals of the matrix the alternation stops at
P^
the rounded output, in U(μ,ν)
P′
P∗ rounded onto μ′,ν′
Constants
L
bound on the costs; gives log(s/ℓ)≤2logn+L/ε in Step 3
s,ℓ
total and smallest entry of K (the paper's letters; ℓ is unrelated to the ℓ1 norm); the count of Step 4 grows with log(s/ℓ)
δ
target ℓ1 marginal error of Step 4; τ/(8L) in Theorem 1
τ
accuracy of the final plan in Theorem 1
Context. Optimal transport measures the lowest cost to move one histogram's mass onto another, given a unit cost between each pair of bins. Exact transport solves a linear program over n×n plans, where general solvers such as Orlin's minimum-cost-flow algorithm take O(n3logn) operations. Cuturi (2013) subtracts a multiple of the plan's entropy from its cost, turning the optimum into a row-and-column scaling of one fixed positive matrix. Sinkhorn's alternationmultiply each row of the current matrix by its target sum over its current sum, then each column, and repeat; it converges to the unique scaling DxADy of a positive matrix A with the target row and column sums (Sinkhorn's theorem). Reading note: Matrix scaling and Sinkhorn's theorem then finds that scaling via matrix-vector products that batch across histograms and run fast on GPUs. Until 2017, the best step bound for ℓ1-accurate marginals still grew linearly in n whenever a histogram held an entry of constant size.
Altschuler, Weed, and Rigollet (2017) prove that the Sinkhorn step count to a target ℓ1 marginal error carries no factor of n. Each step lowers Sinkhorn's convex potential by exactly the Kullback-Leibler divergence between a target marginal and the current one. Pinsker's inequality bounds that divergence below by half the squared ℓ1 error. The potential can fall by at most the log ratio of the starting matrix's entry total to its smallest entry. For entropic transport that log ratio grows linearly in the inverse entropy weight, so tighter approximations to the linear program cost proportionally more steps. Setting the entropy weight and stopping tolerance to match a target additive accuracy yields a valid transport plan within that accuracy in time near-linear in the n2 cost entries.
Setting. Let μ,νthe two histograms: vectors in Rn with positive entries summing to 1; Cuturi and Altschuler et al. write r,c be histograms in Rn with positive entries summing to 1, and let Cthe n×n cost matrix: Cij≥0 is the cost of moving a unit of mass from bin i of μ to bin j of ν be an n×n cost matrix with entries between 0 and Lan upper bound on the entries of the cost matrix, 0≤Cij≤L. A transport plan is a nonnegative matrix with row sums μ and column sums ν. At entropy weight εthe weight of the entropy term in the entropic transport problem; Cuturi writes λ=1/ε, Altschuler et al. η=1/ε>0, exact optimal transport and Cuturi's entropic version areOTPε=P∈U(μ,ν)min⟨P,C⟩,=argP∈U(μ,ν)min⟨P,C⟩−εH(P).Here U(μ,ν)the transport polytope {P∈Rn×n:P≥0,P1=μ,P⊤1=ν}, all joint distributions with marginals μ and ν={P≥0:P1=μ,P⊤1=ν}, ⟨P,C⟩=∑i,jPijCij, and H(P)the entropy −∑i,jPijlogPij of a plan, read as a joint distribution; H(μ) is defined in the same way for a histogram=−∑i,jPijlogPij. On U(μ,ν), fixed marginals give H(P)=H(μ)+H(ν)−KL(P∥μν⊤), where KL(p∥q)the Kullback-Leibler divergence ∑ipilog(pi/qi) between nonnegative vectors (or matrices) of total 1; it is 0 only when p=q=∑ipilog(pi/qi). Raising entropy therefore pulls P toward the independent plan μν⊤ that ignores C. Cuturi defines the Sinkhorn distance by capping KL(P∥μν⊤) with a constraint, which is dual to the penalty at some ε. Both he and Altschuler et al. compute the penalized form directly to avoid searching for that ε.
Start from any positive matrix with entry total sthe total of the entries of the positive matrix being scaled and smallest entry ℓthe smallest entry of the positive matrix being scaled; for entropic transport it is at least e−L/ε, rescaled by 1/s. Sinkhorn's alternation reaches a matrix B whose ℓ1 marginal error is at most δthe target for the ℓ1 marginal error ∥B1−μ∥1+∥B⊤1−ν∥1 of the current matrix B:∥B1−μ∥1+∥B⊤1−ν∥1≤δ.This takes at most O(δ−2log(s/ℓ)) steps, where one step normalizes all rows or all columns (Altschuler et al., Theorem 2; Step 4 gives the constant). To reach additive cost accuracy τthe additive accuracy of the final plan: its cost is at most the optimal transport cost plus τ, their Theorem 1 runs this alternation on K=e−C/ε with ε=τ/(4logn) and δ=τ/(8L). Rounding the output onto U(μ,ν) returns a valid plan P^∈U(μ,ν) with ⟨P^,C⟩≤OT+τ. The whole procedure takes O(n2L3logn/τ3) operations.
Step 1
The entropic plan is a scaling of K=e−C/ε. Attach Lagrange multipliers f,gLagrange multipliers in Rn for the row constraints P1=μ and the column constraints P⊤1=ν to the row and column constraints and differentiate with respect to Pij:Cij+ε(logPij+1)−fi−gj=0,Pij=efi/ε−1/2e−Cij/εegj/ε−1/2.Every entry of Pε is positive because the slope of PijlogPij is −∞ at 0. Hence Pε=DxKDy, where KKij=e−Cij/ε, a positive matrix with entries in [e−L/ε,1]=e−C/ε entrywise and the positive vectors x,ythe row and column scalings, positive vectors with xi=efi/ε−1/2 and yj=egj/ε−1/2; Dx is the diagonal matrix with diagonal x have entries xi=efi/ε−1/2 and yj=egj/ε−1/2. By Sinkhorn's theoremfor a positive matrix A and positive targets μ,ν with equal totals, exactly one matrix of the form DxADy has row sums μ and column sums ν, and alternate row and column normalization converges to it. Reading note: Matrix scaling and Sinkhorn's theorem, only one scaling DxKDy matches μ and ν, so Sinkhorn's alternation on K converges to Pε. Conversely, any matrix DxKDy satisfies stationarity for its own marginals. Strict convexity makes it the unique entropic optimum for those marginals, a fact Step 5 uses.
The weight ε controls how closely Pε tracks exact transport. As ε→∞, Pε approaches μν⊤. As ε→0, it converges to the optimal plan of largest entropy, which is a vertex of U(μ,ν) whenever the linear program's optimum is unique (Peyré and Cuturi, 2019, Proposition 4.1). Comparing the entropic objective at Pε and an optimal plan P∗an optimal plan of the unregularized problem, ⟨P∗,C⟩=OT bounds the cost gap through 0≤H≤2logn (Altschuler et al., proof of Theorem 1):⟨Pε,C⟩−OT≤ε(H(Pε)−H(P∗))≤2εlogn.
Step 2
Each step lowers the potential by exactly a KL divergence. Divide K by its entry total s so AK/s, the matrix the alternation starts from, with entries aij; its entries total 1 and its smallest entry is ℓ/s=K/s has entry total 1. Track the iteration with Sinkhorn's potentialthe convex function F(u,v)=∑i,jaijeui+vj−μ⊤u−ν⊤v of the log-scalings, whose partial derivatives are the row and column sums of the scaled matrix minus their targets. Reading note: Matrix scaling and Sinkhorn's theorem for targets μ,ν:F(u,v)=∑i,jaijeui+vj−μ⊤u−ν⊤v.Here u,vthe log-scalings u=logx, v=logy, entrywise; they start at 0 are the log-scalings, initialized at 0, and Bthe current iterate DxADy, with entries bij=aijeui+vj; its row sums are B1 and its column sums B⊤1 is the current matrix bij=aijeui+vj. After a column step, B has column sums ν and entry total 1. The next row step multiplies row i by μi/(B1)i, shifting ui to ui′=ui+log(μi/(B1)i) and leaving the entry total at 1. Because the exponential sum stays 1, it cancels and only −μ⊤u changes:F(u,v)−F(u′,v)=∑iμilog(B1)iμi=KL(μ∥B1).By symmetry, a column step after a row step lowers F by KL(ν∥B⊤1). Because A also sums to 1, the first row step lowers F by KL(μ∥A1). Evaluating the drop directly replaces the Taylor bound from the proof of Sinkhorn's theorem with an exact KL divergence.
Step 3
The potential has at most log(s/ℓ) to fall. At initialization, F(0,0)=∑i,jaij=1. The minimum F∗the minimum of F, reached at the log-scalings (u∗,v∗) of the entropic plan, Pε=(aijeui∗+vj∗) occurs at the log-scalings (u∗,v∗) of Pε (Step 1). Because Pε also sums to 1, the exponential sums cancel and F(0,0)−F∗=μ⊤u∗+ν⊤v∗. Every entry of Pε is at most 1 and every aij≥ℓ/s, so aijeui∗+vj∗≤1 forces ui∗+vj∗≤log(1/aij)≤log(s/ℓ). Averaging against μiνj givesF(0,0)−F∗=μ⊤u∗+ν⊤v∗=∑i,jμiνj(ui∗+vj∗)≤log(s/ℓ).For K=e−C/ε with costs in [0,L], every entry lies in [e−L/ε,1], giving s≤n2 and log(s/ℓ)≤2logn+L/ε.
Step 4
Pinsker's inequality turns the drops into an iteration count with no factor of n. After every step from the first onward, one marginal is exact, so the entire ℓ1 error sits on the other marginal. While that error exceeds δ, Pinsker's inequality∥p−q∥12≤2KL(p∥q) for probability vectors p,q∥p−q∥12≤2KL(p∥q) ensures that the next step lowers F by more than δ2/2 (Step 2). Let kthe number of steps (row or column normalizations) until the marginal error is at most δ be the first step that brings the error to δ or below, and write (u1,v1) for the iterate after step 1. Steps 2 through k each drop F by more than δ2/2, while their total drop is at most F(u1,v1)−F∗≤F(0,0)−F∗≤log(s/ℓ) (Step 3):(k−1)δ2/2k<log(s/ℓ),<1+2δ−2log(s/ℓ).This constant is computed here. Altschuler et al.'s proof gets 4δ−2log(s/ℓ) because it bounds the squared sum of both marginal errors by four times the sum of both divergences, even though one error is zero after every step. Converted to ℓ1, the earlier ℓ2 bound of Kalantari et al. (2008) carries an extra factor of n times the largest entry of μ and ν (Altschuler et al., Corollary 1).
Small ε. Because log(s/ℓ)≤2logn+L/ε, the step bound grows like L/ε. Step 1 gives u∗=f/ε and v∗=g/ε up to constants, so the log-scalings must travel a distance of order 1/ε. Each step shifts them by log(μi/(B1)i), which stays bounded whenever the marginals are off by a bounded factor. The figure solves a 2×3 problem, since the proof does not use squareness, with cost rows (0,1,3) and (2,0,1), μ=(0.4,0.6), and ν=(0.2,0.3,0.5). For every ε≤0.1, Pε matches the optimal vertex of U(μ,ν) to four decimals, yet steps to δ=10−3 rise from 54 at ε=0.1 to 238 at ε=0.01. At ε=0.02, the error stalls at 0.40 to two decimals from step 2 to step 94 while F falls by about 0.1 per step. During that plateau, εu and εv march toward εu∗ and εv∗, which sit near (0,−1) and (0,1,2) up to a common shift. Once the error becomes small, convergence is linear as in Sinkhorn's theorem, a regime the δ−2 bound misses.
Step 5
Rounding, and the choice of ε and δ, give a plan within τ of optimal. Stopping at marginal error δ yields a matrix B with marginals μ′,ν′the row and column sums B1, B⊤1 of the matrix the alternation stops at; together they are within δ of μ,ν in ℓ1, not yet in U(μ,ν). Altschuler et al.'s rounding scales down rows whose sums exceed μ, then columns whose sums exceed ν, and adds back the missing mass as a rank-one matrix. Applied to B, it produces a valid plan P^the rounded output, a plan in U(μ,ν) with ∥P^−B∥1≤2δ∈U(μ,ν) satisfying ∥P^−B∥1≤2δ. Step 1's bias bound cannot compare B directly with P∗ because their marginals differ. Apply the same rounding to move P∗ onto μ′,ν′, yielding a plan P′P∗ rounded onto the marginals μ′,ν′ of B, with ∥P′−P∗∥1≤2δ with ∥P′−P∗∥1≤2δ. Because B is the entropic optimum for μ′,ν′ (Step 1) and each 2δ shift in ℓ1 changes cost by at most 2δL,⟨P^,C⟩≤⟨B,C⟩+2δL≤⟨P′,C⟩+2εlogn+2δL≤OT+2εlogn+4δL.
With Theorem 1's choices ε=τ/(4logn) and δ=τ/(8L), both error terms equal τ/2, giving ⟨P^,C⟩≤OT+τ. Combining Steps 3 and 4 yields O(L3logn/τ3) steps for τ≤L. Each step takes O(n2) operations, producing Theorem 1's O(n2L3logn/τ3) total runtime.
Theorem 1's ε is far smaller than practice requires. Cuturi's cross-validation most often set ε to the median ground distance divided by 9 and stopped after 20 iterations. On MNIST digits represented as 400-bin histograms with Euclidean pixel cost, an SVM using this Sinkhorn distance beat one using exact optimal transport in classification error. That held even though the Sinkhorn distance stayed about 10% above exact transport at much smaller ε. The same potential analysis covers Greenkhorna greedy variant of the alternation (Altschuler et al., 2017) that normalizes a single row or column per step, the one whose normalization lowers F the most, which updates one row or column per step. Its step bound is up to n times larger, while each step costs O(n) instead of O(n2) work, keeping the same total operation order. In Altschuler et al.'s experiments on MNIST and synthetic images, Greenkhorn outperformed Sinkhorn.
Terms
Entropic transport
minU(μ,ν)⟨P,C⟩−εH(P); equivalently a penalty εKL(P∥μν⊤) pulling toward the independent plan.
Scaling form
Pε=DxKDy with K=e−C/ε, from stationarity of the Lagrangian; Sinkhorn's alternation on K finds it.
Exact drop
A row step lowers F by KL(μ∥B1), a column step by KL(ν∥B⊤1).
Room to fall
F(0,0)−F∗≤log(s/ℓ), since every entry of Pε is at most 1.
Iteration count
k<1+2δ−2log(s/ℓ) steps to ℓ1 marginal error δ, by Pinsker (constant computed here; the paper's proof gives 4δ−2); no factor of n.
Small ε
log(s/ℓ)≤2logn+L/ε: the scalings must travel order 1/ε, so steps grow as ε shrinks.
Entropy bias
⟨Pε,C⟩−OT≤2εlogn.
Near-linear OT
ε=τ/(4logn), δ=τ/(8L), round: cost within τ in O(n2L3logn/τ3).
In a PAC-Bayes bound the KL from posterior to prior is the complexity term, and a Gaussian prior centered at the initialization makes it grow with how precisely the weights are specified and how far they move in training.
Noisy training minimizes a free energy, half the risk plus weight decay minus the entropy over β, and its unique minimizer is the Gibbs fixed point, proportional to e−βΨλ for a potential Ψλ that itself depends on the minimizer.
In-context prediction is a posterior average over latent concepts, each weighted by its prior times eNrN(θ), with rN the per-example log likelihood ratio to the true concept, so the prompt selects the concept once rN has a negative limit for every other.
Observing Yt=tx+Wt turns the prior into the tilt μ(dx)e⟨Yt,x⟩−t∥x∥2/2, so a diffusion sampler runs through a sequence of ever sharper tilted posteriors.