Skip to main content
QUICK REVIEW

[Paper Review] Sparse Sequence-to-Sequence Models

Ben Peters, Vlad Niculae|arXiv (Cornell University)|May 14, 2019
Natural Language Processing TechniquesComputer Science40 references7 citations
TL;DR

This paper introduces sparse sequence-to-sequence models using a new family of differentiable, sparse transformations called α-entmax, which generalize softmax and sparsemax. By replacing dense softmax with α-entmax in both attention and output layers, the models produce sparse alignments and output probabilities, improving interpretability and accuracy while enabling exact beam search in low-ambiguity settings. The method achieves near-softmax speed on GPUs and shows consistent gains on morphological inflection and machine translation tasks.

ABSTRACT

Sequence-to-sequence models are a powerful workhorse of NLP. Most variants employ a softmax transformation in both their attention mechanism and output layer, leading to dense alignments and strictly positive output probabilities. This density is wasteful, making models less interpretable and assigning probability mass to many implausible outputs. In this paper, we propose sparse sequence-to-sequence models, rooted in a new family of $α$-entmax transformations, which includes softmax and sparsemax as particular cases, and is sparse for any $α> 1$. We provide fast algorithms to evaluate these transformations and their gradients, which scale well for large vocabulary sizes. Our models are able to produce sparse alignments and to assign nonzero probability to a short list of plausible outputs, sometimes rendering beam search exact. Experiments on morphological inflection and machine translation reveal consistent gains over dense models.

Motivation & Objective

  • To address the inefficiency and lack of interpretability in dense sequence-to-sequence models that assign nonzero probability to all vocabulary items.
  • To develop a differentiable, sparse alternative to softmax that maintains model performance while reducing probability mass on implausible outputs.
  • To enable exact beam search by restricting output probabilities to a finite, small set of plausible hypotheses.
  • To provide fast, scalable inference algorithms for α-entmax transformations, especially for large-vocabulary tasks.
  • To improve attention interpretability through sparse, focused alignments that highlight only relevant source tokens.

Proposed method

  • Proposes α-entmax, a family of differentiable, sparse probability transformations based on Tsallis entropies, with softmax (α=1) and sparsemax (α=2) as special cases.
  • Uses Fenchel-Young losses as a natural training objective for α-entmax output layers, enabling end-to-end training.
  • Develops an exact GPU-optimized algorithm for 1.5-entmax, achieving near-softmax inference speed despite sparsity.
  • For arbitrary α>1, employs a bisection-based approximate algorithm that remains practical for large vocabularies.
  • Applies α-entmax to both the attention mechanism and output layer, enabling sparse attention and sparse output probabilities simultaneously.
  • Integrates the transformations into a standard RNN-based sequence-to-sequence model with input-feeding and global attention.

Experimental results

Research questions

  • RQ1Can replacing softmax with a sparse, differentiable transformation improve interpretability and performance in sequence-to-sequence models?
  • RQ2Does sparse output probability distribution lead to exact beam search in low-ambiguity tasks?
  • RQ3Can sparse attention mechanisms reduce computational waste and improve focus on relevant source words?
  • RQ4Is the proposed α-entmax transformation efficient enough for large-vocabulary NLP tasks, especially on GPU?
  • RQ5Can the combination of sparse attention and sparse output layers yield consistent gains across diverse NLP tasks?

Key findings

  • The 1.5-entmax model achieved 63.0% BLEU on the de→en translation task, outperforming both softmax and sparsemax.
  • On morphological inflection, the model achieved a 1.4% absolute improvement in accuracy over the best dense baseline.
  • The average number of non-zero attention weights per target token dropped from 24.25 (softmax) to 5.55 (1.5-entmax), significantly improving interpretability.
  • The average number of non-zero output probabilities per time step decreased from 17,993 (softmax) to 16.13 (1.5-entmax), reducing wasted probability mass.
  • The exact 1.5-entmax algorithm runs at 10,500 target words per second on a GTX 1080 GPU, close to softmax’s 13,000 words per second.
  • In morphological inflection, beam search was exact in many cases, with only three hypotheses receiving nonzero probability, including the correct and one plausible alternative.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.