SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2505.17447 · EMNLP · 2025

LeTS: Learning to Think-and-Search via Process-and-Outcome Reward Hybridization

Qi Zhang, Hao Chen, Haobo Wang, Junbo Zhao, Bo Zheng, Xiaomeng Hu, Shouqing Yang, Sheng Guo, Lirong Gao, Jinglei Chen, Jiexiang Wang

arXiv · PDF · Open in the Atlas

Code that ran

7 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 3 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 2 failures of our instrument; 3 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/2505.17447.json · badge: /api/ran/2505.17447.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
Cheungki/LeTS community
Papers with Code archive
7 ran · 3 no recorded run
FunctionStatusWhere it lives
DataProto Ran
ran on a synthesized input · constructed an object; no result was computed
Cheungki/LeTS/src/verl/workers/reward_manager/lets.py
code served (permissive licence) · get_code("ed505af43bfe067d")
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 an instance of its own class, DataProto: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
from tensordict import TensorDict

torch.manual_seed(0)

# Create a small TensorDict for the batch
batch_data = TensorDict({
    'input': torch.randn(2, 4),
    'output': torch.randn(2, 3),
}, batch_size=(2,))

# Create non_tensor_batch dictionary
non_tensor_batch = {
    'id': np.array([0, 1], dtype=object),
    'label': np.array(['a', 'b'], dtype=object),
}

# Create meta_info dictionary
meta_info = {
    'source': 'test_data',
    'version': 1,
}

ARGS = {
    'batch': batch_data,
    'non_tensor_batch': non_tensor_batch,
    'meta_info': meta_info,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, packaging, pandas, tensordict, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataProto — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a DataProto output the recorded ndim 1 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
DataProtoItem Ran
ran on a synthesized input · constructed an object; no result was computed
Cheungki/LeTS/src/verl/workers/reward_manager/lets.py
code served (permissive licence) · get_code("98345403d47f48b3")
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 an instance of its own class, DataProtoItem: the run constructed the object and did not call it, so no result was computed. 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
from tensordict import TensorDict

torch.manual_seed(0)

# Create a small TensorDict batch
batch_data = TensorDict({
    "observations": torch.randn(2, 4),
    "actions": torch.randn(2, 3),
    "rewards": torch.randn(2, 1),
}, batch_size=[2])

# Create non-tensor batch dict
non_tensor_batch = {
    "metadata": ["sample_1", "sample_2"],
    "ids": [101, 102]
}

# Create meta info dict
meta_info = {
    "episode_id": 1,
    "timestamp": 1234567890,
    "source": "environment"
}

ARGS = {
    "batch": batch_data,
    "non_tensor_batch": non_tensor_batch,
    "meta_info": meta_info
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensordict, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataProtoItem — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a DataProtoItem 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
check_content_sim Ran
ran, honoured the contract we drafted
Cheungki/LeTS/src/verl/workers/reward_manager/lets.py
code served (permissive licence) · get_code("38bca990d1f445da")
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
import numpy as np

# Analyze the function: check_content_sim takes two arguments
# search_content_a and search_content_b
# The function converts them to sets and computes Jaccard similarity
# So these should be iterables that can be converted to sets

# Create two simple lists/iterables with some overlapping elements
search_content_a = ['apple', 'banana', 'cherry', 'date']
search_content_b = ['banana', 'cherry', 'elderberry', 'fig']

ARGS = {
    'search_content_a': search_content_a,
    'search_content_b': search_content_b,
}
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 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
cross_chain_of_search_check Ran
ran, honoured the contract we drafted
Cheungki/LeTS/src/verl/workers/reward_manager/lets.py
code served (permissive licence) · get_code("0d13b07048e0133d")
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 numpy as np
from scipy.optimize import linear_sum_assignment

# Setup for cross_chain_of_search_check function
# This function takes two parameters:
# - gold_search_contents: a list of search content lists (each element is a list of items)
# - curr_search_contents: a list of search content lists (each element is a list of items)

# Create sample search contents
# gold_search_contents should be a list of lists/iterables containing searchable items
gold_search_contents = [
    ['apple', 'banana', 'cherry'],
    ['dog', 'cat', 'bird'],
    ['red', 'blue']
]

# curr_search_contents should be a list of lists/iterables containing searchable items
curr_search_contents = [
    ['apple', 'banana', 'orange'],
    ['dog', 'fish', 'bird'],
    ['red', 'green', 'yellow']
]

ARGS = {
    'gold_search_contents': gold_search_contents,
    'curr_search_contents': curr_search_contents
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — 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
extract_search_content Ran
ran; our contract draft was wrong, not the code
Cheungki/LeTS/src/verl/workers/reward_manager/lets.py
code served (permissive licence) · get_code("9980e51b02da5ee0")
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 2, 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 re

def extract_search_content(text):
    try:
        text = text.split('<|im_end|>\n<|im_start|>assistant\n')[1]
    except Exception as e:
        text = text.split('Assistant:', 1)[1]
    pattern = '<result>(.*?)</result>'
    matches = re.findall(pattern, text, re.DOTALL)
    matches = [match.split('\n\n') for match in matches]
    matches = [[m.strip() for m in match] for match in matches]
    return matches


# Setup: Create valid test input for extract_search_content
text_input = """Some preamble text
<|im_end|>
<|im_start|>assistant
Here is the response with results:
<result>First result item

Second result item</result>
<result>Third result

Fourth result</result>
End of response"""

ARGS = {
    "text": text_input
}
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 list, ndim 2, 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
self_check Ran
ran, honoured the contract we drafted
Cheungki/LeTS/src/verl/workers/reward_manager/lets.py
code served (permissive licence) · get_code("45fed3c90c1c528a")
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:
# - self_check takes search_contents parameter
# - search_contents is a list/iterable that can be empty or contain items
# - Each item in search_contents is passed to check_content_sim
# - check_content_sim converts items to sets and computes Jaccard similarity
# - So each item in search_contents should be iterable (like a list or set of hashable elements)

# Create sample data for search_contents
# Each element should be an iterable of hashable items (strings, ints, etc.)
search_contents = [
    ['apple', 'banana', 'orange'],
    ['apple', 'banana', 'grape'],
    ['orange', 'grape', 'kiwi'],
    ['apple', 'kiwi', 'mango']
]

ARGS = {
    'search_contents': search_contents
}
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
union_two_dict Ran
ran; our contract draft was wrong, not the code
Cheungki/LeTS/src/verl/workers/reward_manager/lets.py
code served (permissive licence) · get_code("7794f41d3d01e6f8")
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 torch

torch.manual_seed(0)

# Analyze the function: union_two_dict takes two dictionaries
# It iterates through dict2.items() and checks if keys exist in dict1
# It asserts that values with the same key are equal
# It updates dict1 with values from dict2
# Returns the updated dict1

dict1 = {
    'key1': 'value1',
    'key2': 42,
    'key3': torch.tensor([1, 2, 3, 4]),
}

dict2 = {
    'key2': 42,  # Same key, same value as dict1 - will pass assertion
    'key4': 'new_value',
    'key5': [1, 2, 3],
}

ARGS = {
    'dict1': dict1,
    'dict2': dict2,
}
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 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
LeTSRewardManagerWithSave Not yet run
unverified (harvested, no recorded run)
Cheungki/LeTS/src/verl/workers/reward_manager/lets.py
code served (permissive licence) · get_code("ceff8359e65239d2")
How it ran

no invocation recorded.

_default_compute_score Not yet run
unverified (harvested, no recorded run)
Cheungki/LeTS/src/verl/workers/reward_manager/lets.py
code served (permissive licence) · get_code("75c1c959cded6e52")
How it ran

no invocation recorded.

collate_fn Not yet run
unverified (harvested, no recorded run)
Cheungki/LeTS/src/verl/workers/reward_manager/lets.py
code served (permissive licence) · get_code("c9608313dd7b30d5")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 3 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 3 the same month, 3 later) and 7 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
DataProtoItem
brick of this paper's assembly: helper
4 other papers
1 the same month, 3 later · 1 only as an assembly brick
2505.14146 (2025-05)
s3: You Don't Need That Much Data to Train a Search Agent via RL
2506.05316 (2025-06)
Improving Data Efficiency for LLM Reinforcement Fine-tuning Through Difficulty-targeted Online Data Selection and Rollout Replay
2603.02146 (2026-03)
LongRLVR: Long-Context Reinforcement Learning Requires Verifiable Context Rewards
and 1 more not named here
collate_fn
brick of this paper's assembly: helper
4 other papers
1 the same month, 3 later
2505.14146 (2025-05)
s3: You Don't Need That Much Data to Train a Search Agent via RL
2506.05316 (2025-06)
Improving Data Efficiency for LLM Reinforcement Fine-tuning Through Difficulty-targeted Online Data Selection and Rollout Replay
2603.02146 (2026-03)
LongRLVR: Long-Context Reinforcement Learning Requires Verifiable Context Rewards
and 1 more not named here
union_two_dict
brick of this paper's assembly: helper
4 other papers
1 the same month, 3 later · 1 only as an assembly brick
2505.14146 (2025-05)
s3: You Don't Need That Much Data to Train a Search Agent via RL
2506.05316 (2025-06)
Improving Data Efficiency for LLM Reinforcement Fine-tuning Through Difficulty-targeted Online Data Selection and Rollout Replay
2603.02146 (2026-03)
LongRLVR: Long-Context Reinforcement Learning Requires Verifiable Context Rewards
and 1 more not named here

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 demonstrated impressive capabilities in reasoning with the emergence of reasoning models like OpenAI-o1 and DeepSeek-R1. Recent research focuses on integrating reasoning capabilities into the realm of retrieval-augmented generation (RAG) via outcome-supervised reinforcement learning (RL) approaches, while the correctness of intermediate think-and-search steps is usually neglected. To address this issue, we design a process-level reward module to mitigate the unawareness of intermediate reasoning steps in outcome-level supervision without additional annotation. Grounded on this, we propose Learning to Think-and-Search (LeTS), a novel framework that hybridizes stepwise process reward and outcomebased reward to current RL methods for RAG. Extensive experiments demonstrate the generalization and inference efficiency of LeTS across various RAG benchmarks. In addition, these results reveal the potential of processand outcome-level reward hybridization in boosting LLMs' reasoning ability via RL under other scenarios. The code is released at https://github.com/Cheungki/LeTS.

For agents

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

get_harvested_code_for_paper("2505.17447")
get_code_for_paper("2505.17447")
have("2505.17447")

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

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

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

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

Connect an agent — have() is free.