Augmenting pretrained language models (LMs) with a vision encoder (e.g., Flamingo) has obtained the state-of-the-art results in image-to-text generation. However, these models store all the knowledge within their parameters, thus often requiring enormous model parameters to model the abundant visual concepts and very rich textual descriptions. Additionally, they are inefficient in incorporating new data, requiring a computational-expensive fine-tuning process. In this work, we introduce a Retrieval-augmented Visual Language Model, Re-ViLM, built upon the Flamingo, that supports retrieving the relevant knowledge from the external database for zero and in-context few-shot image-to-text generations. By storing certain knowledge explicitly in the external database, our approach reduces the number of model parameters and can easily accommodate new data during evaluation by simply updating the database. We also construct an interleaved image and text data that facilitates in-context few-shot learning capabilities. We demonstrate that Re-ViLM significantly boosts performance for image-to-text generation tasks, especially for zero-shot and few-shot generation in out-of-domain settings with 4 times less parameters compared with baseline methods.
翻译:通过将视觉编码器(如Flamingo)与预训练语言模型(LM)结合,已在图像到文本生成任务中取得了最先进的成果。然而,此类模型将所有知识存储于参数中,常需海量参数以建模丰富的视觉概念及极其多样的文本描述。此外,它们在整合新数据时效率低下,需耗费大量算力进行微调。本文提出一种基于Flamingo构建的检索增强视觉语言模型Re-ViLM,支持从外部数据库检索相关知识,实现零样本和上下文内少样本的图像到文本生成。通过将特定知识显式存储于外部数据库,本方法减少了模型参数数量,并在评估时仅需更新数据库即可便捷地容纳新数据。我们同时构建了交错图像与文本数据,以增强上下文内少样本学习能力。实验表明,与基线方法相比,Re-ViLM在图像到文本生成任务上性能显著提升,尤其在领域外场景的零样本和少样本生成中,参数量减少4倍。