Snap has described a PyTorch system for trillion-parameter recommendation models whose fresh weights reach live traffic within hours. Built with NVIDIA, it spans ongoing training, model export and fast serving for Snap’s ranking models.
The goal is to keep recommendation models current. On Stories, short videos and Lenses, new content shows up by the million every day, and what people want to watch changes by the hour.
Why recommendation models get so large
A big deployment can involve hundreds of deep learning models. Plenty are modest, between a few gigabytes and just under 20 GB, serving as light rankers or retrieval towers. The principal rankers dwarf them.
These rankers pair RankMixer or HSTU designs with a sparse side made of many embedding tables, indexed by item, creator and user IDs. That sparse side tends to hold the bulk of the parameters. At the top end it hits a trillion parameters and occupies anywhere from hundreds of gigabytes to terabytes of storage, depending on how it is quantized.

Two problems with a moving catalog
The first is vocabulary. Millions of fresh items appear each day and short videos go stale quickly, so lots of IDs being ranked are only days old. A static table with hashed buckets forces a bad trade. Size it for today and tomorrow’s new items collide. Over-provision it and you waste GPU memory on rows nobody touches. New items also land in a shared, stale bucket exactly when ranking them well matters most.
The second is drift. Popularity spikes and fades within hours, and interests shift. Retraining a big ranker from scratch burns days of GPU time across many nodes, and the result already lags behind by many hours.
Snap’s answer is incremental training: each model picks up where the last version stopped and learns only from recent data, with a matching continuous path into serving.

Why existing tools fell short
- Many existing stacks still run on TensorFlow, which blocks use of PyTorch’s sharded embedding and compiler-based export tooling.
- TorchRec’s mature option for large embeddings uses static tables whose capacity is fixed at construction.
- GPU hash tables that add and drop IDs dynamically have to fit TorchRec’s sharding, optimizer state and distributed checkpoints.
- Serving engines are mostly written in C++ while training is in Python, so models must be exported as compiled artifacts without Python.
- One stack has to cover models from a few gigabytes to several terabytes.

The four building blocks
Snap and NVIDIA built the architecture on four pieces:
- DynamicEmb, from NVIDIA’s recsys-examples: GPU hash-table embeddings that plug into TorchRec, take in new IDs and push out cold ones.
- PyTorch 2 export with AOTInductor, which yields a compiled serving artifact with embedding storage kept separate from the graph.
- NV-Embedding Cache, NVIDIA’s inference-time store, which can serve one graph from GPU memory, from host memory with a GPU cache in front, or through a tiered setup that includes a remote parameter server.
- FlexKV, a tiered KV-cache manager borrowed from LLM serving. It keeps each user’s history cached so a request processes only new events and the candidates. This piece has been validated in pre-production.
One design choice ties these together. The compiled graph invokes an opaque embedding lookup tagged with a layer ID, while metadata and the storage tier decide where rows sit. A 20 GB model can therefore be swapped in live as a single artifact, and a terabyte-scale one can update sparse rows and dense weights separately.
How the training loop runs
Every cycle begins from the last committed state, learns from the next slice of data, gets evaluated, and is then published. Weights, dynamic embedding state and optimizer state all carry over, and IDs admitted for the first time start with new embeddings.
Data is gathered hourly to kick off training, and embedding weights that changed are refreshed every 10 minutes. The very largest models use a trainer that stays alive and keeps state in memory between windows, skipping repeated startups and checkpoint loads.
Failures are handled at window edges. The trainer reloads its latest committed checkpoint and continues from the following window, and health checks that watch for progress catch jobs that keep running without getting anywhere.
What the benchmarks show
The FlexKV numbers come with caveats. Tested on the KuaiRand-1K dataset with an RTX PRO 6000, a hit in the GPU cache made end-to-end inference 1.7 to 4.5 times faster for a three-layer HSTU and 2.1 to 5.9 times faster for an eight-layer one, at batch sizes from 2 to 8, against recomputing the whole history.
When the cache hit came from CPU memory on an H100, the onboard wait was 17 to 37 milliseconds for histories of 1,000 to 4,000 tokens. Snap says these figures reflect the tested configurations and shouldn’t be read as gains across all production workloads.
What it means for other teams
Any team with a fast-changing catalog on PyTorch faces similar pressure on freshness, size and deployment, and Snap offers the design as something others can reuse. The approach moves away from retraining everything on a long cycle toward small, frequent updates.
Two caveats matter. FlexKV has only been validated in pre-production, and the C++ client currently relies on a customized FlexKV branch. Teams copying the setup should plan for integration work until those pieces settle.
Source: eng.snap.com