Enhancing Embedding Representation Stability in Recommendation Systems with Semantic ID

Carolina Zheng, Minhui Huang, Dmitrii Pedchenko, Kaushik Rangadurai, Siyu Wang, Gaby Nahum, Jie Lei, Yang Yang 0083, Tao Liu, Zutian Luo, Xiaohan Wei, Dinesh Ramasamy, Jiyan Yang, Yiping Han, Lin Yang, Hangjun Xu, Rong Jin, Shuang Yang

TL;DR

This paper tackles the instability of item embeddings in large-scale recommendation systems, which arises from dynamic item catalogs and skewed data distributions. They introduce "Semantic ID prefix-ngram," a novel method that groups items based on content similarity rather than random hashing, leading to more stable and effective item representations. This approach significantly improves recommendation performance, especially for less popular items, and has been successfully deployed in Meta's production ad ranking system.

What Problem Does This Paper Address?

Modern recommendation systems, particularly in areas like online advertising, deal with an explosion of items (high cardinality) and a skewed distribution of user engagement, where a few items get most of the attention (impression skew). Furthermore, item catalogs are constantly changing, with new items appearing and old ones disappearing (ID drifting). Traditional methods often use random hashing to manage the vast number of item IDs and their corresponding embeddings. However, this random assignment can lead to "collisions," where different items share the same embedding, polluting the learning process and causing embedding representations to become unstable over time. This instability degrades model performance, especially for "tail" items (those with few impressions), making it hard for them to learn meaningful representations.

Methods

The core of this paper is the introduction of Semantic ID prefix-ngram. This method builds upon the concept of Semantic ID, which assigns items to hierarchical clusters based on their content (text, images, video) using a technique called RQ-VAE (Residual Quantized Variational Autoencoder). Instead of directly mapping raw item IDs to embeddings, Semantic ID maps items to a sequence of discrete codes representing their cluster.

The novelty lies in the prefix-ngram parameterization. This technique leverages the hierarchical nature of the Semantic ID codes. Instead of using the full, potentially very long, sequence of codes for each item, it uses prefixes of varying lengths (e.g., "prefix-3gram" uses the first three codes). This allows for a controlled trade-off between the granularity of semantic information and the cardinality of the resulting embedding space. By using these prefixes, items with similar content are more likely to share embedding representations, leading to more stable and semantically meaningful embeddings.

Datasets

The paper uses internal Meta ad ranking data for both offline experiments and online production deployment. Specific datasets are not named, but the data is described as including "production user interaction data" and "ad content information" (text, image, video).

Key Insights and Ideas

  • Semantic Grouping Beats Random Hashing: The fundamental insight is that grouping items based on their content similarity (Semantic ID) is far more effective than random hashing for creating stable and informative item embeddings.
  • Hierarchy Matters: The hierarchical nature of Semantic ID codes, captured by the prefix-ngram approach, is crucial. Using prefixes allows for a flexible way to balance semantic richness with embedding table size.
  • Tail Items Benefit Most: The improvements from Semantic ID are most pronounced for "tail" items (those with few impressions). This is because Semantic ID enables these items to leverage knowledge learned from more popular, semantically similar items.
  • Stability is Key: Semantic ID significantly reduces embedding representation instability caused by ID drifting, leading to more consistent model performance over time.
  • Production Impact: The approach isn't just theoretical; it has been successfully integrated into Meta's live ad ranking system, demonstrating real-world value.

Key Results

  • Offline Performance: Semantic ID prefix-ngram achieved notable improvements in Normalized Entropy (NE), a key metric for recommendation performance, outperforming baselines like random hashing and individual embeddings, especially for tail and new items. For example, gains of up to -0.41% NE were observed for new items compared to random hashing.
  • Stability: Semantic ID models showed significantly less performance degradation over time due to ID drifting compared to random hashing.
  • Production Gains: In Meta's production ad ranking system, incorporating Semantic ID features resulted in a 0.15% gain in the primary online metric. This is considered a significant improvement given the highly optimized nature of the system.
  • Reduced A/A Variance: The approach led to a 43% reduction in A/A prediction difference, meaning that exact copies of items with different IDs produced more consistent model predictions, improving system robustness.

Limitations and Future Work

  • Content Understanding Dependency: The effectiveness of Semantic ID relies heavily on the quality of the underlying content understanding models used to generate initial embeddings.
  • Temporal Stability of Semantics: The paper assumes that broad semantic categories remain temporally stable. If these categories themselves shift rapidly, the benefits of Semantic ID might diminish.
  • Future Work: The authors suggest further exploring the impact of Semantic ID on other recommendation tasks and models, as well as investigating more advanced parameterization techniques. They also hint at the potential for Semantic ID to improve user history modeling by providing more stable and meaningful representations of user interactions.

Summary updated

BibTeX
@inproceedings{zheng2025enhancing,
  author = {Carolina Zheng and Minhui Huang and Dmitrii Pedchenko and Kaushik Rangadurai and Siyu Wang and Gaby Nahum and Jie Lei and Yang Yang and Tao Liu and Zutian Luo and Xiaohan Wei and Dinesh Ramasamy and Jiyan Yang and Yiping Han and Lin Yang and Hangjun Xu and Rong Jin and Shuang Yang},
  title = {{Enhancing Embedding Representation Stability in Recommendation Systems with Semantic ID}},
  booktitle = {RecSys},
  year = {2025},
}
Figure