Research map / Learning theory and algorithms / Optimal transport
Block-Wise Differentiable Sinkhorn Attention: Tail-Refinement Gradients with a Gap-Aware Dustbin Bridge
Dylan Forde
Read the paperPlace an idea next to itCheck your own paper ↗
Derives an exact fixed-depth (R=2) backward for a stopped-base Sinkhorn attention surrogate, showing four staircase plan factors lie in one row/column scaling orbit so the backward can use one reference tile, and validates it on synthetic tests, TPU v6e scaling, and a small Pfam screen.
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Problem
Differentiating long-context entropic optimal-transport (Sinkhorn) attention is memory-hungry: exact autodiff through many Sinkhorn steps is costly and implicit differentiation needs unstable linear solves; the exact R=2 adjoint naively needs four distinct plan tiles.
Approach
Treat the differentiated object as a stopped-base, fixed-depth tail-refinement surrogate; prove that all staircase plans lie in one row/column scaling orbit, so the exact score cotangent can be computed from one resident reference plan tile plus O(B) vector modifiers, with O(L) auxiliary state.
Key results
- Exact R=2 one-reference backward matches autodiff through the centered surrogate with max absolute gradient deviations of about 1e-5 to 1e-9 (relative l2 errors ~5-6%) on synthetic L=512-2048 problems.
- Complete arbitrary-cotangent Q/K/V VJP verified at per-device context L=262,144 on all-eight-device TPU v6e data-parallel; at that length one-reference takes 6020 ms vs direct-four/recompute 5415 ms.
- In a 100-update, three-seed Pfam reconstruction screen, trained FlashAttention had lower reconstruction MSE than Sinkhorn in all observed pairs (mean Sinkhorn-minus-FlashAttention difference +0.0018).
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| add a differentiated tail of R=1 refinement over R=0 (ablation) | stopped-base Sinkhorn surrogate · Tail-refinement gradient vs full BPTT (L=512, T=15) | max gradient discrepancy: 1.49×10⁻⁴ -> 1.63×10⁻⁵ | Improved |
| increase tail depth from R=2 to R=4 (ablation) | stopped-base Sinkhorn surrogate · Tail-refinement gradient vs full BPTT (L=512, T=15) | max gradient discrepancy: 1.42×10⁻⁵ -> 1.42×10⁻⁵ | No clear effect |
| use trained FlashAttention instead of Sinkhorn attention | Pfam reconstruction screen · Pfam reconstruction screen, mean over 3 seeds | reconstruction MSE: +0.0018174 | Improved |
| train promoted balanced Sinkhorn run to step 1437 | k2_eps1 · Held-out Pfam test shard (100 examples) | reconstruction MSE: 5.5730 -> 2.0539 | Improved |
| train promoted run to step 1437 | k2_eps1 · Held-out Pfam test shard (100 examples) | barycenter within-5 accuracy: 0.0406 -> 0.0403 | No clear effect |
| use diagonal reference instead of trained Sinkhorn checkpoint | alignment metrics · Held-out Pfam test shard (100 examples) | barycenter MAE: 64.5921 -> 1.6367 | Improved |
| use R=4 instead of R=2 on balanced path (ablation) | Sinkhorn attention short screen · Short Pfam screen TPU v6e-8, step 50 | throughput (ex/s): 8.46 -> 8.38 | No clear effect |
| add single-active-dustbin augmentation (mono) (ablation) | k2_eps1 · Short Pfam screen TPU v6e-8, step 50 | step-50 loss: 3.5778 -> 3.9030 | Hurt |
| use one-reference schedule instead of direct-four/recompute on TPU (ablation) | exact R=2 VJP · TPU v6e complete Q/K/V VJP, per-device L=262,144 | complete VJP latency (ms): 5,415.049 -> 6,020.270 | Hurt |
| use one-reference schedule instead of direct-four on CPU (ablation) | exact R=2 score adjoint · Score-adjoint CPU diagnostic, L=512, W=256 | latency (ms): 2.32 -> 1.06 | Improved |
| add direct CE alignment objective weight (0.1, 0.3, 1.0) | Sinkhorn attention seed 0 · Pfam direct-objective calibration | within-five accuracy | Hurt |
Surprising findings
- Trained FlashAttention beats the Sinkhorn attention on the short reconstruction screen in every observed seed pair.
- Direct-four/recompute has a lower VJP median than the one-reference schedule in the TPU follow-up, so the one-reference representation is not a latency win.
Limitations
- Exactness is for the stopped-base surrogate, not full backprop through the stopped base solve; the surrogate-bias bound depends on contraction assumptions.
- Biological alignment results do not show superiority over diagonal reference; target-barycenter metrics do not improve, and the direct CE objective fails its selector.
- Dustbin path is a single-active-token unit-target bridge with widened band cost O(L*max(W,L)), and TPU memory numbers are static compiler estimates rather than measured dynamic HBM.
Open problems this paper states
- “Exactness is for the stopped-base surrogate, not full backprop through the stopped base solve; the surrogate-bias bound depends on contraction assumptions.” → Proven guarantees are weaker than, or differ from, what is run in practice. (an open problem in sinkhorn and entropic OT algorithms)
Open problems in sinkhorn and entropic OT algorithms
Do fast entropic and unbalanced optimal transport solvers keep their guarantees and speed on real, large problems?
- Proven guarantees are weaker than, or differ from, what is run in practice. · 9 papers state it
- Experiments use only small or synthetic problems. · 8 papers state it
- Methods cover only low-dimensional or structured supports. · 5 papers state it
Experimental setup
Datasets: Pfam ESM-2 embeddings
Benchmarks: Pfam held-out test shard (100 examples) synthetic exact-autodiff comparison
Metrics: max absolute gradient deviation relative l2 error reconstruction MSE sparse CE barycenter MAE within-five accuracy VJP latency (ms) compiler MiB post-compilation CPU speedup
Baselines: FlashAttention (trained) direct four-plan adjoint exact autodiff through centered surrogate full BPTT through stopped base diagonal reference alignment
Builds on: Sinkhorn-Knopp scaling FlashAttention FlashSinkhorn Birkhoff-Hopf contraction
Closest papers by meaning
- Phase Space Attention: A Hairer Lift Resolves the Single-Layer Induction Obstruction (NeurIPS 2026 · similarity 0.84)
- PISA: Piecewise Sparse Attention Is Wiser for Efficient Diffusion Transformers (NeurIPS 2026 · similarity 0.84)
- On Partial Optimal Transport: Revising the Infeasibility of Sinkhorn and Efficient Gradient Methods (AAAI 2024 · similarity 0.83)
- Log-Averaged Mirror Prox for Fast, Large-Scale Optimal Transport in Linear Space (NeurIPS 2026 · similarity 0.83)
- Faster Video Diffusion with Trainable Sparse Attention (NeurIPS 2025 · similarity 0.83)
- Fast T2T: Optimization Consistency Speeds Up Diffusion-Based Training-to-Testing Solving for Combinatorial Optimization (NeurIPS 2024 · similarity 0.83)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.