Sequential recommendation aims to estimate the dynamic user preferences and sequential dependencies among historical user behaviors. Although Transformer-based models have proven to be effective for sequential recommendation, they suffer from the inference inefficiency problem stemming from the quadratic computational complexity of attention operators, especially for long behavior sequences. Inspired by the recent success of state space models (SSMs), we propose Mamba4Rec, which is the first work to explore the potential of selective SSMs for efficient sequential recommendation. Built upon the basic Mamba block which is a selective SSM with an efficient hardware-aware parallel algorithm, we design a series of sequential modeling techniques to further promote model performance while maintaining inference efficiency. Through experiments on public datasets, we demonstrate how Mamba4Rec effectively tackles the effectiveness-efficiency dilemma, outperforming both RNN- and attention-based baselines in terms of both effectiveness and efficiency. The code is available at https://github.com/chengkai-liu/Mamba4Rec.
翻译:序列推荐旨在估计动态用户偏好及历史用户行为间的序列依赖关系。尽管基于Transformer的模型在序列推荐中已被证明有效,但其注意力算子的二次计算复杂度导致推理效率低下,尤其对于长行为序列。受近期状态空间模型(SSMs)成功的启发,我们提出Mamba4Rec,这是首个探索选择性SSMs在高效序列推荐中潜力的工作。基于具有高效硬件感知并行算法的选择性SSM基础模块——Mamba块,我们设计了一系列序列建模技术,在保持推理效率的同时进一步提升模型性能。通过在公开数据集上的实验,我们证明了Mamba4Rec如何有效解决效果与效率的权衡问题,在效果和效率两方面均优于基于RNN和注意力的基线方法。代码发布于https://github.com/chengkai-liu/Mamba4Rec。