Text generation with beam search has proven successful in a wide range of applications. The commonly-used implementation of beam decoding follows a first come, first served heuristic: it keeps a set of already completed sequences over time steps and stops when the size of this set reaches the beam size. We introduce a patience factor, a simple modification to this decoding algorithm, that generalizes the stopping criterion and provides flexibility to the depth of search. Extensive empirical results demonstrate that the patience factor improves decoding performance of strong pretrained models on news text summarization and machine translation over diverse language pairs, with a negligible inference slowdown. Our approach only modifies one line of code and can be thus readily incorporated in any implementation.
翻译:光束搜索的文本生成在广泛的应用中证明是成功的。 光束解码的常用实施在先来后先来先来后来:它保持一系列经过时间步骤的完整序列,当光束大小达到光束大小时停止。 我们引入一个耐性因素,简单修改这个解码算法,将停止标准概括化,为搜索深度提供灵活性。 广泛的实证结果显示,耐心因素改善了在新闻文本汇总和机器翻译方面对多种语言的强力预先训练模型的解码性能,而其速度则微乎其微的推论减速。 我们的方法只改变一行代码,因此可以很容易地纳入任何执行中。