Commit a8d70675 by xiaotong

wording (sec 13)

parent 6797dee8
...@@ -9,20 +9,20 @@ ...@@ -9,20 +9,20 @@
\tikzstyle{wode} = [inner sep=0pt,minimum width=2em,minimum height=2em,rounded corners=0pt] \tikzstyle{wode} = [inner sep=0pt,minimum width=2em,minimum height=2em,rounded corners=0pt]
\node [anchor=west,wode] (n1) at (0,0) {$y$}; \node [anchor=west,wode] (n1) at (0,0) {$y$};
\node [anchor=north west,wode] (n2) at ([xshift=3em,yshift=-2.0em]n1.south east) {$x$}; \node [anchor=north west,wode] (n2) at ([xshift=3em,yshift=-2.5em]n1.south east) {$x$};
\node [anchor=south west,rnnnode] (n3) at ([xshift=8em,yshift=0.5em]n2.north east) {生成模型$G$}; \node [anchor=south west,rnnnode] (n3) at ([xshift=8em,yshift=0.5em]n2.north east) {生成模型$G$};
\node [anchor=south east,wode] (n4) at ([xshift=-2em,yshift=0em]n3.north west) {$\tilde{y}$}; \node [anchor=south east,wode] (n4) at ([xshift=-2em,yshift=0em]n3.north west) {$\tilde{y}$};
\node [anchor=south,snode] (n5) at ([xshift=0em,yshift=6em]n2.north) {判别网络$D$}; \node [anchor=south,snode] (n5) at ([xshift=0em,yshift=6em]n2.north) {判别网络$D$};
\node [anchor=west,align=left,font=\small] (n6) at ([xshift=15em,yshift=-3em]n5.east) {根据$(\seq{x},\seq{\tilde{y}})$\\成奖励信号}; \node [anchor=west,align=left,font=\small] (n6) at ([xshift=15em,yshift=-3em]n5.east) {根据$(\seq{x},\seq{\tilde{y}})$\\成奖励信号};
\draw [->,thick] ([xshift=0em,yshift=0em]n1.north)--([xshift=-0.3em,yshift=-0.1em]n5.south); \draw [->,thick] ([xshift=0em,yshift=-0.3em]n1.north)--([xshift=-0.3em,yshift=-0.1em]n5.south);
\draw [->,thick] ([xshift=0em,yshift=0em]n2.north)--([xshift=0em,yshift=-0.1em]n5.south); \draw [->,thick] ([xshift=0em,yshift=0em]n2.north)--([xshift=0em,yshift=-0.1em]n5.south);
\draw [->,thick] ([xshift=0em,yshift=0em]n4.west)--([xshift=0.3em,yshift=-0.1em]n5.south); \draw [->,thick] ([xshift=0em,yshift=-0.5em]n4.north west)--([xshift=0.3em,yshift=-0.1em]n5.south);
\draw [->,thick] ([xshift=0em,yshift=0em]n3.north)--([xshift=0em,yshift=1em]n3.north)--([xshift=0em,yshift=0em]n4.east); \draw [->,thick] ([xshift=0em,yshift=0em]n3.north)--([xshift=0em,yshift=1em]n3.north)--([xshift=0em,yshift=0em]n4.east);
\draw [->,thick] ([xshift=0em,yshift=0em]n5.east) -- ([xshift=13.3em,yshift=0em]n5.east) -- ([xshift=1em,yshift=0em]n3.east) -- ([xshift=0em,yshift=0em]n3.east); \draw [->,thick] ([xshift=0em,yshift=0em]n5.east) -- ([xshift=12.9em,yshift=0em]n5.east) -- ([xshift=1em,yshift=0em]n3.east) -- ([xshift=0em,yshift=0em]n3.east);
\draw [->,thick] ([xshift=0em,yshift=0em]n2.east) -- ([xshift=0em,yshift=-1.5em]n3.south) -- ([xshift=0em,yshift=0em]n3.south); \draw [->,thick] ([xshift=0em,yshift=0em]n2.east) -- ([xshift=0em,yshift=-1.5em]n3.south) -- ([xshift=0em,yshift=0em]n3.south);
......
\begin{tikzpicture} \begin{tikzpicture}
\node[anchor=west,inner sep=0mm,minimum height=4em,minimum width=5.5em,rounded corners=15pt,align=left,draw] (n1) at (0,0) {Decoder\\Encoder}; \node[anchor=west,inner sep=0mm,minimum height=4em,minimum width=5.5em,rounded corners=15pt,align=left,draw,fill=red!20] (n1) at (0,0) {Decoder\\Encoder};
\node[anchor=west,inner sep=0mm,minimum height=4em,minimum width=5.5em,rounded corners=15pt,align=left,draw] (n2) at ([xshift=10em,yshift=0em]n1.east) {Decoder\\Encoder}; \node[anchor=west,inner sep=0mm,minimum height=4em,minimum width=5.5em,rounded corners=15pt,align=left,draw,fill=green!20] (n2) at ([xshift=10em,yshift=0em]n1.east) {Decoder\\Encoder};
\node[anchor=south,inner sep=0mm,font=\small] (a1) at ([xshift=0em,yshift=1em]n1.north) {演员$p_{\theta}$}; \node[anchor=south,inner sep=0mm,font=\small] (a1) at ([xshift=0em,yshift=1em]n1.north) {演员$p_{\theta}$};
\node[anchor=north,inner sep=0mm] (a2) at ([xshift=0em,yshift=-1em]n1.south) {${x}_1,{x}_2,\ldots,{x}_m$}; \node[anchor=north,inner sep=0mm] (a2) at ([xshift=0em,yshift=-1em]n1.south) {$x$};
\node[anchor=south,inner sep=0mm,font=\small] (c1) at ([xshift=0em,yshift=1em]n2.north) {评论家$Q$}; \node[anchor=south,inner sep=0mm,font=\small] (c1) at ([xshift=0em,yshift=1em]n2.north) {评论家$Q$};
\node[anchor=north,inner sep=0mm] (c2) at ([xshift=0em,yshift=-1em]n2.south) {${y}_1,{y}_2,\ldots,{y}_J$}; \node[anchor=north,inner sep=0mm] (c2) at ([xshift=0em,yshift=-1em]n2.south) {$y$};
% \node[anchor=west,inner sep=0mm] (n3) at ([xshift=2.1em,yshift=2em]n1.east) {$Q_1,Q_2,\ldots,Q_J$}; % \node[anchor=west,inner sep=0mm] (n3) at ([xshift=2.1em,yshift=2em]n1.east) {$Q_1,Q_2,\ldots,Q_J$};
% \node[anchor=west,inner sep=0mm] (n4) at ([xshift=2.9em,yshift=-0.4em]n1.east) {$\hat{\mathbi{y}}_1,\hat{\mathbi{y}}_2,\ldots,\hat{\mathbi{y}}_J$}; % \node[anchor=west,inner sep=0mm] (n4) at ([xshift=2.9em,yshift=-0.4em]n1.east) {$\hat{\mathbi{y}}_1,\hat{\mathbi{y}}_2,\ldots,\hat{\mathbi{y}}_J$};
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
\node[anchor=west,inner sep=0mm] (n3) at ([xshift=2.1em,yshift=1em]n1.east) {$Q_1,Q_2,\ldots,Q_J$}; \node[anchor=west,inner sep=0mm] (n3) at ([xshift=2.1em,yshift=1em]n1.east) {$Q_1,Q_2,\ldots,Q_J$};
\node[anchor=west,inner sep=0mm] (n4) at ([xshift=2.9em,yshift=-1em]n1.east) {$\tilde{{y}}_1,\tilde{{y}}_2,\ldots,\tilde{{y}}_J$}; \node[anchor=west,inner sep=0mm] (n4) at ([xshift=2.9em,yshift=-1em]n1.east) {$\tilde{{y}}_1,\tilde{{y}}_2,\ldots,\tilde{{y}}_J$};
\draw [->,thick] ([xshift=0em,yshift=0.2em]n2.west) -- ([xshift=0em,yshift=0.2em]n1.east); \draw [->,thick] ([xshift=-0.1em,yshift=0.6em]n2.west) -- ([xshift=0.1em,yshift=0.6em]n1.east);
\draw [->,thick] ([xshift=0em,yshift=-0.2em]n1.east) -- ([xshift=0em,yshift=-0.2em]n2.west); \draw [->,thick] ([xshift=0.1em,yshift=-0.6em]n1.east) -- ([xshift=-0.1em,yshift=-0.6em]n2.west);
\end{tikzpicture} \end{tikzpicture}
\ No newline at end of file
...@@ -520,7 +520,7 @@ Translation}嚗砲蝑霈支蛹摮虫砲敺芸蝘 ...@@ -520,7 +520,7 @@ Translation}嚗砲蝑霈支蛹摮虫砲敺芸蝘
\subsection{强化学习方法} \subsection{强化学习方法}
\parinterval {\small\bfnew{强化学习}}\index{强化学习}(Reinforcement Learning,RL\index{Reinforcement Learning,RL})方法是机器学习中的经典方法,它可以同时解决\ref{subsec-15.3.1}节提到的曝光偏置问题和训练- 推断评价指标不一致问题。本节主要介绍基于策略的方法和基于演员-评论家的方法({\color{red} An Actor-Critic Algorithm for Sequence Prediction})。 \parinterval {\small\bfnew{强化学习}}\index{强化学习}(Reinforcement Learning,RL\index{Reinforcement Learning,RL})方法是机器学习中的经典方法,它可以同时解决\ref{subsec-15.3.1}提到的曝光偏置问题和训练- 推断评价指标不一致问题。本节主要介绍基于策略的方法和基于演员-评论家的强化学习方法({\color{red} An Actor-Critic Algorithm for Sequence Prediction})。
%---------------------------------------------------------------------------------------- %----------------------------------------------------------------------------------------
% NEW SUBSUB-SECTION % NEW SUBSUB-SECTION
...@@ -528,36 +528,41 @@ Translation}嚗砲蝑霈支蛹摮虫砲敺芸蝘 ...@@ -528,36 +528,41 @@ Translation}嚗砲蝑霈支蛹摮虫砲敺芸蝘
\subsubsection{1. 基于策略的强化学习方法} \subsubsection{1. 基于策略的强化学习方法}
\parinterval {\small\bfnew{最小风险训练}}\index{最小风险训练}(Minimum Risk Training\index{Minimum Risk Training},MRT)可以被看作是一种基于策略的方法。与传统的极大似然估计不同,最小风险训练引入了评价指标作为损失函数,目标是将模型的预期风险降至最低,这里预期风险通常用风险函数的期望表示\upcite{DBLP:conf/acl/ShenCHHWSL16} \parinterval {\small\bfnew{最小风险训练}}\index{最小风险训练}(Minimum Risk Training\index{Minimum Risk Training},MRT)可以被看作是一种基于策略的方法。与极大似然估计不同,最小风险训练引入了评价指标作为损失函数,并优化模型将预期风险降至最低\upcite{DBLP:conf/acl/ShenCHHWSL16}
\parinterval 最小风险训练的训练目标是最小化训练数据$\{(x_1,\widetilde{y}_1),...,(x_N,\widetilde{y}_N)\}$上的风险$\funp{R}(\theta)$,如公式\eqref{eq:13-13}所示: \parinterval 假设有$N$个训练样本$\{(x^1,y^1),...,(x^N,y^N)\}$,最小风险训练的目标是找到模型参数$\hat{\theta}_{\textrm{MRT}} $,满足如下公式:
\begin{eqnarray} \begin{eqnarray}
\hat{\theta}_{\textrm{MRT}} & = & \arg\max_{\theta}\{\funp{R}(\theta)\} \\ \hat{\theta}_{\textrm{MRT}} & = & \arg\max_{\theta}\{\funp{R}(\theta)\} \label{eq:13-13a}
\funp{R}(\theta) & = & \sum_{k=1}^N \mathbb{E}_{\tilde{\seq{y}}|\seq{x}_k;\theta}[\vartriangle(\tilde{\seq{y}},\seq{y}_k)] \nonumber \\ \end{eqnarray}
& = & \sum_{k=1}^N \sum_{\tilde{\seq{y}} \in \chi(\seq{x}_k)}\funp{P}(\tilde{\seq{y}}|\seq{x}_k;\theta)\vartriangle(\tilde{\seq{y}},\seq{y}_k)
\noindent 其中,$\funp{R}(\theta)$表示预期风险,通常用风险函数的期望表示,公式如下:
\begin{eqnarray}
\funp{R}(\theta) & = & \sum_{k=1}^N \mathbb{E}_{\tilde{\seq{y}}|\seq{x}^k;\theta}[\vartriangle(\tilde{\seq{y}},\seq{y}^k)] \nonumber \\
& = & \sum_{k=1}^N \sum_{\tilde{\seq{y}} \in \chi(\seq{x}^k)}\funp{P}(\tilde{\seq{y}}|\seq{x}^k;\theta)\vartriangle(\tilde{\seq{y}},\seq{y}^k)
\label{eq:13-13} \label{eq:13-13}
\end{eqnarray} \end{eqnarray}
\noindent 这里,$\tilde{\seq{y}}$是模型预测的译文,$\chi(\seq{x}_k)$$\seq{x}_k$所对应的所有候选翻译的集合,损失函数$\vartriangle(\tilde{\seq{y}},\seq{y}_k)$用来衡量模型预测$\tilde{\seq{y}}$与标准答案$\seq{y}_k$间的差异,损失函数一般用翻译质量评价指标定义,例如,BLEU,TER等。在MRT中,对模型参数$\theta$的偏导数公式\eqref{eq:13-14}所示, \noindent 这里,$\tilde{\seq{y}}$是模型预测的译文,$\chi(\seq{x}^k)$$\seq{x}^k$所对应的所有候选翻译的集合。损失函数$\vartriangle(\tilde{\seq{y}},\seq{y}^k)$用来衡量模型预测$\tilde{\seq{y}}$与标准答案$\seq{y}^k$的差异,损失函数一般用翻译质量评价指标定义,例如,BLEU,TER等。在最小风险训练中,对模型参数$\theta$的偏导数为:
\begin{eqnarray} \begin{eqnarray}
\frac{\partial \funp{R}(\theta)}{\partial \theta} & = & \sum_{k=1}^N \mathbb{E}_{\tilde{\seq{y}}|\seq{x}_k;\theta}[\vartriangle(\tilde{\seq{y}},\seq{y}_k) \times \frac{\partial \funp{P}(\tilde{\seq{y}}|\seq{x}_k;\theta)/\partial \theta}{\funp{P}(\tilde{\seq{y}}|\seq{x}_k;\theta)}] \frac{\partial \funp{R}(\theta)}{\partial \theta} & = & \sum_{k=1}^N \mathbb{E}_{\tilde{\seq{y}}|\seq{x}^k;\theta}[\vartriangle(\tilde{\seq{y}},\seq{y}^k) \times \frac{\partial \funp{P}(\tilde{\seq{y}}|\seq{x}^k;\theta)/\partial \theta}{\funp{P}(\tilde{\seq{y}}|\seq{x}^k;\theta)}]
\label{eq:13-14} \label{eq:13-14}
\end{eqnarray} \end{eqnarray}
\noindent 公式\eqref{eq:13-14}使用了{\small\bfnew{策略梯度}}\index{策略梯度}(Policy Gradient\index{Policy Gradient})的手段将$\vartriangle(\tilde{\seq{y}},\seq{y}_k)$提到微分操作之外({\color{red} A natural policy gradient \noindent 公式\eqref{eq:13-14}使用了{\small\bfnew{策略梯度}}\index{策略梯度}(Policy Gradient\index{Policy Gradient})的手段将$\vartriangle(\tilde{\seq{y}},\seq{y}^k)$提到微分操作之外({\color{red} A natural policy gradient
Where did my optimum go?: An empiricalanalysis of gradient descent optimization in policy gradient methods})。这样,就无需对$\vartriangle(\tilde{\seq{y}},\seq{y}_k)$进行微分,因此最小风险训练允许任意不可微的损失函数,包括BLEU等常用的评价函数。 Where did my optimum go?: An empiricalanalysis of gradient descent optimization in policy gradient methods})。这样,就无需对$\vartriangle(\tilde{\seq{y}},\seq{y}^k)$进行微分,因此最小风险训练允许任意不可微的损失函数,包括BLEU等常用的评价函数。使用公式\eqref{eq:13-14}就可以求出模型参数的相对于风险函数的损失,进而进行基于梯度的优化。这里需要注意的是,公式\eqref{eq:13-14}中求期望的过程是无法直接实现的,因为无法遍历所有的译文句子。通常,会使用采样的方法搜集一定数量的译文,来模拟译文空间。例如,可以使用推断系统生成若干译文。同时,为了保证生成的译文之间具有一定的差异性,也可以对推断过程进行一些“干扰”。从实践的角度看,采样方法是影响强化学习系统的重要因素,因此往往需要对不同的任务设计相适应的采样方法({\color{red} 参考文献!我记得李炎洋以前写过一个文章介绍采样方法,可以问问他,或者在这里再多说两句,采样还是很重要的。})。
\parinterval 相比于最大似然估计,最小风险训练有着以下优点: \parinterval 相比于最大似然估计,最小风险训练有着以下优点:
\begin{itemize} \begin{itemize}
\vspace{0.5em} \vspace{0.5em}
\item 最小风险训练通过使用模型自身产生的数据进行训练,从而解决了曝光偏置问题。 \item 最小风险训练使用模型自身产生的数据进行训练,从而避免了曝光偏置问题。
\vspace{0.5em} \vspace{0.5em}
\item 最小风险训练通过直接优化BLEU等评价指标,从而解决了训练-推断评价指标不一致问题。 \item 最小风险训练直接优化BLEU等评价指标,从而解决了训练-推断评价指标不一致问题。
\vspace{0.5em} \vspace{0.5em}
\item 最小风险训练方法只涉及到模型输出而不涉及具体的模型结构,因此其对体系结构是透明的,可以应用于任意的机器翻译模型。 \item 最小风险训练方法不涉及具体的模型结构,可以应用于任意的机器翻译模型。
\vspace{0.5em} \vspace{0.5em}
\end{itemize} \end{itemize}
...@@ -569,30 +574,32 @@ Where did my optimum go?: An empiricalanalysis of gradient descent optimization ...@@ -569,30 +574,32 @@ Where did my optimum go?: An empiricalanalysis of gradient descent optimization
\parinterval 基于策略的强化学习是要寻找一个策略$\funp{p}(a|\tilde{{y}}_{1 \ldots j},\seq{x})$,使得该策略选择的行动$a$未来可以获得的奖励期望(也被称为{\small\bfnew{动作价值函数}}\index{动作价值函数}(Action-value Function)\index{Action-value Function})最大化。这个过程通常用函数$Q$来描述: \parinterval 基于策略的强化学习是要寻找一个策略$\funp{p}(a|\tilde{{y}}_{1 \ldots j},\seq{x})$,使得该策略选择的行动$a$未来可以获得的奖励期望(也被称为{\small\bfnew{动作价值函数}}\index{动作价值函数}(Action-value Function)\index{Action-value Function})最大化。这个过程通常用函数$Q$来描述:
\begin{eqnarray} \begin{eqnarray}
\funp{Q}(a;\tilde{\mathbi{y}}_{1 \ldots j},\seq{y}) & = & \mathbb{E}_{\tilde{\mathbi{y}}_{j+1 \ldots J} \sim \funp{p}(a|\tilde{\mathbi{y}}_{1 \ldots j} a,\seq{x})}[\funp{r}_j(a;\tilde{\mathbi{y}}_{1 \ldots j-1},\seq{y}) + \nonumber \\ \funp{Q}(a;\tilde{y}_{1 \ldots j},\seq{y}) & = & \mathbb{E}_{\tilde{y}_{j+1 \ldots J} \sim \funp{p}(a|\tilde{y}_{1 \ldots j} a,\seq{x})}[\funp{r}_j(a;\tilde{y}_{1 \ldots j-1},\seq{y}) + \nonumber \\
& & \sum_{i=j+1}^J\funp{r}_i(\tilde{{y}}_i;\tilde{{y}}_{1 \ldots i-1}a\tilde{{y}}_{j+1 \ldots i},\seq{y})] & & \sum_{i=j+1}^J\funp{r}_i(\tilde{{y}}_i;\tilde{{y}}_{1 \ldots j-1}a\tilde{{y}}_{j+1 \ldots i-1},\seq{y})]
\label{eq:13-35} \label{eq:13-35}
\end{eqnarray} \end{eqnarray}
\noindent 其中,$\funp{r}_j(a;\tilde{{y}}_{1 \ldots j-1},\seq{y})$$j$时刻做出行动$a$获得的奖励,$\seq{x}$是源语言句子,$\seq{y}$是正确译文,$\tilde{{y}}_{1 \ldots j}$是策略$\funp{p}$产生的译文的前$j$个词,$J$是生成译文的长度。其(在一个源语句子$x$上的)定义的目标为: \noindent 其中,$\funp{r}_j(a;\tilde{{y}}_{1 \ldots j-1},\seq{y})$$j$时刻做出行动$a$获得的奖励,$\funp{r}_i(\tilde{{y}}_i;\tilde{{y}}_{1 \ldots j-1}a\tilde{{y}}_{j+1 \ldots i-1},\seq{y})$$j$时刻的行动为$a$的前提下$i$时刻的做出行动$\tilde{{y}}_i$获得的奖励。$\seq{x}$是源语言句子,$\seq{y}$是正确译文,$\tilde{{y}}_{1 \ldots j}$是策略$\funp{p}$产生的译文的前$j$个词,$J$是生成译文的长度。对于源语句子$x$,最优策略$\hat{p}$可以被定义为:
\begin{eqnarray} \begin{eqnarray}
\hat{p} & = & \max_{\funp{p}}\mathbb{E}_{\tilde{\seq{y}} \sim \funp{p}(\tilde{\seq{y}} | \seq{x})}\sum_{j=1}^J\sum_{a \in A}\funp{p}(a|\tilde{{y}}_{1 \ldots j},\seq{x})\funp{Q}(a;\tilde{{y}}_{1 \ldots j},\seq{y}) \hat{p} & = & \argmax_{\funp{p}}\mathbb{E}_{\tilde{\seq{y}} \sim \funp{p}(\tilde{\seq{y}} | \seq{x})}\sum_{j=1}^J\sum_{a \in A}\funp{p}(a|\tilde{{y}}_{1 \ldots j},\seq{x})\funp{Q}(a;\tilde{{y}}_{1 \ldots j},\seq{y})
\label{eq:13-15} \label{eq:13-15}
\end{eqnarray} \end{eqnarray}
\noindent 其中,$A$表示所有可能的行动组成的空间,也就是词表$V$。公式\eqref{eq:13-15}的含义是,计算动作价值函数$\funp{Q}$需要枚举$j$时刻以后所有可能的序列,而可能的序列数目是随着其长度呈指数级增长,因此只能估计的方法计算$\funp{Q}$的值。基于策略的强化学习方法,如最小风险训练(风险$\vartriangle=-\funp{Q}$)等都使用了采样的方法来估计$\funp{Q}$。尽管采样估计的结果是$\funp{Q}$的无偏估计,但是它的缺点在于估计的方差比较大。而$\funp{Q}$直接关系到梯度更新的大小,不稳定的数值会导致模型更新不稳定,难以优化。 \noindent 其中,$A$表示所有可能的行动组成的空间,也就是词表$V$。公式\eqref{eq:13-15}的含义是,最优的策略$\hat{p}$选择需要同时考虑当前决策的“信心”(即$\funp{p}(a|\tilde{{y}}_{1 \ldots j},\seq{x})$)和未来可以获得的“价值”(即$\funp{Q}(a;\tilde{{y}}_{1 \ldots j},\seq{y})$)。
\parinterval 计算动作价值函数$\funp{Q}$需要枚举$j$时刻以后所有可能的序列,而可能的序列数目是随着其长度呈指数级增长,因此只能估计的方法计算$\funp{Q}$的值。基于策略的强化学习方法,如最小风险训练(风险$\vartriangle=-\funp{Q}$)等都使用了采样的方法来估计$\funp{Q}$。尽管采样估计的结果是$\funp{Q}$的无偏估计,但是它的缺点在于估计的方差比较大。而$\funp{Q}$直接关系到梯度更新的大小,不稳定的数值会导致模型更新不稳定,难以优化。
\parinterval 为了避免采样的开销和随机性带来的不稳定,基于{\small\bfnew{演员-评论家}}\index{演员-评论家}(Actor-critic\index{Actor-critic})的强化学习方法\upcite{DBLP:conf/iclr/BahdanauBXGLPCB17}引入一个可学习的函数$\tilde{\funp{Q}}$,通过函数$\tilde{\funp{Q}}$来逼近动作价值函数$\funp{Q}$。但是由于$\tilde{\funp{Q}}$是人工设计的一个函数,该函数有着自身的偏置,因此$\tilde{\funp{Q}}$不是$\funp{Q}$的一个无偏估计,所以使用$\tilde{\funp{Q}}$来指导$\funp{p}$的优化无法到达理论上的最优解。尽管如此,得益于神经网络强大的拟合能力,基于演员-评论家的强化学习方法仍更具优势。 \parinterval 为了避免采样的开销和随机性带来的不稳定,基于{\small\bfnew{演员-评论家}}\index{演员-评论家}(Actor-critic\index{Actor-critic})的强化学习方法引入一个可学习的函数$\tilde{\funp{Q}}$,通过函数$\tilde{\funp{Q}}$来逼近动作价值函数$\funp{Q}$\upcite{DBLP:conf/iclr/BahdanauBXGLPCB17}。但是由于$\tilde{\funp{Q}}$是人工设计的一个函数,该函数有着自身的偏置,因此$\tilde{\funp{Q}}$不是$\funp{Q}$的一个无偏估计,所以使用$\tilde{\funp{Q}}$来指导$\funp{p}$的优化无法到达理论上的最优解。尽管如此,得益于神经网络强大的拟合能力,基于演员-评论家的强化学习方法在实践中仍然非常流行。
\parinterval 对于基于演员-评论家的强化学习方法,演员就是策略$\funp{p}$,而评论家就是动作价值函数$\funp{Q}$的估计$\tilde{\funp{Q}}$。对于演员,它的目标函数如下: \parinterval 对于基于演员-评论家的强化学习方法,演员就是策略$\funp{p}$,而评论家就是动作价值函数$\funp{Q}$的估计$\tilde{\funp{Q}}$。对于演员,它的目标是找到最有的决策:
\begin{eqnarray} \begin{eqnarray}
\hat{p} & = & \max_{\funp{p}}\mathbb{E}_{\tilde{\seq{y}} \sim \funp{p}(\tilde{\seq{y}} | \seq{x})}\sum_{j=1}^J\sum_{a \in A}\funp{p}(a|\tilde{{y}}_{1 \ldots j},\seq{x})\tilde{\funp{Q}}(a;\tilde{{y}}_{1 \ldots j},\seq{y}) \hat{p} & = & \argmax_{\funp{p}}\mathbb{E}_{\tilde{\seq{y}} \sim \funp{p}(\tilde{\seq{y}} | \seq{x})}\sum_{j=1}^J\sum_{a \in A}\funp{p}(a|\tilde{{y}}_{1 \ldots j},\seq{x})\tilde{\funp{Q}}(a;\tilde{{y}}_{1 \ldots j},\seq{y})
\label{eq:13-16} \label{eq:13-16}
\end{eqnarray} \end{eqnarray}
\parinterval 与公式\eqref{eq:13-15}对比可以发现,基于演员-评论家的强化学习方法与基于策略的强化学习方法类似,公式\eqref{eq:13-16}对动作价值函数$\funp{Q}$的估计从采样换成了一个函数$\tilde{\funp{Q}}$。对于目标函数里的期望,通常使用采样对方式来进行逼近,例如,选择一定量的$\tilde{y}$来计算期望,而不是遍历所有的$\tilde{y}$。借助与最小风险训练类似的方法,可以计算对$\funp{p}$的梯度来优化演员。 \parinterval 与公式\eqref{eq:13-15}对比可以发现,基于演员-评论家的强化学习方法与基于策略的强化学习方法类似,公式\eqref{eq:13-16}对动作价值函数$\funp{Q}$的估计从采样换成了一个函数$\tilde{\funp{Q}}$。对于目标函数里期望的计算,通常使用采样的方式来进行逼近,这与最小风险训练也是十分类似的,例如,选择一定量的$\tilde{y}$来计算期望,而不是遍历所有的$\tilde{y}$。借助与最小风险训练类似的方法,可以计算对$\funp{p}$的梯度来优化演员。
\parinterval 而对于评论家,它的优化目标并不是那么显而易见。尽管可以通过采样得方式来估计$\funp{Q}$,然后使用该估计作为目标让$\tilde{\funp{Q}}$进行拟合,但是这样会导致非常高的(采样)代价,同时可以想象,既然有了一个无偏估计,为什么还要用有偏估计$\tilde{\funp{Q}}$呢? \parinterval 而对于评论家,它的优化目标并不是那么显而易见。尽管可以通过采样的方式来估计$\funp{Q}$,然后使用该估计作为目标让$\tilde{\funp{Q}}$进行拟合,但是这样会导致非常高的(采样)代价。同时可以想象,既然有了一个无偏估计,为什么还要用有偏估计$\tilde{\funp{Q}}$呢?
\parinterval 回顾动作价值函数的定义,可以对它做适当的展开,可以得到如下等式: \parinterval 回顾动作价值函数的定义,可以对它做适当的展开,可以得到如下等式:
\begin{eqnarray} \begin{eqnarray}
...@@ -601,17 +608,16 @@ Where did my optimum go?: An empiricalanalysis of gradient descent optimization ...@@ -601,17 +608,16 @@ Where did my optimum go?: An empiricalanalysis of gradient descent optimization
\label{eq:13-17} \label{eq:13-17}
\end{eqnarray} \end{eqnarray}
\parinterval 这个等式也被称为{\small\bfnew{贝尔曼方程}}\index{贝尔曼方程}(Bellman Equation\index{Bellman Equation}\upcite{sutton2018reinforcement}。这个等式告诉我们$j-1$时刻的动作价值函数$\funp{Q}(\tilde{{y}}_j;\tilde{{y}}_{1 \ldots j-1},\seq{y})$跟下一时刻$j$的动作价值函数$\funp{Q}(a;\tilde{{y}}_{1 \ldots j},\seq{y})$之间的关系。因此可以很自然的使用等式右部作为等式左部$\funp{Q}(\tilde{{y}}_j;\tilde{{y}}_{1 \ldots j-1},\seq{y})$的目标。而由于动作价值函数的输出是连续的数值,因此通常会选用均方误差来计算目标函数值。 \parinterval 这个等式也被称为{\small\bfnew{贝尔曼方程}}\index{贝尔曼方程}(Bellman Equation\index{Bellman Equation}\upcite{sutton2018reinforcement}。这个等式告诉我们$j-1$时刻的动作价值函数$\funp{Q}(\tilde{{y}}_j;\tilde{{y}}_{1 \ldots j-1},\seq{y})$跟下一时刻$j$的动作价值函数$\funp{Q}(a;\tilde{{y}}_{1 \ldots j},\seq{y})$之间的关系。因此可以很自然的使用等式右部作为等式左部$\funp{Q}(\tilde{{y}}_j;\tilde{{y}}_{1 \ldots j-1},\seq{y})$的等价形式。于是,可以定义$j$时刻动作价值函数为:
\parinterval 进一步,可以定义$j$时刻动作价值函数的目标如下:
\begin{eqnarray} \begin{eqnarray}
\funp{q}_j & = & \funp{r}_j(\tilde{{y}}_j;\tilde{{y}}_{1 \ldots j-1},\seq{y}) + \sum_{a \in A}\funp{p}(a|\tilde{{y}}_{1 \ldots j},\seq{x})\tilde{\funp{Q}}(a;\tilde{{y}}_{1 \ldots j},\seq{y}) \funp{q}_j & = & \funp{r}_j(\tilde{{y}}_j;\tilde{{y}}_{1 \ldots j-1},\seq{y}) + \sum_{a \in A}\funp{p}(a|\tilde{{y}}_{1 \ldots j},\seq{x})\tilde{\funp{Q}}(a;\tilde{{y}}_{1 \ldots j},\seq{y})
\label{eq:13-18} \label{eq:13-18}
\end{eqnarray} \end{eqnarray}
\parinterval 而评论家对的目标函数定义如下: \parinterval 而评论家对应的目标定义如下:
\begin{eqnarray} \begin{eqnarray}
\hat{\tilde{\funp{Q}}} & = & \min_{\tilde{\funp{Q}}}\sum_{j=1}^J{(\tilde{\funp{Q}}(\tilde{{y}}_j;\tilde{{y}}_{1 \ldots j-1},\seq{y}) - \funp{q}_j)}^2 \hat{\tilde{\funp{Q}}} & = & \argmin_{\tilde{\funp{Q}}}\sum_{j=1}^J{(\tilde{\funp{Q}}(\tilde{{y}}_j;\tilde{{y}}_{1 \ldots j-1},\seq{y}) - \funp{q}_j)}^2
\label{eq:13-19} \label{eq:13-19}
\end{eqnarray} \end{eqnarray}
...@@ -632,9 +638,9 @@ Where did my optimum go?: An empiricalanalysis of gradient descent optimization ...@@ -632,9 +638,9 @@ Where did my optimum go?: An empiricalanalysis of gradient descent optimization
\vspace{0.5em} \vspace{0.5em}
\item 多目标学习:演员的优化通常会引入额外的极大似然估计目标函数,同时会使用极大似然估计进行预训练。这样会简化训练,因为随机初始化的演员性能很差,很难获得有效的奖励。同时极大似然估计作为一个额外的正则项也防止模型跑偏,加速收敛。 \item 多目标学习:演员的优化通常会引入额外的极大似然估计目标函数,同时会使用极大似然估计进行预训练。这样会简化训练,因为随机初始化的演员性能很差,很难获得有效的奖励。同时极大似然估计作为一个额外的正则项也防止模型跑偏,加速收敛。
\vspace{0.5em} \vspace{0.5em}
\item 优化目标:评论家的优化目标是由自身输出所构造。当模型更新比较快的时候模型的输出变化也会很快,导致构造的优化目标不稳定,影响模型收敛。一个解决方案是在一定更新次数内固定构造优化目标使用的模型,然后再使用比较新的模型来构造后续一定更新次数内的优化目标,如此往复\upcite{DBLP:journals/nature/SilverHMGSDSAPL16} \item 优化目标:评论家的优化目标是由自身输出所构。当模型更新比较快的时候模型的输出变化也会很快,导致构造的优化目标不稳定,影响模型收敛效果。一个解决方案是,在一定更新次数内固定构造优化目标使用的模型,然后再使用比较新的模型来构造后续一定更新次数内的优化目标,如此往复\upcite{DBLP:journals/nature/SilverHMGSDSAPL16}
\vspace{0.5em} \vspace{0.5em}
\item 方差惩罚:在机器翻译中使用强化学习方法一个问题是动作空间过大,这是由词表过大造成的。因为模型只根据被采样到的结果来进行更新,很多动作很难得到更新,因此对不同动作的动作价值函数估计值会有很大差异。通常会引入一个正则项$C_j = \sum_{a \in A}{(\tilde{\funp{Q}}(a;\tilde{{y}}_{1 \ldots j-1},\seq{y}) - \frac{1}{|A|} \sum_{b \in A}\tilde{\funp{Q}}(b;\tilde{{y}}_{1 \ldots j-1},\seq{y}))}^2$来约束不同动作的动作函数估计值,使其不会偏离他们的均值太远\upcite{DBLP:conf/icml/ZarembaMJF16} \item 方差惩罚:在机器翻译中使用强化学习方法一个问题是动作空间过大,这是由词表过大造成的。因为模型只根据被采样到的结果来进行更新,很多动作很难得到更新,因此对不同动作的动作价值函数估计值会有很大差异。通常会引入一个正则项$C_j = \sum_{a \in A}{(\tilde{\funp{Q}}(a;\tilde{{y}}_{1 \ldots j-1},\seq{y}) - \frac{1}{|A|} \sum_{b \in A}\tilde{\funp{Q}}(b;\tilde{{y}}_{1 \ldots j-1},\seq{y}))}^2$来约束不同动作的动作函数估计值,使其不会偏离均值太远\upcite{DBLP:conf/icml/ZarembaMJF16}
\vspace{0.5em} \vspace{0.5em}
\item 函数塑形:在机器翻译里面使用强化学习方法另一个问题就是奖励的稀疏性。评价指标如BLEU等只能对完整的句子进行打分,也就是奖励只有在句子结尾有值,而在句子中间只能为0。这种情况意味着模型在生成句子的过程中没有任何信号来指导它的行为,从而大大增加了学习难度。常见的解决方案是进行{\small\bfnew{函数塑形}}\index{函数塑形}(Reward Shaping\index{Reward Shaping}),使得奖励在生成句子的过程中变得稠密,同时也不会改变模型的最优解\upcite{DBLP:conf/icml/NgHR99} \item 函数塑形:在机器翻译里面使用强化学习方法另一个问题就是奖励的稀疏性。评价指标如BLEU等只能对完整的句子进行打分,也就是奖励只有在句子结尾有值,而在句子中间只能为0。这种情况意味着模型在生成句子的过程中没有任何信号来指导它的行为,从而大大增加了学习难度。常见的解决方案是进行{\small\bfnew{函数塑形}}\index{函数塑形}(Reward Shaping\index{Reward Shaping}),使得奖励在生成句子的过程中变得稠密,同时也不会改变模型的最优解\upcite{DBLP:conf/icml/NgHR99}
\vspace{0.5em} \vspace{0.5em}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论