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获取。