MMR与CalibratedRec的再思考

最大边缘相关性(Maximum Marginal Relevance)

推荐场景下,MMR对物品重排的目标是找出与推荐目标相关性高,但与已选集合内物品的相似度低的物品,公式表达如下:

M M R ( Q , C , R ) = A r g M a x d i ∈ C / R [ λ S i m 1 ( Q , d i ) − ( 1 − λ ) m a x d j ∈ R S i m 2 ( d i , d j ) ] MMR(Q,C,R)=ArgMax_{d_i\in C/R}[\lambda Sim_1(Q,d_i) - (1-\lambda)max_{d_j\in R}Sim_2(d_i,d_j)] MMR(Q,C,R)=ArgMaxdiC/R[λSim1(Q,di)(1λ)maxdjRSim2(di,dj)]

其中Q表示推荐的目标(一般为用户), d i d_i di表示物品,C表示物品候选集合,R表示推荐集合。

重排序过程如下:

  1. R = ∅ , D r = I R ( Q , C , K ) R=\emptyset, D_r=IR(Q,C,K) R=,Dr=IR(Q,C,K)
  2. Do d i = M M R ( Q , D r , R ) , R = R ∪ { d i } d_i=MMR(Q,D_r,R), R=R\cup \{d_i\} di=MMR(Q,Dr,R),R=R{di} Until D r = ∅ D_r= \emptyset Dr=

其中 D r D_r Dr表示已某种方式从集合C中生成的候选集合,并且 ∣ C ∣ = K |C|=K C=K.

Calibrated Recommendations 目标函数不满足单调递增的推导

Calibrated Recommendations论文提出重排目标中加入推荐列表物品分布与用户历史消费物品分布的相似度,并采用KL散度度量,公式表达如下:

I ∗ = A r g M a x I , ∣ I ∣ = N [ ( 1 − λ ) S ( I ) − λ C K L ( p , q ( I ) ) ] I^*=ArgMax_{I,|I|=N}[(1-\lambda)S(I) - \lambda C_{KL}(p, q(I))] I=ArgMaxI,I=N[(1λ)S(I)λCKL(p,q(I))]

其中 S ( I ) S(I) S(I)表示推荐结合 I I I的相关性得分, p p p表示用户历史消费物品分布, q ( I ) q(I) q(I)表示推荐集合的分布, C K L C_{KL} CKL为KL散度,离散变量的KL散度公式如下(这里暂不考虑连续变量,有关连续变量的公式略去):

C K L ( p , q ) = ∑ i p ( t i ) l o g ( p ( t i ) q ( t i ) ) , ∑ i p ( t i ) = 1 , 1 ≤ i ≤ n C_{KL}(p, q)=\sum_{i}p(t_i)log(\frac{p(t_i)}{q(t_i)}),\sum_ip(t_i)=1,1\le i\le n CKL(p,q)=ip(ti)log(q(ti)p(ti))ip(ti)=11in

其中 t 1 , . . . , t n t_1,...,t_n t1,...,tn表示变量的 n n n种取值,对应推荐集合中物品的n种类别。

原文中采用贪心算法求解最优集合 I ∗ I^* I,即:

d i + 1 ∗ = A r g M a x d i + 1 [ ( 1 − λ ) S ( I i ∗ ∪ { d i + 1 } ) − λ C K L ( p , q ( I i ∗ ∪ { d i + 1 } ) ) ] d_{i+1}^* = ArgMax_{d_{i+1}}[(1-\lambda)S(I_{i}^*\cup \{d_{i+1}\})-\lambda C_{KL}(p,q(I_i^*\cup \{d_{i+1}\}))] di+1=ArgMaxdi+1[(1λ)S(Ii{di+1})λCKL(p,q(Ii{di+1}))]

其中 I i ∗ I_i^* Ii表示长度为 i i i的最优推荐集合,在选择第 i + 1 i+1 i+1个物品 d i + 1 d_{i+1} di+1的时候,满足以上目标函数值的最大化。

原文中提出贪心算法求得的解的目标函数值满足单调递增特征,下面试推导一下:

首先约定 I n + 1 ∗ = I n ∗ ∪ { d n + 1 ∗ } , d n + 1 ∗ I^*_{n+1}=I^*_{n}\cup \{d^*_{n+1}\},d^*_{n+1} In+1=In{dn+1}dn+1表示第n+1次迭代贪心算法选择的最优物品,属于类型 t k t_k tk c n ( t i ) c_{n}(t_i) cn(ti)表示 t i t_i ti类型的物品在 I n ∗ I^*_{n} In中出现的次数,则

f ( I n + 1 ∗ ) − f ( I n ∗ ) = ( 1 − λ ) [ S ( I n + 1 ∗ ) − S ( I n ∗ ) ] − λ [ C K L ( p , q ( I n + 1 ∗ ) ) − C K L ( p , q ( I n ∗ ) ) ] f(I^*_{n+1})-f(I^*_{n})=(1-\lambda)[S(I^*_{n+1}) - S(I^*_{n})] - \lambda[C_{KL}(p,q(I^*_{n+1})) - C_{KL}(p,q(I^*_{n}))] f(In+1)f(In)=(1λ)[S(In+1)S(In)]λ[CKL(p,q(In+1))CKL(p,q(In))]

= ( 1 − λ ) S ( { d n + 1 ∗ } ) − λ [ ∑ i p ( t i ) l o g ( p ( t i ) q n + 1 ( t i ) ) − ∑ i p ( t i ) l o g ( p ( t i ) q n ( t i ) ) ] =(1-\lambda) S(\{d_{n+1}^*\}) - \lambda[\sum_ip(t_i)log(\frac{p(t_i)}{q_{n+1}(t_i)}) - \sum_ip(t_i)log(\frac{p(t_i)}{q_{n}(t_i)})] =(1λ)S({dn+1})λ[ip(ti)log(qn+1(ti)p(ti))ip(ti)log(qn(ti)p(ti))]

= ( 1 − λ ) S ( { d n + 1 ∗ } ) − λ ∑ i p ( t i ) l o g ( q n ( t i ) q n + 1 ( t i ) ) =(1-\lambda) S(\{d_{n+1}^*\}) - \lambda \sum_ip(t_i)log(\frac{q_n(t_i)}{q_{n+1}(t_i)}) =(1λ)S({dn+1})λip(ti)log(qn+1(ti)qn(ti))

= ( 1 − λ ) S ( { d n + 1 ∗ } ) + λ ∑ i p ( t i ) l o g ( q n + 1 ( t i ) q n ( t i ) ) =(1-\lambda) S(\{d_{n+1}^*\}) + \lambda \sum_ip(t_i)log(\frac{q_{n+1}(t_i)}{q_{n}(t_i)}) =(1λ)S({dn+1})+λip(ti)log(qn(ti)qn+1(ti))

= ( 1 − λ ) S ( { d n + 1 ∗ } ) + λ ∑ i p ( t i ) l o g ( c n + 1 ( t i ) / ( n + 1 ) c n ( t i ) / n ) =(1-\lambda) S(\{d_{n+1}^*\}) + \lambda \sum_ip(t_i)log(\frac{c_{n+1}(t_i)/(n+1)}{c_{n}(t_i)/n}) =(1λ)S({dn+1})+λip(ti)log(cn(ti)/ncn+1(ti)/(n+1))

= ( 1 − λ ) S ( { d n + 1 ∗ } ) + λ ∑ i p ( t i ) l o g ( c n + 1 ( t i ) c n ( t i ) ∗ n n + 1 ) =(1-\lambda) S(\{d_{n+1}^*\}) + \lambda \sum_ip(t_i)log(\frac{c_{n+1}(t_i)}{c_{n}(t_i)}*\frac{n}{n+1}) =(1λ)S({dn+1})+λip(ti)log(cn(ti)cn+1(ti)n+1n)

= ( 1 − λ ) S ( { d n + 1 ∗ } ) + λ ∑ i p ( t i ) l o g ( c n + 1 ( t i ) c n ( t i ) ) + λ ∑ i p ( t i ) l o g ( n n + 1 ) =(1-\lambda) S(\{d_{n+1}^*\}) + \lambda \sum_ip(t_i)log(\frac{c_{n+1}(t_i)}{c_{n}(t_i)}) +\lambda\sum_i p(t_i) log(\frac{n}{n+1}) =(1λ)S({dn+1})+λip(ti)log(cn(ti)cn+1(ti))+λip(ti)log(n+1n)

= ( 1 − λ ) S ( { d n + 1 ∗ } ) + λ ∑ i p ( t i ) l o g ( c n + 1 ( t i ) c n ( t i ) ) + λ l o g ( n n + 1 ) =(1-\lambda) S(\{d_{n+1}^*\}) + \lambda \sum_ip(t_i)log(\frac{c_{n+1}(t_i)}{c_{n}(t_i)}) +\lambda log(\frac{n}{n+1}) =(1λ)S({dn+1})+λip(ti)log(cn(ti)cn+1(ti))+λlog(n+1n)

= ( 1 − λ ) S ( { d n + 1 ∗ } ) + λ p ( t k ) l o g ( c n + 1 ( t k ) c n ( t k ) ) + λ l o g ( n n + 1 ) =(1-\lambda) S(\{d_{n+1}^*\}) + \lambda p(t_k)log(\frac{c_{n+1}(t_k)}{c_{n}(t_k)}) +\lambda log(\frac{n}{n+1}) =(1λ)S({dn+1})+λp(tk)log(cn(tk)cn+1(tk))+λlog(n+1n)

= ( 1 − λ ) S ( { d n + 1 ∗ } ) + λ p ( t k ) l o g ( c n ( t k ) + 1 c n ( t k ) ) + λ l o g ( n n + 1 ) =(1-\lambda) S(\{d_{n+1}^*\}) + \lambda p(t_k)log(\frac{c_{n}(t_k) + 1}{c_{n}(t_k)}) +\lambda log(\frac{n}{n+1}) =(1λ)S({dn+1})+λp(tk)log(cn(tk)cn(tk)+1)+λlog(n+1n)

可以看出,上式中的第一项为非负数,第二项为正数,但第三项为负数,因此整体取值可能为负数,由此得出原文中关于单调单调递增的论述实际是不满足的。

你可能感兴趣的:(MMR与CalibratedRec的再思考)