Add LETTER model for Semantic ID recommender - #716
Open
hieuddo wants to merge 1 commit into
Open
Conversation
qtuantruong
reviewed
Jul 28, 2026
| test_data = diginetica.load_test() | ||
| print("data loaded") | ||
|
|
||
| item_ids = sorted({tup[2] for tup in train_data + val_data + test_data}) |
Member
There was a problem hiding this comment.
content and cf_embeddings are constructed in sorted item_ids order. Cornac’s global item indices, however, are assigned by first appearance in the interaction data. FeatureModality(..., ids=item_ids) correctly remaps the content vectors, but cf_embeddings is passed directly and is never remapped. With actual SASRec embeddings, the collaborative loss therefore aligns each item’s semantic representation with another item’s CF vector, invalidating tokenizer training and resulting metrics.
can we check if this is correct/intended alignment? Don't want it to be a hack, we might need to make some changes for better design
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR integrates
LETTER(Learnable Item Tokenization for Generative Recommendation) intocornacas an extension ofTIGER.LETTERretainsTIGER's RQ-VAE Semantic-ID and T5 generation pipeline, and it aligns the quantized content representation of each item with a fixed item embedding from a separately pretrained collaborative filtering model using anInfoNCE-style contrastive loss. The released recipe uses 32-dimensionalSASRecitem embeddings.Key changes
LETTERas an extension ofTIGERVerification and tuning
The original paper uses
LLaMa-7Binstead of the commonSentence-T5or OpenAI'stext-embedding-large-3, so we verified both stages (codebook and seq2seq) separately.1.86e-9. I.e., the behavior of the tokenizer fromcornacand the original implementation is identical.Setting: Amazon Beauty 2014 5-core, chronological leave-last-out, and
seed=42. The end-to-end run uses Sentence-T5 content embeddings and 32-dimensional item embeddings from a locally trained SASRec. The released Beauty tokenizer recipe usescf_weight=0.1,diversity_weight=1e-4, and 10,000 RQ-VAE epochs.With the authors' IDs, the Cornac generator is within
0.0002to0.0004of all reported paper metrics, so that comparison is close and direct. The end-to-end Sentence-T5 result is not an exact paper reproduction because the authors did not release their tokenizer checkpoint, content embeddings, or SASRec checkpoint; it is included as a fully runnable reference.Comparative context
Within the LETTER paper's experimental pipeline, LETTER-TIGER improves over its TIGER reimplementation by approximately 9–10% across the four reported Beauty metrics. However, that TIGER baseline is weaker than the result reported in the original TIGER paper. LETTER-TIGER remains below the original TIGER result on R@5, N@5, and N@10, while exceeding it on R@10.
This cross-paper comparison is not fully controlled: the original TIGER paper uses Sentence-T5 embeddings, whereas the LETTER paper uses LLaMA-7B content embeddings and a different tokenizer-training recipe. Because the LETTER authors did not release their tokenizer checkpoint, content embeddings, or SASRec checkpoint, the current reproduction validates the released implementation and generator with author-provided IDs, but cannot isolate the recommendation gain attributable to LETTER's collaborative and diversity regularization against a well-reproduced TIGER baseline.
Checklist:
README.md(if you are adding a new model).examples/README.md(if you are adding a new example).