DIEN

亮点

    1. 引入辅助 Loss:利用 GRU 的 hidden state 与下一个点击的商品做一个
    1. 一般模型把用户行为直接当成兴趣,dien 认为用户兴趣是隐藏在行为中,需要去挖掘

image.png

  • feature 分成四类:User Profile, User Behavior, Ad and Context

  • [[interest extractor layer]] 作用 :-> 兴趣抽取层,用 GRU 抽取序列信息

  • [[interest evolving layer]] 作用 :-> 兴趣进化层,将Target Attention引入GRU,过滤掉与待排序的广告不相关的信息。

  • [[AUGRU]] 计算方法 #card

    • 这里是先用序列中Item的隐状态和待排序的广告Embedding计算一个Attention标量,再将该标量乘以更新门控向量。

    • 最终隐藏状态和候选状态,以及每一个维度的重要性,由当前Item隐状态,待排序广告,前一Item隐状态,当前Item原特征(后两者用于计算更新门)共同决定。

源码阅读

  • train.py 指定模型

  • model 中包含对模型的实现

  • 数据

    • uid_voc.pkl: 用户名对应的id

    • mid_voc.pkl: item对应的id

    • cat_voc.pkl:category对应的id

    • item-info:item对应的category信息

    • reviews-info:用于进行负采样的数据

    • local_train_splitByUser:训练数据,一行格式为:label、用户名、目标item、 目标item类别、历史item、历史item对应类别。

    • local_test_splitByUser:测试数据,格式同训练数据

  • 网络设置

    • embeeding 18

    • hidden size 18*2

    • attention_size 18*2

    • fcn: 200-80-2

    • dice

    • prelu

  • 需要分析代码:

    • aux 网络

    • gru 改造

    • din_fcn_attention

[[Ref]]


DIN

[[Attachments]]

Embedding & MLP 模型

  • embedding layer (for learning the dense representation of sparse features)

  • MLP (for learning the combination relations of features automatically).

Feature Representation

  • 所使用的特征如下图,没有使用组合特征,所以避免了特征工程。

  • multi-hot 经过 embedding 层组成一个 embedding list,然后通过 pooling 层(sum pooling or average pooling)变成固定长度的向量。

损失函数:$$L=-\frac{1}{N} \sum_{(x, y) \in S}(y \log p(x)+(1-y) \log (1-p(x)))$$

Deep Interest NetWork

  • base model 中所有的历史行为最后通过 sum pooling 得到固定长度的向量,没有考虑 和候选商品的关系 。固定长度的向量表达能力有限。

  • 用户特征的特点:diverse and locally activated

  • User Behaviors 通过 SUM Pooling 转化成为定长的向量。

  • 考虑到用户兴趣不是 严格时间关系 ,所以 User Behaviors 没有考虑序列关系。

  • 通过 local acvtivation unit 学习用户历史行为和候选广告的权重 [[target attention]]

    • vU(A)=f(vA,e1,e2,,eH)=j=1Ha(ej,vA)ej=j=1Hwjejv_{U}(A)=f\left(\boldsymbol{v}_{A}, \boldsymbol{e}_{1}, \boldsymbol{e}_{2}, \ldots, \boldsymbol{e}_{H}\right)=\sum_{j=1}^{H} a\left(\boldsymbol{e}_{j}, \boldsymbol{v}_{A}\right) e_{j}=\sum_{j=1}^{H} w_{j} \boldsymbol{e}_{j}

      • 历史行为和候选广告做叉乘反映两者的 相关性 ,早期版本使用 embedding 差。
      • 和传统的 attention 相比,没有使用 softmax 去进行归一化,用来表达用户信息的强烈程度? #card
        • 赋予和候选广告相关的历史兴趣更高的weight
  • 商品特征包括 goods_id shop_id cate_id(分类)

  • 网络结构 #card
    image.png
    [[mini-batch aware regularization]]

[[data adaptive activation function]]

Attention 权重可视化 #card
image.png

[[Group AUC]]

问题

  • DIN 模型提出的动机是什么?是否适合自己公司当前的场景和数据特点?#card

  • DIN 模型的模型结构是什么?具体实现起来有那些工程上的难点?#card

    • 用户对应行为序列的获取
  • DIN 模型强调的注意力机制是什么?#card

    • 候选商品和用户行为序列的关系
  • [[为什么在推荐系统中引入注意力机制能够有效果上的提升?]]#card

    • 动态权重分配,替代平均池化。长短期分配

    • 引入行为序列表达用户兴趣

    • 可解释性与鲁棒性

  • DIN 模型将用户和商品进行了 Embedding,在实际使用中,应该如何实现 Embedding 过程?#card

  • 与DIN类似的模型有哪些,是否适合当前的使用场景。#card
    [[Ref]]

  • 详解 Deep Interest Network: 为阿里创造更多广告收入 - 知乎

  • 推荐系统中的注意力机制——阿里深度兴趣网络(DIN) - 知乎


@FiBiNET: Combining Feature Importance and Bilinear feature Interaction for Click-Through Rate Prediction

[[Abstract]]

  • Advertising and feed ranking are essential to many Internet companies such as Facebook and Sina Weibo. Among many real-world advertising and feed ranking systems, click through rate (CTR) prediction plays a central role. There are many proposed models in this field such as logistic regression, tree based models, factorization machine based models and deep learning based CTR models. However, many current works calculate the feature interactions in a simple way such as Hadamard product and inner product and they care less about the importance of features. In this paper, a new model named FiBiNET as an abbreviation for Feature Importance and Bilinear feature Interaction NETwork is proposed to dynamically learn the feature importance and fine-grained feature interactions. On the one hand, the FiBiNET can dynamically learn the importance of features via the Squeeze-Excitation network (SENET) mechanism; on the other hand, it is able to effectively learn the feature interactions via bilinear function. We conduct extensive experiments on two realworld datasets and show that our shallow model outperforms other shallow models such as factorization machine(FM) and field-aware factorization machine(FFM). In order to improve performance further, we combine a classical deep neural network(DNN) component with the shallow model to be a deep model. The deep FiBiNET consistently outperforms the other state-of-the-art deep models such as DeepFM and extreme deep factorization machine(XdeepFM).

[[Attachments]]

创新点 #card

  • 使用 SENET 层对 embedding 进行加权

  • 使用 Bilinear-Interaction Layer 进行特征交叉

背景

  • importance of features and feature interactions
    网络结构 #card
    image.png

[[SENET]] Squeeze-and-Excitation network 特征加权方法

  • Squeeze f*k 压缩成 f*1
  • Excitation 然后通过两层 dnn 变成得到权重 f*1
  • Re-Weight 将结果和原始 f*k 相乘。
  • 原理是想通过控制scale的大小,把重要的特征增强,不重要的特征减弱,从而让提取的特征指向性更强。
    [[Bilinear-Interaction Layer]] :-> 结合Inner Product和Hadamard Product方式,并引入额外参数矩阵W,学习特征交叉。
  • 不同特征之间交叉 v_i * W * v_j 时,权重矩阵来源
    • Field-All Type :-> 全体共享 W
      • 参数量 :-> feature * embedding + emb*emb
    • Field-Each Type :-> 每个 filed 一组 W
      • 参数量 :-> feature * embedding + feature*emb*emb
    • Filed-Interaction Type :-> 不同特征之间有一组 w
      • 参数量 :-> feature * embedding + feature*feature*emb*emb
  • Bilinear-Interaction Layer 对比 [[FFM]] 有效减少参数量
    • FM 参数量 :-> feature * embedding
    • FFM 参数量 :-> feature * filed * embedding
  • 不同特征交叉方式

image.png
occlusion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