SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2404.19705 · 2024

When to Retrieve: Teaching LLMs to Utilize Information Retrieval Effectively

arXiv · PDF · Open in the Atlas

Code that ran

7 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 3 honoured the contract we drafted, 2 violated it and 0 have no contract verdict; 2 failures of our instrument; 1 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2404.19705.json · badge: /api/ran/2404.19705.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
tLabruna/Adapt-LLM canonical (classifier label)
classifier basis not recorded on the link
7 ran · 1 no recorded run
FunctionStatusWhere it lives
check_answer Ran
ran, violated the contract we drafted
tLabruna/Adapt-LLM/contriever/src/evaluation.py
pointer only (licence: CC-BY-4.0); the stored copy get_code serves, from facebookresearch/contriever, is pointer only (licence: NOASSERTION) · get_code("637b51b8df78832a")
How it ran

The body of this sample is withheld: CC-BY-4.0, as GitHub detects it on this paper's repository, tLabruna/Adapt-LLM, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

gather Ran
ran, honoured the contract we drafted
tLabruna/Adapt-LLM/contriever/src/dist_utils.py
pointer only (licence: CC-BY-4.0); the stored copy get_code serves, from facebookresearch/contriever, is pointer only (licence: NOASSERTION) · get_code("9fb6e57668661c38")
How it ran

The body of this sample is withheld: CC-BY-4.0, as GitHub detects it on this paper's repository, tLabruna/Adapt-LLM, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

gather_nograd Ran
ran, honoured the contract we drafted
tLabruna/Adapt-LLM/contriever/src/dist_utils.py
pointer only (licence: CC-BY-4.0); the stored copy get_code serves, from agwaBom/TPOUR, is pointer only (licence: NONE) · get_code("01971cc37e6fe583")
How it ran

The body of this sample is withheld: CC-BY-4.0, as GitHub detects it on this paper's repository, tLabruna/Adapt-LLM, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

has_answer Ran
ran, violated the contract we drafted
tLabruna/Adapt-LLM/contriever/src/evaluation.py
pointer only (licence: CC-BY-4.0); the stored copy get_code serves, from facebookresearch/contriever, is pointer only (licence: NOASSERTION) · get_code("fa4ecbff4b9a354b")
How it ran

The body of this sample is withheld: CC-BY-4.0, as GitHub detects it on this paper's repository, tLabruna/Adapt-LLM, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

normalize Ran
ran; our contract draft was wrong, not the code
tLabruna/Adapt-LLM/contriever/src/normalize_text.py
pointer only (licence: CC-BY-4.0); the stored copy get_code serves, from Haoang97/CausalProbe-2024, is pointer only (licence: NONE) · get_code("806114c1fae3d57e")
How it ran

The body of this sample is withheld: CC-BY-4.0, as GitHub detects it on this paper's repository, tLabruna/Adapt-LLM, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

randomcrop Ran
ran; our contract draft was wrong, not the code
tLabruna/Adapt-LLM/contriever/src/data.py
pointer only (licence: CC-BY-4.0); the stored copy get_code serves, from facebookresearch/contriever, is pointer only (licence: NOASSERTION) · get_code("e037474365501512")
How it ran

The body of this sample is withheld: CC-BY-4.0, as GitHub detects it on this paper's repository, tLabruna/Adapt-LLM, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

varsize_gather_nograd Ran
ran, honoured the contract we drafted
tLabruna/Adapt-LLM/contriever/src/dist_utils.py
pointer only (licence: CC-BY-4.0); the stored copy get_code serves, from facebookresearch/contriever, is pointer only (licence: NOASSERTION) · get_code("b1ad8cd3a7168b7f")
How it ran

The body of this sample is withheld: CC-BY-4.0, as GitHub detects it on this paper's repository, tLabruna/Adapt-LLM, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

calculate_matches Not yet run
unverified (harvested, no recorded run)
tLabruna/Adapt-LLM/contriever/src/evaluation.py
pointer only (licence: CC-BY-4.0); the stored copy get_code serves, from facebookresearch/contriever, is pointer only (licence: NOASSERTION) · get_code("7a4988952dd3a127")
How it ran

The body of this sample is withheld: CC-BY-4.0, as GitHub detects it on this paper's repository, tLabruna/Adapt-LLM, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 8 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 0 the same month, 8 later) and 0 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
calculate_matches 13 other papers
8 dated earlier, 5 later
2112.08688 (2021-12)
Evidentiality-guided Generation for Knowledge-Intensive NLP Tasks
2401.03568 (2024-01)
Agent AI: Surveying the Horizons of Multimodal Interaction
2401.16979 (2024-01)
Re3val: Reinforced and Reranked Generative Retrieval
and 10 more not named here
check_answer 13 other papers
8 dated earlier, 5 later
2112.08688 (2021-12)
Evidentiality-guided Generation for Knowledge-Intensive NLP Tasks
2401.03568 (2024-01)
Agent AI: Surveying the Horizons of Multimodal Interaction
2401.16979 (2024-01)
Re3val: Reinforced and Reranked Generative Retrieval
and 10 more not named here
has_answer 11 other papers
7 dated earlier, 4 later
2112.08688 (2021-12)
Evidentiality-guided Generation for Knowledge-Intensive NLP Tasks
2401.03568 (2024-01)
Agent AI: Surveying the Horizons of Multimodal Interaction
2401.16979 (2024-01)
Re3val: Reinforced and Reranked Generative Retrieval
and 8 more not named here
varsize_gather_nograd 10 other papers
3 dated earlier, 7 later
2402.03216 (2024-02)
M3-Embedding: Multi-Linguality, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillation
2402.07867 (2024-02)
PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Models
2403.06840 (2024-03)
RA-ISF: Learning to Answer and Understand from Retrieval Augmentation via Iterative Self-Feedback
and 7 more not named here
gather_nograd 9 other papers
3 dated earlier, 6 later
2402.03216 (2024-02)
M3-Embedding: Multi-Linguality, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillation
2402.07867 (2024-02)
PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Models
2403.06840 (2024-03)
RA-ISF: Learning to Answer and Understand from Retrieval Augmentation via Iterative Self-Feedback
and 6 more not named here
gather 8 other papers
3 dated earlier, 5 later
2402.03216 (2024-02)
M3-Embedding: Multi-Linguality, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillation
2402.07867 (2024-02)
PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Models
2403.06840 (2024-03)
RA-ISF: Learning to Answer and Understand from Retrieval Augmentation via Iterative Self-Feedback
and 5 more not named here
randomcrop 7 other papers
4 dated earlier, 3 later
2310.11511 (2023-10)
Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflection
2402.03216 (2024-02)
M3-Embedding: Multi-Linguality, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillation
2402.07867 (2024-02)
PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Models
and 4 more not named here
normalize 2 other papers
2 later
2025.findings-acl.1365 (2025 (year only))
ECoRAG: Evidentiality-guided Compression for Long Context RAG
2506.21215 (2025-06)
Unveiling Causal Reasoning in Large Language Models: Reality or Mirage?

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

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.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2404.19705")
get_code_for_paper("2404.19705")
have("2404.19705")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2404.19705.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2404.19705.svg)](https://syntology.ai/paper/2404.19705)

Connect an agent — have() is free.