Skip to content

Refactor SequentialRecommender and add Sequential models: SASRec, BERT4Rec, GPT2Rec, FPMC#694

Open
hieuddo wants to merge 10 commits into
PreferredAI:masterfrom
hieuddo:seq
Open

Refactor SequentialRecommender and add Sequential models: SASRec, BERT4Rec, GPT2Rec, FPMC#694
hieuddo wants to merge 10 commits into
PreferredAI:masterfrom
hieuddo:seq

Conversation

@hieuddo
Copy link
Copy Markdown
Member

@hieuddo hieuddo commented May 29, 2026

Description

  • Refactor NextItemRecommender to SequentialRecommender with two settings: session-based and session-aware.
  • Rename NextItemEvaluation to SequentialEvaluation
  • Add new sequential models: SASRec, BERT4Rec, GPT2Rec (similar to BERT4Rec, but with GPT2 architecture)
  • Refactor existing GRU4Rec compatible with session-aware setting

Quick run with 10 epochs from examples/sequential_diginetica.py:

Model AUC MRR NDCG@10 NDCG@50 Recall@10 Recall@50 Train (s) Test (s)
FPMC-sbr 0.7579 0.1254 0.1430 0.1686 0.2242 0.3398 2.8742 0.4422
GRU4Rec-sbr 0.8051 0.0611 0.0632 0.1035 0.1068 0.2907 6.0934 0.7539
SASRec-sbr 0.7902 0.3884 0.4216 0.4295 0.5289 0.5657 2.2551 1.4375
BERT4Rec-sbr 0.7880 0.3812 0.4140 0.4221 0.5201 0.5569 6.3330 1.4493
GPT2Rec-sbr 0.8111 0.3702 0.4021 0.4139 0.5096 0.5604 1.3811 1.4056
FPMC-sar 0.7480 0.1195 0.1341 0.1614 0.2067 0.3275 0.3568 0.3948
GRU4Rec-sar 0.8029 0.0754 0.0820 0.1146 0.1349 0.2837 3.4652 1.9199
SASRec-sar 0.7890 0.3891 0.4208 0.4297 0.5236 0.5639 1.6576 1.3925
BERT4Rec-sar 0.7910 0.3768 0.4080 0.4184 0.5114 0.5552 1.4889 1.3984
GPT2Rec-sar 0.8243 0.3790 0.4084 0.4217 0.5079 0.5674 1.3703 1.3644

Related Issues

Checklist:

  • I have added tests.
  • I have updated README.md (if you are adding a new model).
  • I have updated examples/README.md (if you are adding a new example).

Copilot AI review requested due to automatic review settings May 29, 2026 15:29
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@hieuddo hieuddo requested a review from lthoang May 29, 2026 15:57
@qtuantruong
Copy link
Copy Markdown
Member

holy moly, really long PR

@hieuddo
Copy link
Copy Markdown
Member Author

hieuddo commented May 30, 2026

holy moly, really long PR

Haha. Most of these are from https://github.com/PreferredAI/CoVE/tree/main/models in our joint work with @lthoang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants