PME: pruning-based multi-size embedding for recommender systems

Zirui Liu, Qingquan Song, Li Li, Soo-Hyun Choi, Rui Chen, Xia HuFrontiers Big Data 2024

TL;DR

This paper introduces PME, a novel framework for creating multi-size embeddings in recommender systems. By reframing the problem as a pruning task, PME efficiently identifies and removes redundant dimensions in embeddings without requiring extensive training, leading to significant memory savings and competitive performance.

What Problem Does This Paper Address?

Recommender systems heavily rely on embeddings to represent categorical features like user IDs and item IDs. Traditionally, all features are assigned embeddings of the same fixed size. However, this approach is inefficient because many features (long-tail tokens) are rarely encountered and don't require large embedding dimensions, leading to wasted memory. While some methods attempt to assign variable embedding sizes, they often involve complex architecture search or heuristic rules that can be suboptimal or computationally expensive. This paper tackles the challenge of efficiently determining optimal, feature-specific embedding sizes to reduce memory footprint without sacrificing recommendation performance.

Methods

The core innovation of PME lies in its pruning-based approach to determining multi-size embeddings. Instead of directly searching for optimal sizes, PME treats the problem as identifying and removing dimensions from a standard, fixed-size embedding that have the least impact on model performance. This is achieved through a single-shot pruning strategy inspired by SNIP (Single-shot Network Pruning).

Here's a breakdown of the method:

  • Connection Sensitivity: PME calculates the "connection sensitivity" of each embedding dimension. This metric quantifies how much removing a specific dimension would affect the model's loss function.
  • Pruning at Initialization: Crucially, this sensitivity is calculated before any training occurs, using randomly initialized weights and a full batch of training data. This significantly reduces the computational cost compared to iterative pruning or architecture search methods.
  • Capacity Transfer: Once the least impactful dimensions are identified and pruned, the remaining capacity (i.e., the number of preserved dimensions) directly dictates the new, customized embedding size for each token.
  • Multi-size Table Construction: A multi-size embedding table is then constructed based on these determined sizes. For efficient lookup, embeddings are grouped by their rounded sizes and processed in batches.

Datasets

The paper evaluates PME on two public benchmark datasets commonly used in recommender systems:

  • Criteo: A large-scale dataset for click-through rate (CTR) prediction.
  • Avazu: Another dataset for CTR prediction.

Key Insights and Ideas

  • Pruning as Size Allocation: The most significant insight is reframing the embedding size allocation problem as a pruning problem. This shift allows for efficient, non-iterative search for optimal sizes.
  • Efficiency through Initialization: Pruning at initialization, rather than after pre-training, dramatically reduces the computational overhead and eliminates the need for complex pruning schedules.
  • Frequency vs. Importance: While frequent tokens often benefit from larger embeddings, PME's approach goes beyond simple frequency scaling. It identifies tokens whose representations are crucial for performance, even if they are infrequent (e.g., niche items), and allocates them appropriate capacity.
  • Robustness: The PME framework demonstrates robustness to different initializations and backbone models, suggesting its allocation strategy is generally applicable.

Key Results

  • Significant Parameter Reduction: PME achieves substantial reductions in the number of parameters in the embedding layer, often by factors of 10x, 20x, and even 40x, without compromising performance.
  • Competitive Performance: PME matches or even improves upon the performance (measured by Logloss and AUC) of state-of-the-art embedding compression methods across various backbone models (DeepFM, Autoint+, Wide and Deep) and compression rates. For instance, on the Criteo dataset, PME improved Logloss by 0.001 while eliminating over 97% of parameters for Autoint+.
  • Reduced Training Time: PME can lead to a 10-20% reduction in training time compared to standard single-size embeddings, likely due to fewer trainable parameters.
  • Faster Search Time: The search phase for PME is significantly faster (approximately 30-40% of the time) compared to a comparable NAS-based method like DartsEMB.

Limitations and Future Work

  • Memory Usage During Search: The paper acknowledges that during the embedding size search phase, the memory usage of embedding layers cannot be reduced, as maximal sizes need to be considered. This is a common limitation in search-based multi-size embedding methods.
  • Future Work: The authors suggest further exploration into optimizing the retrieval process for multi-size tables and investigating the impact of PME on other recommendation tasks beyond CTR prediction. The paper also implicitly points towards exploring more sophisticated pruning criteria or integrating PME with other compression techniques.

Summary updated

BibTeX
@article{liu2024pme,
  author = {Zirui Liu and Qingquan Song and Li Li and Soo-Hyun Choi and Rui Chen and Xia Hu},
  title = {{PME: pruning-based multi-size embedding for recommender systems}},
  journal = {Frontiers Big Data},
  year = {2024},
  doi = {10.3389/fdata.2023.1195742},
}
Figure