When mapping data across different modalities—such as aligning an image with a textual description—modern machine learning often relies on two extremes. On one end, global contrastive learning compresses an entire image and a full sentence into single vectors, computing a solitary similarity score. This approach is highly efficient but discards fine-grained spatial and structural details. On the other end, token-level cross-attention uses the SoftMax operator to compute dense, pairwise correlations. However, SoftMax attention is unconstrained; a single, highly dominant visual feature can easily hijack multiple text tokens, leading to redundant mappings and a lack of strict structural grounding.
To bridge this gap, a powerful paradigm has emerged: framing feature alignment as an Optimal Transport (OT) problem. By treating local features (such as image patches, video frames, or point cloud segments) and semantic descriptors (such as text tokens or attributes) as probability distributions, models can find the globally optimal, cost-minimizing translation plan between them.
The Intuition: Alignment as Resource Allocation
The core reason Optimal Transport works so well for feature alignment is its mathematical insistence on conservation of mass. Imagine an image patch map as a collection of dirt piles and a text token sequence as a set of holes. To align them, you must move all the dirt into the holes while minimizing the total work done (the Earth Mover's Distance).
Because every piece of "mass" must be accounted for, the model cannot simply map every single text token to the most prominent object in an image. Instead, it is forced to distribute alignment across the entire structure.
Early foundations in vision-language representation leveraged this property to achieve fine-grained understanding. In UNITER: UNiversal Image-TExt Representation Learning, Yen-Chun Chen et al. minimized the transport cost between visual region embeddings and linguistic token distributions. This explicit optimization forced the model to discover precise, localized correspondences rather than relying on global context. Similarly, ViLT: Vision-and-Language Transformer Without Convolution or Region Supervision, developed by Wonjae Kim et al., bypassed heavy object detectors entirely by using optimal transport to calculate the alignment distance directly between raw image patch embeddings and word embeddings.
This set-to-set matching philosophy preserves structural integrity across transformations. As demonstrated by Wenliang Zhao et al. in Towards Interpretable Deep Metric Learning with Structural Matching, replacing global average pooling with an optimal transport framework that aligns local feature maps drastically improves image retrieval. The model inherently accounts for spatial configurations, making it robust to changes in viewpoint and pose because it finds the best part-to-part correspondence.
From SoftMax to Sinkhorn: Enforcing Competition
To understand why this mechanism behaves differently than standard attention, we must look at the underlying mathematics. Standard attention matrices are normalized along only one dimension using SoftMax. This means multiple query tokens can independently choose the exact same key token, ignoring whether that key token has already been "exhausted."
Optimal Transport introduces a doubly stochastic constraint: the rows and columns of the alignment matrix must sum to predefined marginal distributions. This is typically solved efficiently in deep networks using a differentiable, unrolled Sinkhorn algorithm.
Standard Attention (SoftMax) Sinkhorn Attention (Optimal Transport)
Text Tokens Text Tokens
"A" "cat" "on" "mat" "A" "cat" "on" "mat"
+----+----+----+----+ +----+----+----+----+
P | 0.1| 0.7| 0.1| 0.1| P | 0.1| 0.6| 0.2| 0.1| -> Sums to 1.0
a |----+----+----+----| a |----+----+----+----|
t | 0.1| 0.8| 0.0| 0.1| t | 0.2| 0.1| 0.1| 0.6| -> Sums to 1.0
c |----+----+----+----| c |----+----+----+----|
h | 0.2| 0.6| 0.1| 0.1| h | 0.7| 0.3| 0.0| 0.0| -> Sums to 1.0
+----+----+----+----+ +----+----+----+----+
| | | | |
v v v v v
Column sums are unconstrained Columns are ALSO constrained to sum to 1.0
(Redundant focus on "cat") (Forces diverse, competitive allocation)
This mathematical constraint forces a healthy competition among features. In OTSeg: Multi-Prompt Sinkhorn Attention for Zero-Shot Semantic Segmentation, the authors replaced standard SoftMax attention with the Sinkhorn algorithm to map pixels to multiple text prompts. Because the resulting matrix is doubly stochastic, it prevents different text prompts from redundantly focusing on the same dominant visual features, forcing the model to distribute its attention across diverse semantic regions.
Native Grounding and Interpretability
A remarkable byproduct of solving the optimal transport problem is that the resulting transport plan doubles as an explicit, highly interpretable alignment map. You do not need to train an auxiliary explainability module; the network must output the exact coordinate-to-coordinate mapping to minimize its loss.
In Discovering Fine-Grained Visual-Concept Relations by Disentangled Optimal Transport Concept Bottleneck Models, Yan Xie et al. utilized this property to mitigate "spurious correlations"—instances where a model correctly predicts a concept but based on entirely wrong visual evidence. By modeling the patch-to-concept relationship via optimal transport, the system generates a native assignment matrix that provides pixel-level visual grounding for every single prediction.
This capability allows models to learn spatial distributions from weak, high-level text supervision alone. For instance, Feng Liu 0037 et al. developed Distilling CLIP with Dual Guidance for Learning Discriminative Human Body Shape Representation, which aligns local image patches with textual body descriptors. By leveraging optimal transport, the student network successfully learns to localize specific anatomical traits and physical builds without ever seeing a manual part-segmentation mask.
Handling Noise and Occlusions via Partial Transport
In real-world scenarios, sets rarely match perfectly. An image might contain background clutter that has no corresponding text token, or a person might be partially hidden behind an obstacle. Standard optimal transport struggles here because it forces all mass to be distributed, which inadvertently aligns background noise with semantic text.
To solve this, researchers deploy Partial Optimal Transport (POT). Instead of forcing total mass conservation, POT allows only a fraction of the total mass to be transported, effectively ignoring outliers.
Standard Optimal Transport Partial Optimal Transport (POT)
(Forces 100% mass matching) (Allows un-transported residual mass)
Source (Patches) Target (Tokens) Source (Patches) Target (Tokens)
[ Person ] ------> [ "Person" ] [ Person ] ------> [ "Person" ]
[ Trash ] ---\ [ Trash ] --x [ "Walking" ]
[ Pole ] ------> [ "Walking" ] [ Pole ] --x (No match forced)
(Noise forced into semantic space) (Irrelevant features filtered out)
This mechanism acts as an automated filter for open-world scenarios. In Detecting Open World Objects via Partial Attribute Assignment, Muli Yang et al. framed attribute selection as a POT problem. This allowed their model to dynamically pick the most relevant descriptors from a highly noisy candidate pool while letting irrelevant or out-of-distribution descriptors remain unassigned.
When dealing with structural missing data, the Earth Mover's Distance provides a robust bridge. As shown in Dynamic Feature Pruning and Consolidation for Occluded Person Re-identification by Yuteng Ye et al., when an image token is corrupted or occluded, the model can prune it away. The Earth Mover's Distance then matches the remaining sparse, non-occluded feature sets against complete holistic representations in a gallery, maintaining strict alignment despite the missing data.
Generality Across Modalities
The beauty of treating features as abstract distributions is that the underlying modality ceases to matter. Whether aligning pixels to text, audio to transcripts, or 3D structures to adjectives, the mathematical framework remains identical.
- 3D Point Clouds: In Parts2Words: Learning Joint Embedding of Point Clouds and Texts by Bidirectional Matching Between Parts and Words, Chuan Tang et al. used the Sinkhorn algorithm to resolve many-to-many correspondences between discrete geometric parts of a 3D shape and linguistic tokens, allowing abstract shape components to map naturally to descriptive adjectives.
- Audio and Speech: In Optimal Transport Regularization for Speech Text Alignment in Spoken Language Models, Wenze Xu et al. mapped variable-length continuous speech embeddings to discrete text transcripts. By minimizing the transport distance based on cosine similarity, they successfully forced the model to ignore paralinguistic noise (like speech rate and pauses) and focus purely on shared semantic content.
By shifting the paradigm from unconstrained point-to-point attention to constrained distribution-to-distribution transport, optimal transport feature alignment provides a mathematically rigorous, interpretable, and noise-robust foundation for modern multimodal architectures.
Key Foundational Work
UNITER: UNiversal Image-TExt Representation Learning (2020) — contributed 2 concept elements to this direction.