TL;DR
X-Rec is a continuous generative retrieval framework for recommender systems that directly models the next-item distribution in a continuous embedding space using flow matching. By avoiding the quantization errors of discrete semantic IDs and the expressiveness bottlenecks of traditional two-tower models, X-Rec matches the retrieval quality of autoregressive methods while delivering a 3.46× speedup in inference throughput.
What Problem Does This Paper Address?
Large-scale recommendation systems rely on a "retrieval" stage to filter millions of items down to a few hundred candidates before passing them to heavy downstream ranking models. Currently, two paradigms dominate this space:
- User-to-Item (U2I): Traditional two-tower models map a user’s history to a single deterministic embedding vector. This collapses user interest into a single point (a delta distribution), failing to capture diverse, multi-modal interests (e.g., a user who simultaneously enjoys both cooking videos and sports cars).
- Semantic-ID-based Autoregressive (SID-AR): These methods discretize continuous item embeddings into string tokens (Semantic IDs) and use language-model-like autoregressive decoding to predict the next item sequence. While highly expressive, they suffer from quantization errors (information loss during discretization) and low throughput because tokens must be generated sequentially.
X-Rec bridges this gap by performing generative retrieval directly in the continuous item embedding space, combining the speed of embedding-based retrieval with the expressiveness of generative modeling.
Methods
X-Rec models the conditional recommendation distribution using Flow Matching (FM)-based diffusion. To make continuous generation effective and fast enough for production scales, the authors introduce three key architectural innovations:
- Anchor Conditioning: Instead of generating fine-grained item embeddings from pure noise, X-Rec first predicts a coarse semantic region (a cluster center index, or "anchor") via a standard cross-entropy loss. The continuous diffusion process is then conditioned on this anchor, making generation more stable and controllable.
- Riemannian Flow Matching (RFM): Because item embeddings are typically $\ell_2$-normalized and naturally live on a unit hypersphere, standard Euclidean diffusion paths waste model capacity. RFM ensures the generative trajectory moves along spherical geodesics, keeping intermediate states natively on the manifold.
- Late-Interaction Diffusion Transformer: To avoid running a full, heavy Transformer stack at every single denoising step, X-Rec caches the user context representations and restricts the repeated velocity-field estimation to just the final Transformer layer.
Datasets
The model was evaluated on a large-scale industrial streaming benchmark constructed from the TikTok platform. To faithfully simulate a production environment with continuous user feedback, the benchmark consists of 47 consecutive temporal partitions. Each partition contains 2.6 million sampled training examples and 10,000 test examples, with user interaction histories capped at a maximum length of 200.
Key Insights and Ideas
- Continuous vs. Discrete Generative Retrieval: Operating directly on continuous embeddings eliminates the fragile one-to-one mapping requirements and quantization errors inherent to Semantic IDs. The paper demonstrates that forcing targets into discrete SID spaces distorts fine-grained neighborhoods and hurts end-to-end recall.
- The Power of Multiple Triggers: Generating multiple stochastic triggers allows the model to map out a complex, multi-region decision boundary rather than a single local neighborhood, vastly improving coverage of diverse user interests.
- Geometry Matters: Forcing the diffusion model to respect the native hyperspherical geometry of contrastively learned embeddings yields a massive boost in retrieval accuracy (+1.78% Recall@20) compared to standard Euclidean flow matching.
Key Results
- Throughput: X-Rec achieves a 3.46× higher inference throughput compared to autoregressive SID-AR baselines due to parallel trigger generation instead of token-by-token decoding.
- Accuracy: On the streaming benchmark, X-Rec achieved a Mean Recall@20 of 10.76%, substantially outperforming traditional U2I baselines (like SASRec at 1.03% and DreamRec at 4.30%) and outperforming its own autoregressive variant (X-Rec-AR at 10.23%).
- Production Impact: Deployed on TikTok for vertical content recommendation, X-Rec delivered a +4.1484% increase in vertical engagement and a +0.0111% increase in general engagement across two consecutive live A/B launches.
Limitations and Future Work
- Sampling Steps: The current sampler still requires multiple sequential denoising steps (30 steps in the evaluation setup), prompting future work into few-step distillation or adaptive numerical solvers to further reduce serving costs.
- Scalability: While the late-interaction design is highly efficient, how it scales with much larger backbone models and deeper denoising modules remains an open question.
- Alignment: The authors suggest exploring reward-aligned post-training (such as Reinforcement Learning) to optimize directly for long-term user satisfaction and content relevance rather than just next-item prediction.
Summary updated