Transformer-based sequential recommendation (SR) has been booming in recent years, with the self-attention mechanism as its key component. Self-attention has been widely believed to be able to effectively select those informative and relevant items from a sequence of interacted items for next-item prediction via learning larger attention weights for these items. However, this may not always be true in reality. Our empirical analysis of some representative Transformer-based SR models reveals that it is not uncommon for large attention weights to be assigned to less relevant items, which can result in inaccurate recommendations. Through further in-depth analysis, we find two factors that may contribute to such inaccurate assignment of attention weights: sub-optimal position encoding and noisy input. To this end, in this paper, we aim to address this significant yet challenging gap in existing works. To be specific, we propose a simple yet effective framework called Attention Calibration for Transformer-based Sequential Recommendation (AC-TSR). In AC-TSR, a novel spatial calibrator and adversarial calibrator are designed respectively to directly calibrates those incorrectly assigned attention weights. The former is devised to explicitly capture the spatial relationships (i.e., order and distance) among items for more precise calculation of attention weights. The latter aims to redistribute the attention weights based on each item's contribution to the next-item prediction. AC-TSR is readily adaptable and can be seamlessly integrated into various existing transformer-based SR models. Extensive experimental results on four benchmark real-world datasets demonstrate the superiority of our proposed ACTSR via significant recommendation performance enhancements. The source code is available at https://github.com/AIM-SE/AC-TSR.
翻译:基于Transformer的序列推荐(SR)近年来蓬勃发展,其中自注意力机制是其关键组成部分。人们普遍认为,自注意力能够通过学习对序列中交互项赋予更大的注意力权重,从而有效选择那些信息丰富且相关的项目,用于下一项预测。然而,在现实中这并不总是成立。我们对一些代表性基于Transformer的SR模型进行的实证分析揭示,较大的注意力权重被分配给相关性较低的项目的情况并不罕见,这可能导致不准确的推荐。通过进一步深入分析,我们发现了两个可能导致注意力权重分配不准确的因素:次优的位置编码和噪声输入。为此,本文致力于解决现有工作中这一重要但具有挑战性的空白。具体而言,我们提出一个简单而有效的框架,称为基于Transformer的序列推荐中的注意力校准(AC-TSR)。在AC-TSR中,分别设计了新颖的空间校准器和对抗校准器,直接校准那些被错误分配的注意力权重。前者旨在显式捕捉项目间的空间关系(即顺序和距离),以实现更精确的注意力权重计算;后者则根据每个项目对下一项预测的贡献重新分配注意力权重。AC-TSR易于适配,可无缝集成到各种现有的基于Transformer的SR模型中。在四个基准真实世界数据集上的大量实验结果表明,我们提出的AC-TSR通过显著的推荐性能提升展现了其优越性。源代码可在https://github.com/AIM-SE/AC-TSR获取。