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(a∣s,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})
π^(a∣s,c)=D(a~on∣s,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=π^(a∣s,c)∇θff(Δ∣s,a;θf)∣a=D(a∣s,c;θd)].=Es,c[∇aQπ^(s,a)∣a=π^(a∣s,c)∇θdD(a∣s,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+1∣st+1);θq1′),Q2′(st+1,π^′(at+1∣st+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(r∣zh)logp(r)o(r∣zh;θo)dzhdr;=∫∫pθh(zh)p(r∣zh)logo(r∣zh;θ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,zh∼pθh(zh∣sh)[H(p(r∣s)∣∣o(r∣zh;θ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(zh∣sh)logpθh(zh)pθh(zh∣sh)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(zh∣sh)logm(zh)pθh(zh∣sh)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(zh∣sh)logm(zh)pθh(zh∣sh)dzh]dsh;=Es[KL(pθh(zh∣sh)∣∣m(zh))].
伪代码
而在执行策略时,通过采样的方法近似
π
^
(
a
∣
s
)
\hat{\pi}(a|s)
π^(a∣s)
π
^
(
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}
π^(a∣s)=π^(a∣s,c∗);c∗=argcmaxQ1(s,π^(a∣s,c);θq1),c∈{ci∼N(0,1)}i=0n