English

From Softmax to Sparsemax: A Sparse Model of Attention and Multi-Label Classification

Computation and Language 2016-02-09 v2 Machine Learning Machine Learning

Abstract

We propose sparsemax, a new activation function similar to the traditional softmax, but able to output sparse probabilities. After deriving its properties, we show how its Jacobian can be efficiently computed, enabling its use in a network trained with backpropagation. Then, we propose a new smooth and convex loss function which is the sparsemax analogue of the logistic loss. We reveal an unexpected connection between this new loss and the Huber classification loss. We obtain promising empirical results in multi-label classification problems and in attention-based neural networks for natural language inference. For the latter, we achieve a similar performance as the traditional softmax, but with a selective, more compact, attention focus.

Keywords

Cite

@article{arxiv.1602.02068,
  title  = {From Softmax to Sparsemax: A Sparse Model of Attention and Multi-Label Classification},
  author = {André F. T. Martins and Ramón Fernandez Astudillo},
  journal= {arXiv preprint arXiv:1602.02068},
  year   = {2016}
}

Comments

Minor corrections

R2 v1 2026-06-22T12:44:21.455Z