Skip to main content
QUICK REVIEW

[Paper Review] Anchor & Transform: Learning Sparse Embeddings for Large Vocabularies

Paul Pu Liang, Manzil Zaheer|arXiv (Cornell University)|Mar 18, 2020
Topic ModelingComputer Science78 references4 citations
TL;DR

This paper proposes ANCHOR & TRANSFORM (ANT), a method that learns sparse embeddings for large vocabularies by representing each discrete object as a sparse linear combination of a small set of learnable anchor vectors, using a differentiable, end-to-end trainable transformation matrix. ANT achieves up to 40× parameter compression with stronger performance than baselines on text classification, language modeling, and recommendation tasks, while a Bayesian extension (NBANT) automatically tunes the number of anchors without hyperparameter tuning.

ABSTRACT

Learning continuous representations of discrete objects such as text, users, movies, and URLs lies at the heart of many applications including language and user modeling. When using discrete objects as input to neural networks, we often ignore the underlying structures (e.g., natural groupings and similarities) and embed the objects independently into individual vectors. As a result, existing methods do not scale to large vocabulary sizes. In this paper, we design a simple and efficient embedding algorithm that learns a small set of anchor embeddings and a sparse transformation matrix. We call our method Anchor & Transform (ANT) as the embeddings of discrete objects are a sparse linear combination of the anchors, weighted according to the transformation matrix. ANT is scalable, flexible, and end-to-end trainable. We further provide a statistical interpretation of our algorithm as a Bayesian nonparametric prior for embeddings that encourages sparsity and leverages natural groupings among objects. By deriving an approximate inference algorithm based on Small Variance Asymptotics, we obtain a natural extension that automatically learns the optimal number of anchors instead of having to tune it as a hyperparameter. On text classification, language modeling, and movie recommendation benchmarks, we show that ANT is particularly suitable for large vocabulary sizes and demonstrates stronger performance with fewer parameters (up to 40x compression) as compared to existing compression baselines.

Motivation & Objective

  • To address the scalability and inefficiency of full embedding matrices in large-vocabulary settings, where parameters can constitute up to 80% of model size.
  • To exploit underlying structures such as natural groupings and similarities among discrete objects (e.g., words, users) that are ignored in standard independent embedding methods.
  • To develop a differentiable, end-to-end trainable method that learns sparse, interdependent representations without requiring multiple training stages or post-processing.
  • To provide a statistical foundation for sparse embeddings via a Bayesian nonparametric prior, enabling automatic selection of the optimal number of anchors.

Proposed method

  • ANT represents each object's embedding as a sparse linear combination of a small set of learned anchor vectors, where the transformation matrix T is sparse and differentiable.
  • The method jointly optimizes the anchor vectors A and the sparse transformation matrix T end-to-end using a differentiable objective function.
  • A statistical interpretation frames ANT as an Indian Buffet Process (IBP) prior, enabling a Bayesian nonparametric extension (NBANT) that automatically learns the number of anchors.
  • Small Variance Asymptotics (SVA) is used to derive an approximate inference algorithm that leads to NBANT’s automatic anchor count selection.
  • The objective function balances predictive loss, sparsity of T (∥T∥0), and the number of anchors K via hyperparameters λ1 and λ2.
  • NBANT extends ANT to online learning, dynamically adjusting the number of anchors as new data batches arrive, enabling memory-efficient training on large-scale datasets.

Experimental results

Research questions

  • RQ1Can a sparse, differentiable, and end-to-end trainable method learn high-quality embeddings for large vocabularies while significantly reducing parameter count?
  • RQ2How can underlying structural relationships (e.g., groupings, similarities) among discrete objects be leveraged in embedding learning without relying on independent vector assignments?
  • RQ3Can a Bayesian nonparametric prior be effectively integrated with deep neural networks to automatically determine the optimal number of anchors in a sparse embedding framework?
  • RQ4Does the proposed method outperform existing compression baselines in terms of both model efficiency and predictive performance on downstream tasks?
  • RQ5Can the method scale to online learning settings where data arrives in batches and the number of anchors must be adapted dynamically?

Key findings

  • ANT achieves up to 40× parameter compression on text classification and language modeling benchmarks while maintaining or improving performance compared to full embedding matrices and existing compression baselines.
  • On the PTB language modeling task, ANT with 200 anchors and 245K non-zero parameters achieved a perplexity of 77.7, outperforming a full 1,000-embedding baseline with 214K non-zero parameters.
  • The NBANT extension automatically learns the optimal number of anchors: on MovieLens 1M, it converged to 8 user and 8 item anchors, matching the offline version’s performance.
  • In the online setting, NBANT dynamically increased the number of anchors from 10 to 26 as data arrived, then reduced to 8–10, demonstrating robust adaptation to emerging data structures.
  • Tuning λ1 allowed effective model selection: a small λ1 = 2×10⁻⁵ selected a model with 1,000 anchors and perplexity 79.4, while λ1 = 1×10⁻¹ selected a model with only 100 anchors and perplexity 106.6, showing control over the performance-compression trade-off.
  • On MovieLens 25M, NBANT efficiently optimized the objective function and reached a solution close to the global optimum, as confirmed by 3D visualization and grid search comparison.

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.