Embedding tables are critical components of large-scale recommendation systems, facilitating the efficient mapping of high-cardinality categorical features into dense vector representations. However, as the volume of unique IDs expands, traditional hash-based indexing methods suffer from collisions that degrade model performance and personalization quality. We present Multi-Probe Zero Collision Hash (MPZCH), a novel indexing mechanism based on linear probing that effectively mitigates embedding collisions. With reasonable table sizing, it often eliminates these collisions entirely while maintaining production-scale efficiency. MPZCH utilizes auxiliary tensors and high-performance CUDA kernels to implement configurable probing and active eviction policies. By retiring obsolete IDs and resetting reassigned slots, MPZCH prevents the stale embedding inheritance typical of hash-based methods, ensuring new features learn effectively from scratch. Despite its collision-mitigation overhead, the system maintains training QPS and inference latency comparable to existing methods. Rigorous online experiments demonstrate that MPZCH achieves zero collisions for user embeddings and significantly improves item embedding freshness and quality. The solution has been released within the open-source TorchRec library for the broader community.
Figures & tables
Figure 1. A simplified example of ID insertion, lookup, and collision handling. A simplified example of ID insertion, lookup, and collision handling.
Table Size
Capacity
Sigrid Hash
MPZCH Collision Rate (%) at max_probe = P
(Millions)
Ratio
Collision
P=8
P=16
P=32
P=64
P=128
P=256
P=512
100
0.67x
48.2080%
34.0631%
33.4269%
33.3363%
33.3333%
33.3333%
33.3333%
33.3333%
150
1.00x
36.7917%
12.0940%
8.4059%
5.8717%
4.1186%
2.8981%
2.0430%
1.4411%
200
1.33x
29.6472%
3.8475%
1.3054%
0.2875%
0.0299%
0.0008%
0.0000%
0.0000%
250
1.67x
24.8028%
1.2974%
0.1967%
0.0105%
0.0001%
0.0000%
0.0000%
0.0000%
300
2.00x
21.3082%
0.4791%
0.0332%
0.0004%
0.0000%
0.0000%
0.0000%
0.0000%
Table 1. Collision rate comparison between Sigrid Hash and MPZCH using 150 million unique IDs. The Capacity Ratio represents the degree of over-provisioning, calculated as the embedding table size divided by the ID cardinality ( Ntable/Nids ). The results demonstrate that MPZCH achieves zero collisions with adequate capacity and probe depth, whereas the baseline Sigrid Hash retains significant collisions even when the table size is more than triple the ID cardinality. Collision rate comparison between Sigrid Hash and MPZCH using 150 million unique IDs. The Capacity Ratio represents the degree of over-provisioning, calculated as the embedding table size divided by the ID cardinality (Ntable/Nids). The results demonstrate that MPZCH achieves zero collisions with adequate capacity and probe depth, whereas the baseline Sigrid Hash retains significant collisions even when the table size is more than triple the ID cardinality.
Figure 2. An example of kernel execution with TTL eviction policy. Probing details are omitted for clarity, with arrows pointing to the final result slots. An example of kernel execution with TTL eviction policy. Probing details are omitted for clarity, with arrows pointing to the final result slots.
Figure 3. An example of kernel execution with LRU eviction policy. Probing details are omitted for clarity, with arrows pointing to the final result slots. An example of kernel execution with LRU eviction policy. Probing details are omitted for clarity, with arrows pointing to the final result slots.
Hardware & Execution Mode
Latency (ms) at max_probe = P
P=8
P=16
P=32
P=64
P=128
P=256
P=512
HBM / CUDA (GPU Native)
Batched
0.90
0.80
0.90
0.80
0.90
0.80
0.90
Non-batched
14.60
14.50
14.70
14.50
14.50
14.50
14.60
UVM Managed (Unified Virtual Memory)
Batched
4.40
4.40
4.40
4.40
4.40
4.40
4.40
Table 2. MPZCH kernel latency benchmark (in milliseconds). The results demonstrate that MPZCH performance is highly efficient on GPU and remains consistent across varying probe depths, indicating that the linear probing mechanism incurs negligible overhead even at higher search ranges. MPZCH kernel latency benchmark (in milliseconds). The results demonstrate that MPZCH performance is highly efficient on GPU and remains consistent across varying probe depths, indicating that the linear probing mechanism incurs negligible overhead even at higher search ranges.
Figure 4. The MPZCH module is co-sharded with the associated embedding table, ensuring that operations are executed locally within each shard. The MPZCH module is co-sharded with the associated embedding table, ensuring that operations are executed locally within each shard.
Prediction Task
NE Improvement
Share
0.38%
Video View Duration (VVD)
0.12%
Video View Percentage 100% (VVP100)
0.12%
Skip
0.09%
Table 3. Normalized Entropy (NE) improvements for critical tasks following the deployment of MPZCH for the user embedding table. Normalized Entropy (NE) improvements for critical tasks following the deployment of MPZCH for the user embedding table.
Figure 5. Top: Video embeddings from selected creators in the baseline model appear dispersed and uncorrelated. Bottom: With MPZCH, embeddings for the same creators exhibit significantly higher correlation and tighter clustering. Top: Video embeddings from selected creators in the baseline model appear dispersed and uncorrelated. Bottom: With MPZCH, embeddings for the same creators exhibit significantly higher correlation and tighter clustering.
Creation Window
Production
MPZCH
Relative Lift
Same Day
0.66%
0.91%
+38%
Same & Next Day
0.66%
0.91%
+38%
Overall (All Time)
0.62%
0.77%
+25%
Table 4. Comparison of intra-creator embedding similarity. MPZCH consistently yields higher similarity scores across all creation time windows, with the most significant gains observed for videos posted in close temporal proximity. Comparison of intra-creator embedding similarity. MPZCH consistently yields higher similarity scores across all creation time windows, with the most significant gains observed for videos posted in close temporal proximity.
Figure 6. Top: In the absence of MPZCH, video embeddings exhibit volatile shifts attributed to hash collisions. Bottom: MPZCH enables the learning trajectory to follow a consistent, smooth path, free from collision-induced noise. Top: In the absence of MPZCH, video embeddings exhibit volatile shifts attributed to hash collisions. Bottom: MPZCH enables the learning trajectory to follow a consistent, smooth path, free from collision-induced noise.
Early ranking stages in recommendation systems precompute item embeddings and cache them in-model for scoring within strict latency constraints. Because this cache exists only at serving time, outside the training loop, training and serving use different item representations, a structural discrepancy that limits quality and adds operational fragility. We show that co-designing the training and serving paths removes this representation discrepancy at its source. We introduce the memory layer, an in-model key-value embedding cache co-trained with the model: the item tower writes embeddings during training and the model reads them at serving, one source of truth for item representations by construction. Always-on embeddings cover items not yet cached, so every item receives a prediction, and the design consolidates three separate trainer-to-predictor update paths into a single self-contained pipeline. Deployed in production on Instagram Reels, the memory layer raises prediction coverage from 96% to 100%, improves embedding freshness from O(5 min) to O(20 s), and narrows the training-serving Normalized Entropy (NE) gap by up to 86%, yielding over 2× recall for the freshest content and a 5-6% cold start engagement lift. Because embeddings are produced during training, the system needs no separate bulk-evaluation or publish-time recomputation, cutting training-and-publish computational cost by 30% at neutral serving computational cost.
Large-scale recommendation systems face "Memory Wall" bottlenecks due to massive, dense embedding tables. While generative retrieval uses discrete tokens for IDs, high-dimensional context still relies on inefficient dense formats. Inspired by computer vision data compression, we propose Dual-purpose Semantic IDs to achieve LLM-level I/O efficiency. Our methodology uses hierarchical quantization to condense continuous embeddings into discrete Semantic IDs performing two concurrent roles: (1) Collaborative Identity: modeling user-item interactions via learnable embedding table; and (2) Content Reconstruction: using a lightweight Semantic Decoder for on-the-fly embedding approximation. This approach replaces massive vector storage with on-demand reconstruction, reducing system overhead and data footprints. We demonstrate the efficacy of our framework through offline evaluations and successful online deployment in production-scale ranking and retrieval systems at a major video sharing platform, showing that discrete tokens are indeed all you need for highly efficient, content-rich recommendation.
Recommender systems have advanced markedly over the past decade by transforming each user/item into a dense embedding vector with deep learning models. At industrial scale, embedding tables constituted by such vectors of all users/items demand a vast amount of parameters and impose heavy compute and memory overhead during training and inference, hindering model deployment under resource constraints. Existing solutions towards embedding compression either suffer from severely compromised recommendation accuracy or incur considerable computational costs. To mitigate these issues, this paper presents BACO, a fast and effective framework for compressing embedding tables. Unlike traditional ID hashing, BACO is built on the idea of exploiting collaborative signals in user-item interactions for user and item groupings, such that similar users/items share the same embeddings in the codebook. Specifically, we formulate a balanced co-clustering objective that maximizes intra-cluster connectivity while enforcing cluster-volume balance, and unify canonical graph clustering techniques into the framework through rigorous theoretical analyses. To produce effective groupings while averting codebook collapse, BACO instantiates this framework with a principled weighting scheme for users and items, an efficient label propagation solver, as well as secondary user clusters. Our extensive experiments comparing BACO against full models and 18 baselines over benchmark datasets demonstrate that BACO cuts embedding parameters by over 75% with a drop of at most 1.85% in recall, while surpassing the strongest baselines by being up to 346X faster.
Runhao Jiang, Renchi Yang, Donghao Wu
Hong Kong Baptist University · The Chinese University of Hong Kong