We lifted 2 functions out of this paper's own repositories and ran 2 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.
| Repository | Role | Ran |
|---|---|---|
| petergriffinjin/search-r1 | canonical | 1 of 1 |
| copy not recorded | — | 1 of 1 |
| Function | Status | Where it lives |
|---|---|---|
| get_query | Ran | this paper's copy was not recorded; identical code first harvested from hzy312/knowledge-r1 pointer only · get_code("8709b4b7236b87d7") |
| make_prefix | Ran | petergriffinjin/search-r1/scripts/data_process/nq_search.py code served (permissive licence) · get_code("018ba1bb83412f58") |
Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.
Efficiently acquiring external knowledge and up-to-date information is essential for effective reasoning and text generation in large language models (LLMs). Prompting advanced LLMs with reasoning capabilities to use search engines during inference is often suboptimal, as the LLM might not fully possess the capability on how to interact optimally with the search engine. This paper introduces Search-R1, an extension of reinforcement learning (RL) for reasoning frameworks where the LLM learns to autonomously generate (multiple) search queries during step-by-step reasoning with real-time retrieval. Search-R1 optimizes LLM reasoning trajectories with multi-turn search interactions, leveraging retrieved token masking for stable RL training and a simple outcome-based reward function. Experiments on seven question-answering datasets show that Search-R1 improves performance by 41% (Qwen2.5-7B) and 20% (Qwen2.5-3B) over various RAG baselines under the same setting. This paper further provides empirical insights into RL optimization methods, LLM choices, and response length dynamics in retrieval-augmented reasoning. The code and model checkpoints are available at https://github.com/PeterGriffinJin/Search-R1.
The same record, over MCP at https://syntology.ai/mcp:
get_harvested_code_for_paper("2503.09516")
get_code_for_paper("2503.09516")
have("2503.09516")
Connect an agent — have() is free.