arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2408.09992cs.IRcs.DS
收藏

基于子项ID的百万级物品序列推荐模型的高效推理

Efficient Inference of Sub-Item Id-based Sequential Recommendation Models with Millions of Items

Aleksandr V. Petrov, Craig Macdonald, Nicola Tonellotto

AI总结:

针对Transformer序列推荐模型在百万级物品场景下内存消耗高、推理慢的问题,本研究将PQTopK算法应用于RecJPQ增强的SASRec,在百万级Gowalla数据集上实现了推理速度的显著提升,为大规模生产环境部署扫清了障碍。

摘要:

基于Transformer的推荐系统(如BERT4Rec或SASRec)在序列推荐任务中取得了当前最优的结果。然而,在物品目录达数百万级的生产环境中部署这类模型极具挑战:将Transformer扩展到数千种物品以上时会出现诸多问题,包括模型内存消耗高、推理速度慢。在这一领域,RecJPQ是当前最优的降低模型内存消耗的方法;RecJPQ通过将物品ID分解为少量共享的子项ID来压缩物品目录。尽管已有研究报告称其内存消耗最多可降低50倍,但RecJPQ的原始论文并未提及相较于基线Transformer模型的推理效率提升。通过分析RecJPQ的打分算法,我们发现其效率受限的原因在于为每个物品使用分数累加器,这阻碍了并行计算。相比之下,LightRec(一种采用类似子ID思路的非序列方法)通过一种我们称之为PQTopK的算法实现了大幅推理效率提升。我们证明,使用PQTopK算法同样可以提升基于RecJPQ的模型的推理效率。具体而言,在包含超过百万级物品的大规模Gowalla数据集上,我们将经RecJPQ增强的SASRec的推理速度提升至原始SASRec推理方法的4.5倍,是RecJPQ代码中实现的方法的1.56倍。此外,通过模拟数据我们证实,PQTopK在物品目录多达数千万级时仍能保持高效,消除了Transformer模型在大规模物品目录生产环境中落地的最后障碍之一。

英文摘要:

Transformer-based recommender systems, such as BERT4Rec or SASRec, achieve state-of-the-art results in sequential recommendation. However, it is challenging to use these models in production environments with catalogues of millions of items: scaling Transformers beyond a few thousand items is problematic for several reasons, including high model memory consumption and slow inference. In this respect, RecJPQ is a state-of-the-art method of reducing the models' memory consumption; RecJPQ compresses item catalogues by decomposing item IDs into a small number of shared sub-item IDs. Despite reporting the reduction of memory consumption by a factor of up to 50x, the original RecJPQ paper did not report inference efficiency improvements over the baseline Transformer-based models. Upon analysing RecJPQ's scoring algorithm, we find that its efficiency is limited by its use of score accumulators for each item, which prevents parallelisation. In contrast, LightRec (a non-sequential method that uses a similar idea of sub-ids) reported large inference efficiency improvements using an algorithm we call PQTopK. We show that it is also possible to improve RecJPQ-based models' inference efficiency using the PQTopK algorithm. In particular, we speed up RecJPQ-enhanced SASRec by a factor of 4.5 x compared to the original SASRec's inference method and by a factor of 1.56 x compared to the method implemented in RecJPQ code on a large-scale Gowalla dataset with more than a million items. Further, using simulated data, we show that PQTopK remains efficient with catalogues of up to tens of millions of items, removing one of the last obstacles to using Transformer-based models in production environments with large catalogues.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑