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

EulerFormer:使用复向量注意力进行序列用户行为建模

EulerFormer: Sequential User Behavior Modeling with Complex Vector Attention

Renmin University of China(中国人民大学);Huawei(华为);Gaoling School for Artificial Intelligence(高瓴人工智能学院)

Zhen Tian, Wayne Xin Zhao, Changwang Zhang, Xin Zhao, Zhongrui Ma, Ji-Rong Wen

AI总结:

本文提出 EulerFormer,通过欧拉公式将 token 转为极坐标复向量,并以差分旋转机制统一建模语义与位置差异,辅以相位对比学习,在四个公开数据集上验证了效果与效率。

摘要:

为了捕捉用户偏好,transformer 模型已被广泛用于对序列用户行为数据进行建模。transformer 架构的核心在于自注意力机制,该机制计算序列中成对的注意力分数。由于其具有排列等变性质,位置编码被用于增强 token 表示之间的注意力。在这种设定下,成对注意力分数既可以由语义差异推导,也可以由位置差异推导。然而,以往研究通常以不同方式对这两种差异度量进行建模,这可能限制序列建模的表达能力。为解决该问题,本文提出一种具有复向量注意力的新型 transformer 变体,名为 EulerFormer,它提供了一个统一理论框架来表述语义差异和位置差异。EulerFormer 包含两项关键技术改进。首先,它采用一种新的变换函数,利用欧拉公式将序列 token 高效变换为极坐标形式的复向量,从而能够以复数旋转形式统一建模语义信息和位置信息。其次,它开发了一种差分旋转机制,其中语义旋转角度可由自适应函数控制,从而能够根据语义上下文自适应地融合语义信息与位置信息。此外,本文提出了一个相位对比学习任务,以改善 EulerFormer 中上下文表示的各向同性。我们的理论框架具有高度的完备性和通用性。它对语义变化更加鲁棒,并且原则上具有更优越的理论性质。在四个公开数据集上进行的大量实验证明了本文方法的有效性和效率。

英文摘要:

To capture user preference, transformer models have been widely applied to model sequential user behavior data. The core of transformer architecture lies in the self-attention mechanism, which computes the pairwise attention scores in a sequence. Due to the permutation-equivariant nature, positional encoding is used to enhance the attention between token representations. In this setting, the pairwise attention scores can be derived by both semantic difference and positional difference. However, prior studies often model the two kinds of difference measurements in different ways, which potentially limits the expressive capacity of sequence modeling. To address this issue, this paper proposes a novel transformer variant with complex vector attention, named EulerFormer, which provides a unified theoretical framework to formulate both semantic difference and positional difference. The EulerFormer involves two key technical improvements. First, it employs a new transformation function for efficiently transforming the sequence tokens into polar-form complex vectors using Euler's formula, enabling the unified modeling of both semantic and positional information in a complex rotation form.Secondly, it develops a differential rotation mechanism, where the semantic rotation angles can be controlled by an adaptation function, enabling the adaptive integration of the semantic and positional information according to the semantic contexts.Furthermore, a phase contrastive learning task is proposed to improve the isotropy of contextual representations in EulerFormer. Our theoretical framework possesses a high degree of completeness and generality. It is more robust to semantic variations and possesses moresuperior theoretical properties in principle. Extensive experiments conducted on four public datasets demonstrate the effectiveness and efficiency of our approach.

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

↑