Abstract
Reinforcement learning (RL) has been widely studied for improving sequence-generation models. However, the conventional rewards used for RL training typically cannot capture sufficient semantic information, leading to limited performance. In this paper, we propose a novel Nested-Wasserstein Self-Imitation Learning (WSIL) framework for sequence generation. Specifically, we define a nested Wasserstein distance to measure the semantic similarity between the generated sequences and the target sequences at word, sequence, and distribution levels. Furthermore, we develop a self-imitation learning mechanism to encourage the model to learn from its own high-reward sequences, which effectively addresses the sparse reward problem in RL. Experimental results on various sequence generation tasks, including text generation and image/video captioning, demonstrate the effectiveness of the proposed WSIL framework.
Introduction
Sequence generation is a fundamental task in artificial intelligence, encompassing applications from image captioning to automated storytelling. Traditionally, these models are trained using Maximum Likelihood Estimation (MLE), where the objective is to predict the next token given the ground-truth prefix. While effective, MLE suffers from exposure bias: during inference, the model relies on its own previously generated (and potentially erroneous) tokens, leading to error accumulation.
Reinforcement Learning (RL) offers a solution by optimizing sequence-level metrics directly. However, standard RL rewards often exhibit "semantic blindness." Metrics like BLEU or ROUGE rely on exact n-gram overlaps. As shown in Figure 1, a candidate sentence that is semantically identical to the reference but uses different synonyms (e.g., "soccer" vs. "football") may receive a lower score than a sentence that shares more words but has a different meaning.
To address these challenges, researchers have introduced Nested-Wasserstein Self-Imitation Learning (WSIL), a framework that leverages semantic distances and self-imitation to produce more coherent and diverse sequences.
Methodology
Nested-Wasserstein Distance
The core of this approach is a hierarchical distance metric based on the Wasserstein distance (also known as Earth Mover’s Distance). Unlike discrete metrics, Wasserstein distance can leverage continuous word embeddings to understand semantic proximity. This distance is defined across three nested levels:
- Word-level: Measures the cost of moving between individual word embeddings (e.g., the distance between "bike" and "cycle").
- Sequence-level: Aggregates word-level costs to determine the distance between two full sentences.
- Distribution-level: Measures the distance between the distribution of sequences generated by the model and the distribution of target sequences.
By nesting these distances, the model receives a reward signal that is sensitive to both the overall meaning and the specific lexical choices, providing a much richer gradient for optimization than sparse, exact-match rewards.
Self-Imitation Learning (WSIL)
In many sequence generation tasks, rewards are sparse—the model only receives feedback after completing an entire sequence. To mitigate this, the WSIL framework implements a self-imitation mechanism. The model maintains a replay buffer of its own historical "best hits"—sequences it generated that achieved high rewards.
The training objective is augmented with a "trust-region" that encourages the model to stay semantically close to these past successes. This distributional matching ensures that the model explores the sequence space effectively without deviating into low-quality regions, effectively treating its own high-performing past as a secondary teacher. To maintain computational efficiency, the framework utilizes the Inexact Proximal Optimal Transport (IPOT) algorithm, which provides a fast approximation of the Wasserstein distance.
Experimental Evaluation
The WSIL framework was evaluated across three diverse benchmarks: Image COCO (unconditional text generation and image captioning), EMNLP2017 WMT News (long-form text generation), and MSR-VTT (video description tasks).
Key Results
WSIL consistently outperformed state-of-the-art baselines, including LeakGAN and SeqGAN:
- Quality and Diversity: On the WMT News dataset, WSIL achieved superior Test-BLEU scores while maintaining low Self-BLEU scores. This indicates that the model generates high-quality text without falling into the trap of repetitive, "robotic" outputs common in standard RL.
- Captioning Performance: In video captioning on MSR-VTT, the WSIL-D variant achieved a CIDEr score of 52.1, a significant improvement over the MLE baseline (46.6).
- Human Evaluation: Blind human studies confirmed that WSIL-generated sequences were perceived as more readable and semantically meaningful compared to those from previous top-tier models.
Discussion and Conclusion
The WSIL framework demonstrates that prioritizing semantic meaning over exact syntactic matching leads to more robust sequence generation. By combining nested Wasserstein distances with a self-imitation mechanism, the model effectively addresses exposure bias and sparse rewards. While the use of IPOT mitigates the computational cost of Optimal Transport, the approach remains more intensive than simple MLE. Future work may explore the application of nested semantic matching to more structured domains, such as program synthesis, where the "meaning" of a sequence is tied to its functional execution.
Summary updated