Skip to main content
QUICK REVIEW

[Paper Review] Efficient softmax approximation for GPUs

Édouard Grave, Armand Joulin|arXiv (Cornell University)|Sep 14, 2016
Parallel Computing and Optimization TechniquesComputer Science47 references139 citations
TL;DR

Adaptive softmax provides an GPU-optimized, two-cluster hierarchical softmax to accelerate training with very large vocabularies, achieving substantial speedups with perplexity close to full softmax.

ABSTRACT

We propose an approximate strategy to efficiently train neural network based language models over very large vocabularies. Our approach, called adaptive softmax, circumvents the linear dependency on the vocabulary size by exploiting the unbalanced word distribution to form clusters that explicitly minimize the expectation of computation time. Our approach further reduces the computational time by exploiting the specificities of modern architectures and matrix-matrix vector operations, making it particularly suited for graphical processing units. Our experiments carried out on standard benchmarks, such as EuroParl and One Billion Word, show that our approach brings a large gain in efficiency over standard approximations while achieving an accuracy close to that of the full softmax. The code of our method is available at https://github.com/facebookresearch/adaptive-softmax.

Motivation & Objective

  • Motivate efficient language modeling with very large vocabularies for GPUs.
  • Introduce adaptive softmax that minimizes computation time based on word frequency distribution.
  • Demonstrate empirical speedups and maintained accuracy on standard benchmarks.

Proposed method

  • Define a computation time model for matrix-multiplication in GPUs.
  • Split the vocabulary into a head (frequent words) and tail (rare words) with unbalanced sizes.
  • Keep the head cluster at the root for fast access and use projections to reduce tail classifier capacity.
  • Generalize to multiple clusters and optimize cluster sizes via a dynamic-programming approach.
  • Empirically evaluate on Text8, Europarl, and One Billion Word against baselines.

Experimental results

Research questions

  • RQ1Can an adaptive, GPU-aware hierarchical softmax approximate full softmax with reduced computation time?
  • RQ2How should word clusters be sized to minimize expected computation time while preserving accuracy?
  • RQ3How does adaptive softmax compare to other large-vocabulary strategies in perplexity and training speed?
  • RQ4What is the impact of using a short-list for frequent words at the root versus placing them as leaves?
  • RQ5Is the approach scalable to very large corpora like One Billion Word?

Key findings

  • Adaptive softmax achieves 2x to 10x speedups over full softmax while maintaining perplexity close to the full model on large corpora.
  • A two-cluster head-tail arrangement yields significant speedups (e.g., over 5x in their example) with minimal loss in accuracy.
  • Using a small number of clusters (2–5) provides favorable speed-perplexity tradeoffs; more clusters offer diminishing gains.
  • Tail capacity is reduced via projection, preserving learning efficiency for rare words without full hidden-dimension usage.
  • On Text8, their approach approaches full-softmax perplexity within 3 points while being the fastest; on Europarl and One Billion Word, it outperforms several baselines in speed for similar perplexities.
  • Their method achieves 43.9 perplexity after five epochs on One Billion Word with less than three days on a single GPU, competitive with larger multi-GPU setups.

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.