An Adversarial Non-Autoregressive Model for Text Generation with Incomplete Information

Da Ren, Qing Li

Abstract

Generative Adversarial Networks (GANs) have been studied in text generation to tackle the exposure bias problem. Despite their remarkable development, they adopt autoregressive structures so suffering from high latency in both training and inference stages. Although GANs have potential to support efficient generation by adopting non-autoregressive (NAR) structures, their explorations in NAR models are extremely limited. In this work, we conduct pioneering study of building language GANs based on NAR structures. We identify two issues that constrain the performance of GAN-based NAR models. Firstly, existing methods of incorporating latent variables provide highly similar representations which cannot describe the diversity of different words in sentences. We tackle this problem by proposing Position-Aware Self-Modulation, providing more diverse and effective representations. Secondly, the attention mechanism in Transformer cannot accurately build word dependencies in the unstable training of GANs, and we adopt Dependency Feed Forward Network to enhance the model capacity in dependency modeling. Armed with these two facilities, we propose a GAN-based NAR model, Adversarial Non-autoregressive Transformer (ANT). The experimental results demonstrate that ANT can achieve comparable performance with mainstream models in a single forward pass and has great potential in various applications like latent interpolation and semi-supervised learning.

Introduction

Text generation has traditionally relied on autoregressive (AR) models, which generate tokens sequentially. While effective, this sequential nature introduces high latency and exposure bias. Non-autoregressive (NAR) models offer a promising alternative by generating all tokens in parallel. However, NAR models often struggle with the "multi-modality problem," where independent token predictions lead to incoherent sentences.

Generative Adversarial Networks (GANs) have been explored to mitigate exposure bias, but most existing text GANs are AR-based. This paper introduces the Adversarial Non-autoregressive Transformer (ANT), a novel framework that combines the efficiency of NAR generation with the adversarial training benefits of GANs.

The ANT Framework

The ANT architecture consists of three primary components: an Aligner, a Generator, and a Discriminator. This structure allows the model to learn a continuous representation of text, avoiding the non-differentiable sampling issues common in discrete text GANs.

The overall architecture of the Adversarial Non-autoregressive Transformer (ANT), comprising the Aligner, Generator, and Discriminator.

Key Technical Innovations

To overcome the limitations of standard NAR models, ANT introduces two critical modules:

  1. Position-Aware Self-Modulation: Standard self-modulation often applies uniform noise across all positions, leading to repetitive representations. ANT introduces position-specific mapping layers for the latent vector $z$, allowing the model to capture the distinct roles of words at different positions.
  2. Dependency Feed Forward Network (Dependency FFN): To stabilize dependency modeling during adversarial training, the standard FFN is replaced with a Dependency FFN. This module explicitly integrates information from adjacent states to reinforce word dependencies, compensating for the potential instability of the attention mechanism in a GAN setting.
Detailed view of (a) Position-Aware Self-Modulation and (b) Dependency Feed Forward Network (FFN) modules.

Experimental Results

ANT was evaluated on the COCO Image Caption, EMNLP 2017 News, and Yelp datasets.

  • Massive Speedup: ANT achieves a 14.75x speedup compared to standard AR Transformers, enabling true "one-shot" generation.
  • Generation Quality: On the COCO dataset, ANT achieved a Fréchet Embedding Distance (FED) of 0.013, outperforming several well-known AR GANs like SeqGAN and matching state-of-the-art performance.
  • Controllability: In sentiment-controlled tasks on the Yelp dataset, ANT reached 88.35% accuracy, the highest among all compared NAR models.
  • Downstream Utility: Synthetic data generated by ANT improved classification F1 scores by 1.75% in semi-supervised learning experiments.

Conclusion

The Adversarial Non-autoregressive Transformer (ANT) successfully addresses the latency of AR models and the representation limitations of previous NAR GANs. By leveraging Position-Aware Self-Modulation and the Dependency FFN, it achieves high-quality, parallel text generation. The model's ability to perform smooth latent interpolation and enhance semi-supervised learning demonstrates its versatility beyond simple text generation.

Summary updated

BibTeX
@misc{ren2023adversarial,
  author = {Da Ren and Qing Li},
  title = {{An Adversarial Non-Autoregressive Model for Text Generation with Incomplete Information}},
  year = {2023},
  eprint = {2305.03977},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.03977},
}
Figure