SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2505.20128 · 2025

Iterative Self-Incentivization Empowers Large Language Models as Agentic Searchers

arXiv · PDF · Open in the Atlas

Code that ran

9 of 13 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 8 have no contract verdict; 1 failure of our instrument; 4 no recorded run), measured 2026-11-22; 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/2505.20128.json · badge: /api/ran/2505.20128.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
mangopy/searchlm canonical (classifier label)
classifier basis not recorded on the link
9 ran · 4 no recorded run
FunctionStatusWhere it lives
calculate_probability Ran
ran on a synthesized input
mangopy/searchlm/src/utilize/utilize.py
code served (permissive licence) · get_code("2d3b1c0d8ff65548")
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 float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 math

torch_manual_seed = 0

# The function calculate_probability takes a cumulative_logprob parameter
# and computes math.exp(cumulative_logprob)
# cumulative_logprob should be a numeric value (int, float, or similar)
# that can be passed to math.exp()

# Create a simple float value representing a cumulative log probability
# Using a realistic log probability value (negative, since probabilities < 1)
cumulative_logprob_value = -0.5

ARGS = {
    "cumulative_logprob": cumulative_logprob_value
}
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 float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
causal_cross_entropy Ran
ran on a synthesized input
mangopy/searchlm/src/_entropy.py
code served (permissive licence) · get_code("fac0d9d6ff56e2b2")
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 Tensor, ndim 1, dtype family float, shape (2,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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
from torch import nn, tensor

torch.manual_seed(0)

# Define a minimal model that satisfies the function's requirements
class MinimalLanguageModel(nn.Module):
    def __init__(self, vocab_size=10, hidden_size=4):
        super().__init__()
        self.embedding = nn.Embedding(vocab_size, hidden_size)
        self.lm_head = nn.Linear(hidden_size, vocab_size)
    
    def forward(self, input_ids, labels=None):
        # input_ids shape: (batch_size, seq_len)
        # returns dict with 'logits' key
        x = self.embedding(input_ids)  # (batch_size, seq_len, hidden_size)
        logits = self.lm_head(x)  # (batch_size, seq_len, vocab_size)
        return {'logits': logits}

# Create model instance
model = MinimalLanguageModel(vocab_size=10, hidden_size=4)

# Create input_ids tensor: (batch_size=2, seq_len=5)
input_ids = torch.tensor([[1, 2, 3, 4, 5],
                          [2, 3, 4, 5, 1]], dtype=torch.long)

# Create labels tensor: same shape as input_ids, with -100 for ignore_index positions
labels = torch.tensor([[2, 3, 4, 5, 1],
                       [3, 4, 5, 1, 2]], dtype=torch.long)

ARGS = {
    'model': model,
    'input_ids': input_ids,
    'labels': labels
}
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 Tensor, ndim 1, dtype family float, shape (2,) — shape (2,) as a later run recorded it
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
create_output_file Ran
ran on a synthesized input
mangopy/searchlm/src/inference.py
code served (permissive licence) · get_code("00512313aa5d3869")
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
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'model_name': 'transformers/bert-base-uncased',
    'input_file': 'data/train.json',
    'file_type': 'predictions',
    'left': '0',
    'right': '1'
}
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
eval_em Ran
ran on a synthesized input
mangopy/searchlm/src/utilize/metrics.py
code served (permissive licence) · get_code("a100cdcea346bed3")
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 dict. 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
import string

def rounder(num):
    return round(num, 3)

def normalize_answer(s):
    """Lower text and remove punctuation, articles and extra whitespace."""
    re_punc = re.compile('[!"#$%&()*+,-./:;<=>?@\\[\\]\\\\^`{|}~_\\\']')

    def remove_articles(text):
        return re.sub('\\b(a|an|the)\\b', ' ', text)

    def white_space_fix(text):
        return ' '.join(text.split())

    def remove_punc(text):
        exclude = set(string.punctuation)
        return ''.join((ch for ch in text if ch not in exclude))

    def lower(text):
        return text.lower()
    return white_space_fix(remove_articles(remove_punc(lower(s))))

def eval_em(preds, answers):
    scores = []
    for pred, answer in zip(preds, answers):
        pred = normalize_answer(pred)
        if any([normalize_answer(ans) == pred for ans in answer]):
            scores.append(1)
        else:
            scores.append(0)
    return {'EM': rounder(sum(scores) * 100 / len(scores))}

# Setup code
ARGS = {
    'preds': [
        'The quick brown fox',
        'Hello world'
    ],
    'answers': [
        ['the quick brown fox', 'a quick brown fox'],
        ['hello world', 'hello there world']
    ]
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
normalize_answer Ran
ran on a synthesized input
mangopy/searchlm/src/utilize/metrics.py
code served (permissive licence) · get_code("93730b62e07a68f0")
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
import string

def normalize_answer(s):
    """Lower text and remove punctuation, articles and extra whitespace."""
    re_punc = re.compile('[!"#$%&()*+,-./:;<=>?@\\[\\]\\\\^`{|}~_\\\']')

    def remove_articles(text):
        return re.sub('\\b(a|an|the)\\b', ' ', text)

    def white_space_fix(text):
        return ' '.join(text.split())

    def remove_punc(text):
        exclude = set(string.punctuation)
        return ''.join((ch for ch in text if ch not in exclude))

    def lower(text):
        return text.lower()
    return white_space_fix(remove_articles(remove_punc(lower(s))))

# The function takes a single parameter 's' which is a string
ARGS = {
    's': "The Quick Brown Fox, jumps over the lazy dog!"
}
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
rank_instruction Ran
ran on a synthesized input
mangopy/searchlm/src/instruction.py
code served (permissive licence) · get_code("13bc5dd5167e35d3")
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 copy
from typing import List, Union

ARGS = {
    "question": "What is the capital of France?",
    "candidates": [
        "Paris is the capital and largest city of France, located in the north-central part of the country.",
        "France is a country in Western Europe with several overseas regions and territories.",
        "The Eiffel Tower is an iconic landmark located in Paris, France.",
        "Lyon is the second-largest city in France."
    ]
}
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
remove_duplicate Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mangopy/searchlm/src/utilize/utilize.py
code served (permissive licence) · get_code("765325bbb716f8dc")
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 int; 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

torch.manual_seed(0)

# The function remove_duplicate takes a response parameter and removes duplicates
# while preserving order. It iterates through elements and checks membership.
# The parameter should be an iterable (list, tuple, etc.) of hashable items.

# Create a simple list with some duplicate elements
response = [1, 2, 3, 2, 4, 1, 5, 3]

ARGS = {
    "response": response
}
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 int — 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
rounder Ran
ran on a synthesized input
mangopy/searchlm/src/utilize/metrics.py
code served (permissive licence) · get_code("1ac4537f9c4bf017")
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 float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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)

ARGS = {
    "num": 3.14159
}
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 float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
str_index_docs Ran
ran on a synthesized input
mangopy/searchlm/src/utilize/utilize.py
code served (permissive licence) · get_code("2988ca73371f5e72")
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
import numpy as np

torch.manual_seed(0)

# Analyze the function str_index_docs:
# - text: str - used in extract_numbers_from_ordered_brackets(text)
# - candidates: list - indexed with [i - start] and len(candidates) is checked
# - start: int (default=1) - used in arithmetic and comparison

# The function extracts numbers from text, then uses them as indices into candidates
# Let's create appropriate test arguments

text = "The top results are [1] and [3] and [2]"
candidates = ["doc_a", "doc_b", "doc_c", "doc_d"]
start = 1

ARGS = {
    "text": text,
    "candidates": candidates,
    "start": start
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, 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
document_retrieval Not yet run
unverified (harvested, no recorded run)
mangopy/searchlm/src/utilize/apis.py
code served (permissive licence) · get_code("de974ba295370e38")
How it ran

no invocation recorded.

get_doc_by_ids Not yet run
unverified (harvested, no recorded run)
mangopy/searchlm/src/instruction.py
code served (permissive licence) · get_code("bbf687f13e8a8059")
How it ran

no invocation recorded.

get_from_openai Not yet run
unverified (harvested, no recorded run)
mangopy/searchlm/src/utilize/apis.py
code served (permissive licence) · get_code("8c43f83df55cd40a")
How it ran

no invocation recorded.

load_tokenizer Not yet run
unverified (harvested, no recorded run)
mangopy/searchlm/src/_entropy.py
code served (permissive licence) · get_code("a3518bfc816435e7")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 0 later) and 10 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
causal_cross_entropy 1 other paper
1 dated earlier
2108.00573 (2021-08)
MuSiQue: Multihop Questions via Single-hop Question Composition
remove_duplicate 1 other paper
1 dated earlier
2407.18940 (2024-07)
LitSearch: A Retrieval Benchmark for Scientific Literature Search
rounder 1 other paper
1 dated earlier
2108.00573 (2021-08)
MuSiQue: Multihop Questions via Single-hop Question Composition

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

Large language models (LLMs) have been widely integrated into information retrieval to advance traditional techniques. However, effectively enabling LLMs to seek accurate knowledge in complex tasks remains a challenge due to the complexity of multi-hop queries as well as the irrelevant retrieved content. To address these limitations, we propose EXSEARCH, an agentic search framework, where the LLM learns to retrieve useful information as the reasoning unfolds through a self-incentivized process. At each step, the LLM decides what to retrieve (thinking), triggers an external retriever (search), and extracts fine-grained evidence (recording) to support next-step reasoning. To enable LLM with this capability, EXSEARCH adopts a Generalized Expectation-Maximization algorithm. In the E-step, the LLM generates multiple search trajectories and assigns an importance weight to each; the M-step trains the LLM on them with a re-weighted loss function. This creates a self-incentivized loop, where the LLM iteratively learns from its own generated data, progressively improving itself for search. We further theoretically analyze this training process, establishing convergence guarantees. Extensive experiments on four knowledge-intensive benchmarks show that EXSEARCH substantially outperforms baselines, e.g., +7.8% improvement on exact match score. Motivated by these promising results, we introduce EXSEARCH-Zoo, an extension that extends our method to broader scenarios, to facilitate future work.

For agents

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

get_harvested_code_for_paper("2505.20128")
get_code_for_paper("2505.20128")
have("2505.20128")

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

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

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

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

Connect an agent — have() is free.