SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2501.12835 · ACL · 2025

Adaptive Retrieval without Self-Knowledge? Bringing Uncertainty Back Home

Alexander Panchenko, Irina Nikishina, Viktor Moskvoretskii, Sergey Pletenev, Daria Galimzianova, Vasily Konovalov, Nikolay Ivanov, Nikita Krayko, M. Salnikov, M. Lysyuk

arXiv · PDF · Open in the Atlas

Code that ran

9 of 9 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; 0 honoured the contract we drafted, 1 violated it and 3 have no contract verdict; 5 failures of our instrument; 0 no recorded run), measured 2026-11-22; 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/2501.12835.json · badge: /api/ran/2501.12835.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
s-nlp/AdaRAGUE canonical (classifier label)
classifier basis not recorded on the link
9 ran · 0 no recorded run
FunctionStatusWhere it lives
answer_extractor Ran
ran; our contract draft was wrong, not the code
s-nlp/AdaRAGUE/Adaptive_Rag/evaluate.py
code served (permissive licence) · get_code("0114479cb31c26f0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re

def answer_extractor(potentially_cot: str) -> str:
    if potentially_cot.startswith('"') and potentially_cot.endswith('"'):
        potentially_cot = potentially_cot[1:-1]
    cot_regex = re.compile('.* answer is:? (.*)\\.?')
    match = cot_regex.match(potentially_cot)
    if match:
        output = match.group(1)
        if output.endswith('.'):
            output = output[:-1]
    else:
        output = potentially_cot
    return output

ARGS = {
    "potentially_cot": "The answer is: 42."
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
extract_assistant_responses Ran
ran on a synthesized input
s-nlp/AdaRAGUE/UC/add_column.py
code served (permissive licence) · get_code("12e13b9f901be896")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

# Construct test data for extract_assistant_responses
# The function expects decoded_pairs: iterable of tuples (_, generations)
# where generations can be str, list of str, or list of dicts with 'generated_text'

# Test case 1: generations as string
decoded_pairs_1 = [
    (None, "assistant: This is a response"),
    (None, ["assistant: Another response", "assistant: Yet another"]),
    (None, [
        {"generated_text": "assistant: Dict-based response"},
        {"generated_text": "assistant: Another dict response"}
    ]),
]

# Test case 2: with separator and SCORE keyword
decoded_pairs_2 = [
    (None, "assistant: response1\\sep\\sep more text"),
    (None, ["assistant: PASS response", "assistant: FAIL response"]),
]

# Use the first test case as the primary argument
ARGS = {
    'decoded_pairs': decoded_pairs_1,
    'keyword': 'assistant'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_answer Ran
ran; our contract draft was wrong, not the code
s-nlp/AdaRAGUE/SeaKR/main_simpleqa.py
pointer only (licence: MIT); the stored copy get_code serves, from thu-keg/seakr, is pointer only (licence: GPL-3.0) · get_code("64fc92f1ad0464da")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from thu-keg/seakr, and GPL-3.0, as GitHub detects it on that repository, 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.

get_bootstrap_result Ran
ran on a synthesized input
s-nlp/AdaRAGUE/SeaKR/bootstrap_CI_upd.py
code served (permissive licence) · get_code("7f3f10b6af5865d1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 3, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pandas as pd
import numpy as np

# Create a sample DataFrame with the required columns
np.random.seed(0)
df_init = pd.DataFrame({
    'has_answer': np.random.randint(0, 2, size=20),
    'em': np.random.rand(20),
    'f1': np.random.rand(20)
})

ARGS = {
    'df_init': df_init,
    'num_round': 5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 3, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_init_result Ran
ran on a synthesized input
s-nlp/AdaRAGUE/SeaKR/bootstrap_CI_upd.py
code served (permissive licence) · get_code("a71025d9e41c8f26")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
import pandas as pd
from unittest.mock import Mock
import json
import tempfile
import os

torch.manual_seed(0)

# Create a temporary JSON file with sample data
temp_dir = tempfile.mkdtemp()
json_file = os.path.join(temp_dir, "test_data.json")

sample_data = [
    {"id": "1", "prediction": "Paris", "ground_truth": ["Paris"]},
    {"id": "2", "prediction": "London", "ground_truth": ["London", "capital"]},
    {"id": "3", "prediction": "wrong", "ground_truth": ["correct"]},
]

with open(json_file, 'w') as f:
    json.dump(sample_data, f)

# Create a mock args object with required attributes
class ArgsStandIn:
    def __init__(self, input_file, pred_col, gt_col):
        self.input_file = input_file
        self.pred_col = pred_col
        self.gt_col = gt_col

args = ArgsStandIn(
    input_file=json_file,
    pred_col="prediction",
    gt_col="ground_truth"
)

# Create a mock comp_metrics function that returns expected values
def comp_metrics(json_path, pred_answer, gt_answers):
    # Load the JSON data
    with open(json_path, 'r') as f:
        data = json.load(f)
    
    # Create a simple dataframe from the data
    df = pd.DataFrame(data)
    
    # Return mock metrics and dataframe
    acc = 0.67
    em = 0.67
    f1 = 0.75
    
    return (acc, em, f1, df)

ARGS = {
    "args": args,
    "comp_metrics": comp_metrics
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
is_digital Ran
ran, violated the contract we drafted
s-nlp/AdaRAGUE/SeaKR/eval_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from shiyunee/when-to-retrieve, is pointer only (licence: NONE) · get_code("aa1fd19e0a59d29c")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from shiyunee/when-to-retrieve, and GitHub detected no licence in that repository 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.

normalize_answer Ran
ran; our contract draft was wrong, not the code
s-nlp/AdaRAGUE/Adaptive_Rag/evaluate.py
pointer only (licence: MIT); the stored copy get_code serves, from saptarshi059/cdqa-project, is pointer only (licence: NONE) · get_code("6a96435eba311b08")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from saptarshi059/cdqa-project, and GitHub detected no licence in that repository 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
s-nlp/AdaRAGUE/SeaKR/eval_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from shiyunee/when-to-retrieve, is pointer only (licence: NONE) · get_code("6017b412458e24f4")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from shiyunee/when-to-retrieve, and GitHub detected no licence in that repository 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
s-nlp/AdaRAGUE/SeaKR/eval_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from shiyunee/when-to-retrieve, is pointer only (licence: NONE) · get_code("12c87f537e859253")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from shiyunee/when-to-retrieve, and GitHub detected no licence in that repository 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.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 0 the same month, 2 later) and 3 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
normalize_answer 37 other papers
34 dated earlier, 3 later · 1 only as an assembly brick
1808.07042 (2018-08)
CoQA: A Conversational Question Answering Challenge
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1902.01718 (2019-02)
End-to-End Open-Domain Question Answering with BERTserini
and 34 more not named here
answer_extractor 2 other papers
1 dated earlier, 1 later
2403.14403 (2024-03)
Adaptive-RAG: Learning to Adapt Retrieval-Augmented Large Language Models through Question Complexity
2504.17454 (2025-04)
Adaptive Orchestration of Modular Generative Information Access Systems
get_answer 1 other paper
1 dated earlier
2406.19215 (2024-06)
SeaKR: Self-aware Knowledge Retrieval for Adaptive Retrieval Augmented Generation
is_digital 1 other paper
1 dated earlier
2402.11457 (2024-02)
When Do LLMs Need Retrieval Augmentation? Mitigating LLMs' Overconfidence Helps Retrieval Augmentation
read_json 1 other paper
1 dated earlier
2402.11457 (2024-02)
When Do LLMs Need Retrieval Augmentation? Mitigating LLMs' Overconfidence Helps Retrieval Augmentation
remove_punc 1 other paper
1 dated earlier
2402.11457 (2024-02)
When Do LLMs Need Retrieval Augmentation? Mitigating LLMs' Overconfidence Helps Retrieval Augmentation

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-22.

Repositories linked to this paper

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

Abstract

Retrieval Augmented Generation (RAG) improves correctness of Question Answering (QA) and addresses hallucinations in Large Language Models (LLMs), yet greatly increase computational costs. Besides, RAG is not always needed as may introduce irrelevant information. Recent adaptive retrieval methods integrate LLMs' intrinsic knowledge with external information appealing to LLM self-knowledge, but they often neglect efficiency evaluations and comparisons with uncertainty estimation techniques. We bridge this gap by conducting a comprehensive analysis of 35 adaptive retrieval methods, including 8 recent approaches and 27 uncertainty estimation techniques, across 6 datasets using 10 metrics for QA performance, self-knowledge, and efficiency. Our findings show that uncertainty estimation techniques often outperform complex pipelines in terms of efficiency and self-knowledge, while maintaining comparable QA performance.

For agents

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

get_harvested_code_for_paper("2501.12835")
get_code_for_paper("2501.12835")
have("2501.12835")

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

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

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

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

Connect an agent — have() is free.