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

一种用于序列推荐任务的高效注意力机制:HydraRec

An Efficient Attention Mechanism for Sequential Recommendation Tasks: HydraRec

Rensselaer Polytechnic Institute(伦斯勒理工学院)

Uzma Mushtaque

AI总结:

本文提出HydraRec,一种基于Hydra线性注意力的高效序列推荐模型,在保持时间上下文的同时降低注意力计算复杂度,并在下一物品预测任务中优于现有线性及点积注意力模型。

摘要:

基于Transformer的模型正越来越多地被应用于包括推荐系统(RS)在内的各个领域。诸如BERT之类的预训练Transformer模型已在语言建模中展现出良好性能。凭借更强的序列任务建模能力,仅编码器模型的变体(如BERT4Rec、SASRec等)在序列推荐系统问题中取得了成功。传统Transformer模型中计算点积注意力在序列长度上具有二次复杂度。这在推荐系统中是一个更严重的问题,因为与语言模型不同,新物品每天都会被添加到目录中。用户购买历史是一个依赖于多种因素的动态序列。近年来,各种线性注意力模型试图通过使模型在序列长度(token维度)上呈线性来解决这一问题。Hydra注意力正是为视觉Transformer提出的一种此类线性复杂度模型,它同时降低了关于token数量和模型嵌入维度的注意力复杂度。基于Hydra注意力的思想,我们提出了一种高效的基于Transformer的序列推荐系统(HydraRec),它在保持时间上下文的同时,显著改善了针对更长序列和更大数据集计算注意力的理论复杂度。我们进行了大量实验来评估其他基于线性Transformer的推荐系统模型,并在各种评估指标上与HydraRec进行比较。在用于序列推荐下一物品预测任务并采用因果掩码时,HydraRec优于其他基于线性注意力的模型以及基于点积注意力的模型。对于双向模型,其性能与BERT4Rec模型相当,同时运行时间有所改善。

英文摘要:

Transformer based models are increasingly being used in various domains including recommender systems (RS). Pretrained transformer models such as BERT have shown good performance at language modelling. With the greater ability to model sequential tasks, variants of Encoder-only models (like BERT4Rec, SASRec etc.) have found success in sequential RS problems. Computing dot-product attention in traditional transformer models has quadratic complexity in sequence length. This is a bigger problem with RS because unlike language models, new items are added to the catalogue every day. User buying history is a dynamic sequence which depends on multiple factors. Recently, various linear attention models have tried to solve this problem by making the model linear in sequence length (token dimensions). Hydra attention is one such linear complexity model proposed for vision transformers which reduces the complexity of attention for both the number of tokens as well as model embedding dimensions. Building on the idea of Hydra attention, we introduce an efficient Transformer based Sequential RS (HydraRec) which significantly improves theoretical complexity of computing attention for longer sequences and bigger datasets while preserving the temporal context. Extensive experiments are conducted to evaluate other linear transformer-based RS models and compared with HydraRec across various evaluation metrics. HydraRec outperforms other linear attention-based models as well as dot-product based attention models when used with causal masking for sequential recommendation next item prediction tasks. For bi-directional models its performance is comparable to the BERT4Rec model with an improvement in running time.

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

↑