Papers › When to Retrieve: Teaching LLMs to Utilize Information Retrieval Effectively

When to Retrieve: Teaching LLMs to Utilize Information Retrieval Effectively

30 Apr 2024arXiv:2404.19705archive 2025-07-28

Tiziano Labruna, Jon Ander Campos, Gorka Azkune

In this paper, we demonstrate how Large Language Models (LLMs) can effectively learn to use an off-the-shelf information retrieval (IR) system specifically when additional context is required to answer a given question. Given the performance of IR systems, the optimal strategy for question answering does not always entail external information retrieval; rather, it often involves leveraging the parametric memory of the LLM itself. Prior research has identified this phenomenon in the PopQA dataset, wherein the most popular questions are effectively addressed using the LLM's parametric memory, while less popular ones require IR system usage. Following this, we propose a tailored training approach for LLMs, leveraging existing open-domain question answering datasets. Here, LLMs are trained to generate a special token, <RET>, when they do not know the answer to a question. Our evaluation of the Adaptive Retrieval LLM (Adapt-LLM) on the PopQA dataset showcases improvements over the same LLM under three configurations: (i) retrieving information for all the questions, (ii) using always the parametric memory of the LLM, and (iii) using a popularity threshold to decide when to use a retriever. Through our analysis, we demonstrate that Adapt-LLM is able to generate the <RET> token when it determines that it does not know how to answer a question, indicating the need for IR, while it achieves notably high accuracy levels when it chooses to rely only on its parametric memory.

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

Code

Syntology Ran 1 of 8 code samples harvested from 1 repository linked to this paper; 7 have no recorded run. Of those that ran: 1 ran · honoured contract.

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

tLabruna/Adapt-LLM officialpytorchCC-BY-4.0 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

8 samples harvested; 1 ran; 1 honoured the contract we drafted; 7 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.

1ran · honoured contract
7unverified

Licence: 8 of the 8 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 tLabruna/Adapt-LLM. “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.

gather_nograd tLabruna/Adapt-LLM/contriever/src/dist_utils.py official repository ran · honoured contract fingerprinted CC-BY-4.0 · pointer only · 01971cc37e6fe583 · report
calculate_matches tLabruna/Adapt-LLM/contriever/src/evaluation.py official repository unverified CC-BY-4.0 · pointer only · 7a4988952dd3a127 · report
check_answer tLabruna/Adapt-LLM/contriever/src/evaluation.py official repository unverified CC-BY-4.0 · pointer only · 637b51b8df78832a · report
gather tLabruna/Adapt-LLM/contriever/src/dist_utils.py official repository unverified CC-BY-4.0 · pointer only · 9fb6e57668661c38 · report
has_answer tLabruna/Adapt-LLM/contriever/src/evaluation.py official repository unverified CC-BY-4.0 · pointer only · fa4ecbff4b9a354b · report
normalize tLabruna/Adapt-LLM/contriever/src/normalize_text.py official repository unverified CC-BY-4.0 · pointer only · 806114c1fae3d57e · report
randomcrop tLabruna/Adapt-LLM/contriever/src/data.py official repository unverified CC-BY-4.0 · pointer only · e037474365501512 · report
varsize_gather_nograd tLabruna/Adapt-LLM/contriever/src/dist_utils.py official repository unverified CC-BY-4.0 · pointer only · b1ad8cd3a7168b7f · report

Tasks

Information RetrievalOpen-Domain Question AnsweringQuestion AnsweringRetrieval

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