genrec icon indicating copy to clipboard operation
genrec copied to clipboard

Evaluation metrics may be inflated due to disabled deduplication (4th codeword) in TIGER configuration

Open HuangFeiY opened this issue 6 months ago • 1 comments

Summary

The current TIGER training configuration disables the semantic ID disambiguation mechanism (add_disambiguation=False, sem_id_dim=3), which contradicts the original TIGER paper's specification. This leads to potentially inflated Recall and NDCG metrics since multiple items sharing the same 3-code Semantic ID are treated as indistinguishable during evaluation.

Paper Specification

The TIGER paper (Section 3.2) explicitly states:

To avoid multiple items being mapped to the same Semantic ID, we add a unique 4th code for items that share the same first three codewords, i.e. two items associated with a tuple (7, 1, 4) are assigned (7, 1, 4, 0) and (7, 1, 4, 1) respectively (if there are no collisions, we still assign 0 as the fourth codeword). In particular, the vocabulary contains 1024 (256 × 4) tokens to represent items in the corpus. This 4th codeword ensures a one-to-one mapping between items and Semantic IDs, which is critical for correct evaluation. Current Implementation

Current Implementation

In both config/tiger/amazon/tiger.gin and config/tiger/amazon2023/tiger.gin:

AmazonSeqDataset.add_disambiguation=False   # Disabled - 4th code hurts performance
train.sem_id_dim=3

While the codebase does include the disambiguation logic (_add_disambiguation_suffix in genrec/data/amazon.py), it is explicitly disabled in the configuration.

Why This Matters

Without the 4th deduplication code, multiple items can share the same 3-code Semantic ID (collisions). During evaluation: 1、The model generates beam search candidates as 3-dimensional SIDs. 2、These predicted SIDs are compared against the ground-truth target's 3-dimensional SID. 3、If a predicted SID matches the target SID, it counts as a hit — even if the model "intended" a different item that happens to share the same SID. This introduces an optimistic bias in both Recall@K and NDCG@K, as the model receives credit for predictions that may not actually correspond to the correct target item.

Reproduction

I ran the experiment using the current configuration (add_disambiguation=False, sem_id_dim=3) and obtained:

  • NDCG@10 = 0.0331

The README reports NDCG@10 = 0.0354, which is in the same ballpark, suggesting the reported results were also obtained with deduplication disabled.

Questions

1、Were the metrics reported in the README obtained with add_disambiguation=False? If so, these results do not strictly follow the paper's protocol and may be slightly inflated due to SID collisions. 2、The comment in config/tiger/amazon2023/tiger.gin states "Disabled - 4th code hurts performance". Could you elaborate on why enabling the paper-specified disambiguation degrades performance? Is this due to increased sequence length making generation harder, or some other factor? 3、Would it be possible to provide results with add_disambiguation=True and sem_id_dim=4 for a fair comparison aligned with the paper's evaluation protocol?

HuangFeiY avatar Jun 01 '26 07:06 HuangFeiY

Hi @HuangFeiY Thanks for the careful report — you're right, and it's a valid concern.

The README numbers were produced with add_disambiguation=False (3-code SIDs), which does not follow the paper's 4-code protocol. When items share a 3-code SID, evaluation is done at SID granularity, so a predicted SID that matches the target's SID counts as a hit regardless of the exact item — this introduces an optimistic bias.

Why we defaulted to 3 codes: The appended 4th code is a non-semantic tie-break index (0, 1, 2, … assigned within a collision group) — it carries no semantic signal, so the model can only memorize it rather than learn it. All our SID-based generative methods (TIGER / LCRec / OneRec) use the same 3-code, SID-level evaluation, so the bias is consistent across them and comparisons within the SID-based family remain valid.

Measured impact (Amazon Beauty Dataset):

Protocol R@5 R@10 N@5 N@10
3-code (add_disambiguation=False, current) 0.0401 0.0632 0.0258 0.0332
4-code (add_disambiguation=True, paper) 0.0364 0.0594 0.0235 0.0308
Inflation +10.2% +6.4% +9.8% +7.8%

We'll dive deeper into this (collision rate, exposure, and how different works handle dedup) and revise the benchmark to report under a consistent, clearly-documented protocol. Thanks again!

phonism avatar Jun 02 '26 04:06 phonism