Understanding Retrieval Robustness for Retrieval-augmented Image Captioning

Wenyan Li, Jiaang Li, Rita Ramos, Raphael Tang, Desmond Elliott

Abstract

Retrieval-augmented image captioning models often suffer from a lack of robustness, blindly copying retrieved text even when it contradicts visual evidence. This paper investigates this "Achilles' heel," quantifying the impact of irrelevant context and proposing a "Sample-k" training strategy. By training on diverse subsets of retrieved captions, the authors significantly improve robustness and out-of-domain performance.

Introduction

Retrieval-Augmented Generation (RAG) has emerged as a powerful paradigm for image captioning, allowing models to leverage external knowledge bases for more accurate and adaptable descriptions. Models like SMALLCAP retrieve similar captions from a database to serve as "hints" during generation. However, the effectiveness of these models is heavily dependent on the quality of the retrieved data.

Visualizing the hallucination problem: standard retrieval-augmented models often copy irrelevant text (e.g., 'elephant') from retrieved captions, ignoring the actual image content ('truck').

As shown in the example above, if a retriever returns captions about an "elephant" for a photo of a "truck," the model often ignores the visual evidence and includes the hallucinated object in its output. This paper quantifies this lack of robustness, analyzes the underlying mechanisms of model distraction, and proposes a training-based solution to build resilience against irrelevant context.

The Copying Trap: Why Models Fail

Through multi-stage analysis, the researchers discovered that models aren't just using retrieved text as a semantic guide; they are often literally copying tokens. Input attribution methods like Integrated Gradients revealed that when a model generates a specific word, it often shows a very high attribution score to that exact word in the retrieved captions.

This behavior stems from a "shortcut" learned during standard training. In typical datasets, "majority tokens" (words appearing in more than half of the retrieved captions) overlap with the ground truth 88–99% of the time. The model learns that if most retrieved hints suggest a word, that word is almost certainly correct. This shortcut fails in real-world scenarios where retrievers are imperfect, leading to significant performance drops—up to 50% in CIDEr scores—when context is irrelevant.

Methods: Improving Robustness via Sample-k Training

To address this over-reliance, the authors proposed a new training intervention called Sample-k Training. Instead of always training the model on the $k$ most relevant captions, they sample $k$ captions from a larger pool of the top $N$ results (e.g., sampling 4 out of the top 7). This forces the model to encounter more diverse and occasionally less relevant context during training, encouraging it to weigh visual evidence more heavily against textual hints.

Key Results and Generalization

The Sample-k strategy yielded substantial improvements in both robustness and generalization across multiple benchmarks, including COCO, NoCaps, and VizWiz.

Performance comparison (CIDEr) across different retrieval qualities. Standard models suffer significantly when presented with random or low-rank retrieved captions.

Key findings include:

  • Improved Noise Resilience: Models trained with Sample-k were significantly better at ignoring random noise. For a model using one retrieved caption ($k=1$), the CIDEr score on random (irrelevant) captions jumped from 73.2 to 98.9.
  • Cross-Domain Performance: The sampling strategy improved performance on entirely new domains. On the challenging VizWiz dataset, the Sample-k model consistently outperformed the standard top-k model.
  • Selective Attention: The performance gap between using the "best" retrieved captions and "lower-ranked" captions was significantly narrowed, indicating the model became more selective about which hints to follow.

Conclusion

While retrieval-augmented models offer significant advantages, their tendency to "hallucinate" based on noisy retrieved data is a critical weakness. By introducing diversity into the retrieved context during training via the Sample-k method, researchers can build models that are more robust to retriever errors and more capable of generalizing to out-of-domain data. Future work may explore whether these findings extend to larger vision-language models and the potential for inference-time filtering modules.

Summary updated

BibTeX
@inproceedings{li2024understanding,
  author = {Wenyan Li and Jiaang Li and Rita Ramos and Raphael Tang and Desmond Elliott},
  title = {{Understanding Retrieval Robustness for Retrieval-augmented Image Captioning}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.acl-long.503},
}
Figure