Fi-GNN: Modeling Feature Interactions via Graph Neural Networks for CTR Prediction

发布时间 2023-10-12 17:03:25作者: 馒头and花卷

Li Z., Cui Z., Wu S., Zhang X. and Wang L. Fi-GNN: Modeling feature interactions via graph neural networks for ctr prediction. CIKM, 2019.

"图网络"用在精排阶段 (算哪门子图网络啊).

Fi-GNN

  • 一个 item 可能有多种 field, 比如:

    \[\underbrace{[1, 0, \ldots, 0]}_{Language}, \underbrace{[0, 1, \ldots, 0]}_{Genre}, \underbrace{[0, 1, \ldots, 0]}_{Director}, \underbrace{[0, 1, \ldots, 0]}_{Starring}, \]

    这里我们用 one-hot 向量来表示具体的 item 对应的属性.

  • 假设总共有 m fields, 通过 embedding layer 可以得到:

    \[\mathbf{E} = [\mathbf{e}_1, \mathbf{e}_2, \mathbf{e}_3, \ldots, \mathbf{e}_m] \in \mathbb{R}^{m \times d}. \]

  • 对于 \(\mathbf{E}\), Fi-GNN 首先通过多头自注意力层得到 \(\mathbf{H}^1 = [\mathbf{h}_1^1, \mathbf{h}_2^1, \ldots, \mathbf{h}_m^1]\), 它作者后续的图网络的初始 embedding.

  • 这里, Fi-GNN 将每个域看成图的一个结点, 故该图总过有 \(m\) 个结点, 它的状态更新方式如下:

    \[\mathbf{h}_i^t = GRU(\mathbf{h}_i^{t-1}, \mathbf{a}_i^t), \\ \mathbf{a}_i^t = \sum_{n_j \rightarrow n_i} \mathbf{A}_{ji} \mathbf{W}_{out}^j \mathbf{W}_{in}^i \mathbf{h}_j^{t-1} + \mathbf{b}_{p}. \]

    其中 \(\mathbf{A} \in \mathbb{R}^{m \times m}\) 为图上的邻接矩阵, 它是通过 attenton 学习得到的:

    \[\mathbf{A}_{ij} = \frac{\exp(\text{LeakyReLU}(\mathbf{W}_w[\mathbf{e}_i \| \mathbf{e}_j])}{\sum_k \text{LeakyReLU}(\mathbf{W}_w[\mathbf{e}_i \| \mathbf{e}_k])}, j \not = i, \quad \mathbf{A}_{ii} = 0. \]

  • 经过T轮的"图"的更新之后,我们得到:

    \[\mathbf{H}^T = [\mathbf{h}_1^T, \mathbf{h}_2^T, \ldots, \mathbf{h}_m^T], \]

    在此基础上, 通过如下方式计算最后的预测 (二元):

    \[\hat{y} = \sum_{i=1}^m a_i \hat{y}_i, \\ \hat{y}_i = MLP_1(\mathbf{h}_i^p), \\ a_i = MLP_2 (\mathbf{h}_i^p). \]

代码

[official]