SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2502.14768 · 2025

Logic-RL: Unleashing LLM Reasoning with Rule-Based Reinforcement Learning

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 23 functions out of this paper's own repositories and ran 15 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.

RepositoryRoleRan
Unakar/Logic-RL canonical 10 of 16
OpenLLMAI/OpenLLaMA2 pwc_unofficial 5 of 7
FunctionStatusWhere it lives
aggregate_loss Ran OpenLLMAI/OpenLLaMA2/openrlhf/models/loss.py
code served (permissive licence) · get_code("0edeb138e07fbecc")
compute_approx_kl Ran OpenLLMAI/OpenLLaMA2/openrlhf/models/utils.py
code served (permissive licence) · get_code("c146f3cb0e5259a0")
compute_reward Ran OpenLLMAI/OpenLLaMA2/openrlhf/models/utils.py
code served (permissive licence) · get_code("812f2e3f5cda7c93")
create_huggingface_actor Ran Unakar/Logic-RL/verl/utils/model.py
code served (permissive licence) · get_code("360c671d6041ba3b")
extract_solution Ran Unakar/Logic-RL/eval_kk/compute_score.py
code served (permissive licence) · get_code("b870fd9007fabd94")
extract_step Ran Unakar/Logic-RL/verl/trainer/fsdp_sft_trainer.py
code served (permissive licence) · get_code("216e28c040173a61")
get_loss_batch_info Ran OpenLLMAI/OpenLLaMA2/openrlhf/utils/loss_utils.py
code served (permissive licence) · get_code("557aef158c28bb84")
is_transformers_version_in_range Ran Unakar/Logic-RL/verl/models/transformers/monkey_patch.py
code served (permissive licence) · get_code("42a7954a8cfa89e0")
load_jsonl Ran Unakar/Logic-RL/eval_kk/main_eval_instruct.py
code served (permissive licence) · get_code("0998b08e39672d66")
log_probs_from_logits Ran OpenLLMAI/OpenLLaMA2/openrlhf/models/utils.py
code served (permissive licence) · get_code("75afa2affd2a8e36")
parse_cot_eval Ran Unakar/Logic-RL/eval_kk/kk_processor.py
code served (permissive licence) · get_code("f4e717416b80af20")
parse_model_answer Ran Unakar/Logic-RL/eval_kk/compute_score.py
code served (permissive licence) · get_code("df0cff7e9a4ca96e")
parse_solution_text_format Ran Unakar/Logic-RL/eval_kk/compute_score.py
code served (permissive licence) · get_code("a6a2e23358e05581")
union_tensor_dict Ran Unakar/Logic-RL/verl/protocol.py
code served (permissive licence) · get_code("21331a58f93375e4")
unpad_dataproto Ran Unakar/Logic-RL/verl/protocol.py
code served (permissive licence) · get_code("25f0ea3f460f6ce1")
apply_monkey_patch Not yet run Unakar/Logic-RL/verl/models/transformers/monkey_patch.py
code served (permissive licence) · get_code("1fb4adb621eefddc")
get_huggingface_actor_config Not yet run Unakar/Logic-RL/verl/utils/model.py
code served (permissive licence) · get_code("19472d4343d0a082")
get_tensor_in_current_ring_attn_rank Not yet run OpenLLMAI/OpenLLaMA2/openrlhf/models/ring_attn_utils.py
code served (permissive licence) · get_code("5110d3bb195169a8")
get_weight_loader Not yet run Unakar/Logic-RL/verl/models/weight_loader_registry.py
code served (permissive licence) · get_code("919cf310ad4c189a")
load_eval_records Not yet run Unakar/Logic-RL/eval_kk/main_eval_instruct.py
code served (permissive licence) · get_code("cbfcdbb8e1ddcaca")
num_tokens_from_string Not yet run Unakar/Logic-RL/eval_kk/kk_processor.py
code served (permissive licence) · get_code("26b075196c1c10bf")
reset_ring_attn_position_ids Not yet run OpenLLMAI/OpenLLaMA2/openrlhf/models/ring_attn_utils.py
code served (permissive licence) · get_code("e93117d99aa6b210")
squeeze Not yet run Unakar/Logic-RL/verl/utils/model.py
code served (permissive licence) · get_code("3b15e2ac7497c441")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Inspired by the success of DeepSeek-R1, we explore the potential of rule-based reinforcement learning (RL) in large reasoning models. To analyze reasoning dynamics, we use synthetic logic puzzles as training data due to their controllable complexity and straightforward answer verification. We make some key technical contributions that lead to effective and stable RL training: a system prompt that emphasizes the thinking and answering process, a stringent format reward function that penalizes outputs for taking shortcuts, and a straightforward training recipe that achieves stable convergence. Our 7B model develops advanced reasoning skills-such as reflection, verification, and summarization-that are absent from the logic corpus. Remarkably, after training on just 5K logic problems, it demonstrates generalization abilities to the challenging math benchmarks AIME and AMC.

For agents

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

get_harvested_code_for_paper("2502.14768")
get_code_for_paper("2502.14768")
have("2502.14768")

Connect an agent — have() is free.