Open-ended text generation with autoregressive language models (LMs) is one of the core tasks in natural language processing. However, maximization-based decoding methods (e.g., greedy/beam search) often lead to the degeneration problem, i.e., the generated text is unnatural and contains undesirable repetitions. Existing solutions to this problem either introduce randomness prone to incoherence or require a look-ahead mechanism that demands extra computational overhead. In this study, we formulate open-ended text generation from a new perspective, i.e., we view it as an exploration process within a directed graph. Thereby, we understand the phenomenon of degeneration as circular loops within the directed graph. Based on our formulation, we propose a novel decoding method -- \textit{momentum decoding} -- which encourages the LM to \textit{greedily} explore new nodes outside the current graph. Meanwhile, it also allows the LM to return to the existing nodes with a momentum downgraded by a pre-defined resistance function. We extensively test our approach on three benchmarks from different domains through automatic and human evaluations. The results show that momentum decoding performs comparably with the current state of the art while enjoying notably improved inference speed and computation FLOPs. Furthermore, we conduct a detailed analysis to reveal the merits and inner workings of our approach. Our codes and other related resources are publicly available at https://github.com/gmftbyGMFTBY/MomentumDecoding.
翻译:具有自动递减语言模型(LMS)的不限文本生成是自然语言处理的核心任务之一。 但是,基于最大化的解码方法(例如贪婪/波音搜索)往往会导致退化问题, 即生成的文本是非自然的, 包含不可取的重复。 这一问题的现有解决方案要么引入随机性, 容易出现不一致性, 要么需要一个需要额外计算间接费用的外观头机制。 在此研究中, 我们从新的角度来制定不限名额的文本生成, 也就是说, 我们把它看成是一个定向图表中的探索过程。 因此, 我们理解基于最大化的解码方法( 例如贪婪/ 光线搜索) 往往会导致退化问题, 也就是说, 我们提出一种新的解码方法 -- -- 即不自然线性{ { momentum decoding} -- 这鼓励LM( textitalitit{greallyly) 探索当前图表以外的新节点。 同时, 我们允许LM/ 回到现有的节点, 通过预先定义的工作阻力功能降低现有节点。 因此, 我们广泛测试了退化的代代代代代的代的代的代方法, 我们的三种代次的自我分析, 展示了我们不同的计算方法, 通过不同的轨道 的自我分析, 展示了我们不同的计算, 展示的自我的自我的 和精确的轨迹标值 。