---
title: Optimal-Transport Direct Preference Optimization
url: https://www.emergentmind.com/topics/optimal-transport-direct-preference-optimization-otpo
type: topic
---

# Optimal-Transport Direct Preference Optimization

Searching arXiv for the specified papers and closely related optimal-transport preference-learning work.
{"queries":[{"query":"id:2604.01837"},{"query":"id:2505.18720"},{"query":"id:2406.05882"}]}
I retrieved the relevant arXiv records for the three cited works and will ground the article in those sources: "PLOT: Enhancing Preference Learning via Optimal Transport" [2604.01837], "Optimal Transport-Based Token Weighting scheme for Enhanced Preference Optimization" [2505.18720], and "Distributional Preference Alignment of LLMs via Optimal Transport" [2406.05882].
Optimal-Transport Direct Preference Optimization (OTPO) denotes a family of alignment methods that incorporate optimal transport into direct preference optimization and adjacent preference-learning objectives for large language models. In the most specific current usage, OTPO is the method introduced in "Optimal Transport-Based Token Weighting scheme for Enhanced Preference Optimization," which replaces uniform token weighting in DPO by an unbalanced optimal-transport coupling over chosen and rejected token representations [2505.18720]. Closely related work uses the same optimal-transport perspective to formulate token-distribution alignment in PLOT, explicitly describing the reformulation of direct preference optimization as an optimal-transport problem ("OTPO") [2604.01837], and to formulate reward-distribution alignment in Alignment via Optimal Transport (AOT) [2406.05882]. Across these variants, the common objective is to make preference optimization globally informed rather than purely local, while preserving useful distributional structure.

## 1. Scope, terminology, and variant structure

The term *Optimal-Transport Direct Preference Optimization* is not fully standardized across the recent literature. One paper uses OTPO as the method name for a context-aware token weighting scheme on top of DPO, another describes PLOT as a reformulation of direct preference optimization as an optimal-transport problem, and a related distributional method is presented as AOT but also exposited as an OTPO-style approach. This suggests that OTPO is best understood as a design pattern for OT-based preference optimization rather than a single canonical loss [2505.18720; 2604.01837; 2406.05882].

| Variant | Core OT object | Preference setting |
|---|---|---|
| OTPO | Transport plan between chosen and rejected token hidden states | Paired DPO |
| PLOT / OTPO reformulation | Transport between model output distribution $Q_\theta$ and target preference distribution $P_t$ | Fine-tuning-based alignment |
| AOT | One-dimensional OT between reward distributions | Paired and unpaired |

Despite their differences, these methods share several structural commitments. First, they recast preference learning as transport between distributions or empirical measures rather than as a purely sample-level scalar comparison. Second, they use the transport plan or transport cost to emphasize semantically meaningful differences. Third, they frame OT as a way to control alignment updates without arbitrarily distorting the original model distribution.

## 2. Motivation from the limitations of conventional DPO

The OTPO literature starts from a critique of standard DPO. In the token-decomposed DPO objective, each token contributes equally to the reward difference, so longer but semantically irrelevant spans can inflate the margin and dominate the gradient. The 2025 OTPO paper identifies this as a source of “length bias,” and argues that uniform weighting does not distinguish tokens that carry the core answer or instruction-following content from noisy or low-value tokens [2505.18720].

PLOT motivates OT from a broader alignment perspective. It states that existing methods remain limited by modest performance gains, high computational costs, hyperparameter sensitivity, and insufficient modeling of global token-level relationships. The proposed remedy is a token-level loss derived from optimal transport that adds a global, distribution-level penalty rather than penalizing only local token-by-token KL deviations [2604.01837].

A related limitation appears at the distributional level. AOT observes that pairwise human preferences at the sample level do not imply alignment on the distributional level. It therefore formulates alignment as first-order stochastic dominance of the positive reward distribution over the negative reward distribution, then relaxes that condition into an OT objective [2406.05882]. Taken together, these criticisms define the main OTPO agenda: mitigate uniform-token artifacts, encode semantic structure, and move from local pairwise comparisons toward global distributional alignment.

## 3. OTPO as context-aware token weighting in DPO

In the 2025 OTPO formulation, the chosen and rejected responses are treated as two discrete distributions in the model’s hidden space, using last-layer token representations $h_c^i$ and $h_r^j$. The cost matrix is defined by Euclidean distance,
\[
M_{i,j} = \|h_c^i - h_r^j\|_2,
\]
and the transport plan $\Gamma \in \mathbb{R}_{\ge 0}^{|y_c|\times |y_r|}$ is obtained from an unbalanced, entropic OT problem with both entropy and marginal-KL regularization [2505.18720]:
\[
\Gamma^* = \arg\min_{\Gamma \ge 0}
\left\{
\sum_{i,j}\Gamma_{i,j} M_{i,j}
+\epsilon_1\sum_{i,j}\Gamma_{i,j}\log\Gamma_{i,j}
+\epsilon_2\Bigl[
\mathrm{KL}(\Gamma\mathbf{1},\mathbf{1}_{|y_c|})
+\mathrm{KL}(\Gamma^\top\mathbf{1},\mathbf{1}_{|y_r|})
\Bigr]
\right\}.
\]

This transport plan induces token weights through marginalization,
\[
\omega_c^i = \sum_j \Gamma_{i,j},
\qquad
\omega_r^j = \sum_i \Gamma_{i,j},
\]
which are then normalized to sum to a fixed budget $\tau$, with $\tau=\min(|y_c|,|y_r|)$ by default. The weighted reward difference is
\[
\Delta_{\hat r}
=
\sum_{i=1}^{|y_c|}\omega_c^{*i}\,q_c^i
-
\sum_{j=1}^{|y_r|}\omega_r^{*j}\,q_r^j,
\]
where
\[
q_*^t
=
\log
\frac{\pi_\theta(y_*^t\mid x,y_*^{<t})}
{\pi_{\mathrm{ref}}(y_*^t\mid x,y_*^{<t})}.
\]
The final loss becomes
\[
\mathcal{L}_{\mathrm{OTPO}}(\theta)
=
-
\mathbb{E}_{(x,y_c,y_r)\sim D}
\Bigl[
\log \sigma\bigl(\beta\,\Delta_{\hat r}\bigr)
\Bigr].
\]

The training algorithm follows the standard DPO workflow up to the reward decomposition, then inserts an OT solve. For each mini-batch, the model extracts last-layer hidden states, computes the cost matrix, solves the unbalanced entropic OT problem, converts the coupling into row and column weights, normalizes those weights, computes the weighted log-likelihood-ratio margin, and updates $\theta$ with AdamW. The reported hyperparameters are batch size $128$, epochs $1$, learning rate $5\times 10^{-7}$, $\beta\in\{0.01,0.1\}$, $\epsilon_1\in\{0.1,1\}$, $\epsilon_2=0.2$, and $\tau=\min(|y_c|,|y_r|)$.

Conceptually, this OTPO variant does not replace DPO’s Bradley–Terry-style preference objective; it replaces DPO’s implicit uniform token weighting. The claimed advantages are a more contrastive reward-difference estimate, greater reward stability, improved interpretability, and better focus on meaningful differences between responses.

## 4. PLOT and the OTPO reformulation of token-distribution alignment

PLOT formulates preference learning as an optimal-transport problem directly over token distributions rather than over pairwise token hidden states. Let $Q_\theta\in\Delta^n$ denote the model’s current output distribution over $n$ tokens, $P_t\in\Delta^n$ a target preference distribution, and $C\in\mathbb{R}_+^{n\times n}$ a cost matrix with entries $c_{ij}\ge 0$. The discrete OT problem is [2604.01837]
\[
OT(Q_\theta,P_t)
=
\min_{\Gamma\in\Pi(Q_\theta,P_t)}
\langle C,\Gamma\rangle
\]
subject to
\[
\Gamma \mathbf{1}_n = Q_\theta,\qquad
\Gamma^\top \mathbf{1}_n = P_t,\qquad
\Gamma_{ij}\ge 0.
\]
In expanded form,
\[
OT(Q,P)
=
\min_{\Gamma\in\mathbb{R}_+^{n\times n}}
\sum_{i=1}^n\sum_{j=1}^n c_{ij}\gamma_{ij}
\quad\text{s.t.}\quad
\sum_j \gamma_{ij}=Q_i,\qquad
\sum_i \gamma_{ij}=P_j.
\]

The fine-tuning loss augments a baseline objective by the OT term:
\[
\mathcal{L}
=
\mathcal{L}_{\mathrm{vanilla}}
+
\alpha\,\mathcal{L}_{\mathrm{PLOT}},
\qquad
\mathcal{L}_{\mathrm{PLOT}} := OT(Q_\theta,P_t).
\]
The stated interpretation is that PLOT preserves the overall shape of the original distribution because mass is only “re-routed,” not arbitrarily zeroed or blown up.

A distinctive element of PLOT is how it constructs the target preference distribution. From a dataset $D=\{(x,y_+,y_-)\}$, token frequencies $Q_+$ and $Q_-$ are counted in positive and negative answers. A raw difference is then formed:
\[
Q_{\mathrm{diff}}
=
\frac{Q_+}{\sum Q_+}
-
\frac{Q_-}{\sum Q_-},
\]
followed by non-negativity and normalization:
\[
T(v)=v-\min(Q_{\mathrm{diff}}),
\qquad
P_t(i)=\frac{T(Q_{\mathrm{diff}}(i))}{\sum_j T(Q_{\mathrm{diff}}(j))}.
\]

PLOT also builds semantic information into the transport cost through the model’s token-embedding matrix $E=[e_1,\dots,e_n]$, with $e_i\in\mathbb{R}^d$. The paper uses
\[
c_{ij} = \bigl|\,\|e_i\|_2 - \|e_j\|_2\,\bigr|,
\]
while noting that one could more generally use $\|e_i-e_j\|_2$ or cosine distance. This design is intended to make mass travel more cheaply between semantically close tokens.

The implementation path is correspondingly direct. After precomputing $P_t$ and the cost matrix, each training batch produces $Q_\theta$, solves the OT problem against $P_t$, computes $\mathcal{L}_{\mathrm{PLOT}}$, and backpropagates the combined loss. For one-dimensional transport, the paper notes that one can compute the Wasserstein distance after sorting tokens by embedding norms $u_i=\|e_i\|_2$:
\[
W_1(Q,P)=\sum_{k=1}^{n-1}|F_Q(x_k)-F_P(x_k)|\cdot \Delta x_k.
\]
If $n$ is large, entropy-regularized OT or Sinkhorn may be used with $\epsilon\approx 0.01$–$0.1$. The reported hyperparameters are $\alpha=8$, $\ell=2$, batch size $4$, epochs $1$, and either direct $W_1$ for one-dimensional vectors or Sinkhorn for full $C$, with $O(n^2)$ per batch.

## 5. Relation to distributional OT alignment and first-order stochastic dominance

AOT places OT preference optimization on a more explicitly statistical footing by defining alignment through first-order stochastic dominance of one reward distribution over another. In this formulation, if $U_\theta$ and $V_\theta$ are reward random variables induced by positive and negative data, then the desired condition is
\[
Q_{U_\theta}(p)\ge Q_{V_\theta}(p)\qquad\text{for all }p\in[0,1],
\]
where $Q_W(p)$ is the $p$-th quantile of $W$ [2406.05882]. Rather than enforcing this exact condition, AOT introduces a convex surrogate
\[
\epsilon_h(\theta)=\int_0^1 h\bigl(Q_{U_\theta}(p)-Q_{V_\theta}(p)\bigr)\,dp,
\]
with examples such as the $\beta$-squared hinge, $\beta$-logistic, and least-squares-with-margin surrogates.

The key OT identity is
\[
\int_0^1 h(Q_U(p)-Q_V(p))\,dp
=
\min_{\gamma\in\Pi(\mu_U,\mu_V)}
\int h(u-v)\,d\gamma(u,v)
=: OT_h(\mu_U,\mu_V),
\]
so the stochastic-dominance relaxation becomes a one-dimensional optimal-transport problem on reward distributions. For empirical measures with equal sample size, the solution has a closed form by sorting:
\[
OT_h(\mu_U,\mu_V)
=
\frac{1}{n}\sum_{i=1}^n h\bigl(u^{(i)}-v^{(i)}\bigr),
\]
where $u^{(1)}\le \cdots \le u^{(n)}$ and $v^{(1)}\le \cdots \le v^{(n)}$ are order statistics. The paper further states that sorting is $1$-Lipschitz and piecewise-constant in its Jacobian, so one can backpropagate by sorting at each step and differentiating with the permutation held fixed; a soft-sort variant via entropic OT is also possible.

This formulation is not DPO with token reweighting. Instead, it generalizes the OT perspective from token-level alignment to reward-distribution alignment. Its relevance to OTPO lies in the shared claim that preference optimization can be expressed more naturally through transport between structured distributions than through isolated scalar margins. The statistical analysis is also distinctive: under stated boundedness and complexity assumptions, the empirical AOT objective achieves the parametric rate
\[
\mathbb{E}[\epsilon(\hat\theta_n)]-\epsilon(\theta^*) = O(n^{-1/2}).
\]

## 6. Empirical findings, stability, and unresolved issues

The empirical record for OTPO-style methods is distributed across several task families. In instruction-following experiments, the 2025 OTPO paper evaluates Llama-3-8B and Llama-3.2-3B on UltraFeedback (61 k pairs) and HelpSteer2 (9 k pairs), and Qwen-2.5-3B on TL;DR (92 k pairs). It reports LC-WR improvements of $+2.6\%$–$10.9\%$ over DPO across four instruction settings, including $53.37\%$ versus $48.14\%$ on Llama-3-8B/UltraFeedback; a summarization win-rate improvement of $+8.6\%$ over the best baseline; consistent or minor changes below $1\%$ on general benchmarks; human pairwise evaluation in which OTPO is rated best by both experts at approximately $0.63$ versus $0.50$ for DPO; and interpretability in the form of a $0.76$ correlation between OT weights and leave-one-out contributions from an explicit reward model [2505.18720].

PLOT reports gains across safety, helpfulness, and reasoning. On HarmBench ASR for Llama3.2-3B + DPO, the baseline is approximately $8.46\%$ and $+$PLOT reaches $4.39\%$, a $-48.1\%$ relative change. Similar gains are reported for SFT ($15.38\rightarrow 11.96$), PRO ($16.50\rightarrow 13.40$), and AOT ($5.80\rightarrow 3.96$). In Human Values, helpfulness measured by a reward model improves from $70.63$ to $72.14$, helpfulness under GPT-4 from $7.87$ to $8.74$, and humanity under GPT-4 from $8.65$ to $9.15$. In Logic & Problem Solving, GSM8K improves from $67.52$ to $68.36$, MATH from $47.68$ to $48.28$, reasoning from $4.05$ to $4.50$, coding from $5.95$ to $6.35$, and STEM from $7.45$ to $8.25$. The ablations report that removing embeddings from the cost matrix degrades ASR, with an example of $4.39\rightarrow 4.91$ on SFS, and that DEFT’s reward-based distribution term gives ASR approximately $5.65$ whereas the OT reformulation gives $4.39$. Varying $\alpha$ from $50\%$ to $150\%$ of its default keeps PLOT’s ASR within approximately $4.12$–$4.59\%$, versus DEFT at $5.22$–$6.54\%$. On AlpacaEval LC Win Rate, DPO drops from $17.93$ to $13.64\%$, whereas $+$PLOT recovers to $14.06\%$, which the paper presents as less erosion of fluency and coherence. The reported wall-clock overhead is approximately $2$–$3\%$ [2604.01837].

AOT reports strong results in the 7B regime. On UltraFeedback with Merlinite-7B, AlpacaEval (GPT-4) scores are $17.1\%$ for the base model, $27.4\%$ for DPO, $24.9\%$ for KTO, $27.7\%$ for IPO, $29.9\%$ for paired AOT, and $31.3\%$ for unpaired AOT. The paper states that AOT is state-of-the-art in the 7B family as of May 2024, and its ablations indicate that larger batch sizes improve performance, the logistic surrogate outperforms hinge or squared surrogates, soft-sort and hard-sort give virtually identical scores, and the best margin is approximately $\beta=0.01$ [2406.05882].

Two points of clarification recur in discussions of OTPO. First, optimal transport is not presented as computationally prohibitive in these papers, but its cost profile depends on the formulation: the 2025 OTPO method states that the OT solve per pair is $O(n^2)$ in tokens, with end-to-end training time approximately DPO plus $\sim 10\%$ overhead, while PLOT reports approximately $2$–$3\%$ wall-clock overhead for its setup. Second, OT-based preference optimization is not limited to paired preference data: AOT explicitly treats both unpaired and paired settings. The main unresolved issues are also formulation-specific. The 2025 OTPO paper notes additional OT hyperparameters requiring mild tuning, experiments limited to mid-sized models, unexplored fully iterative on-policy loops, and evaluation dependence on GPT-4 judges with potential biases. PLOT frames OT as more stable and robust, but its reported demonstration uses batch size $4$ and one epoch. A plausible implication is that OTPO remains an active methodological category whose internal variants differ materially in what is transported, how the cost is defined, and where computational and statistical bottlenecks appear.

Source: https://www.emergentmind.com/topics/optimal-transport-direct-preference-optimization-otpo