← all repositories
snap-research/GRID

Snap GRID turns product text into generative recommendation tokens

GRID compresses LLM item embeddings into hierarchical semantic IDs so transformers can generate recommendations as discrete token sequences.

GRID
Not currently ranked — collecting fresh signals.
star history

What it does

GRID is an end-to-end research framework that converts item descriptions into embeddings using any Hugging Face LLM, compresses those embeddings into hierarchical semantic IDs through residual quantization, and trains transformer models to generate those IDs as recommendation sequences. It reframes recommendation as autoregressive token generation rather than scoring or retrieval. The codebase is built on PyTorch Lightning and Hydra and includes pre-processed Amazon benchmark data.

The interesting bit

The semantic IDs are learned from LLM text embeddings and discretized via residual quantization, giving the transformer a compact, hierarchical vocabulary of item tokens. It applies the autoregressive image-generation playbook—borrowed from the RVQ literature—to recommendation sequences.

Key highlights

  • Supports three quantization strategies for semantic ID learning: RQ-KMeans, RQ-VAE, and RVQ.
  • Implements TIGER-style generative retrieval as the default recommendation backbone.
  • Uses PyTorch Lightning and Hydra, making the pipeline modular and experiment-friendly.
  • Includes pre-processed Amazon Beauty, Sports, and Toys datasets from the P5 paper.
  • Lets you swap in any Hugging Face LLM for the initial item embedding step.

Caveats

  • The README is mostly a quickstart guide; deeper architectural documentation and benchmark numbers are absent.
  • Only TIGER is currently supported for generative recommendation, so swapping in other generative backbones requires manual extension.
  • The training scripts expose an internal deduplication quirk where you must manually increment num_hierarchies by one.

Verdict

A solid reference if you’re experimenting with generative retrieval or semantic-ID recommenders. Look elsewhere if you need a battle-tested production system—this is research code with training wheels.

Frequently asked

What is snap-research/GRID?
GRID compresses LLM item embeddings into hierarchical semantic IDs so transformers can generate recommendations as discrete token sequences.
Is GRID open source?
Yes — snap-research/GRID is an open-source project tracked on heatdrop.
What language is GRID written in?
snap-research/GRID is primarily written in Python.
How popular is GRID?
snap-research/GRID has 716 stars on GitHub.
Where can I find GRID?
snap-research/GRID is on GitHub at https://github.com/snap-research/GRID.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.