Abstract
Recently, Reinforcement Learning (RL) approaches have demonstrated advanced performance in image captioning by directly optimizing the metric used for testing. However, this shaped reward introduces learning biases, which reduces the readability of generated text. In addition, the large sample space makes training unstable and slow. To alleviate these issues, we propose a simple coherent solution that constrains the action space using an n-gram language prior. Quantitative and qualitative evaluations on benchmarks show that RL with the simple add-on module performs favorably against its counterpart in terms of both readability and speed of convergence. Human evaluation results show that our model is more human readable and graceful.
Introduction
Standard image captioning models trained with Maximum Likelihood Estimation (MLE) suffer from "exposure bias," where the model is never exposed to its own errors during training. Reinforcement Learning (RL) techniques, such as Self-Critical Sequence Training (SCST), address this by directly optimizing evaluation metrics like CIDEr. However, this optimization often leads to "learning bias." Models discover that they can inflate CIDEr scores by appending repetitive, nonsensical phrases—termed "bad endings"—to the end of captions. These endings, such as "on a" or "with a," boost n-gram overlap metrics but degrade human readability.
Methodology: Natural Language Priors
To combat learning bias and improve training efficiency, we introduce a Natural Language Prior that constrains the RL agent's action space.
n-gram Constraint
We extract all valid 3-grams or 4-grams from the training corpus. During the RL sampling phase, the model's choice for the next word is restricted: a word is only selectable if it forms a valid n-gram when combined with the preceding sequence. This hard constraint effectively masks out linguistically invalid transitions and prevents the generation of gibberish endings.
Action Space Reduction
This constraint significantly reduces the search space. In our experiments, the average number of candidate words at each step dropped from approximately 9,000 to just 56. This massive compression allows the RL agent to explore the action space more effectively, leading to more stable and faster training.
Experimental Results
We evaluated our approach on the MSCOCO dataset using the standard Karpathy split. We applied the n-gram prior to both standard Encoder-Decoder models and those utilizing spatial attention mechanisms.
Training Efficiency and Performance
The inclusion of the language prior led to a dramatic increase in training speed. As shown in the training curves, models with the prior (SC+prioritize+4-gram) reached higher CIDEr scores nearly twice as fast as the standard SCST baseline. For instance, the attention-based model with a 4-gram prior achieved a CIDEr score of 102.0, outperforming the baseline while maintaining perfect grammatical endings.
Readability and Diversity
The "Bad-End-Rate" dropped from roughly 44% in the baseline to 0% with our method. Furthermore, the constraint actually improved caption diversity; the 4-gram model achieved a novelty score of 77.83%, significantly higher than the 59.28% of the unconstrained baseline. Human evaluations confirmed these findings, showing a strong preference for the more "graceful" captions produced by our model in head-to-head matchups.
Conclusion
By integrating a simple n-gram language prior, we effectively mitigate the learning biases inherent in RL-based image captioning. This approach not only eliminates nonsensical "bad endings" but also doubles training efficiency. While the n-gram prior is rigid, it provides a robust foundation for future work involving more flexible neural language models to further enhance caption quality and diversity.
Summary updated