Papers › UniRAG: Universal Retrieval Augmentation for Large Vision Language Models

UniRAG: Universal Retrieval Augmentation for Large Vision Language Models

16 May 2024arXiv:2405.10311archive 2025-07-28

Sahel Sharifymoghaddam, Shivani Upadhyay, Wenhu Chen, Jimmy Lin

Recently, Large Vision Language Models (LVLMs) have unlocked many complex use cases that require Multi-Modal (MM) understanding (e.g., image captioning or visual question answering) and MM generation (e.g., text-guided image generation or editing) capabilities. To further improve the output fidelityof LVLMs we introduce UniRAG, a plug-and-play technique that adds relevant retrieved information to prompts as few-shot examples during inference. Unlike the common belief that Retrieval Augmentation (RA) mainly improves generation or understanding of uncommon entities, our evaluation results on the MSCOCO dataset with common entities show that both proprietary models like GPT-4o and Gemini-Pro and smaller open-source models like LLaVA, LaVIT, and Emu2 significantly enhance their generation quality when their input prompts are augmented with relevant information retrieved by Vision-Language (VL) retrievers like UniIR models. All the necessary code to reproduce our results is available at https://github.com/castorini/UniRAG

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2405.10311")

Code

Syntology Ran 12 of 13 code samples harvested from 1 repository linked to this paper; 1 has no recorded run. Of those that ran: 12 ran with no contract checked.

By repository: official repository: 13 samples from 1 repository, 12 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

castorini/unirag officialmentioned in papermentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

13 samples harvested; 12 ran; 0 honoured the contract we drafted; 1 has no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

12ran
1unverified

Licence: 13 of the 13 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from castorini/unirag. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

convert_to_tokenizer_input_format castorini/unirag/src/unirag/eval_caption_generation.py official repository ran no licence file found · pointer only · d53d25a47fbce248 · report
file_in_dir castorini/unirag/src/unirag/eval_caption_generation.py official repository ran fingerprinted no licence file found · pointer only · 1606cd36064dba35 · report
filter_qids castorini/unirag/src/unirag/incontext_example_provider.py official repository ran no licence file found · pointer only · 142c53c9cf9f8446 · report
get_candidates castorini/unirag/src/unirag/incontext_example_provider.py official repository ran no licence file found · pointer only · df3c779782a41086 · report
get_positive_cands castorini/unirag/src/unirag/incontext_example_provider.py official repository ran no licence file found · pointer only · 29a3bd6adf269138 · report
infer_lavit castorini/unirag/src/unirag/image_generation_inference.py official repository ran no licence file found · pointer only · aa1c0514a26caa69 · report
load_candidates castorini/unirag/src/unirag/prepare_dataset.py official repository ran no licence file found · pointer only · cf46d511fdda3462 · report
load_images castorini/unirag/src/unirag/eval_image_generation.py official repository ran no licence file found · pointer only · 3277243808d631aa · report
load_prompts castorini/unirag/src/unirag/eval_image_generation.py official repository ran no licence file found · pointer only · 1d3391d39efd8b4c · report
load_retrieved_images castorini/unirag/src/unirag/eval_image_generation.py official repository ran no licence file found · pointer only · 6a7fd654c9b1931c · report
sample_queries castorini/unirag/src/unirag/prepare_dataset.py official repository ran no licence file found · pointer only · 98c063b347cbdd01 · report
save_result castorini/unirag/src/unirag/utils.py official repository ran no licence file found · pointer only · 58629c6a6cb6b282 · report
download_cached_file castorini/unirag/src/unirag/utils.py official repository unverified no licence file found · pointer only · 643539116e049080 · report

Tasks

Image CaptioningImage GenerationQuestion AnsweringRetrievalVisual Question Answering

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections