Learning Classifiers with Fenchel-Young Losses: Generalized Entropies, Margins, and Algorithms

Mathieu Blondel, André F. T. Martins, Vlad Niculae

Abstract

This paper studies Fenchel-Young losses, a generic way to construct convex loss functions from a regularization function. We analyze their properties in depth, showing that they unify many well-known loss functions and allow to create useful new ones easily. Fenchel-Young losses constructed from a generalized entropy, including the Shannon and Tsallis entropies, induce predictive probability distributions. We formulate conditions for a generalized entropy to yield losses with a separation margin, and probability distributions with sparse support. Finally, we derive efficient algorithms, making Fenchel-Young losses appealing both in theory and practice.

Introduction

In machine learning, loss functions serve as the primary metric for training models. Traditionally, researchers have navigated a trade-off between probabilistic models (like Logistic Regression) and margin-based models (like Support Vector Machines). While probabilistic models offer smooth optimization and interpretable outputs, they often produce "dense" distributions that assign non-zero probability to every class. Conversely, margin-based models are robust but lack natural probabilistic interpretations.

This paper introduces Fenchel-Young (F-Y) losses, a unified framework that leverages Fenchel duality to bridge this gap. By selecting specific regularization functions—primarily generalized entropies—researchers can create a continuous spectrum of loss functions that range from standard logistic loss to sparse alternatives like sparsemax.

The Fenchel-Young Framework

The core of the framework is the definition of a loss function $L_\Omega(\theta; y)$ using the Fenchel conjugate of a regularization function $\Omega$:

$$L_\Omega(\theta; y) = \Omega^*(\theta) + \Omega(y) - \langle \theta, y \rangle$$

By choosing $\Omega$ to be a negative generalized entropy, such as the Tsallis $\alpha$-entropy, we can generate a family of losses. For instance, $\alpha=1$ yields the Shannon entropy and standard Logistic loss, while $\alpha=2$ yields the Gini index and Sparsemax loss. As $\alpha \to \infty$, the framework recovers the Perceptron loss.

Visualization of entropy, predictive distributions, and loss functions for different alpha values.

The Sparsity-Margin Connection

A key theoretical contribution of this work is the formal link between sparsity and separation margins. The authors prove that a loss function possesses a separation margin if and only if its associated prediction function can produce sparse distributions (i.e., reaching the boundary of the probability simplex).

This explains why the Logistic loss lacks a margin: its underlying Shannon entropy is "essentially smooth," meaning its gradient explodes at the boundary, preventing the model from ever assigning exactly zero probability to a class. By contrast, Tsallis entropies with $\alpha > 1$ allow for sparse supports, providing a tunable "knob" to control the level of sparsity and the size of the margin.

Empirical Evaluation and Results

The framework was evaluated on sparse label proportion estimation using seven multi-label benchmark datasets, including Birds, Yeast, and Mediamill. These datasets are particularly relevant as they often feature many labels where only a few are applicable to any single instance.

Performance comparison across multi-label datasets, showing the benefit of tuning the alpha parameter.

The results demonstrate that tuning the $\alpha$ parameter consistently outperforms fixed choices like Logistic ($\alpha=1$) or Sparsemax ($\alpha=2$). The "tuned $\alpha$" approach achieved the best average rank across all tested datasets, highlighting the value of the flexible F-Y framework.

Computational Efficiency

Beyond theoretical unification, the paper provides efficient algorithms for computing predictions. For separable entropies, the mapping from scores to the probability simplex is reduced to a 1D root-finding problem. In practice, a specialized solver using Brent's method proved to be 10x to 100x faster than standard proximal gradient methods like FISTA, particularly as the number of classes ($d$) scaled to 1,000.

Conclusion and Future Work

Fenchel-Young losses provide a principled foundation for constructing convex losses with desirable properties like sparsity and margins. While the current work focuses on multi-class and multi-label settings, future research may extend these sparse losses to structured prediction tasks involving sequences or trees. Additionally, while the $\alpha$ parameter offers significant power, efficient automated hyperparameter tuning remains an area for further optimization.

Summary updated

BibTeX
@inproceedings{blondel2019learning,
  author = {Mathieu Blondel and André F. T. Martins and Vlad Niculae},
  title = {{Learning Classifiers with Fenchel-Young Losses: Generalized Entropies, Margins, and Algorithms}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2019},
  url = {https://openreview.net/forum?id=p34YtSpwqBe},
}
Figure