DLRM Explained: How Deep Learning Recommendation Models Work in Production

How the deep learning recommendation model architecture works: bottom MLP, embedding tables, pairwise interaction, top MLP, and why serving is a memory…

DLRM Explained: How Deep Learning Recommendation Models Work in Production
Written by TechnoLynx Published on 11 Jul 2026

A deep learning recommendation model (DLRM) is the ranking network Facebook (now Meta) open-sourced in 2019. It predicts whether a user will interact with an item, and it was designed around the categorical data that other deep learning models handle badly. The deep learning recommendation model architecture runs in four steps. Continuous features pass through a bottom multilayer perceptron (MLP), categorical IDs are looked up in embedding tables, the resulting vectors interact through explicit pairwise products, and a top MLP ending in a sigmoid turns the result into a click probability. In production the cost is lopsided. The MLPs are computation-dominated, while the embedding tables are bandwidth-dominated and hold most of the parameters.

Why Meta Built a Model Around Categorical Features

The original DLRM paper (Naumov et al., 2019) argued that neural recommendation networks “differ significantly from other deep learning networks due to their need to handle categorical features” and that they were not well studied. Ad ranking depends on fields such as user ID, ad category and the product pages a user has visited. Each of these is a multi-hot vector with a few ones among many zeros. Meta’s launch post describes DLRM as combining ideas from collaborative filtering with predictive-analytics models so that it works at production data scale.

The paper released DLRM in both PyTorch and Caffe2. It also proposed a parallelisation scheme: model parallelism for the embedding tables, to get around memory limits, and data parallelism for the fully connected layers, to scale out compute. A 2020 study found that large-scale recommenders took up to 79% of all inference cycles in the data centre. A 2021 Meta training paper called DLRMs often the single largest AI application by infrastructure demand.

Deep Learning Recommendation Model Architecture: The Four-Stage Path

Each request carries two kinds of input. Dense features are real-valued signals such as a user’s average click-through rate. Sparse features are categorical IDs. The model handles them on two parallel paths and joins them in the middle.

The bottom MLP takes the dense features and compresses them into a short vector. 64 or 128 elements)”. Its output width has to equal the embedding dimension, because the interaction layer compares the two directly.

The embedding tables turn each categorical ID into a dense vector. Each table works like a matrix with one row per category value. The rows a request activates are gathered and pooled (usually summed or concatenated) into one vector per feature. Production tables differ enormously in size. In three Facebook models, hash sizes ranged from 30 rows to 20 million.

The feature-interaction layer holds DLRM’s distinguishing design choices. The bottom MLP output and the pooled embeddings are stacked, and the layer takes the dot product of every pair. That captures interactions between dense and sparse features and among the sparse features themselves. In the default implementation the diagonal (each vector dotted with itself) is left out. The pairwise products are concatenated with the original bottom MLP output and passed upward.

The top MLP processes that concatenation. Every fully connected layer uses ReLU except the last, which uses a sigmoid to output a single click probability between 0 and 1. NVIDIA’s documentation describes the same output as the likelihood of interaction between a user and an item.

Worked Example: The DLRM-RM2 Configuration

A hardware-architecture study of DLRM gives a full specification of a representative configuration. It shows how little compute sits behind each prediction relative to the memory accessed.

Parameter Value
Embedding tables 40
Lookups per table 80
Embedding size 32 FP16 = 64 B (small); 128 FP16 = 256 B (large)
Dense features 256
Bottom MLP 256-128-32-embedding dimension
Top MLP interactions-512-128-1
Feature interaction dot products, diagonal excluded
Compute per inference about 1.40 MFLOPs (small); about 2 MFLOPs (large)

The arithmetic follows from the table. 40 tables × 80 lookups gives 3,200 embedding rows per inference. At 64 bytes per row that is about 205 KB of embedding reads for roughly 1.4 MFLOPs, around 7 FLOPs per byte. At 256 bytes per row it is about 819 KB for roughly 2 MFLOPs, around 2.4 FLOPs per byte. Such low arithmetic intensity puts pressure on memory systems.

Why Are Embedding Tables the Memory Bottleneck While the MLPs Are Compute-Bound?

The embedding tables are where the parameters are. A survey of embedding compression puts it plainly: DLRMs “are typically shallow models, with the majority of parameters concentrated in the embedding tables”. YouTube’s ranking paper gives a sense of scale. One million IDs embedded in 32 dimensions carry seven times more parameters than fully connected layers 2,048 units wide. Production models are much larger than that. A 2025 study of inference-side model updates cites Meta’s Model-F at 96 TB and Kuaishou’s Persia at over 200 TB. A 2025 study of tiered-memory inference reports that one production embedding table can reach hundreds of gigabytes, with the total at multiple terabytes.

Each lookup fetches a scattered row of 64 to 256 bytes with little spatial locality, which gives poor DRAM page-hit behaviour. Little arithmetic is done per byte fetched. NVIDIA’s DLRM documentation says that, unlike compute-intensive layers, embedding layers are limited by memory bandwidth. A 2024 analysis of DLRM training sums up the split: embedding layers are bandwidth-dominated, MLP layers are computation-dominated, and the feature-interaction layer is communication-dominated. The Neo training paper reaches the same conclusion from benchmarks. Embedding performance depends on achievable HBM bandwidth, and MLP performance is bounded by achievable FLOPs.

This asymmetry is why DLRM training is split the way it is. Meta’s launch post calls the model a mix of compute-dominated MLPs and memory-capacity-limited embeddings, so data parallelism suits the first and model parallelism suits the second. In practice the MLPs are copied to every GPU, and the embedding tables are partitioned across GPUs or nodes.

The Communication Cost of Sharding the Embeddings

Each device holds only some of the tables but needs the lookups for its whole slice of the batch. An all-to-all exchange therefore runs in the forward pass to share the embedding lookups, and again in the backward pass to send their gradients back. A separate all-reduce synchronises the MLP gradients. Meta’s launch post calls this exchange a “butterfly shuffle”.

The Neo paper points out that these all-to-all transfers sit on the critical path because of data dependencies. MLP gradient all-reduces can overlap with compute, but the all-to-all transfers cannot, which puts pressure on the interconnect. Its measurements show the gap: 7 GB/s for a 256 MB all-to-all against 60 GB/s for a 256 MB all-reduce, because the all-reduce can also use NVLink bandwidth. Neo’s 4D parallelism (table-wise, row-wise, column-wise and data parallelism for the embedding operators) responds to load imbalance and all-to-all latency, which the paper names as the two main limits on scaling efficiency.

MLCommons’ October 2026 DLRMv4 training benchmark keeps embedding tables of about 560 GiB in its reference workload. Our explainer on what the MLPerf Training benchmarks measure covers how that suite is used to size infrastructure.

Where the Ranking Model Sits: After Retrieval Narrows the Catalogue

NVIDIA’s DLRM documentation describes the usual serving pattern. A retrieval step first cuts millions or hundreds of millions of items down to a few hundred or a few thousand, using cheap methods such as approximate nearest-neighbour search or business-rule filters. The deep learning model then re-ranks those candidates. MLCommons’ DLRMv3 write-up describes the same split. Retrieval is tuned for recall under tight latency and memory limits. Ranking uses richer features and a more expressive model to optimise engagement metrics such as click-through rate, under latency budgets that are somewhat looser but still critical.

Meta’s account of Instagram Explore adds a stage. A lightweight first-stage ranker recalls thousands of candidates, and a heavier second-stage model scores the best 100. The two stages differ in structure, not only in size. Retrieval models usually keep user and item towers separate so their embeddings can be cached, which means they cannot use user-item interaction features. Ranking models combine user, item and cross features early, inside one network. Like those ranking models, DLRM crosses its dense and sparse features inside one network. It belongs at the ranking stage, re-ranking the short candidate list that retrieval leaves.

How Is DLRM Different from DeepFM, NCF and Matrix Factorization?

NVIDIA’s documentation names DLRM’s two distinguishing choices: it computes feature interactions explicitly but only to second order (pairs), and it treats each embedded feature vector as one unit rather than crossing every element. Both choices keep compute and memory costs down while staying accurate.

Model Inputs How interactions are modelled Typical role
Classic matrix factorization User and item IDs Dot product of a user latent vector and an item latent vector Retrieval-stage collaborative filtering
Factorization machine IDs plus side features Interactions among more features than user and item IDs Highly sparse data
Neural collaborative filtering (NCF) User and item IDs An MLP learns the interaction function in place of the inner product Generalises matrix factorization
DeepFM Raw features shared by a “wide” part and a “deep” part Factorization machine for recommendation plus a deep network for feature learning Recommendation without feature engineering beyond raw features
DLRM Dense features plus many categorical tables Explicit pairwise dot products between whole embedding vectors and the bottom MLP output, then a top MLP Ranking after retrieval

The practical difference from matrix factorization and NCF is the range of inputs. Those models centre on the user-item pair. DLRM takes dense and categorical inputs, and YouTube’s ranking paper names easily adding such features as a key advantage of deep networks over matrix factorization. DeepFM and DLRM both draw on factorization machines, and DLRM’s default interaction layer is FM-based. DLRM, though, puts dense features through their own bottom MLP into the shared embedding space, and limits crossing to whole-vector pairs.

How the DLRM Lineage Moved On

The name now covers a family. In MLCommons’ account, DLRMv1 is MLPs and embedding tables with simple dot-product interaction. DLRMv2 adds a deep-cross network for richer explicit crossing. DLRMv3 replaces the interaction stack with a sequential component based on the hierarchical sequential transduction unit (HSTU), and keeps a large embedding table and a top MLP. The reason given is that production systems moved from summarising user behaviour as aggregated features to treating each user’s recent interactions as a token sequence. Models built that way keep improving as they scale, while the older feature-interaction designs level off. MLCommons reports that DLRMv3 grows model size twentyfold over DLRMv2, from 50 GB to 1 TB, and per-candidate compute by 6,500 times, from 40 MFLOP to 260 GFLOP. That gives the newer models a much heavier demand for compute than the classic DLRM described above.

What Hardware Matters for Serving DLRM Inference at Data-Centre Scale?

Serving a classic DLRM is limited by memory accesses to embedding table rows. The inference-updates study describes the usual production layout as a hybrid CPU-GPU hierarchy. GPU HBM holds the 5-10% of embeddings that are hot, CPU DRAM (several terabytes per node) holds the warm rest, and GPUs run the compute-heavy dense layers. NVIDIA’s Merlin Hierarchical Parameter Server adds SSD as a third tier and copies the much smaller dense layers to every GPU worker.

The hierarchy works because access is heavily skewed. In the Criteo 1 TB Click Logs dataset, 305,000 of 188 million categories (0.16%) are referenced by 95.9% of samples. MLCommons found sharper skew in the Yambda data behind DLRMv4: the top 1% of touched rows took 52-68% of embedding lookups and the top 10% took over 90%. HBM handles random embedding reads much better than a typical six-channel DDR4 server memory system, but it holds far less. That trade-off is why the tiers exist.

The tiered-memory study shows what happens as the caching ratio falls. As the number of tables and indices grows and the caching ratio falls, embedding access can take up to 58.7% of total execution time. The cost comes from GPU buffer misses that fall through to CPU memory. Placement is therefore a design decision, not a default. Facebook’s 2021 training characterisation compares four options: GPU memory, the GPU server’s system memory, remote CPU servers, and a GPU-plus-system hybrid. The best choice changed with model size and platform. One model ran fastest on remote CPU parameter servers because its tables did not fit in a single server’s GPU memory.

Industrial systems enforce strict P99 latency, and Meta targets tens of milliseconds. In the DLRMv3 reference, sparse lookups run on CPU against a 1 TB table and the dense HSTU encoder runs on GPUs. Going from one to eight GPUs raised throughput 3.3 times (300 to 1,000 QPS), but P99 stayed slightly above 80 ms because of batching, data movement and Python and CPU overheads. MLCommons notes that production systems usually go further, with GPU-side lookup, distributed sharding, HBM-plus-DRAM caching and quantisation. On quantisation, the embedding compression survey reports that 16-bit representations have been shown sufficient for accurate results.

Gupta et al. (HPCA 2020) measured inference latency varying by 60% across three Intel server generations, and found that batching and co-locating inferences improved latency-bounded throughput substantially. DeepRecSys, a scheduler that adapts to query size, arrival pattern, model and hardware, reported over 30% lower latency in a production deployment across hundreds of machines. When tables are split across servers, a 2020 study of distributed inference found that the added latency and compute come mostly from how the tables are statically distributed and how sparse the requests are.

From those sources, we would put the hardware questions in this order. First, does the hot working set fit in HBM? Second, how much host DRAM bandwidth sits behind it? Third, how is a cache miss handled? Fourth, does the P99 budget survive batching? GPU FLOPs come after all four for a classic DLRM, though HSTU-style successors move compute back up the list. Our companion piece on where DLRM inference latency actually lives breaks that tail-latency budget down stage by stage.

The Architecture Explains the Cost, Not the Upkeep

A small compute graph sits on top of a huge, skewed, constantly updated store of embedding rows. The same structure creates a core operational tension. The embeddings update continuously as new interactions arrive. Production systems usually separate the training clusters that apply those updates from the inference clusters that serve them, which puts freshness and synchronisation overhead in direct tension. How often to retrain, how to version the tables and how to tell when a model has gone stale are separate MLOps engineering questions.