Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Turning Dross Into Gold Loss: is BERT4Rec really better than SASRec?

About

Recently sequential recommendations and next-item prediction task has become increasingly popular in the field of recommender systems. Currently, two state-of-the-art baselines are Transformer-based models SASRec and BERT4Rec. Over the past few years, there have been quite a few publications comparing these two algorithms and proposing new state-of-the-art models. In most of the publications, BERT4Rec achieves better performance than SASRec. But BERT4Rec uses cross-entropy over softmax for all items, while SASRec uses negative sampling and calculates binary cross-entropy loss for one positive and one negative item. In our work, we show that if both models are trained with the same loss, which is used by BERT4Rec, then SASRec will significantly outperform BERT4Rec both in terms of quality and training speed. In addition, we show that SASRec could be effectively trained with negative sampling and still outperform BERT4Rec, but the number of negative examples should be much larger than one.

Anton Klenitskiy, Alexey Vasilev• 2023

Related benchmarks

TaskDatasetResultRank
Sequential RecommendationBooks Amazon (test)
HR@2000.14
20
Sequential RecommendationYelp (test)
H@104.66
19
Sequential RecommendationAmazon Reviews Toys (test)
HR@10.0334
11
Sequential RecommendationAmazon Reviews Sports (test)
HR@10.0156
11
Sequential RecommendationAmazon Reviews Beauty (test)
HR@12.93
11
Sequential RecommendationOnline Retail (test)
HR@11.28
11
Sequential RecommendationML 1M (full-shuffle)
HR@100.2853
5
Sequential RecommendationML 20M (full-shuffle)
HR@1029.06
5
Sequential RecommendationAmazon Books (full-shuffle)
HR@100.0292
3
Sequential RecommendationML 1M (test)
HR@1028.53
3
Showing 10 of 11 rows

Other info

Follow for update