Papers › RuleReasoner: Reinforced Rule-based Reasoning via Domain-aware Dynamic Sampling

RuleReasoner: Reinforced Rule-based Reasoning via Domain-aware Dynamic Sampling

10 Jun 2025arXiv:2506.08672archive 2025-07-28

Yang Liu, Jiaqi Li, Zilong Zheng

Rule-based reasoning has been acknowledged as one of the fundamental problems in reasoning, while deviations in rule formats, types, and complexity in real-world applications pose severe challenges. Recent studies have shown that large reasoning models (LRMs) have remarkable reasoning capabilities, and their performance is substantially enhanced by reinforcement learning (RL). However, it remains an open question whether small reasoning models (SRMs) can learn rule-based reasoning effectively with robust generalization across diverse tasks and domains. To address this, we introduce Reinforced Rule-based Reasoning, a.k.a. RuleReasoner, a simple yet effective method to conduct rule-based reasoning via a wide collection of curated tasks and a novel domain-aware dynamic sampling approach. Specifically, RuleReasoner resamples each training batch by updating the sampling weights of different domains based on historical rewards. This facilitates domain augmentation and flexible online learning schedules for RL, obviating the need for pre-hoc human-engineered mix-training recipes used in existing methods. Empirical evaluations on in-distribution (ID) and out-of-distribution (OOD) benchmarks reveal that RuleReasoner outperforms frontier LRMs by a significant margin (Δ4.1% average points on eight ID tasks and Δ10.4% average points on three OOD tasks over OpenAI-o1). Notably, our approach also exhibits higher computational efficiency compared to prior dynamic sampling methods for RL.

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="2506.08672")

Code

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

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

bigai-nlco/rulereasoner officialmentioned in papermentioned on GitHubpytorchMIT 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

13 samples harvested; 6 ran; 0 honoured the contract we drafted; 7 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 · our draft was wrong
1ran · fixture could not drive it
4ran
7unverified

Licence: 0 of the 13 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 bigai-nlco/rulereasoner. “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.

compute_ce_dpo_loss_rm bigai-nlco/rulereasoner/verl/recipe/prime/prime_core_algos.py official repository ran MIT (permissive) · f220595adfc5e83c · report
compute_detach_dpo_loss_rm bigai-nlco/rulereasoner/verl/recipe/prime/prime_core_algos.py official repository ran MIT (permissive) · 4d91e4383716e42c · report
is_ipv4 bigai-nlco/rulereasoner/verl/verl/utils/net_utils.py official repository ran MIT (permissive) · 735e93af30b15fa9 · report
reward_func bigai-nlco/rulereasoner/verl/recipe/r1/reward_score.py official repository ran MIT (permissive) · c30b2a96103abd2c · report
union_tensor_dict bigai-nlco/rulereasoner/verl/verl/protocol.py official repository ran · fixture could not drive it MIT (permissive) · 21331a58f93375e4 · report
unpad_dataproto bigai-nlco/rulereasoner/verl/verl/protocol.py official repository ran · our draft was wrong MIT (permissive) · 25f0ea3f460f6ce1 · report
get_custom_reward_fn bigai-nlco/rulereasoner/verl/recipe/dapo/src/main_dapo.py official repository unverified MIT (permissive) · b6512040439cb7a2 · report
get_generation_config bigai-nlco/rulereasoner/verl/verl/utils/model.py official repository unverified MIT (permissive) · 68aa34a57b353cae · report
get_huggingface_actor_config bigai-nlco/rulereasoner/verl/verl/utils/model.py official repository unverified MIT (permissive) · 9411d1fb7e4f68e5 · report
get_weight_loader bigai-nlco/rulereasoner/verl/verl/models/weight_loader_registry.py official repository unverified MIT (permissive) · acf240079d434746 · report
get_weight_saver bigai-nlco/rulereasoner/verl/verl/models/weight_loader_registry.py official repository unverified MIT (permissive) · 1008c22d29f85015 · report
is_ipv6 bigai-nlco/rulereasoner/verl/verl/utils/net_utils.py official repository unverified MIT (permissive) · 705afe175ad8e404 · report
squeeze bigai-nlco/rulereasoner/verl/verl/utils/model.py official repository unverified MIT (permissive) · 3b15e2ac7497c441 · report

Tasks

Computational EfficiencyReinforcement Learning (RL)

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

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