TL;DR
TIGER (Transformer Index for GEnerative Recommenders) recommends by generating. Each item gets a Semantic ID, a short tuple of codes built from the item's text, so that similar items share their leading codes. A Transformer encoder-decoder reads a user's history as a sequence of these codes and writes out the code of the next item, one token at a time. No separate search index is built. On three Amazon review datasets the authors report gains over the strongest sequential recommenders of the time, and the same codes let the model suggest items that have almost no interaction history and let the operator tune how varied the suggestions are.
Builds on: Sequential Recommendation, Residual Vector Quantization, Transformer · Leads to: HSTU, a later generative recommender
Why it mattered
Most large recommenders still use retrieve-and-rank. A retrieval model maps users and items into one vector space, and an approximate nearest neighbor index returns the items closest to the user's vector. The paper asks whether the index can be dropped. TIGER stores the catalogue inside the model's parameters: the decoder's output vocabulary is the set of codes, and beam search over those codes returns candidate items.
The paper's framing is that this opens "a new area of research," titled Recommender Systems based on Generative Retrieval. The authors say it is the first Semantic ID-based generative model for recommendation. A concurrent paper from the same group, by Singh et al., used hierarchical Semantic IDs to replace item IDs in a ranking model, so the idea was being tried in more than one part of the pipeline.
The stakes are set by catalogue size. The authors note that the item corpus "can be in the order of billions" for real products. The experiments here use three Amazon review datasets, far smaller than that. The method's claims about memory and cold start matter most at the larger scale.
The problem
Sequential recommendation asks: given a user's items in time order, , which item comes next? The standard answer, covered in Sequential Recommendation, uses a self-attention network such as SASRec to produce one user vector and scores items by its dot product with an item embedding. That approach has three costs the paper targets.
- Every item has its own row in an embedding table. The table has one row per item, so its size grows with the catalogue. A new item has no row until it has interactions, so it is hard to recommend.
- Random IDs carry no meaning. Two near-identical products have unrelated IDs, so the model learns about each item separately. Items with few interactions are the worst served.
- Retrieval runs as a separate step. The index is built from item embeddings and searched with a second algorithm, so the model is not trained to output the item it recommends.
Generative retrieval, which earlier work applied to documents, removes the separate step: the model writes the identifier of the target itself. For documents, the identifier can be a title or a string. For recommendation, the authors need an identifier that is short, that is built from content, and that has enough capacity for every item. TIGER's answer is the Semantic ID.
How it works
The paper has two stages. Stage one turns each item into a Semantic ID. Stage two trains a generative recommender on sequences of those IDs.
flowchart LR A["Item text: title, brand, price, category"] --> B["Sentence-T5 embedding, 768 numbers"] B --> C["RQ-VAE encoder, 32 numbers"] C --> D["Three residual quantization levels"] D --> E["Semantic ID: three codes plus a collision code"] E --> F["Transformer encoder-decoder over the user history"] F --> G["Beam search decodes the next Semantic ID"] G --> H["Look up the item; drop IDs that match no item"]
To keep the arithmetic readable, the walkthrough uses one number per vector and codebooks of three entries. The paper uses 768 numbers per item, a 32-number latent, and codebooks of 256 entries at each of three levels.
- Start with a content embedding. A pretrained text encoder, Sentence-T5 in the paper, turns the item's text into a vector. Pretend the item's encoder output is the single number .
- Quantize level 1. The first codebook is . The nearest entry to is , which is code 1. The residual, the part not yet explained, is .
- Quantize level 2 on the residual. The second codebook is . The nearest entry to is , code 2. The new residual is .
- Quantize level 3. The third codebook is . The nearest entry to is , code 0, since is less than . The residual is .
- Check the reconstruction. The Semantic ID is . The decoded value is , and the error equals the last residual. Each level only has to explain what the earlier levels missed.
- Resolve collisions. Two items can land on the same three codes. If a second item also gets , the lookup table appends a fourth code to tell them apart: one gets and the other . The paper uses 0 as the fourth code when there is no collision, so every item has a four-code ID.
- Turn a history into tokens. Suppose a user first chose item A with ID , then item B with ID . The model reads the flat sequence , with a user token in front. The training target is the next item's ID, here C with . The model learns to produce , then , then , then , one token at a time, each conditioned on what it has already written.
- Decode at inference time. Beam search keeps the several most probable partial codes at each position. A finished code that matches an item becomes a recommendation. A code that matches no item is dropped, which is why the paper reports invalid IDs separately.
The math
Stage 1: residual quantization of the content embedding
Let be an item's content embedding, with in the paper. An encoder maps it to a latent vector , and the residual starts as .
At each level there is a codebook of vectors, where is the number of levels. Level chooses the nearest codeword to the current residual and passes the leftover to the next level.
This is the step from the walkthrough, written out. The Semantic ID is the tuple of indices , one per level, and the collision code is appended after it. The quantized vector is the sum of the chosen codewords,
which the decoder maps back to a reconstruction . The paper uses a separate codebook for each level, not one codebook of size , because the norm of the residuals tends to fall at higher levels, so each level needs its own scale.
Training uses two terms. The first is the reconstruction error, . The second ties the encoder to the codebook:
Here is the Stop-Gradient operator: its argument is used in the value but gets no gradient. The first part moves the codewords toward the residuals, and the second, weighted by , keeps the encoder from drifting far from its codewords. The total loss is . The paper initializes each codebook with K-Means Clustering on the first batch, which prevents most inputs from collapsing onto a few codewords.
Stage 2: next-item prediction over Semantic ID tokens
Each item's full Semantic ID has tokens: the three quantizer codes and the collision code. Let the user's history be , each item with its ID . The history is flattened into one token sequence, , and the target is the ID of the next item. Writing the target as , the model's probability of the target is a product of token probabilities:
Training maximizes the log of this probability, which is the same as minimizing the sum of per-token Cross-Entropy Loss terms. Each token is predicted from the history and from the tokens already written for the same item, so the model learns the coarse-to-fine order of the code. Decoding keeps several partial codes at once with Beam Search.
Size and memory
Three levels of 256 codewords already give distinct triples, far more than the items in any of the three datasets. Four positions give IDs, about 4.3 billion, so most of the code space is unused; the paper reports that the model almost always lands on a valid one.
The embedding table of a conventional recommender has one row of length per item, so its size is . TIGER has one row per code value, rows, so its table costs regardless of . The two lookup tables that link items and codes together cost on the order of bits: each item needs 32 bits for its four-code Semantic ID and 32 bits for its integer item ID.
Results
On the Amazon Beauty dataset, the paper reports up to 29% higher NDCG@5 than SASRec and 17.3% higher Recall@5 than S3-Rec. On Toys and Games, it reports 21% and 15% higher NDCG@5 and NDCG@10 than the second-best method. These are relative gains, not differences in absolute score. Recall@K asks whether the true next item is among the top K results. NDCG@K also rewards placing it near the top.
The ablations support the design choices.
- Quantizer. Semantic IDs from RQ-VAE beat IDs from locality-sensitive hashing (the paper uses LSH with eight hyperplanes and four codewords) and beat random IDs. The paper says the gap holds consistently; the comparison table holds the exact figures.
- Depth. Recall@5 rises slightly as the encoder and decoder grow from three to five layers. In the paper's table the Beauty rows are 0.04499 Recall@5 for three layers, 0.0454 for four, and 0.04633 for five, so the gains are small. NDCG@5 rises from three to four layers and then does not improve at five (0.03062, 0.0321, 0.03206). The authors used four layers.
- Variance. The main tables give single-run numbers. Across three random seeds the paper reports Beauty Recall@5 of 0.0441 with a standard error of 0.00069, slightly below the single-run 0.0454. The authors describe the spread as small compared with the gap to the baselines.
- Scalability. Building Semantic IDs on all three datasets together, then training on Beauty, lowers Beauty Recall@5 from 0.0454 to 0.04355 and Recall@10 from 0.0648 to 0.06314. The paper calls this a small decrease.
Two capabilities follow from the design, and the paper tests both.
- Cold start. The authors hold out 5% of test items from training. Because each unseen item shares the first three codes with related items, a predicted code can retrieve it. The paper caps the share of unseen items in the output with a parameter ; with the method beats a nearest-neighbour baseline on the semantic embedding space at every Recall@K.
- Diversity. Sampling the first code gives items from coarse categories, and sampling a later code varies items within one category. Raising the decoding temperature increases the entropy of the categories in the top-K list.
The main limits are these. The model can produce invalid IDs: for the top 10 predictions the paper reports 0.1% to 1.6% invalid, and for the top 20, about 0.3% to 6%. Inference is more expensive than an index lookup because beam search runs a decoder for every position. The P5 numbers use a preprocessing the authors changed for consistency with the other baselines, so that comparison rests on their choice. Everything is on three product-review datasets, not a live system.
Reading guide
Read the paper in this order, with the lessons that cover each section.
- Section 1, Introduction. Retrieve-and-rank and the dual-encoder index: Recommender System, Matrix Factorization, Approximate Nearest Neighbor Search.
- Section 2, Related work. The sequential models it compares against: Sequential Recommendation, SASRec. Generative retrieval for documents is the other thread, and the paper's Appendix A covers it in more detail.
- Section 3.1, Semantic ID generation. The codes and their quantization: Vector Quantization, Residual Vector Quantization, Variational Autoencoder, Sentence Embedding. Appendix A also compares Locality-Sensitive Hashing.
- Section 3.2, Generative retrieval. The token sequence and the next-code objective: Autoregressive Model, Transformer, Encoder-Decoder Architecture, Cross-Entropy Loss.
- Section 4, Experiments. The sequence model is built with the T5X framework, the encoder-decoder pattern of T5. Decoding and invalid IDs use Beam Search. Read Table 5 and Table 9 for the layer and variance results.
- Appendix D. The data-preprocessing changes to P5, which matter for fair comparison.
Check yourself
QuestionWhat is a Semantic ID, and why is it made of several codes rather than one?Show answer
QuestionWith codebooks {0, 5, 10} and {-2, 0, 2}, what are the first two codes for z = 8.2, and what residual is left after level 2?Show answer
QuestionWhy does TIGER not need a separate approximate nearest neighbor index, and what does it pay for that?Show answer
QuestionA new product is added with no interaction history. Why can TIGER recommend it when an ID-based sequential model cannot?Show answer
Sources
- Rajput et al., Recommender Systems with Generative Retrieval (arXiv:2305.05065), 2023.
- van den Oord et al., Neural Discrete Representation Learning (arXiv:1711.00937), 2017. The VQ-VAE that RQ-VAE extends.
- Vaswani et al., Attention Is All You Need (arXiv:1706.03762), 2017.
- Vector quantization (Wikipedia).