Abstract
Neural text generation models conditioning on given input (e.g. machine translation and image captioning) are usually trained by maximum likelihood estimation of target text. However, the trained models suffer from various types of errors at inference time. In this paper, we propose to suppress an arbitrary type of errors by training the text generation model in a reinforcement learning framework, where we use a trainable reward function that is capable of discriminating between references and sentences containing the targeted type of errors. We create such negative examples by artificially injecting the targeted errors to the references. In experiments, we focus on two error types, repeated and dropped tokens in model-generated text. The experimental results show that our method can suppress the generation errors and achieve significant improvements on two machine translation and two image captioning tasks.
Introduction
Neural text generation models, such as those used for machine translation and image captioning, are typically trained using Maximum Likelihood Estimation (MLE). While effective, MLE-trained models often suffer from "exposure bias," where errors accumulate during inference because the model relies on its own previous (and potentially incorrect) predictions. This frequently manifests as specific pathologies, notably the unnecessary repetition of tokens or the omission of critical information from the source text.
Proposed Framework
To address these issues, we propose a reinforcement learning (RL) framework designed to suppress specific types of errors. The core idea is to use a trainable reward function—a discriminator—that can distinguish between high-quality reference sentences and sentences containing targeted errors.
The training process involves two main stages:
- Discriminator Training: A binary classifier is trained to distinguish between gold-standard reference sentences and "Artificial Negative Examples" (ANEs).
- Generation Model Training: The trained discriminator is frozen and used as a reward signal in an RL setup using the REINFORCE algorithm. The generator is fine-tuned to maximize the reward, effectively learning to avoid the patterns identified as "negative" by the discriminator.
Creating Artificial Negative Examples (ANEs)
The effectiveness of the discriminator depends on the quality of the negative examples. Rather than waiting for the model to produce errors naturally, we artificially inject targeted errors into the reference data.
For repeating errors, consecutive tokens are stochastically duplicated at random positions. For dropping errors, consecutive tokens are randomly deleted. This "targeted" approach allows for the suppression of specific, undesirable behaviors by providing the model with explicit examples of what a "bad" sentence looks like.
Experimental Evaluation
The method was evaluated on four major benchmarks: WAT’15 (Japanese-to-English) and WMT’16 (German-to-English) for machine translation, and MS COCO and Flickr30K for image captioning. Success was measured using standard metrics (BLEU, METEOR, CIDEr) alongside custom metrics: eREP (repetition score) and DROP (omission score).
Key Findings
- Targeted Error Suppression: The RL-D$_{REP}$ model significantly reduced repetition scores across tasks. For instance, in MS COCO image captioning, the BLEU-4 score improved from 25.69 to 26.54, and the CIDEr score rose from 82.77 to 83.06.
- Low-Resource Efficacy: The method proved particularly effective when training data was limited, providing a clearer boundary for model behavior in scenarios where MLE might lead to poor generalization.
- Discriminator Sensitivity: Identifying repetitions was found to be significantly easier for the discriminator (96%+ accuracy) than identifying dropped tokens (73-87% accuracy), suggesting that omissions are more contextually complex and harder for a generator to correct.
Conclusion
By training models on what not to say through artificial negative examples, we can effectively suppress common generation pathologies. While "dropping" errors remain more challenging to mitigate than repetitions, the proposed framework offers a flexible, "sniper rifle" approach to target and mitigate specific model biases. Future work may explore applying this technique to unannotated source-side data to further improve robustness.
Summary updated