SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2601.16462 · 2026

Finding What Matters: Anchoring Context Knowledge with Evolving Indices for Iterative Retrieval

Shuo Wang, Maosong Sun, Cheng Yang, Zhenghao Liu, Yukun Yan, Xinze Li, Zheni Zeng, Minghe Yu, Mingyan Wu, Yuqing Lan

arXiv · PDF · Open in the Atlas

Code that ran

5 of 15 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, 0 violated it and 0 have no contract verdict; 5 failures of our instrument; 10 no recorded run), measured 2026-11-23; 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/2601.16462.json · badge: /api/ran/2601.16462.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
NEUIR/KAIR community
Papers with Code archive
5 ran · 10 no recorded run
FunctionStatusWhere it lives
extract_index_tag Ran
ran; our contract draft was wrong, not the code
NEUIR/KAIR/src/KAIR.py
code served (permissive licence) · get_code("4b620cc018f632bb")
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 extract_index_tag(output: str) -> str | None:
    """
    Extract the content of the <index> tag.
    Supports two scenarios:
    1. <index> ... </index>
    2. <index> ...   (When the closing tag is missing, extract until the end of the text)
    """
    match = re.search('<index>\\s*([\\s\\S]*?)\\s*</index>', output, re.IGNORECASE)
    if match:
        return match.group(1).strip()
    match_open = re.search('<index>\\s*([\\s\\S]*)', output, re.IGNORECASE)
    if match_open:
        return match_open.group(1).strip()
    return None


# Test case 1: Complete tag with content
output_1 = "<index>  some index content  </index>"

# Test case 2: Missing closing tag
output_2 = "<index>  unclosed index content"

# Test case 3: No index tag
output_3 = "no index tag here"

# Test case 4: Case insensitive
output_4 = "<INDEX>  case insensitive  </INDEX>"

# Test case 5: Complex content with newlines
output_5 = "<index>\n  multiline\n  content\n</index>"

ARGS = {
    "output": output_1
}
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_judgement_tag Ran
ran; our contract draft was wrong, not the code
NEUIR/KAIR/src/KAIR.py
code served (permissive licence) · get_code("b599a750dbef7e3e")
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 extract_judgement_tag(output: str) -> str:
    """
    Extract the content of the <judgement> tag (sufficient / insufficient).
    Return a lowercase string; return None if not found.
    """
    match = re.search('<judgement>\\s*(sufficient|insufficient)\\s*</judgement>', output, re.IGNORECASE)
    if match:
        return match.group(1).lower()
    return None


# Test cases for the function
test_output_1 = "<judgement>sufficient</judgement>"
test_output_2 = "<judgement>  INSUFFICIENT  </judgement>"
test_output_3 = "Some text <judgement>sufficient</judgement> more text"
test_output_4 = "No tag here"
test_output_5 = "<judgement>invalid</judgement>"

ARGS = {
    "output": test_output_1
}
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_question_tag Ran
ran; our contract draft was wrong, not the code
NEUIR/KAIR/src/KAIR.py
code served (permissive licence) · get_code("aaa54adb200ada0f")
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 extract_question_tag(output: str) -> str | None:
    """
    Extract the content of the <next_question> tag.
    Supports two scenarios:
    1. <next_question> ... </next_question>
    2. <next_question> ...   (When the closing tag is missing, retrieve up to the end of the text)
    """
    match = re.search('<next_question>\\s*([\\s\\S]*?)\\s*</next_question>', output, re.IGNORECASE)
    if match:
        return match.group(1).strip()
    match_open = re.search('<next_question>\\s*([\\s\\S]*)', output, re.IGNORECASE)
    if match_open:
        return match_open.group(1).strip()
    return None


ARGS = {
    "output": "<next_question>What is the capital of France?</next_question>"
}
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
get_context Ran
ran; our contract draft was wrong, not the code
NEUIR/KAIR/src/KAIR.py
code served (permissive licence) · get_code("e0b68be4c85e7c8e")
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 torch

torch.manual_seed(0)

# The function expects 'data' to be an iterable of documents (strings)
# It joins them with labels like 'Passage[0] = doc', 'Passage[1] = doc', etc.
data = [
    "The quick brown fox jumps over the lazy dog.",
    "Machine learning is a subset of artificial intelligence.",
    "Python is a versatile programming language."
]

ARGS = {
    "data": data
}
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 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
passage_deduplication Ran
ran; our contract draft was wrong, not the code
NEUIR/KAIR/src/KAIR.py
code served (permissive licence) · get_code("81c191763e2461ce")
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

def passage_deduplication(passages):
    seen = set()
    deduplicated_passages = []
    for passage in passages:
        if passage not in seen:
            seen.add(passage)
            deduplicated_passages.append(passage)
    return deduplicated_passages

# The function iterates through passages and checks membership in a set.
# Passages should be hashable (strings, tuples, etc.)
# We'll use strings as they are hashable and commonly used for passages.

passages_list = [
    "This is the first passage about machine learning.",
    "This is the second passage about deep learning.",
    "This is the first passage about machine learning.",
    "This is a unique third passage.",
    "This is the second passage about deep learning."
]

ARGS = {
    "passages": passages_list
}
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
KAIR Not yet run
unverified (harvested, no recorded run)
NEUIR/KAIR/src/KAIR.py
code served (permissive licence) · get_code("6daee07ee80c04c0")
How it ran

no invocation recorded.

call_llm_template Not yet run
unverified (harvested, no recorded run)
NEUIR/KAIR/src/KAIR.py
code served (permissive licence) · get_code("1c8cd8a7e983cc7b")
How it ran

no invocation recorded.

gen_answer Not yet run
unverified (harvested, no recorded run)
NEUIR/KAIR/src/KAIR.py
code served (permissive licence) · get_code("3848e79c8bb04f74")
How it ran

no invocation recorded.

gen_finalanswer Not yet run
unverified (harvested, no recorded run)
NEUIR/KAIR/src/KAIR.py
code served (permissive licence) · get_code("e09a43193202e348")
How it ran

no invocation recorded.

gen_indexanswer Not yet run
unverified (harvested, no recorded run)
NEUIR/KAIR/src/KAIR.py
code served (permissive licence) · get_code("c651a7f370e1f934")
How it ran

no invocation recorded.

gen_passageanswer Not yet run
unverified (harvested, no recorded run)
NEUIR/KAIR/src/KAIR.py
code served (permissive licence) · get_code("b2a9693f538ccbfb")
How it ran

no invocation recorded.

init_reasoning Not yet run
unverified (harvested, no recorded run)
NEUIR/KAIR/src/KAIR.py
code served (permissive licence) · get_code("51e719888e62f3ab")
How it ran

no invocation recorded.

init_reasoning_plus Not yet run
unverified (harvested, no recorded run)
NEUIR/KAIR/src/KAIR.py
code served (permissive licence) · get_code("341f7ea59da01b89")
How it ran

no invocation recorded.

step_reasoning Not yet run
unverified (harvested, no recorded run)
NEUIR/KAIR/src/KAIR.py
code served (permissive licence) · get_code("4f5e6f55db6baabb")
How it ran

no invocation recorded.

step_reasoning_plus Not yet run
unverified (harvested, no recorded run)
NEUIR/KAIR/src/KAIR.py
code served (permissive licence) · get_code("02f2972d57004c68")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 15 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.

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

Retrieval-Augmented Generation (RAG) has become a dominant paradigm for mitigating hallucinations in Large Language Models (LLMs) by incorporating external knowledge. However, existing RAG systems often struggle to effectively integrate and reason over key evidence scattered across noisy retrieved documents, particularly in multi-hop scenarios. In this paper, we propose KAIR, a Knowledge Anchoring framework for Iterative Retrieval that anchors knowledge within retrieved knowledge to guide LLMs to locate the key information. During iterative retrieval, KAIR progressively updates the knowledge index to anchor salient evidence from retrieved documents. The evolving index serves as a navigational anchoring index that enables the LLM to assess knowledge sufficiency and formulate subsequent retrieval queries. Finally, KAIR generates answers by jointly leveraging the retrieved documents and the finalized anchoring index. Experiments on four multi-hop question answering benchmarks demonstrate that KAIR consistently outperforms strong RAG baselines. Further analysis shows that KAIR effectively anchors key knowledge and alleviates the context noise during iterative retrieval, improving the LLM's ability to associate and reason over dispersed evidence across retrieved documents. All code and data are available at https://github.com/NEUIR/KAIR. * indicates equal contribution. † indicates corresponding author.

For agents

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

get_harvested_code_for_paper("2601.16462")
get_code_for_paper("2601.16462")
have("2601.16462")

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

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

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

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

Connect an agent — have() is free.