EdoardoBotta/RQ-VAE-Recommender
[Pytorch] Generative retrieval model using semantic IDs from "Recommender Systems with Generative Retrieval"
What it solves
It addresses the complexity of implementing generative recommendation systems, where items are treated as tokens rather than just IDs. Instead of just providing a neural layer, it offers a complete experimental pipeline to handle semantic-ID tokenization, dataset preparation, identifier collisions, and the training of sequence models for item retrieval.
How it works
The project implements a two-stage workflow:
- Semantic-ID Tokenization: A Residual-Quantized Variational Autoencoder (RQ-VAE) maps catalog items into short tuples of discrete semantic IDs.
- Generative Retrieval: A Transformer (specifically a T5 encoder-decoder) takes a user's history of these semantic IDs and generates the IDs of the most likely next items.
Who it’s for
It is designed for recommender-system researchers and practitioners focusing on semantic tokenization, vector quantization, cold-item representations, and generative retrieval.
Highlights
- Flexible Quantization: Supports K-means initialization and multiple gradient estimators including Gumbel-Softmax, straight-through, and the rotation-trick.
- Integrated Pipeline: Includes automatic preprocessing for Amazon Reviews and MovieLens datasets.
- Collision Handling: Features semantic-ID collision disambiguation and corpus-prefix-constrained generation.
- Research Ready: Provides a T5-based retrieval model with built-in hit-rate and NDCG evaluation metrics.
Related
- Project
- Project
- Project
- Project
- Project