Generating Long Semantic IDs in Parallel for Recommendation
Authors:
- Yupeng HouYHYupeng Hou
- Jiacheng LiJLJiacheng Li
- Ashley ShinASAshley Shin
- Jinsung JeonJJJinsung Jeon
- Abhishek SanthanamASAbhishek Santhanam
- Wei ShaoWSWei Shao
- Kaveh HassaniKHKaveh Hassani
- Ning YaoNYNing Yao
- Julian McAuleyJMJulian McAuley
Preprint
Abstract
Semantic ID-based recommendation models tokenize each item into a small number of discrete tokens that preserve specific semantics, leading to better performance, scalability, and memory efficiency. While recent models adopt a generative approach, they often suffer from inefficient inference due to the reliance on resource-intensive beam search and multiple forward passes through the neural sequence model. As a result, the length of semantic IDs is typically restricted (e.g. to just 4 tokens), limiting their expressiveness. To address these challenges, we propose RPG, a lightweight framework for semantic ID-based recommendation. The key idea is to produce unordered, long semantic IDs, allowing the model to predict all tokens in parallel. We train the model to predict each token independently using a multi-token prediction loss, directly integrating semantics into the learning objective. During inference, we construct a graph connecting similar semantic IDs and guide decoding to avoid generating invalid IDs. Experiments show that scaling up semantic ID length to 64 enables RPG to outperform generative baselines by an average of 12.6% on the NDCG@10, while also improving inference efficiency. Code is available at: https://github.com/facebookresearch/RPG_KDD2025.Keywords
All Related Versions
This publication has 32 references indexed in Scilit:
- The Faiss LibraryIEEE Transactions on Big Data, 2025
- SoundStream: An End-to-End Neural Audio CodecIEEE/ACM Transactions on Audio, Speech, and Language Processing, 2021
- Hierarchical Gating Networks for Sequential Recommendation2019
- Self-Attentive Sequential Recommendation2018
- Personalized Top-N Sequential Recommendation via Convolutional Sequence Embedding2018
- Neural Attentive Session-based Recommendation2017
- Image-Based Recommendations on Styles and Substitutes2015
- Optimized Product QuantizationIEEE Transactions on Pattern Analysis and Machine Intelligence, 2013
- Factorizing personalized Markov chains for next-basket recommendation2010
- Product Quantization for Nearest Neighbor SearchIEEE Transactions on Pattern Analysis and Machine Intelligence, 2010