Memory-efficient Embedding for Recommendations

Xiangyu Zhao, Haochen Liu, Hui Liu, Jiliang Tang, Weiwei Guo, Jun Shi, Sida Wang, Huiji Gao, Bo LongarXiv 2020

Introduction

Deep Learning Recommender Systems (DLRS) rely heavily on categorical features, which are mapped into dense numerical vectors known as embeddings. In standard practice, a uniform dimension is assigned to all feature fields. This "one-size-fits-all" approach is fundamentally inefficient. Low-cardinality features (e.g., gender) are often over-parameterized, while high-cardinality features (e.g., UserID) may lack sufficient representational capacity. Furthermore, embedding tables typically constitute over 99% of a model's parameters, creating significant memory bottlenecks for large-scale deployment.

The AutoDim Framework

To address these challenges, researchers from Michigan State University and LinkedIn introduced AutoDim, an end-to-end differentiable framework designed to automatically assign optimal embedding dimensions to different feature fields. AutoDim operates in two distinct stages: dimensionality search and parameter re-training.

The two-stage AutoDim framework: (a) Dimensionality Search using differentiable weights and (b) Parameter Re-training of the pruned architecture.

1. Dimensionality Search Stage

In the search phase, the framework explores a large space of potential dimensions ($N^M$ for $M$ fields and $N$ candidate sizes). To make this search tractable, AutoDim utilizes a differentiable architecture search (NAS) approach. It employs the Gumbel-Softmax trick to relax discrete dimension choices into a continuous space, allowing for optimization via standard backpropagation. A bilevel optimization strategy is used, where recommendation weights are updated on training data while dimensionality weights ($\alpha$) are optimized on validation data to ensure generalization.

2. Parameter Re-training Stage

Once the search converges, the optimal dimension for each field is selected by identifying the candidate with the highest architectural weight. The model is then pruned of all suboptimal dimensions and retrained from scratch. This ensures that the final, compact model is fully optimized for the selected architecture.

Key Technical Innovations: Weight-Sharing

A critical component of AutoDim's efficiency is its weight-sharing embedding mechanism. Storing independent vectors for every candidate dimension would be prohibitively expensive. Instead, AutoDim stores a single large vector for each feature and "slices" it to create smaller candidate embeddings.

Comparison between (a) Separate Embeddings and (b) Weight-sharing Embeddings. Weight-sharing allows smaller dimensions to act as prefixes of larger ones, improving training efficiency.

This prefix-based approach offers a unique advantage: the "front digits" of the embedding vector are updated more frequently across different candidate dimensions, effectively capturing the most salient feature information.

Experimental Results

AutoDim was evaluated on industry-standard benchmarks, including the Criteo (45M records) and Avazu (40M records) datasets for Click-Through Rate (CTR) prediction.

  • Memory Efficiency: AutoDim achieved a 70-80% reduction in embedding parameters compared to fixed-dimension baselines.
  • Predictive Performance: Despite the massive reduction in parameters, AutoDim consistently outperformed state-of-the-art methods in terms of AUC and Logloss. In the competitive field of CTR prediction, even minor improvements in AUC are significant; AutoDim's gains were substantial.
  • Automated Intuition: Case studies on MovieLens-1m revealed that AutoDim aligns with human intuition, automatically assigning larger dimensions to highly predictive features (e.g., movieId) and smaller dimensions to less informative ones (e.g., gender).

Conclusion

AutoDim represents a significant step forward in making large-scale recommender systems more efficient and performant. By automating the "needle in a haystack" problem of dimension selection, it enables the deployment of high-accuracy models on standard hardware with a fraction of the memory footprint. Future research may extend this to value-level dimension selection, catering to the varying activity levels of individual users or items.

Summary updated

BibTeX
@misc{zhao2020memory,
  author = {Xiangyu Zhao and Haochen Liu and Hui Liu and Jiliang Tang and Weiwei Guo and Jun Shi and Sida Wang and Huiji Gao and Bo Long},
  title = {{Memory-efficient Embedding for Recommendations}},
  year = {2020},
  eprint = {2006.14827},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2006.14827},
}
Figure