Offline RL: ResAct: Reinforcing Long-term Engagement in Sequential Recommendation ....

ICLR 2023
paper

Intro

文章研究顺序推荐系统中的强化学习问题,提出无需在线交互的离线方法ResAct。ResAct的工作流程包括三个阶段:重建、预测和选择。在重建阶段,通过监督学习重建在线服务策略。在预测阶段,对于每个重建的行为估计器,ResAct预测残差并将其应用到重建的行为上。在选择阶段,从所有改进的行为中选择最佳行为作为最终输出。

此外,ResAct还设计了两个信息论正则化器来提高状态表示的特征表达性和简洁性,以确保学习到的特征既包含关于长期参与度的充分信息,又能过滤掉冗余信息。

Method

在这里插入图片描述
在线行为重构:ResAct采用条件VAE对行为进行预测
L θ e , θ d R e c = E s , a o n , c [ ( D ( a ∣ s , c ; θ d ) − a o n ) 2 + K L ( C ( s , a o n ; θ e ) ∣ ∣ N ( 0 , 1 ) ) ] L_{\theta_e,\theta_d}^{Rec}=\mathbb{E}_{s,a_{on},c}\left[(D(a|s,c;\theta_d)-a_{on})^2+KL(\mathcal{C}(s,a_{on};\theta_e)||\mathcal{N}(0,1))\right] Lθe,θdRec=Es,aon,c[(D(as,c;θd)aon)2+KL(C(s,aon;θe)∣∣N(0,1))]
其中 C \mathcal{C} C为Encoder得到的latent vector,

预测行为残差:由图可知,中间结构预测残差项,与重构的行为 a ~ o n \tilde{a}_{on} a~on相加得到最终策略: a ~ i = a ~ o n i + Δ ( s , a ~ o n i ) \tilde{a}^{i}=\tilde{a}_{on}^{i}+\Delta(s,\tilde{a}_{on}^{i}) a~i=a~oni+Δ(s,a~oni)。对high-level的request编码得到 z h z_h zh以及low-level的session编码得到 z l z_l zl,二者concat后联合 a ~ o n \tilde{a}_{on} a~on,输入到: f ( Δ ∣ s , a ~ o n ; θ f ) , θ f = { θ h , θ l , θ a } f(\Delta|s,\tilde{a}_{on};\theta_{f}), \theta_{f}=\{\theta_{h},\theta_{l},\theta_{a}\} f(Δ∣s,a~on;θf),θf={θh,θl,θa}到得到残差项。
z h = f h ( s h ; θ h ) , z l = f l ( s l ; θ l ) ; z = C o n c a t ( z h , z l ) ; Δ = f a ( z , a ; θ a ) z_h=f_h(s_h;\theta_h),z_l=f_l(s_l;\theta_l);z=Concat(z_h,z_l);\Delta=f_a(z,a;\theta_a) zh=fh(sh;θh),zl=fl(sl;θl);z=Concat(zh,zl);Δ=fa(z,a;θa)
最终策略可以表示为:
π ^ ( a ∣ s , c ) = D ( a ~ o n ∣ s , c ; θ d ) + f ( Δ ∣ s , a ~ o n ; θ f ) \hat{\pi}(a|s,c)=D(\tilde{a}_{on}|s,c;\theta_{d})+f(\Delta|s,\tilde{a}_{on};\theta_{f}) π^(as,c)=D(a~ons,c;θd)+f(Δ∣s,a~on;θf)
对于策略网络的参数则是采用DPG的RL进行优化:
∇ θ f J ( π ^ ) = E s , c [ ∇ a Q π ^ ( s , a ) ∣ a = π ^ ( a ∣ s , c ) ∇ θ f f ( Δ ∣ s , a ; θ f ) ∣ a = D ( a ∣ s , c ; θ d ) ] . ∇ θ d J ( π ^ ) = E s , c [ ∇ a Q π ^ ( s , a ) ∣ a = π ^ ( a ∣ s , c ) ∇ θ d D ( a ∣ s , c ; θ d ) ] . \begin{aligned}\nabla_{\theta_f}\mathcal{J}(\hat{\pi})&=\mathbb{E}_{s,c}\left[\nabla_aQ^{\hat{\pi}}(s,a)|_{a=\hat{\pi}(a|s,c)}\nabla_{\theta_f}f(\Delta|s,a;\theta_f)|_{a=D(a|s,c;\theta_d)}\right].\\\nabla_{\theta_d}\mathcal{J}(\hat{\pi})&=\mathbb{E}_{s,c}\left[\nabla_aQ^{\hat{\pi}}(s,a)|_{a=\hat{\pi}(a|s,c)}\nabla_{\theta_d}D(a|s,c;\theta_d)\right].\end{aligned} θfJ(π^)θdJ(π^)=Es,c[aQπ^(s,a)a=π^(as,c)θff(Δ∣s,a;θf)a=D(as,c;θd)].=Es,c[aQπ^(s,a)a=π^(as,c)θdD(as,c;θd)].
价值函数则是采用TD3,最小化均方bellman损失函数优化:
L θ q j T D = E ( s t , a t , r t , s t + 1 ) [ ( Q j ( s t , a t ; θ q j ) − y ) 2 ] , j = { 1 , 2 } ; y = r t + γ min ⁡ [ Q 1 ′ ( s t + 1 , π ^ ′ ( a t + 1 ∣ s t + 1 ) ; θ q 1 ′ ) , Q 2 ′ ( s t + 1 , π ^ ′ ( a t + 1 ∣ s t + 1 ) ; θ q 2 ′ ) ] \begin{aligned}L_{\theta_{qj}}^{TD}&=\mathbb{E}_{(s_t,a_t,r_t,s_{t+1})}\left[(Q_j(s_t,a_t;\theta_{qj})-y)^2\right],j=\{1,2\};\\y&=r_t+\gamma\min\left[Q_1^{'}(s_{t+1},\hat{\pi}^{'}(a_{t+1}|s_{t+1});\theta_{q_1}^{'}),Q_2^{'}(s_{t+1},\hat{\pi}^{'}(a_{t+1}|s_{t+1});\theta_{q_2}^{'})\right]\end{aligned} LθqjTDy=E(st,at,rt,st+1)[(Qj(st,at;θqj)y)2],j={1,2};=rt+γmin[Q1(st+1,π^(at+1st+1);θq1),Q2(st+1,π^(at+1st+1);θq2)]

通过梯度上升对 θ f \theta_f θf进行更新:
θ f ← θ f + ∇ θ f J ( π ^ ) , θ f = { θ h , θ l , θ a } \theta_f\leftarrow\theta_f+\nabla_{\theta_f}\mathcal{J}(\hat{\pi}),\theta_f=\{\theta_h,\theta_l,\theta_a\} θfθf+θfJ(π^),θf={θh,θl,θa}
对于 θ d \theta_d θd则需要再次使用 L θ e , θ d R e c L_{\theta_e,\theta_d}^{Rec} Lθe,θdRec:
θ d ← θ d + ∇ θ d J ( π ^ ) − ∇ θ d L θ e , θ d R e c . \theta_d\leftarrow\theta_d+\nabla_{\theta_d}\mathcal{J}(\hat{\pi})-\nabla_{\theta_d}L_{\theta_e,\theta_d}^{Rec}. θdθd+θdJ(π^)θdLθe,θdRec.

除此外,为了实现更好的状态特征提取,ResAct额外对于High-level特征提取器基于信息论的角度提出两个正则化项。
Expressiveness:要求提取的特征包含尽可能多的关于长期参与奖励的信息,即最大化 z h z_h zh r ( s , a ) r(s,a) r(s,a)的互信息
I θ h ( z h ; r ) ≥ ∫ ∫ p θ h ( z h ) p ( r ∣ z h ) log ⁡ o ( r ∣ z h ; θ o ) p ( r ) d z h d r ; = ∫ ∫ p θ h ( z h ) p ( r ∣ z h ) log ⁡ o ( r ∣ z h ; θ o ) d z h d r + H ( r ) , \begin{aligned} I_{\theta_{h}}(z_{h};r)& \geq\int\int p_{\theta_h}(z_h)p(r|z_h)\operatorname{log}\frac{o(r|z_h;\theta_o)}{p\left(r\right)}\mathrm{d}z_h\mathrm{d}r; \\ &=\int\int p_{\theta_h}(z_h)p(r|z_h)\log o(r|z_h;\theta_o)\mathrm{d}z_h\mathrm{d}r+H(r), \end{aligned} Iθh(zh;r)∫∫pθh(zh)p(rzh)logp(r)o(rzh;θo)dzhdr;=∫∫pθh(zh)p(rzh)logo(rzh;θo)dzhdr+H(r),
其中 H ( r ) = − ∫ p ( r ) log ⁡ p ( r ) d r H(r)=-\int p(r)\operatorname{log}p(r)\mathrm{d}r H(r)=p(r)logp(r)dr。因此,原问题转化为最小化
L θ h , θ o E x p = E s , z h ∼ p θ h ( z h ∣ s h ) [ H ( p ( r ∣ s ) ∣ ∣ o ( r ∣ z h ; θ o ) ) ] , L_{\theta_h,\theta_o}^{Exp}=\mathbb{E}_{s,z_h\sim p_{\theta_h}(z_h|s_h)}\left[\mathcal{H}(p(r|s)||o(r|z_h;\theta_o))\right], Lθh,θoExp=Es,zhpθh(zhsh)[H(p(rs)∣∣o(rzh;θo))],

Conciseness:希望 z h z_h zh足够简洁,可以从 s h s_h sh中过滤掉冗余信息…该目标表示为最小化互信息 I θ h ( z h ; s h ) = ∫ ∫ p ( s h ) p θ h ( z h ∣ s h ) log ⁡ p θ h ( z h ∣ s h ) p θ h ( z h ) d s h d z h I_{\theta_h}(z_h;s_h)=\int\int p(s_h)p_{\theta_h}(z_h|s_h)\log\frac{p_{\theta_h}(z_h|s_h)}{p_{\theta_h}(z_h)}\mathrm{d}s_h\mathrm{d}z_h Iθh(zh;sh)=∫∫p(sh)pθh(zhsh)logpθh(zh)pθh(zhsh)dshdzh, 由于 p θ h ( z h ) p_{\theta_{h}}(z_{h}) pθh(zh)无法计算,因此选择标准正态分布作为其变分近似, 则该互信息存在上界:
I θ h ( z h ; s h ) ≤ ∫ ∫ p ( s h ) p θ h ( z h ∣ s h ) log ⁡ p θ h ( z h ∣ s h ) m ( z h ) d s h d z h . I_{\theta_h}(z_h;s_h)\leq\int\int p(s_h)p_{\theta_h}(z_h|s_h)\log\frac{p_{\theta_h}(z_h|s_h)}{m(z_h)}\mathrm{d}s_h\mathrm{d}z_h. Iθh(zh;sh)∫∫p(sh)pθh(zhsh)logm(zh)pθh(zhsh)dshdzh.
最小化该上界:
L θ h C o n = ∫ p ( s h ) [ ∫ p θ h ( z h ∣ s h ) log ⁡ p θ h ( z h ∣ s h ) m ( z h ) d z h ] d s h ; = E s [ K L ( p θ h ( z h ∣ s h ) ∣ ∣ m ( z h ) ) ] . \begin{aligned} L_{\theta_{h}}^{Con}& =\int p(s_{h})\left[\int p_{\theta_{h}}(z_{h}|s_{h})\log\frac{p_{\theta_{h}}(z_{h}|s_{h})}{m(z_{h})}\mathrm{d}z_{h}\right]\mathrm{d}s_{h}; \\ &=\mathbb{E}_s\left[KL(p_{\theta_h}(z_h|s_h)||m(z_h))\right]. \end{aligned} LθhCon=p(sh)[pθh(zhsh)logm(zh)pθh(zhsh)dzh]dsh;=Es[KL(pθh(zhsh)∣∣m(zh))].

伪代码

在这里插入图片描述而在执行策略时,通过采样的方法近似 π ^ ( a ∣ s ) \hat{\pi}(a|s) π^(as)
π ^ ( a ∣ s ) = π ^ ( a ∣ s , c ∗ ) ; c ∗ = arg ⁡ max ⁡ c Q 1 ( s , π ^ ( a ∣ s , c ) ; θ q 1 ) , c ∈ { c i ∼ N ( 0 , 1 ) } i = 0 n \begin{gathered}\hat{\pi}(a|s)=\hat{\pi}(a|s,c^*);\\c^*=\arg\max_cQ_1(s,\hat{\pi}(a|s,c);\theta_{q_1}),c\in\{c^i\sim\mathcal{N}(0,1)\}_{i=0}^n\end{gathered} π^(as)=π^(as,c);c=argcmaxQ1(s,π^(as,c);θq1),c{ciN(0,1)}i=0n
在这里插入图片描述

  • 11
    点赞
  • 28
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值