SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.11457 · 2024

When Do LLMs Need Retrieval Augmentation? Mitigating LLMs' Overconfidence Helps Retrieval Augmentation

arXiv · PDF · Open in the Atlas

Code that ran

6 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; 2 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 3 failures of our instrument; 2 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/2402.11457.json · badge: /api/ran/2402.11457.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
shiyunee/when-to-retrieve canonical (classifier label)
classifier basis: census
6 ran · 2 no recorded run
FunctionStatusWhere it lives
adaptive_retrieval_score Ran
ran, honoured the contract we drafted
shiyunee/when-to-retrieve/utils/compute.py
pointer only (licence: NONE) · get_code("05cc221ee34c1e8d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, shiyunee/when-to-retrieve when it was checked. 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.

is_digital Ran
ran, violated the contract we drafted
shiyunee/when-to-retrieve/utils/utils.py
pointer only (licence: NONE) · get_code("aa1fd19e0a59d29c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, shiyunee/when-to-retrieve when it was checked. 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.

rag_score Ran
ran, honoured the contract we drafted
shiyunee/when-to-retrieve/utils/compute.py
pointer only (licence: NONE) · get_code("a279129a5bfc796f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, shiyunee/when-to-retrieve when it was checked. 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.

read_json Ran
ran; our contract draft was wrong, not the code
shiyunee/when-to-retrieve/utils/utils.py
pointer only (licence: NONE) · get_code("6017b412458e24f4")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, shiyunee/when-to-retrieve when it was checked. 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.

remove_pattern Ran
ran; our contract draft was wrong, not the code
shiyunee/when-to-retrieve/utils/preprocess.py
pointer only (licence: NONE) · get_code("0ed2d2bac23cfd92")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, shiyunee/when-to-retrieve when it was checked. 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.

remove_punc Ran
ran; our contract draft was wrong, not the code
shiyunee/when-to-retrieve/utils/preprocess.py
pointer only (licence: NONE) · get_code("12c87f537e859253")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, shiyunee/when-to-retrieve when it was checked. 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.

get_llm_result Not yet run
unverified (harvested, no recorded run)
shiyunee/when-to-retrieve/utils/llm.py
pointer only (licence: NONE) · get_code("a1fab13ffb9f7975")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, shiyunee/when-to-retrieve when it was checked. 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.

get_prompt Not yet run
unverified (harvested, no recorded run)
shiyunee/when-to-retrieve/utils/prompt.py
pointer only (licence: NONE) · get_code("277b2d82e854b570")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, shiyunee/when-to-retrieve when it was checked. 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, 3 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 3 later) and 5 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
is_digital 1 other paper
1 later
2501.12835 (2025-01)
Adaptive Retrieval without Self-Knowledge? Bringing Uncertainty Back Home
read_json 1 other paper
1 later
2501.12835 (2025-01)
Adaptive Retrieval without Self-Knowledge? Bringing Uncertainty Back Home
remove_punc 1 other paper
1 later
2501.12835 (2025-01)
Adaptive Retrieval without Self-Knowledge? Bringing Uncertainty Back Home

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

Large Language Models (LLMs) have been found to have difficulty knowing they do not possess certain knowledge and tend to provide specious answers in such cases. Retrieval Augmentation (RA) has been extensively studied to mitigate LLMs' hallucinations. However, due to the extra overhead and unassured quality of retrieval, it may not be optimal to conduct RA all the time. A straightforward idea is to only conduct retrieval when LLMs are uncertain about a question. This motivates us to enhance the LLMs' ability to perceive their knowledge boundaries to help RA. In this paper, we first quantitatively measure LLMs' such ability and confirm their overconfidence. Then, we study how LLMs' certainty about a question correlates with their dependence on external retrieved information. We propose several methods to enhance LLMs' perception of knowledge boundaries and show that they are effective in reducing overconfidence. Additionally, equipped with these methods, LLMs can achieve comparable or even better performance of RA with much fewer retrieval calls.

For agents

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

get_harvested_code_for_paper("2402.11457")
get_code_for_paper("2402.11457")
have("2402.11457")

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

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

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

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

Connect an agent — have() is free.