NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

On the Existence of Optimal Transport Gradient for Learning Generative Models

Antoine Houdard, Arthur Leclaire, Nicolas Papadakis, Julien RabinarXiv 2021

Abstract

The use of optimal transport cost for learning generative models has become popular with Wasserstein Generative Adversarial Networks (WGAN). Training of WGAN relies on a theoretical background: the calculation of the gradient of the optimal transport cost with respect to the generative model parameters. We first demonstrate that such gradient may not be defined, which can result in numerical instabilities during gradient-based optimization. We address this issue by stating a valid differentiation theorem in the case of entropic regularized transport and specify conditions under which existence is ensured. By exploiting the discrete nature of empirical data, we formulate the gradient in a semi-discrete setting and propose an algorithm for the optimization of the generative model parameters. Finally, we illustrate numerically the advantage of the proposed framework.

Introduction

Generative Adversarial Networks (GANs) aim to learn a mapping from a latent space to a data distribution. Wasserstein GANs (WGANs) have gained prominence by minimizing the Wasserstein distance, an optimal transport (OT) cost, between the generated and real distributions. The optimization of the generator parameters $\theta$ typically relies on the gradient of this OT cost. Standard practice justifies this gradient calculation using the envelope theorem, which posits that the gradient of a maximum can be obtained by evaluating the gradient at the point where the maximum is achieved.

The Gradient Existence Problem

A critical theoretical gap exists in the standard WGAN framework. The envelope theorem requires specific differentiability conditions that frequently fail in generative modeling, particularly when the generated distribution is supported on a lower-dimensional manifold than the data space. In such cases, the dual potential (the "discriminator") may exhibit non-differentiable "kinks" at the locations of the generated data points. Consequently, the gradient of the OT cost with respect to $\theta$ may be undefined, leading to numerical instabilities, such as persistent oscillations or stalling during training.

Entropic Regularized Optimal Transport

To resolve these instabilities, the authors propose utilizing Entropic Regularized Optimal Transport. By adding a relative entropy penalty to the OT objective, the problem becomes strictly convex, resulting in a smoother mathematical landscape.

The paper provides a significant theoretical contribution by proving a Stronger Envelope Theorem: for any regularization strength $\lambda > 0$, the gradient of the regularized OT cost is well-defined and differentiable almost everywhere. This ensures that gradient-based optimization is mathematically sound.

Semi-Discrete Formulation and Algorithm

Given that empirical data consists of finite samples, the authors adopt a semi-discrete setting where the target distribution is discrete and the generator produces a continuous distribution. This allows the dual potentials to be represented as a finite vector of values, simplifying the optimization. They propose a stochastic gradient descent algorithm that alternates between:

  1. Estimating dual potentials via a fast ascent method (similar to the Sinkhorn algorithm).
  2. Updating the generator parameters $\theta$ using the well-defined regularized gradient.

Numerical Results

The theoretical findings are validated through synthetic and real-world experiments. In a 2D toy example, a single generated point attempts to reach the midpoint between two target points.

Optimization trajectories for unregularized (left) vs. entropic regularized (right) optimal transport.

As shown in the figure above, the unregularized case ($OT_c$) fails to converge, with the parameter $\theta$ oscillating indefinitely due to the non-existence of the gradient at the optimal point. In contrast, the entropic regularized version ($OT_c^\lambda$) exhibits smooth, monotonic convergence to the optimal solution.

Experiments on the MNIST dataset further demonstrate the algorithm's capability. While higher regularization ($\lambda$) provides greater stability, it introduces a "blurring" effect where the generator targets the mean of the data distribution. This highlights a fundamental bias-variance tradeoff inherent in entropic regularization.

Conclusion

This work demonstrates that entropic regularization is not merely a computational trick for speed but a theoretical necessity for stable gradient-based learning in OT-based generative models. By ensuring the existence of gradients, the proposed framework provides a robust foundation for training WGANs. Future work includes addressing the bias introduced by regularization through Sinkhorn Divergences and scaling the semi-discrete approach to massive datasets.

Summary updated

BibTeX
@misc{houdard2021existence,
  author = {Antoine Houdard and Arthur Leclaire and Nicolas Papadakis and Julien Rabin},
  title = {{On the Existence of Optimal Transport Gradient for Learning Generative Models}},
  year = {2021},
  eprint = {2102.05542},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2102.05542},
}
Figure