Evade the Trap of Mediocrity: Promoting Diversity and Novelty in Text Generation via Concentrating Attention

Wenhao Li, Xiaoyuan Yi, Jinyi Hu, Maosong Sun, Xing Xie
11/14/2022
cs.CL
transformer-attention

Official code: peterliwenhao/CARE (4 stars, last commit 2022-10-21).

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

peterliwenhao/CAREOfficial100%

The code in the paper Evade the Trap of Mediocrity: Promoting Diversity and Novelty in Text Generation via Concentrating Attention

40Oct 21, 20224 years ago

Similar Papers

Cite this paper

@article{li2022evade,
  title  = {Evade the Trap of Mediocrity: Promoting Diversity and Novelty in Text Generation via Concentrating Attention},
  author = {Wenhao Li and Xiaoyuan Yi and Jinyi Hu and Maosong Sun and Xing Xie},
  year   = {2022},
  eprint = {2211.07164},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2211.07164}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2211.07164.svg)](https://codeofpaper.com/paper/2211.07164)

Discussion