Neural Optimal Transport with Lagrangian Costs

Aram-Alexandre Pooladian, Carles Domingo-Enrich, Ricky T. Q. Chen, Brandon Amos

Abstract

Standard Optimal Transport (OT) models typically rely on squared-Euclidean costs, which dictate that the most efficient path between two points is a straight line. However, real-world applications—ranging from cellular biology to robotics—often involve complex geometries, physical obstacles, or position-dependent costs. We introduce Neural Lagrangian Optimal Transport (NLOT), a framework that enables OT to respect these constraints by incorporating Lagrangian costs. By leveraging "double amortization"—using neural networks to simultaneously predict transport maps and optimal spline-based trajectories—NLOT avoids the high computational costs of traditional bi-level optimization and ODE solvers. Our results demonstrate superior accuracy in constrained transport tasks and near-perfect recovery of underlying Riemannian metrics from distributional data.

The Challenge: Moving Beyond Straight Lines

In classical OT, the "cost" of moving mass is usually geometry-agnostic. While mathematically convenient, this assumption fails when:

  1. Obstacles are present: Paths must navigate around barriers (e.g., a robot in a room).
  2. Geometries are non-Euclidean: Movement occurs on curved manifolds (e.g., global weather patterns on a sphere).
  3. Physical potentials exist: The cost of movement varies by location or velocity (e.g., fluid flow).

Solving OT with these constraints traditionally requires solving a "least action" problem for every pair of points, creating a computationally expensive bi-level optimization loop.

Neural Lagrangian Optimal Transport (NLOT)

The proposed NLOT framework overcomes these hurdles through two key amortized components:

1. Amortized Path Computation

Instead of solving geodesics via expensive ODE solvers, NLOT parameterizes paths as cubic splines. A dedicated neural network learns to predict the optimal spline parameters for any start and end point. This provides a fast, differentiable, and closed-form trajectory for training.

2. Amortized c-transform

The dual formulation of OT requires finding a target point that minimizes a specific cost. NLOT uses a second neural network to predict this target, which is then refined using a few L-BFGS steps. This "double amortization" transforms a nested optimization problem into a standard gradient descent task.

Experimental Results

The authors tested NLOT on 2D benchmarks featuring obstacles ("Box," "Slit") and potentials ("Hill," "Well"). NLOT consistently outperformed Neural Lagrangian Schrödinger Bridges (NLSB), providing more accurate transport maps with lower Marginal 2-Wasserstein errors.

Comparison of NLOT against NLSB baselines across various obstacle and potential environments. NLOT provides deterministic paths that accurately respect the underlying geometry.

Riemannian Metric Learning

A significant capability of NLOT is its ability to "reverse-engineer" an unknown Riemannian metric by observing how a population evolves. In benchmarks such as "Circle," "Mass Splitting," and "X Paths," NLOT achieved alignment scores between 0.957 and 0.997, significantly improving upon previous specialized methods.

Metric learning results: NLOT successfully recovers the underlying Riemannian metrics (arrows) and geodesics (blue paths) from distributional data.

Key Insights

  • Efficiency: Unlike Schrödinger Bridge methods that require stochastic SDE integration, NLOT provides deterministic mappings in a single function evaluation.
  • Flexibility: The use of splines offers a lightweight alternative to Neural ODEs, making the model easier to train and evaluate.
  • Physical Interpretability: By learning the underlying metric, NLOT can uncover the "physics" governing observed data motion, such as cellular differentiation pathways.

Limitations and Future Directions

While NLOT excels in 2D settings, scaling spline parameterization and metric learning to high-dimensional spaces (e.g., image manifolds) remains a challenge. Future work may explore Unbalanced Optimal Transport for biological systems where mass is not conserved, and Multi-marginal OT for tracking populations across multiple time steps.

Summary updated

Abstract

We investigate the optimal transport problem between probability measures when the underlying cost function is understood to satisfy a least action principle, also known as a Lagrangian cost. These generalizations are useful when connecting observations from a physical system where the transport dynamics are influenced by the geometry of the system, such as obstacles (e.g., incorporating barrier functions in the Lagrangian), and allows practitioners to incorporate a priori knowledge of the underlying system such as non-Euclidean geometries (e.g., paths must be circular). Our contributions are of computational interest, where we demonstrate the ability to efficiently compute geodesics and amortize spline-based paths, which has not been done before, even in low dimensional problems. Unlike prior work, we also output the resulting Lagrangian optimal transport map without requiring an ODE solver. We demonstrate the effectiveness of our formulation on low-dimensional examples taken from prior work. The source code to reproduce our experiments is available at https://github.com/facebookresearch/lagrangian-ot.
BibTeX
@inproceedings{pooladian2024neural,
  author = {Aram-Alexandre Pooladian and Carles Domingo-Enrich and Ricky T. Q. Chen and Brandon Amos},
  title = {{Neural Optimal Transport with Lagrangian Costs}},
  booktitle = {Conference on Uncertainty in Artificial Intelligence},
  year = {2024},
  url = {https://openreview.net/forum?id=x4paJ2sJyZ},
}
Figure