Abstract
Reinforcement learning (RL) for sentence generation is often hampered by the massive search space of large vocabularies. This paper proposes a method to accelerate RL training by dynamically predicting a small, input-specific vocabulary (typically $K=1,000$) to serve as a reduced action space. Our approach achieves up to a 2.7x speedup in training and a 2.3x reduction in GPU memory usage without sacrificing translation or captioning quality.
Introduction
In RL-based sentence generation, such as the REINFORCE algorithm, every word selection is treated as an action. With vocabularies often exceeding 50,000 words, models face two primary challenges: high computational overhead from large softmax operations and sparse rewards due to the difficulty of exploring a vast action space. While softmax approximations exist for supervised learning, they are often incompatible with RL, which requires the model to simulate its own behavior during training.
Methodology: Dynamic Vocabulary Prediction
The core innovation is the dynamic pruning of the vocabulary based on the input $X$.
- Vocabulary Predictor: A lightweight model predicts a subset of words likely to appear in the output. For text, it uses a bag-of-embeddings approach; for images, it utilizes pre-computed CNN features.
- Small Softmax: The generator operates only within a predicted subset of $K$ words. This transforms the softmax layer into a much smaller matrix multiplication, drastically reducing computational load.
- Integrated Training: This reduced space is used consistently across supervised pre-training, the REINFORCE phase, and inference.
As illustrated in Figure 1, a small vocabulary size ($K$) is sufficient to capture target words with high recall across diverse datasets, validating the feasibility of the "Small Softmax" approach.
Experimental Results
The method was evaluated on eight datasets covering Machine Translation (En-De, En-Ja, En-Vi, Ch-Ja) and Image Captioning (MS COCO, Flickr8K).
Efficiency and Convergence
The "Small Softmax" approach significantly accelerates convergence. By narrowing the action space, the model receives more meaningful feedback during exploration, leading to faster learning.
Figure 2 demonstrates that the Small softmax model achieves higher BLEU scores with fewer pre-training epochs compared to the full-vocabulary baseline.
Performance Gains
- Hardware Efficiency: Training on the En-Ja (2M) dataset was ~2.7x faster. GPU memory usage on En-Vi dropped from 10.8 GB to 2.9 GB, allowing large models to be trained on a single consumer-grade GPU.
- Rare Word Advantage: By removing thousands of irrelevant frequent words, the model can more easily select correct rare words, improving overall generation quality.
- Accuracy: BLEU scores remained competitive or improved. For instance, on the En-Ja test set, the REINFORCE model with a small vocabulary achieved a BLEU score of 40.16.
Discussion and Limitations
The system's success depends on the vocabulary predictor's recall. While $K=1000$ generally provides near 100% recall, any word omitted by the predictor cannot be generated. Currently, the predictor and generator are trained separately; joint training remains a challenge due to RL instabilities. Future work may explore integrating this technique with Generative Adversarial Networks (GANs) to accelerate discriminator training.
Conclusion
By dynamically reducing the action space, this method makes reinforcement learning for natural language generation significantly more efficient and accessible without compromising performance.
Summary updated