[Paper Review] Contrastive Learning with Adversarial Perturbations for Conditional Text Generation
This paper proposes CLAPS, a contrastive learning method for sequence-to-sequence models that generates hard positive and negative examples via adversarial perturbations to mitigate exposure bias in conditional text generation. By minimizing conditional likelihood for negative samples and enforcing high likelihood for semantically similar but distant positive samples, CLAPS improves generalization across machine translation, text summarization, and question generation with consistent performance gains over baselines.
Recently, sequence-to-sequence (seq2seq) models with the Transformer architecture have achieved remarkable performance on various conditional text generation tasks, such as machine translation. However, most of them are trained with teacher forcing with the ground truth label given at each time step, without being exposed to incorrectly generated tokens during training, which hurts its generalization to unseen inputs, that is known as the "exposure bias" problem. In this work, we propose to mitigate the conditional text generation problem by contrasting positive pairs with negative pairs, such that the model is exposed to various valid or incorrect perturbations of the inputs, for improved generalization. However, training the model with naive contrastive learning framework using random non-target sequences as negative examples is suboptimal, since they are easily distinguishable from the correct output, especially so with models pretrained with large text corpora. Also, generating positive examples requires domain-specific augmentation heuristics which may not generalize over diverse domains. To tackle this problem, we propose a principled method to generate positive and negative samples for contrastive learning of seq2seq models. Specifically, we generate negative examples by adding small perturbations to the input sequence to minimize its conditional likelihood, and positive examples by adding large perturbations while enforcing it to have a high conditional likelihood. Such "hard" positive and negative pairs generated using our method guides the model to better distinguish correct outputs from incorrect ones. We empirically show that our proposed method significantly improves the generalization of the seq2seq on three text generation tasks - machine translation, text summarization, and question generation.
Motivation & Objective
- To address the exposure bias problem in seq2seq models trained with teacher forcing, where models are never exposed to incorrect generations during training.
- To improve generalization by exposing models to diverse, meaningful positive and negative examples during training.
- To overcome the limitations of naive contrastive learning with random negative examples, which are easily distinguishable and suboptimal.
- To develop a principled method for generating hard, semantically meaningful positive and negative pairs using adversarial perturbations on hidden representations.
- To demonstrate the effectiveness of the proposed method across multiple conditional text generation tasks.
Proposed method
- Generate negative examples by adding small perturbations to the input sequence’s hidden representation to minimize its conditional likelihood.
- Generate positive examples by applying large perturbations to the target sequence’s hidden representation while enforcing high conditional likelihood via KL divergence minimization.
- Use the resulting hard positive and negative pairs in a contrastive learning framework to improve model discrimination between correct and incorrect outputs.
- Train the seq2seq model end-to-end with contrastive loss using both original and perturbed input-output pairs.
- Leverage pretrained models to enhance the quality of generated perturbations and improve generalization.
- Apply the method to sequence-to-sequence models with Transformer architecture across multiple text generation tasks.
Experimental results
Research questions
- RQ1Can adversarially generated hard negative and positive examples improve model generalization in conditional text generation?
- RQ2How does contrastive learning with principled perturbations compare to naive contrastive learning with random negatives in terms of model performance and robustness?
- RQ3Does the proposed method effectively reduce exposure bias in seq2seq models without requiring reinforcement learning or GAN-based training?
- RQ4To what extent does CLAPS improve performance across diverse text generation tasks such as machine translation, summarization, and question generation?
- RQ5How does the model’s ability to distinguish correct from incorrect outputs improve when trained with hard, semantically meaningful contrastive pairs?
Key findings
- CLAPS significantly improves generalization on three text generation tasks: machine translation, text summarization, and question generation.
- The method achieves consistent performance gains over strong baselines, including models trained with teacher forcing and contrastive learning with random negatives.
- The model trained with CLAPS shows improved robustness to distributional shifts and unseen inputs due to exposure to hard, semantically plausible negative examples.
- Experiments show that the contrastive pairs generated by CLAPS are significantly harder to distinguish than random negatives, as evidenced by lower zero-shot classification accuracy on positive-negative pairs.
- The use of adversarial perturbations to generate both hard positive and negative examples leads to better alignment between the model’s predictions and ground truth, especially in low-resource or out-of-domain settings.
- The method is effective even when applied to models pretrained on large corpora, where naive contrastive learning fails due to easy discrimination of random negatives.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.