避开平庸的陷阱:通过集中注意力促进文本生成的多样性和新颖性
Evade the Trap of Mediocrity: Promoting Diversity and Novelty in Text Generation via Concentrating Attention
摘要:
最近,强大的Transformer体系结构在生成高质量句子方面已经证明了其优越性。然而,这些模型往往会产生枯燥的高频短语,严重损害了生成文本的多样性和新颖性。在这项工作中,我们深入研究了这个问题的内在机制,发现在Transformer中稀疏的注意力值可以提高多样性。为了理解这种现象,我们首先进行了实证和理论分析,然后将其归因于在训练过程中注意隐藏状态的混合所导致的表征退化。我们把这个过程称为平庸的陷阱。为了摆脱这样的陷阱,我们引入了一种新的注意力正则化损失来控制注意力分布的清晰度,这对模型结构是透明的,并且可以在20行Python代码内轻松实现。我们证明,这种方法可以在数学上被视为学习贝叶斯近似的后验注意。实验表明,我们的方法提高了所生成的文本的多样性和新颖性,同时在各种条件和无条件生成任务上保持相当的质量。
英文摘要:
Recently, powerful Transformer architectures have proven superior in generating high-quality sentences. Nevertheless, these models tend to produce dull high-frequency phrases, severely hurting the diversity and novelty of generated text. In this work, we dig into the intrinsic mechanism of this problem and found that sparser attention values in Transformer could improve diversity. To understand such a phenomenon, we first conduct both empirical and theoretical analysis and then attribute it to representation degeneration caused by the attentive mixture of the hidden states during training. We term this process the Trap of Mediocrity. To escape from such a trap, we introduce a novel attention regularization loss to control the sharpness of the attention distribution, which is transparent to model structures and can be easily implemented within 20 lines of python code. We prove that this method could be mathematically regarded as learning a Bayesian approximation of posterior attention. Experiments show that our method improved the diversity and novelty of the generated text while maintaining comparable quality on a variety of conditional and unconditional generation tasks.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。