← Open Source
snap-research

GRID

GRID: Generative Recommendation with Semantic IDs.

Model DevelopmentArchitecturePython
Open on GitHub
Momentum
+0stars in 24 hours0.0%
754
Stars
132
Forks
+4
This week
2
Contributors
Created 2025-06-16 · Updated 2026-10-16 · #14192 today
Top developers
jumxglhfnshah171

snap-research/GRID is ranked 14,192 with 754 stars.

Same-category comparison

snap-research/GRID is ranked 14,192 among these 8 peers; taki0112/SENet-Tensorflow is ranked 14,193.

Same-category comparison
NameRankMetrics
facebookresearch/InterHand2.6M14,183
Language:
Python
Stars:
754
Forks:
91
Description:
Official PyTorch implementation of "InterHand2.6M: A Dataset and Baseline for 3D Interacting Hand Pose Estimation from a Single RGB Image", ECCV 2020.
nnsvs/nnsvs14,187
Language:
Python
Stars:
754
Forks:
84
Description:
Neural network-based singing voice synthesis library for research.
ohayonguy/PMRF14,188
Language:
Python
Stars:
754
Forks:
42
Description:
[ICLR 2025] Official implementation of Posterior-Mean Rectified Flow: Towards Minimum MSE Photo-Realistic Image Restoration.
open-mmlab/mmfewshot14,189
Language:
Python
Stars:
754
Forks:
126
Description:
OpenMMLab FewShot Learning Toolbox and Benchmark.
taki0112/SENet-Tensorflow14,193
Language:
Python
Stars:
754
Forks:
265
Description:
Simple Tensorflow implementation of "Squeeze and Excitation Networks" using Cifar10 (ResNeXt, Inception-v4, Inception-resnet-v2).
hfawaz/InceptionTime14,199
Language:
Python
Stars:
753
Forks:
161
Description:
InceptionTime: Finding AlexNet for Time Series Classification.
jeongyoonlee/Kaggler14,202
Language:
Python
Stars:
753
Forks:
164
Description:
Code for Kaggle Data Science Competitions.
soapisnotfat/super-resolution14,204
Language:
Python
Stars:
753
Forks:
183
Description:
collection of super-resolution models & algorithms.
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguagePython
CategoryModel Development
SubcategoryArchitecture
KeywordsRecommender system
Stars754
Forks132
Contributors2
Created date2025-06-16
Updated date2026-10-16
Stars in 1 day0
Stars in 7 days4
Rank14,192
Previous rank14,057
Rank change-135
7-day stars rank6,379
Previous 7-day stars rank5,722
7-day stars rank change-657
Total stars rank14,023
Previous total stars rank13,996
Total stars rank change-27
CountryUSA
README summary

Generative Recommendation with Semantic IDs (GRID) **GRID** (Generative Recommendation with Semantic IDs) is a state-of-the-art framework for generative recommendation systems using semantic IDs, developed by a group of scientists and engineers from Snap Research. This project implements novel approaches for learning semantic IDs from text embedding and generating recommendations through transformer-based generative models. 🚀 Overview GRID facilitates generative recommendation three overarching steps: **Embedding Generation with LLMs**: Converting item text into embeddings using any LLMs available on Huggingface

. **Semantic ID Learning**: Converting item embedding into hierarchical semantic IDs using Residual Quantization techniques such as RQ-KMeans, RQ-VAE, RVQ. **Generative Recommendations**: Using transformer architectures to generate recommendation sequences as semantic ID tokens. 10+ CUDA-compatible GPU (recommended) Setup Environment 🎯 Quick Start 1. Data Preparation Prepare your dataset in the expected format: We provide pre-processed Amazon data explored in the P5 paper [4]. The data can be downloaded from this google drive link. Embedding Generation with LLMs Generate

embeddings from LLMs, which later will be transformed into semantic IDs. Train and Generate Semantic IDs Learn semantic ID centroids for embeddings generated in step 2: Generate SIDs: 4. Train Generative Recommendation Model with Semantic IDs Train the recommendation model using the learned semantic IDs: 4. Generate Recommendations Run inference to generate recommendations: Supported Models: Semantic ID: 1. Residual K-means proposed in One-Rec [2] 2. Residual Quantization with Variational Autoencoder [3] Generative Recommendation: 1. TIGER [1] 📚 Citation If

you use GRID in your research, please cite: 🤝 Acknowledgments Built with PyTorch and PyTorch Lightning Configuration management by Hydra Inspired by recent advances in generative AI and recommendation systems Part of this repo is built on top of 📞 Contact For questions and support: Create an issue on GitHub Contact the development team: Clark Mingxuan Ju (mju@snap. Bibliography [1] Rajput, Shashank, et al. "Recommender systems with generative retrieval. " Advances in Neural Information Processing Systems 36 (2023): 10299-10315. "Onerec: Unifying

retrieve and rank with generative recommender and iterative preference alignment. "Autoregressive image generation using residual quantization. " Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. "Recommendation as language processing (rlp): A unified pretrain, personalized prompt & predict paradigm (p5). " Proceedings of the 16th ACM conference on recommender systems.

Frequently asked questions

How many stars and forks are recorded?

snap-research/GRID has 754 stars and 132 forks.

What is the repository rank?

snap-research/GRID is ranked 14,192.

What language and category are recorded?

snap-research/GRID has 754 stars, uses Python and belongs to Model Development.

Which repository is closest in rank?

snap-research/GRID is compared with taki0112/SENet-Tensorflow, ranked 14,193 with 754 stars.

README

Generative Recommendation with Semantic IDs (GRID)

GRID (Generative Recommendation with Semantic IDs) is a state-of-the-art framework for generative recommendation systems using semantic IDs, developed by a group of scientists and engineers from Snap Research. This project implements novel approaches for learning semantic IDs from text embedding and generating recommendations through transformer-based generative models.

🚀 Overview

GRID facilitates generative recommendation three overarching steps:

  • Embedding Generation with LLMs: Converting item text into embeddings using any LLMs available on Huggingface.
  • Semantic ID Learning: Converting item embedding into hierarchical semantic IDs using Residual Quantization techniques such as RQ-KMeans, RQ-VAE, RVQ.
  • Generative Recommendations: Using transformer architectures to generate recommendation sequences as semantic ID tokens.

📦 Installation

Prerequisites

  • Python 3.10+
  • CUDA-compatible GPU (recommended)

Setup Environment

# Clone the repository
git clone https://github.com/snap-research/GRID.git
cd GRID

# Install dependencies
pip install -r requirements.txt

🎯 Quick Start

1. Data Preparation

Prepare your dataset in the expected format:

data/
├── train/       # training sequence of user history 
├── validation/  # validation sequence of user history 
├── test/        # testing sequence of user history 
└── items/       # text of all items in the dataset

We provide pre-processed Amazon data explored in the P5 paper [4]. The data can be downloaded from this google drive link.

2. Embedding Generation with LLMs

Generate embeddings from LLMs, which later will be transformed into semantic IDs.

python -m src.inference experiment=sem_embeds_inference_flat data_dir=data/amazon_data/beauty # avaiable data includes 'beauty', 'sports', and 'toys'

3. Train and Generate Semantic IDs

Learn semantic ID centroids for embeddings generated in step 2:

python -m src.train experiment=rkmeans_train_flat \
    data_dir=data/amazon_data/beauty \
    embedding_path=/merged_predictions_tensor.pt \ # this can be found in the log dirs in step2
    embedding_dim=2048 \ # the model dimension of the LLMs you use in step 2. 2048 for flan-t5-xl as used in this example.
    num_hierarchies=3 \  # we train 3 codebooks
    codebook_width=256 \ # each codebook has 256 rows of centroids  

Generate SIDs:

python -m src.inference experiment=rkmeans_inference_flat \
    data_dir=data/amazon_data/beauty \
    embedding_path=/merged_predictions_tensor.pt \ 
    embedding_dim=2048 \ 
    num_hierarchies=3 \  
    codebook_width=256 \ 
    ckpt_path= # this can be found in the log dir for training SIDs

4. Train Generative Recommendation Model with Semantic IDs

Train the recommendation model using the learned semantic IDs:

python -m src.train experiment=tiger_train_flat \
    data_dir=data/amazon_data/beauty \ 
    semantic_id_path=/pickle/merged_predictions_tensor.pt \
    num_hierarchies=4 # Please note that we add 1 for num_hierarchies because in the previous step we appended one additional digit to de-duplicate the semantic IDs we generate.

4. Generate Recommendations

Run inference to generate recommendations:

python -m src.inference experiment=tiger_inference_flat \
    data_dir=data/amazon_data/beauty \ 
    semantic_id_path=/pickle/merged_predictions_tensor.pt \
    ckpt_path= \ # this can be found in the log dir for training GR models
    num_hierarchies=4 \ # Please note that we add 1 for num_hierarchies because in the previous step we appended one additional digit to de-duplicate the semantic IDs we generate.

Supported Models:

Semantic ID:

  1. Residual K-means proposed in One-Rec [2]
  2. Residual Vector Quantization
  3. Residual Quantization with Variational Autoencoder [3]

Generative Recommendation:

  1. TIGER [1]

📚 Citation

If you use GRID in your research, please cite:

@inproceedings{grid,
  title     = {Generative Recommendation with Semantic IDs: A Practitioner's Handbook},
  author    = {Ju, Clark Mingxuan and Collins, Liam and Neves, Leonardo and Kumar, Bhuvesh and Wang, Louis Yufeng and Zhao, Tong and Shah, Neil},
  booktitle = {Proceedings of the 34th ACM International Conference on Information and Knowledge Management (CIKM)},
  year      = {2025}
}

🤝 Acknowledgments

📞 Contact

For questions and support:

Bibliography

[1] Rajput, Shashank, et al. "Recommender systems with generative retrieval." Advances in Neural Information Processing Systems 36 (2023): 10299-10315.

[2] Deng, Jiaxin, et al. "Onerec: Unifying retrieve and rank with generative recommender and iterative preference alignment." arXiv preprint arXiv:2502.18965 (2025).

[3] Lee, Doyup, et al. "Autoregressive image generation using residual quantization." Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. 2022.

[4] Geng, Shijie, et al. "Recommendation as language processing (rlp): A unified pretrain, personalized prompt & predict paradigm (p5)." Proceedings of the 16th ACM conference on recommender systems. 2022.

Nearby in the ranking
Similar items