begin{array}{l}
z_i=phi(x_i)=x_iW^{phi} b^{phi}\
q_{i}=psileft(a_{i}, c_{i}right)=operatorname{concat}_{c o l}left(a_{i}, c_{i}right) W^{psi} b^{psi}, W^{psi} in mathbb{R}^{(j l) times g}, b^{psi} in mathbb{R}^{g}\
e_{i}=omegaleft(z_{i}, q_{i}right)=text { concat }_{c o l}left(z_{i}, q_{i}right) W^{omega} b^{omega}, W^{omega} in mathbb{R}^{(g d) times d}, b^{omega} in mathbb{R}^{d}
end{array}
3.2 自注意力块
用户画像中的用户交互序列embedding为
E^P={e_1^P,...,e_{|P_t^u|}^P}
,目标商品embedding为
E^O={e_1^O,...,e_{|O_{t 1}|}^O}
。
3.2.1 用户画像级别的自注意力
为了提取用户画像级的特征,将
E^P
输入到一系列多头自注意力块中。首先是输入到自注意力块的第一部分,公式如下,
operatorname{Attention}(mathbf{Q}, mathbf{K}, mathbf{V})=operatorname{softmax}left(frac{mathbf{Q K ^ { T }}}{sqrt{frac{d}{H}}}right) mathbf{V}
begin{aligned}
S^{P} &=mathrm{SA}left(mathbf{E}^{P}right) \
&=text { concat }_{c o l}left(operatorname{Attention}left(mathbf{E}^{P} mathbf{W}_{h}^{Q}, mathbf{E}^{P} mathbf{W}_{h}^{K}, mathbf{E}^{P} mathbf{W}_{h}^{V}right)right)_{h=1: H}
end{aligned}