Repository navigation
Add opt-in SID and collision-corrected next-item evaluation - #728
Conversation
There was a problem hiding this comment.
Maybe better to move this out of models. It can go to utils for instance.
There was a problem hiding this comment.
Sounds good. That'd be a better fit than inside models
There was a problem hiding this comment.
What is the difference between this file "semantic_id_evaluation.py" and "sid_evaluation.py"?
- I would recommend improving the naming. For instance, can we say that semantic_id_evaluation.py implements a NextItemEvaluation for Semantic-ID based recommenders? If yes we can name it explicitly
- Add more documentation explain why and when to use this eval over the base NextItem evaluation
- Are there any references in the literature supporting this method? If yes, we can point to them
- Is this method dedicated to SIDs based models are can be used to evaluate list of models including both SID-based (e.g., Tiger) and non-SIDs-based (e.g., Sasrec) models?
- Also: semantic_id_evaluation can be confusing, what we are evaluating here is recommendation performance, not the quality of semantic IDs.
There was a problem hiding this comment.
- Add more docs with a concrete example to explain what code inside this scripts allows to do.
- /eval_methods may not be the right path for this script. Consider moving it to utils.
|
@saghiles Thanks for the suggestions. I’ve consolidated the implementation into:
The documentation now distinguishes two ways to convert SID predictions into item-level results:
|
Hi @hieuddo , thank you so much for the clarification. to follow up,
|
@saghiles, your design actually makes more sense. I tried to take on too big a scope for this PR. Let me reduce this PR to SID-level vs. item-level evaluation metrics for I'm thinking we can extend some flag for I'll skip the item resolvers for now and think it through first. |
|
I largely agree with @saghiles on trying to enable these SID models to work with
class SemanticIDMixin:
def semantic_id_catalog(self):
raise NotImplementedError
def predict_semantic_ids(self, history_items, **context):
raise NotImplementedError
class TIGER(NextItemRecommender, SemanticIDMixin):
...
There will be other details to get right, but I hope we can align on the above to more forward. |
@qtuantruong Thanks for the feedback. The updated implementation is ready for another review. I updated #728 (comment) to reflect the revised implementation. Could you take another look and see whether the changes address your earlier concerns? |
|
With SASRec + TIGER
SASRec alone
TIGER alone
|
| # limitations under the License. | ||
| # ============================================================================ | ||
|
|
||
| """Backend-free ordinary item, SID and CCE evaluation in one Experiment.""" |
why all metrics are 0.25? isn't that suspicious? |
@qtuantruong Thanks for the feedback. I removed the redundant examples. The previous table used synthetic data with only a few users/items/interactions. I ran LETTER on a small Beauty subset (100 items), with 5 epochs (each, for tokenizer and recommender model):
The three views measure different things:
Consequently, ordinary Recall@5 (0.0208) and CCE-Recall@5 (0.0193) are close but need not match: one evaluates the concrete ordering, while the other evaluates the uniform-order expectation. I suppose for bigger data and more test samples, CCE and ordinary item score would come closer |
Semantic ID predictions can match the target ID while failing to identify the target item when IDs collide. This change adds optional SID and Collision-Corrected Evaluation (CCE) views to
NextItemEvaluationwhile preserving ordinary item metrics, so Semantic ID and ordinary next-item models can share an experiment.semantic_id_metrics=Falseby default; SID examples explicitly enable it. Supported finite-K Recall/NDCG metrics additionally produce labeledSID-*andCCE-*results.SemanticIDMixinand adapt TIGER, LETTER, RPG and DiffGRM to return item rankings and raw SID predictions from one inference. Item resolution stays inside each model.N/Afor unavailable views.