Abstract
Deep learning-based recommendation systems (e.g., DLRMs) are widely used AI models to provide high-quality personalized recommendations. Training data used for modern recommendation systems commonly includes categorical features taking on tens-of-millions of possible distinct values. These categorical tokens are typically assigned learned vector representations, that are stored in large embedding tables, on the order of 100s of GB. Storing and accessing these tables represent a substantial performance burden. Our work proposes MEM-REC, a novel alternative representation approach for embedding tables. MEM-REC leverages Bloom filters and hashing methods to encode categorical features using two cache-friendly embedding tables. The first table (token embedding) contains raw embeddings (i.e. learned vector representation), and the second table (weight embedding), which is much smaller, contains weights to scale these raw embeddings to provide better discriminative capability to each data point. We provide a detailed architecture, design and analysis of MEM-REC addressing trade-offs in accuracy and computation requirements. In comparison with state-of-the-art techniques MEM-REC can not only maintain the recommendation quality and significantly reduce the memory footprint for commercial scale recommendation models but can also improve the embedding latency. In particular, based on our results, MEM-REC compresses the MLPerf CriteoTB benchmark DLRM model size by $2900\times$ and performs up to $3.4\times$ faster embeddings while achieving the same AUC as that of the full uncompressed model.
Introduction
Modern recommendation systems, such as those powering large-scale e-commerce and social media platforms, rely heavily on Deep Learning Recommendation Models (DLRMs). A core component of these models is the embedding table, which maps high-cardinality categorical features (e.g., User IDs, Product IDs) to dense mathematical vectors. As the number of unique entities grows into the billions, these tables often exceed hundreds of gigabytes, creating a significant "memory wall." The resulting performance bottleneck occurs because the CPU spends a disproportionate amount of time waiting for data to be fetched from slow system RAM (DRAM) to the processor.
The Mem-Rec Architecture
To overcome these limitations, we propose Mem-Rec, a novel architecture that replaces traditional "one-row-per-ID" embedding tables with a more efficient dual-encoder scheme. Instead of linear scaling, Mem-Rec's memory requirements scale logarithmically with the number of unique IDs.
The architecture consists of two primary components:
- Token Encoder: This component utilizes a set of hash functions, similar to a Bloom filter, to map categorical inputs to multiple indices within a relatively small "Token Embedding Table." Rather than fetching a single large row, it retrieves several smaller vectors and pools them to form a raw embedding.
- Weight Encoder: A common issue with hashing-based approaches is "hash collisions," where different IDs map to the same indices. Mem-Rec mitigates this by introducing a second, significantly smaller table that provides a learnable scalar weight. This weight re-scales the raw token embedding, providing the model with the discriminative power needed to distinguish between colliding IDs.
Experimental Evaluation
We evaluated Mem-Rec using three industry-standard click-through-rate (CTR) prediction benchmarks:
- Criteo-Kaggle: A standard display advertising dataset.
- Avazu: Mobile advertisement click data.
- Criteo-Terabyte (Criteo-TB): A 1-terabyte dataset representing the scale of production-grade commercial systems.
Key Results and Insights
The primary advantage of Mem-Rec is its hardware alignment. By compressing a 96GB model down to under 48MB, the entire embedding operation can reside within the CPU’s Last Level Cache (LLC). This bypasses the DRAM bottleneck entirely, leading to substantial performance gains.
- Massive Compression: On the Criteo-TB benchmark, Mem-Rec achieved a 2904× reduction in model size compared to the baseline DLRM while maintaining identical accuracy (AUC).
- Enhanced Speed: The system performed embedding operations up to 3.4× faster than the baseline, primarily due to a 98× reduction in memory bandwidth utilization and fewer LLC misses.
- Scalability: The Bloom filter-based representation allows for doubling the number of users without a linear increase in memory usage, making it ideal for hyper-scale applications.
Conclusion and Future Work
Mem-Rec demonstrates that it is possible to achieve extreme compression and speedups in recommendation systems without sacrificing quality. However, there are trade-offs: on the Criteo-TB dataset, Mem-Rec required 6 training epochs to reach the same accuracy that the baseline achieved in 1 epoch, indicating a more computationally intensive training phase. Future work will focus on optimizing hyper-parameter tuning and exploring the architecture's performance on GPUs and specialized AI accelerators.
Summary updated