GanLM: Encoder-Decoder Pre-training with an Auxiliary Discriminator

Jian Yang, Shuming Ma, Li Dong, Shaohan Huang, Haoyang Huang, Yuwei Yin, Dongdong Zhang, Liqun Yang, Furu Wei, Zhoujun Li

Abstract

GanLM is a novel pre-training framework for encoder-decoder models that introduces an auxiliary discriminator to bridge the gap between language understanding and generation. By combining Replaced Token Detection (RTD) with a novel Replaced Token Denoising (RD) task, GanLM achieves state-of-the-art results across major summarization and translation benchmarks. The discriminator acts as a teacher, identifying "hard" examples for the generator to reconstruct, thereby enhancing both understanding and generation capabilities.

Introduction

In Natural Language Processing (NLP), pre-training has become the standard for achieving high performance. For sequence-to-sequence (seq2seq) tasks such as summarization and translation, encoder-decoder architectures like BART or T5 are typically pre-trained using denoising objectives—reconstructing original text from corrupted versions. However, these standard methods often under-utilize language understanding to improve generation. While encoder-only models like ELECTRA have demonstrated that "replaced token detection" is a superior understanding task, this approach has not been effectively applied to seq2seq models. GanLM aims to unify these paradigms, using a discriminator to improve the generator by forcing it to understand and correct its own errors.

Methodology

GanLM (Generative Adversarial Network Language Model) consists of a Generator ($G$) and a Discriminator ($D$) that share a single encoder. The training process utilizes two primary objectives:

  1. Replaced Token Detection (RTD): The generator produces a probability distribution for masked tokens. Tokens are sampled from this distribution to create a "fake" sentence. The discriminator then predicts whether each token is "ORIGINAL" or "REPLACED."
  2. Replaced Token Denoising (RD): This novel task focuses on generation. Tokens flagged as "REPLACED" (or misclassified) by the discriminator are used to construct a noisy context. The generator is then tasked with reconstructing the original, clean sentence from this noisy version.
Overview of the Replaced Token Detection and Replaced Token Denoising tasks in GanLM.

Unlike standard GANs, which face stability issues in NLP due to discrete text sampling, GanLM trains the generator using standard maximum likelihood. The "adversarial" component is the RD task, where the discriminator identifies "hard" examples for the generator to fix. Additionally, the auxiliary discriminator is retained during the task-specific fine-tuning phase to continue guiding the generator.

Experimental Setup

GanLM was pre-trained on extensive datasets:

  • English: 160GB of text from BookCorpus, CC-News, OpenWebText, and CC-Stories.
  • Multilingual (GanLM-m): 6TB of text covering 100 languages (CC100, CC-Net, Wikipedia).

Evaluation spanned several benchmarks, including summarization (CNN/DailyMail, XSum), translation (WMT-14, WMT-16, IWSLT-17), and language understanding (GLUE, XNLI).

Results and Discussion

GanLM consistently outperformed strong baselines such as BART, T5, and UniLMv2. On the XSum summarization dataset, GanLM achieved a ROUGE-L score of 36.84, surpassing BART (36.02) and T5 (36.12). In translation, GanLM-m reached 30.6 BLEU on the WMT-14 English-German task.

The model showed significant advantages in low-resource scenarios. For instance, in the WMT-16 En-Ro translation task, GanLM provided a substantial improvement over standard Transformer baselines, particularly when training data was limited.

Performance comparison between GanLM and a standard Transformer baseline on En-Ro and Ro-En translation tasks across different data ratios.

Key insights from the results include:

  • Hard Example Loop: By focusing on tokens the discriminator finds suspicious, the generator learns context-dependent word choices more effectively.
  • Efficiency: Using a "tiny" 4-layer discriminator alongside a 12-layer generator maintains computational efficiency.
  • Cross-lingual Alignment: The GAN-style training improves shared representation space alignment in multilingual models, as seen in zero-shot translation performance.

Conclusion

GanLM demonstrates that integrating an auxiliary discriminator into seq2seq pre-training significantly enhances both language understanding and generation. While the training process is approximately 0.5x slower than standard T5 models, the performance gains across summarization, translation, and understanding tasks justify the overhead. Future work may explore the scalability of this approach to larger model sizes and the sensitivity of the sampling process.

Summary updated

BibTeX
@inproceedings{yang2023ganlm,
  author = {Jian Yang and Shuming Ma and Li Dong and Shaohan Huang and Haoyang Huang and Yuwei Yin and Dongdong Zhang and Liqun Yang and Furu Wei and Zhoujun Li},
  title = {{GanLM: Encoder-Decoder Pre-training with an Auxiliary Discriminator}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.acl-long.522},
}
Figure