We propose InsNet, an expressive insertion-based text generator with efficient training and flexible decoding (parallel or sequential). Unlike most existing insertion-based text generation works that require re-encoding of the context after each insertion operation and thus are inefficient to train, InsNet only requires one pass of context encoding for the entire sequence during training by introducing a novel insertion-oriented position encoding and a light-weighted slot representation strategy to enable computation sharing. Furthermore, we propose an algorithm InsNet-Dinic to better determine the parallelization of insertion operations that provides a controllable switch between parallel and sequential decoding, making it flexible to handle more parallelizable tasks such as machine translation with efficient decoding, or less parallelizable tasks such as open-domain text generation to guarantee high-quality outputs. Experiments on two lexically constrained text generation datasets and three machine translation datasets demonstrate InsNet's advantages over previous insertion-based methods in terms of training speed, inference efficiency, and generation quality.
翻译:我们建议 InsNet 是一个有高效培训和灵活解码(平行或相继)的直线插入式文本生成器。 与大多数现有的基于插入式文本生成器不同,在每次插入操作后都需要对上下文进行重新编码,因而培训效率低下。 InsNet 只需在培训期间对整个序列进行一次上下文编码,即引入一种新的以插入为导向的位置编码和轻量化空格代表战略,以便能够进行计算共享。 此外,我们提议了一个InsNet-Dinic算法,以更好地确定插入操作的平行化,从而在平行和顺序解码之间实现可控的转换,使其具有灵活性,能够处理更平行的任务,如机器翻译,高效解码,或较不易平行的任务,如开放式文本生成,以保证高质量的产出。 在两个具有法律限制的文本生成数据集和三个机器翻译数据集上进行的实验表明InsNet在培训速度、推断效率和生成质量方面比以前插入式方法的优势。