Papers › REPLUG: Retrieval-Augmented Black-Box Language Models

REPLUG: Retrieval-Augmented Black-Box Language Models

30 Jan 2023arXiv:2301.12652archive 2025-07-28

Weijia Shi, Sewon Min, Michihiro Yasunaga, Minjoon Seo, Rich James, Mike Lewis, Luke Zettlemoyer, Wen-tau Yih

We introduce REPLUG, a retrieval-augmented language modeling framework that treats the language model (LM) as a black box and augments it with a tuneable retrieval model. Unlike prior retrieval-augmented LMs that train language models with special cross attention mechanisms to encode the retrieved text, REPLUG simply prepends retrieved documents to the input for the frozen black-box LM. This simple design can be easily applied to any existing retrieval and language models. Furthermore, we show that the LM can be used to supervise the retrieval model, which can then find documents that help the LM make better predictions. Our experiments demonstrate that REPLUG with the tuned retriever significantly improves the performance of GPT-3 (175B) on language modeling by 6.3%, as well as the performance of Codex on five-shot MMLU by 5.1%.

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="2301.12652")

Code

Syntology Ran 0 of 13 code samples harvested from 1 repository linked to this paper; 13 have no recorded run.

By repository: community (archive-listed): 13 samples from 1 repository, 0 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

intellabs/fastrag mentioned on GitHubpytorchApache-2.0 report
liano3/RAG-fairness mentioned on GitHubpytorch report
ruc-nlpir/flashrag mentioned on GitHubpytorchMIT 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; 0 ran; 0 honoured the contract we drafted; 13 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

13unverified

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 intellabs/fastrag. “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.

add_timing_to_pipeline intellabs/fastrag/fastrag/utils.py community (archive-listed) unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · f3305aacfc98aaff · report
adjust_batch intellabs/fastrag/fastrag/generators/gaudi_utils.py community (archive-listed) unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · 22702323a133d7aa · report
clean_for_prompt intellabs/fastrag/fastrag/agents/utils.py community (archive-listed) unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · a063dd45ba80cda9 · report
fastrag_timing intellabs/fastrag/fastrag/utils.py community (archive-listed) unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · 3bd441205b45bf06 · report
get_padded_tensor intellabs/fastrag/fastrag/generators/fid_utils.py community (archive-listed) unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · 392eb8978ee423ad · report
get_timing_from_pipeline intellabs/fastrag/fastrag/utils.py community (archive-listed) unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · 629184378b16dad0 · report
get_torch_compiled_model intellabs/fastrag/fastrag/generators/gaudi_utils.py community (archive-listed) unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · 9a8ef57d5aeeee0d · report
load_text intellabs/fastrag/fastrag/agents/utils.py community (archive-listed) unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · e7bb63793c50dd54 · report
passages_to_tensors intellabs/fastrag/fastrag/generators/fid_utils.py community (archive-listed) unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · b7cb9a8067883d41 · report
setup_device intellabs/fastrag/fastrag/generators/gaudi_utils.py community (archive-listed) unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · 3c215e4cbc96b8b6 · report
setup_parser intellabs/fastrag/fastrag/generators/gaudi.py community (archive-listed) unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · 3a98b7557c38ef50 · report
tokenization_result_to_tensor intellabs/fastrag/fastrag/generators/fid_utils.py community (archive-listed) unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · 24505d354160b0da · report
wiki_odqa_tasks_encoder intellabs/fastrag/fastrag/data_loaders.py community (archive-listed) unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · 71454965f4141e50 · report

Tasks

Language ModelingLanguage ModellingMMLUMulti-task Language UnderstandingQuestion AnsweringRetrieval

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Question Answering Natural Questions code-davinci-002 175B + REPLUG LSR (few-shot) EM 45.5 #16 of 47 Archive leaderboard report
Question Answering Natural Questions code-davinci-002 175B + REPLUG (few-shot) EM 44.7 #18 of 47 Archive leaderboard report
Question Answering TriviaQA code-davinci-002 175B + REPLUG LSR (Few-Shot) EM 77.3 #16 of 56 Archive leaderboard report
Question Answering TriviaQA code-davinci-002 175B + REPLUG (Few-Shot) EM 76.8 #18 of 56 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

AdamAttentionAttention DropoutBPECosine AnnealingDense ConnectionsDropoutGPT-3Layer NormalizationLinear LayerLinear Warmup With Cosine AnnealingMulti-Head AttentionResidual ConnectionSoftmaxWeight Decay

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