
上一篇中,我们介绍了样本感知的FM模型,也就是IFM模型。而本文将介绍其改进版本,称为Dual Input-aware Factorization Machine(DIFM),一起来学习下。
1、背景
因子分解机(Factorization machine,FM)已经被成功地应用于各种推荐系统中。同时,许多的研究工作聚焦于从特征交互角度来提升FM模型的效果,如DeepFM将FM和DNN进行结合,建模特征之间的二阶和高阶交互,AFM通过引入attention思想,建模不同特征交互的重要性。
但是上述工作忽略了样本的独特性,举例来说,当样本是<青少年,女性,学生,喜欢粉色>,预测是否会点击<连衣裙>,此时女性这个特征会起到较为关键的作用;当样本是<青少年,女性,学生,喜欢蓝色>,预测是否会点击<笔记本>,此时女性这个特征就相对来说没有那么重要。因此,同一个特征在不同样本中应该被赋予不同的重要程度以更好地反映其具体贡献。
基于上述思路,上一篇文章我们介绍了样本感知的FM模型( Input-aware Factorization Ma- chine,IFM)来显式建模不同特征在不同样本的影响程度。下图是IFM的模型结构:

其中,FEN结构如下:

在IFM中,使用DNN结构来计算input-aware factors,这种方式是bit-wise level的,也就是说,特征的embedding的不同元素之间会相互影响;另一方面,在CTR预估领域,使用NN网络来学习input-aware factors是否是最有效的,这一点也有待商榷。
本文在IFM的基础上,在网络中加入了transformer,进一步在vector-wise level学习input-aware factors,提出了Dual Input-aware Factorization Machine (DIFM)。Dual这里我们翻译为双重,意思是既包括bit-wise的建模,又包括vector-wise的建模。接下来,一起来看一下DIFM网络结构。
2、DIFM模型
DIFM的结构如下图所示:

接下来,按照从下到上的顺序,依次介绍模型的几个部分:
2.1 Sparse Input and Embedding Layer
假设输入样本中有h个域,每个域中只有一位取值为1,其余取值为0,那么经过embeding层,共得到h个长度为k的embedding向量。将这些向量转置后横向拼接,得到Ex:

2.2 Dual-Factor Estimating Networks (Dual-FEN) Layer
这一层也是论文的主要创新点所在,其结构如下,主要包含vector-wise part和bit-wise part。
vector-vise part
vector-vise part主要借鉴transformer中encoder的block结构,其结构如下:

首先,针对embedding layer的输出Ex,首先reshape为h*k的矩阵:

随后,分别经过Multi-Head Self Attention和Residual Network得到两部分输出,同transformer的block结构,论文也加入了Residual Network部分来保存原始embedding向量的有效信息。具体地,Multi-Head Self Attention的计算过程如下:



而Residual Network的计算如下:

随后两部分进行对位相加,并经过激活函数激活,得到vector-wise part的输出,计作Ovec。
bit-wise part
bit-wise part同IFM,其结构如下,输入为Ex,经过多层全连接网络,输出计作Obit:

Combination Layer
这一层主要是将vector-wise part和bit-wise part的输出进行结合,但二者输出维度不相同,需要通过矩阵分别转化为长度为h的向量:

随后,二者进行对位相加:

Reweighting Layer
经过Combination Layer得到输出mx,就可以对样本每个特征的一次项权重和embedding向量进行refine,计算公式如下:

Prediction Layer
DIFM的预测公式如下所示:

同FM一样,DIFM在预测时,也可以对公式进行相应的化简,其结果如下:

3、实验结果
论文对比了DIFM和FM等bese模型在不同数据集上的表现,其结果如下:

同时,论文对比了不同的网络结构的效果:

好了,论文就介绍到这里,感兴趣的同学可以下载论文进行阅读哟~~
网友评论