GenRec is an open-source, end-to-end framework designed to standardize the Generative Recommendation (GenRec) workflow. It provides a reproducible pipeline covering Representation → Tokenization → Modeling → Training → Inference.
📘 arXiv Paper (coming soon)
Generative Recommendation is shifting the paradigm from scoring/matching to generative modeling. However, the current ecosystem is highly fragmented:
- Inconsistent Tokenization: Diverse quantization methods (RQ-VAE, VQ-VAE, OPQ, RKMeans) make inputs incompatible.
- Varied Backbones: Architectures range from Encoder–Decoder (T5/BART) to Decoder-only LLMs (Llama/GPT).
- Disparate Pipelines: Training and inference strategies (Beam Search vs. Prefix-tree) vary significantly between implementations.
The Result: Models are difficult to compare, hard to extend, and often unreproducible.
GenRec solves this by providing a single, plug-and-play stack that unifies the entire lifecycle.
- 🧩 Fully Modular: Decoupled components for Tokenization, Backbones, and Inference.
- ⚙️ Config-Driven: Manage complex experiments with simple YAML configurations.
- 📊 Fair Comparison: Benchmarking SOTA models (TIGER, Letter, RPG, etc.) under the same setting.
- 🔬 Standardized SID Modeling: The first open-source standardization for Semantic ID-based recommendation.
Raw Data
↓
Download + Preprocessing
↓
Embedding Generation (Text / Image / CF / VLM)
↓
Multimodal Fusion (optional)
↓
Quantization (RQ-VAE / OPQ / PQ / RKMeans)
↓
Generative Recommender (TIGER / RPG / LETTER / LLMs)
↓
Inference (Beam Search / Prefix-tree / Contrastive Rerank)
| Dimension | Category | Supported Components | Status |
|---|---|---|---|
| Data | Datasets | Amazon, MovieLens | ✓ |
| Input Formats | Raw IDs, Embeddings, Codebooks (SID) | ✓ | |
| Representation | Text | Qwen, T5, OpenAI Embedding API | ✓ |
| Vision | CLIP ViT | ✓ | |
| Collaborative | SASRec | ✓ | |
| Fusion | Concat, MLP Fusion | ✓ | |
| Quantization | Residual Family | RQ-VAE, Residual KMeans, Residual-VQ | ✓ |
| Product Family | OPQ, PQ | ✓ | |
| Other | VQ-VAE, Multi-Codebook (RPG-style) | ✓ | |
| Backbone | Encoder–Decoder | TIGER-style architectures | ✓ |
| Decoder-only LLM | GPT-2, Qwen, LLaMA | ✓ | |
| Retrieval-Hybrid | RPG-style architectures | ✓ | |
| Training | Objectives | LM Loss, Contrastive Loss, Hybrid Loss | ✓ |
| Paradigms | SFT, Alignment, Multi-stage Training | ✓ | |
| Inference | Decoding | Greedy, Beam Search | ✓ |
| Constraints | Prefix-Tree | ✓ |
Requirements
- Python 3.10 (recommended)
- CUDA 11.8+ (for GPU acceleration)
- PyTorch, CUDA, and other dependencies will be installed automatically via
requirements.txt
git clone https://github.com/yourname/GenRec
cd GenRec
pip install -r requirements.txtWe provide a dedicated submodule for downloading, cleaning, and extracting embeddings (Text/Image/CF).
👉 See detailed tutorial:
GenRec-Factory Data Processing & Embedding Guide
Convert dense embeddings into discrete Semantic IDs (SIDs)
cd quantization
python main.py \
--model_name rqvae \
--dataset_name Musical_Instruments \
--embedding_modality text \
--embedding_model text-embedding-3-largeTrain a generative recommender using the generated SIDs.
cd recommendation
python main.py \
--model TIGER \
--dataset Baby \
--quant_method rqvae