Geometric Losses for Distributional Learning

Arthur Mensch, Mathieu Blondel, Gabriel Peyré

The Problem with Standard Softmax

In standard machine learning classification, the multinomial logistic loss and the softmax operator are the gold standards. However, they are fundamentally "geometry-oblivious": they treat all misclassifications as equally wrong. For instance, if a model is trying to classify "Golden Retriever," "Labrador," and "Toaster," standard softmax penalizes confusing the two dog breeds just as heavily as confusing a dog with a kitchen appliance.

While "cost-sensitive" losses exist to address this, they often lack a matching "softmax-like" operator to map scores to probabilities, or they result in non-convex optimization problems that are difficult to solve. Furthermore, most existing methods struggle to scale to continuous distributions or "infinite" class spaces, such as predicting a point on a 2D curve or a 3D surface.

A Geometric Approach to Loss Functions

To solve this, the authors introduce a "geometric softmax" (g-softmax) and a corresponding "g-logistic loss" that explicitly incorporate the underlying relationships (costs or distances) between classes. By bridging the gap between Optimal Transport (OT) and Fenchel-Young losses, they create a convex, theoretically sound framework that produces sparse, geometrically-aware probability distributions.

The approach relies on three key pillars:

  1. Sinkhorn Negentropy ($\Omega_C$): Instead of using standard Shannon entropy, the authors use a functional derived from entropy-regularized optimal transport. This "Sinkhorn negentropy" measures the uncertainty of a distribution while accounting for a cost matrix $C$ (the distance between classes).
  2. Fenchel Duality: They use the Fenchel-Young loss framework to derive a loss function ($\ell_\Omega$) and a link function ($\psi$). This ensures that the resulting loss is convex and differentiable, making it well-behaved for gradient-based training.
  3. The Geometric Softmax (g-softmax): Defined as the gradient of the conjugate of the Sinkhorn negentropy, the g-softmax maps model outputs to probabilities.
Behavior of the proposed link function, negentropy, and conjugate under different regularization strengths ($\gamma$).

Key Insights and Properties

Sparsity by Design: Unlike the standard softmax, which always produces dense distributions (where every class gets at least a tiny fraction of probability), the g-softmax is naturally sparse. It concentrates probability mass on the most likely candidates based on the geometry of the output space. This acts as a "deconvolutional" effect, finding the simplest distribution that explains the predicted distance field.

Comparison of the proposed reconstruction (g-softmax) versus a naive softmax. The g-softmax successfully recovers a sparse, sharp distribution.

Unification of Losses: The g-logistic loss serves as a broad generalization. Depending on the regularization strength ($\gamma$), it can recover the standard logistic loss (low regularization) or the "sparsemax" loss (high regularization).

Fisher Consistency: The authors prove that the g-logistic loss is Fisher consistent with the asymmetric Hausdorff divergence. This guarantees that minimizing this loss is a theoretically sound way to minimize the geometric distance between the predicted and true distributions.

Experimental Results

The paper evaluates the proposed loss on two distinct types of tasks:

  • Ordinal Regression: Using real-world ordinal datasets (where classes have a natural ordering, e.g., "bad" < "average" < "good"), the g-logistic loss achieved the lowest Hausdorff divergence compared to standard Logistic Regression and specialized thresholding variants. While slightly behind in raw accuracy, it provided a much more geometrically faithful representation of uncertainty between ordered categories.
  • Generative Modeling (VAEs): The authors trained Variational Autoencoders on the Google QuickDraw and MNIST datasets, where "classes" are individual pixels and the cost is the Euclidean distance between them. When used as the output layer, the g-softmax produced significantly sharper and more concentrated reconstructions. While a standard softmax produces blurry "average" images, the g-softmax successfully captures the thin, singular nature of hand-drawn lines.

Limitations and Future Directions

The primary drawback of this approach is computational overhead. Computing the g-softmax and its loss requires an inner optimization loop (like L-BFGS for discrete spaces or Frank-Wolfe for continuous spaces), which increases the computational cost by roughly a factor of 10 compared to standard softmax. Additionally, the method requires a pre-defined cost matrix $C$; while Euclidean distance works well for images, other domains might require complex or manually engineered cost functions.

Despite these computational hurdles, the geometric softmax provides a powerful, theoretically grounded tool for tasks where the relationships between classes matter. Future work may explore applying this framework to super-resolution and investigating "particle swarm" parameterizations to further improve performance in continuous measure spaces.

Summary updated

BibTeX
@inproceedings{mensch2019geometric,
  author = {Arthur Mensch and Mathieu Blondel and Gabriel Peyré},
  title = {{Geometric Losses for Distributional Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2019},
  url = {https://openreview.net/forum?id=HkZRJnZOZS},
}
Figure