Papers › Reinforcement Learning for Reasoning in Large Language Models with One Training Example

Reinforcement Learning for Reasoning in Large Language Models with One Training Example

29 Apr 2025arXiv:2504.20571archive 2025-07-28

Yiping Wang, Qing Yang, Zhiyuan Zeng, Liliang Ren, Lucas Liu, Baolin Peng, Hao Cheng, Xuehai He, Kuan Wang, Jianfeng Gao, Weizhu Chen, Shuohang Wang, Simon Shaolei Du, Yelong Shen

We show that reinforcement learning with verifiable reward using one training example (1-shot RLVR) is effective in incentivizing the math reasoning capabilities of large language models (LLMs). Applying RLVR to the base model Qwen2.5-Math-1.5B, we identify a single example that elevates model performance on MATH500 from 36.0% to 73.6%, and improves the average performance across six common mathematical reasoning benchmarks from 17.6% to 35.7%. This result matches the performance obtained using the 1.2k DeepScaleR subset (MATH500: 73.6%, average: 35.9%), which includes the aforementioned example. Similar substantial improvements are observed across various models (Qwen2.5-Math-7B, Llama3.2-3B-Instruct, DeepSeek-R1-Distill-Qwen-1.5B), RL algorithms (GRPO and PPO), and different math examples (many of which yield approximately 30% or greater improvement on MATH500 when employed as a single training example). In addition, we identify some interesting phenomena during 1-shot RLVR, including cross-domain generalization, increased frequency of self-reflection, and sustained test performance improvement even after the training accuracy has saturated, a phenomenon we term post-saturation generalization. Moreover, we verify that the effectiveness of 1-shot RLVR primarily arises from the policy gradient loss, distinguishing it from the "grokking" phenomenon. We also show the critical role of promoting exploration (e.g., by adding entropy loss with an appropriate coefficient) in 1-shot RLVR training. As a bonus, we observe that applying entropy loss alone, without any outcome reward, significantly enhances Qwen2.5-Math-1.5B's performance on MATH500 by 27.4%. These findings can inspire future work on RLVR data efficiency and encourage a re-examination of both recent progress and the underlying mechanisms in RLVR. Our code, model, and data are open source at https://github.com/ypwang61/One-Shot-RLVR

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2504.20571")

Code

Syntology Ran 4 of 16 code samples harvested from 1 repository linked to this paper; 12 have no recorded run. Of those that ran: 1 ran · violated contract; 1 ran · our draft was wrong; 1 ran · fixture could not drive it; 1 ran with no contract checked.

By repository: official repository: 16 samples from 1 repository, 4 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

ypwang61/one-shot-rlvr officialmentioned in papermentioned on GitHubpytorchApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

16 samples harvested; 4 ran; 0 honoured the contract we drafted; 12 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · violated contract
1ran · our draft was wrong
1ran · fixture could not drive it
1ran
12unverified

Licence: 0 of the 16 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from ypwang61/one-shot-rlvr. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

generate_completions ypwang61/one-shot-rlvr/Qwen2.5-Eval/evaluation/model_utils.py official repository ran Apache-2.0 (permissive) · 1525d8bc0fc8d5a0 · report
is_multi_choice ypwang61/one-shot-rlvr/Qwen2.5-Eval/evaluation/math_eval.py official repository ran · violated contract Apache-2.0 (permissive) · d338a8cb44aeb6b4 · report
union_tensor_dict ypwang61/one-shot-rlvr/verl/protocol.py official repository ran · fixture could not drive it Apache-2.0 (permissive) · 21331a58f93375e4 · report
unpad_dataproto ypwang61/one-shot-rlvr/verl/protocol.py official repository ran · our draft was wrong Apache-2.0 (permissive) · 25f0ea3f460f6ce1 · report
choice_answer_clean ypwang61/one-shot-rlvr/Qwen2.5-Eval/evaluation/grader.py official repository unverified Apache-2.0 (permissive) · 809c0178a7ae90ff · report
compare_numerical_ans ypwang61/one-shot-rlvr/Qwen2.5-Eval/evaluation/math_utils.py official repository unverified Apache-2.0 (permissive) · 81082f28e1440f9d · report
extract_multi_choice_answer ypwang61/one-shot-rlvr/Qwen2.5-Eval/evaluation/parser.py official repository unverified Apache-2.0 (permissive) · ed2f4689128f9885 · report
get_generation_config ypwang61/one-shot-rlvr/verl/utils/model.py official repository unverified Apache-2.0 (permissive) · 660713a8fa047736 · report
get_huggingface_actor_config ypwang61/one-shot-rlvr/verl/utils/model.py official repository unverified Apache-2.0 (permissive) · fe79c459a3e4cc64 · report
get_weight_loader ypwang61/one-shot-rlvr/verl/models/weight_loader_registry.py official repository unverified Apache-2.0 (permissive) · 76f3c749a0e655f2 · report
is_digit ypwang61/one-shot-rlvr/Qwen2.5-Eval/evaluation/grader.py official repository unverified Apache-2.0 (permissive) · fb37d3c84b18e368 · report
is_number ypwang61/one-shot-rlvr/Qwen2.5-Eval/evaluation/math_utils.py official repository unverified Apache-2.0 (permissive) · 1c1060f6e43d5dfa · report
load_hf_lm_and_tokenizer ypwang61/one-shot-rlvr/Qwen2.5-Eval/evaluation/model_utils.py official repository unverified Apache-2.0 (permissive) · ee71a94d9dd1b8e9 · report
my_parse_latex ypwang61/one-shot-rlvr/Qwen2.5-Eval/evaluation/math_utils.py official repository unverified Apache-2.0 (permissive) · 73925940858a62b3 · report
parse_digits ypwang61/one-shot-rlvr/Qwen2.5-Eval/evaluation/grader.py official repository unverified Apache-2.0 (permissive) · 7d4b7f8c3875b126 · report
squeeze ypwang61/one-shot-rlvr/verl/utils/model.py official repository unverified Apache-2.0 (permissive) · 3b15e2ac7497c441 · report

Tasks

Domain GeneralizationMathMathematical Reasoning

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

BASE

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections