\node[sentence] (node1) at (0,0) {[`low', `lower', `newest', `widest']};
\node[sentence,anchor = north] (node2) at ([yshift = -1em]node1.south) {[`l o w $<$e$>$':5, `l o w e r $<$e$>$':2, `n e w e s t $<$e$>$':6, `w i d e s t $<$e$>$':3]};
\node[sentence,anchor = north] (node3) at ([yshift = -1.5em]node2.south) {[`l o w $<$e$>$':5, `l o w e r $<$e$>$':2, `n e w {\red es} t $<$e$>$':6, `w i d {\red es} t $<$e$>$':3]};
\node[sentence,anchor = north] (node4) at ([yshift = -1em]node3.south) {[`l o w $<$e$>$':5, `l o w e r $<$e$>$':2, `n e w {\red est}$<$e$>$':6, `w i d {\red est}$<$e$>$':3]};
\node[sentence,anchor = north] (node5) at ([yshift = -1em]node4.south) {[`l o w $<$e$>$':5, `l o w e r $<$e$>$':2, `n e w {\red est$<$e$>$}':6, `w i d {\red est$<$e$>$}':3]};
\node[sentence] (node1) at (0,0) {['low', 'lower', 'newest', 'widest']};
\node[sentence,anchor = north] (node2) at ([yshift = -1em]node1.south) {['l o w $<$e$>$':5, 'l o w e r $<$e$>$':2, 'n e w e s t $<$e$>$':6, 'w i d e s t $<$e$>$':3]};
\node[sentence,anchor = north] (node3) at ([yshift = -1.5em]node2.south) {['l o w $<$e$>$':5, 'l o w e r $<$e$>$':2, 'n e w {\red es} t $<$e$>$':6, 'w i d {\red es} t $<$e$>$':3]};
\node[sentence,anchor = north] (node4) at ([yshift = -1em]node3.south) {['l o w $<$e$>$':5, 'l o w e r $<$e$>$':2, 'n e w {\red est}$<$e$>$':6, 'w i d {\red est}$<$e$>$':3]};
\node[sentence,anchor = north] (node5) at ([yshift = -1em]node4.south) {['l o w $<$e$>$':5, 'l o w e r $<$e$>$':2, 'n e w {\red est$<$e$>$}':6, 'w i d {\red est$<$e$>$}':3]};
\node[sentence,anchor = north] (node6) at ([yshift = -1em]node5.south) {$\cdots$};
\node[node,anchor = north] (node7) at ([yshift = -1.6em]node6.south) {直到达到预设的子词词表大小或下一个最高频的字节对出现频率为1。};
\parinterval 机器翻译模型是基于平行语料训练出来的,语料的质量、数量对翻译效果都有很大的影响。特别是,当机器翻译系统应用于不同领域的文本时,训练语料与所应用领域的相关性就非常重要(Survey of data-selection methods in statistical machine translation;Effective Domain Mixing for Neural Machine Translation)。不同领域往往具有自己独特的属性,比如语言风格、句子结构、专业术语等,例如,“bank”这个英语单词,在金融领域通常被翻译为“银行”,而在计算机领域,一般被解释为“库”、“存储体”等。这也会导致,使用通用领域数据训练出来的模型在特定领域上的翻译效果往往不理想,这本质上是训练数据和测试数据的领域属性不匹配造成的。
\item 基于交叉熵差(cross-entropy difference,CED)的方法(Domain Adaptation Via Pseudo In-Domain Data Selection;Data Selection With Fewer Words;Instance Weighting for Neural Machine Translation Domain Adaptation;Combining translation and language model scoring for domain-specific data filtering)。该方法做法是在目标领域数据和通用数据上分别训练语言模型,然后用语言模型来给句子打分并做差,分数越低说明句子与目标领域越相关。
\item 基于文本分类的方法(Semi-supervised Convolutional Networks for Translation Adaptation with Tiny Amount of In-domain Data;Bilingual Methods for Adaptive Training Data Selection for Machine Translation;Cost Weighting for Neural Machine Translation Domain Adaptation;Automatic Threshold Detection for Data Selection in Machine Translation)。将该问题转化为文本分类问题,先构造一个领域分类器,之后利用该分类器对给定的句子进行领域分类,最后用输出的概率来打分,选择目标领域预测得分高的样本。
\item 基于特征衰减算法的方法(Feature Decay Algorithms,FDA)(Instance selection for machine translation using feature decay algorithms;Feature decay algorithms for neural machine translation;Selecting Backtranslated Data from Multiple Sources for Improved Neural Machine Translation;Data Selection with Feature Decay Algorithms Using an Approximated Target Side)。该算法基于特征匹配,试图从源领域中提取出一个句子集合,这些句子能够使目标领域语言特征的覆盖范围最大化。
\parinterval 尽管这些方法有所不同,但是它们的目的都是为了衡量样本和领域的相关性,这些评价指标最终服务于训练过程中的样本学习策略。样本学习策略主要分为静态和动态两种,早期的研究工作都是关注于设计评分函数,在学习策略上普遍采用静态方法,即首先利用评分函数对源领域的数据进行打分排序,然后选取一定数量的数据合并到目标领域数据集中共同训练模型(Domain Adaptation Via Pseudo In-Domain Data Selection;Data Selection With Fewer Words;Bilingual Methods for Adaptive Training Data Selection for Machine Translation;Instance selection for machine translation using feature decay algorithms;Semi-supervised Convolutional Networks for Translation Adaptation with Tiny Amount of In-domain Data),这个过程其实是扩大了目标领域的数据规模,模型的收益主要来自于数据的增加。但是研究人员也发现静态方法会存在两方面的缺陷:
\item 静态方法可以看作一种数据过滤技术,它对数据的判定方式是“非黑即白”的,即接收或拒绝,这种方式一方面会受到评分函数的影响,一方面被拒绝的数据可能对于训练模型仍然有用,而且样本的价值可能会随着训练过程的推进而改变。(Denoising Neural Machine Translation Training with Trusted Data and Online Data Selection)
\parinterval 使用动态学习策略可以有效地缓解上述这些问题。这里的动态主要体现在模型训练过程中,训练数据是以某种策略进行动态的组织。它的基本想法是:不完全抛弃领域相关性低的样本,而只是使模型给予相关性高的样本更高的关注度,使得它更容易参与到训练过程中。具体在实现上,主要有两种方法,一种是将句子的领域相似性表达成概率分布,然后在训练过程中根据该分布对数据进行动态采样(Dynamic Data Selection for Neural Machine Translation;Dynamic Sentence Sampling for Efficient Training of Neural Machine Translation), 一种是在计算损失函数时根据句子的领域相似性以加权的方式进行训练(Instance Weighting for Neural Machine Translation Domain Adaptation;Cost Weighting for Neural Machine Translation Domain Adaptation)。相比于基于静态的二元选择,基于动态的方法是一种“软”选择方式,这使得模型有机会使用到其它数据,提高了训练数据的多样性,因此性能也更稳定。
\parinterval 除了领域差异,训练数据中也存在噪声,比如,机器翻译所使用的数据中经常出现句子未对齐、多种语言单词混合、单词丢失等问题。相关研究表明神经机器翻译对于噪声数据很敏感,当噪声过多时就会带来模型性能的显著下降(On the impact of various types of noise on neural machine translation),因此无论是从模型健壮性还是训练效率出发,数据降噪都是很有意义的。事实上,数据降噪从统计机器翻译时代就已经开展了许多工作(Dealing with Input Noise in Statistical Machine Translation;Bilingual Data Cleaning for SMT using Graph-based Random Walk;Learning from Noisy Data in Statistical Machine Translation),因此很多方法也可以应用到神经机器翻译中来。
\parinterval 含有噪声的数据通常都具有较为明显的特征,因此可以用诸如句子长度比、词对齐率、最长连续未对齐序列长度等一些特征来对句子进行综合评分(MT Detection in Web-Scraped Parallel Corpora;Parallel Corpus Refinement as an Outlier Detection Algorithm;Zipporah: a Fast and Scalable Data Cleaning System for NoisyWeb-Crawled Parallel Corpora);也可以将该问题转化为分类任务来对句子进行筛选(Detecting Cross-Lingual Semantic Divergence for Neural Machine Translation;Identifying Semantic Divergences in Parallel Text without Annotations);此外,从某种意义上来说,数据降噪其实也可以算是一种领域数据选择,因为它的目标是选择可信度高的样本,因此也可以人工构建一个可信度高的小数据集,然后利用该数据集和通用数据集之间的差异性进行选择(Denoising Neural Machine Translation Training with Trusted Data and Online Data Selection)。
\parinterval 早期的工作大多在关注过滤噪声数据的方法,对于噪声数据中模型的健壮性训练和噪声样本的利用探讨较少。事实上,噪声是有强度的,有些噪声数据对于模型可能是有价值的,而且它们的价值可能会随着模型的状态而改变(Denoising Neural Machine Translation Training with Trusted Data and Online Data Selection)。一个例子如图\ref{fig:13-51}所示(画图的时候zh-gloss那行不要了,zh翻译为汉语{\color{red} 例子是别人的,还是自己造的?})。图中的汉语句子中缺少了一部分翻译,但这两个句子都很流畅,简单的基于长度或双语词典的方法可以很容易地对其进行过滤({\color{red} 过滤啥?})。但是,这个训练样本对于训练机器翻译模型仍然有用,特别是在数据稀缺的情况下,因为汉语句子和英语句子的前半部分仍然是正确的互译结果。这表明了噪声数据的微妙之处,它不是一个简单的二元分类问题:一些训练样本可能部分有用,而它们的有用性也可能随着训练的进展而改变。因此简单的过滤并不一种很好的办法,一种合理的学习策略应该是既可以合理的利用这些数据,又不让其对模型产生负面影响。直觉上,这是一个动态的过程,当模型能力较弱时(比如在训练初期),这些数据就能对模型起到正面作用,反之亦然。受课程学习、微调等方法的启发,研究人员也提出了类似的学习策略,它的主要思想是:在训练过程中对批量数据的噪声水平进退火(Anneal),使得模型在越来越干净的数据上进行训练(Denoising Neural Machine Translation Training with Trusted Data and Online Data Selection;Dynamically Composing Domain-Data Selection with Clean-Data Selection by “Co-Curricular Learning” for Neural Machine Translation)。从宏观上看,整个训练过程其实是一个持续微调的过程,这和微调的思想基本一致。这种学习策略一方面充分利用了训练数据,一方面又避免了噪声数据对模型的负面影响,因此取得了不错的效果。
\parinterval{\small\bfnew{主动学习}}\index{主动学习}(Active Learning\index{Active Learning})也是一种数据选择策略。它最初的应用场景式是:标注大量的数据成本过高,因此希望优先标注对模型最有价值的数据,这样可以最大化模型学习的效率,同时整体降低标注的代价。主动学习主要由五个部分组成({\color{red}再确定一下Active learning with sampling by uncertainty and density for word sense disambiguation and text classification还是Active learning with sampling by uncertainty and density for data annotations还是Active learning for word sense disambiguation with methods for addressing the class imbalance problem等等}),包括:未标注样本池、筛选策略、标注者、标注样本集、目标模型。在主动学习过程中,会根据当前的模型状态找到未标注样本池中最优价值的样本,之后送给标注者。标注结束后,会把标注的样本加入到标注样本集中,之后用这些标注的样本更新模型。之后,重复这个过程,直到到达某种收敛状态。
\parinterval 主动学习的一个核心问题是:如何选择出那些最有价值的未标注样本?通常会假设模型认为最“难”的样本是最有价值的。具体实现有很多思路,例如,基于置信度的方法、基于分类错误的方法等等(Uncertainty-based Active Learning with Instability Estimation for Text Classification;Active Learning with Sampling by Uncertainty and Density for Word Sense Disambiguation and Text Classification)。
\parinterval 在机器翻译中,主动学习可以被用于低资源翻译,以减少人工标注的成本(Learning to Actively Learn Neural Machine Translation;Active Learning Approaches to Enhancing Neural Machine Translation)。也可以被用于交互式翻译,让模型持续从外界反馈中受益(Active Learning for Interactive Neural Machine Translation of Data Streams;Continuous learning from human post-edits for neural machine translation;Online learning for effort reduction in interactive neural machine translation)。不过,总的来说,主动学习在机器翻译中应用不算广泛。这是由于,机器翻译任务较为复杂,设计样本价值的评价函数较为困难。而且,在很多场景中,并不是要简单的选择样本,而是希望训练装置能够考虑样本的价值,以充分发挥所有数据的优势。这也正是即将介绍的课程学习等方法要解决的问题。
\parinterval 从某种程度上看,机器翻译中的多领域、多语言等都属于持续学习的场景。在多领域神经机器翻译中,我们期望模型既有通用领域的性能,并且在特定领域也表现良好,然而事实上,适应特定领域往往是以牺牲通用领域的性能为代价的(Overcoming Catastrophic Forgetting During Domain Adaptation of Neural Machine Translation;Investigating Catastrophic Forgetting During Continual Training for Neural Machine Translation)。在多语言神经翻译中,最理想的情况是一个模型就能够实现在多个语言之间的映射,然而由于数据分布的极大不同,实际情况往往是:多语言模型能够提高低资源语言对互译的性能,但同时也会降低高资源语言对的性能。因此如何让模型从多语言训练数据中持续受益就是一个关键的问题。以上这些问题在{\chaptersixteen}和{\chaptereighteen}中还会有详细讨论。
\item 从广义上说,大多数课程学习方法都是遵循由易到难的原则,然而在实践过程中人们逐渐赋予了课程学习更多的内涵,课程学习的含义早已超越了最原始的定义。一方面,课程学习可以与许多任务相结合,此时,评估准则并不一定总是样本的困难度,这取决于具体的任务,比如在多任务学习中(multi-task learning)(Curriculum learning of multiple tasks;Curriculum learning for multi-task classification of visual attributes),指的任务的难易程度或相关性;在领域适应任务中(Curriculum Learning for Domain Adaptation in Neural Machine Translation),指的是数据与领域的相似性;在噪声数据场景中,指的是样本的可信度(Dynamically Composing Domain-Data Selection with Clean-Data Selection by “Co-Curricular Learning” for Neural Machine Translation)。另一方面,在一些任务或数据中,由易到难并不总是有效,有时困难优先反而会取得更好的效果(Curriculum learning with deep convolutional neural networks;An empirical exploration of curriculum learning for neural machine translation),实际上这和我们的直觉不太符合,一种合理的解释是课程学习更适合标签噪声、离群值较多或者是目标任务困难的场景,能提高模型的健壮性和收敛速度,而困难优先则更适合数据集干净的场景,能使随机梯度下降更快更稳定(Active bias: Training more accurate neural networks by emphasizing high variance samples)。({\color{red} 这段写得不错!})