Abstract While Large Language Models (LLMs) have demonstrated significant potential in natural language processing, complex general-purpose reasoning requiring multi-step logic, planning, and verification remains a critical bottleneck. Although Reinforcement Learning with Verifiable Rewards (RLVR) has succeeded in specific domains, the field lacks large-scale, high-quality, and difficulty-calibrated data for general reasoning. To address this, we propose UltraLogic, a framework that decouples the logical core of a problem from its natural language expression through a Code-based Solving methodology to automate high-quality data production. The framework comprises hundreds of unique task types and an automated calibration pipeline across ten difficulty levels. Furthermore, to mitigate binary reward sparsity and the Non-negative Reward Trap, we introduce the Bipolar Float Reward (BFR) mechanism, utilizing graded penalties to effectively distinguish perfect responses from those with logical flaws. Our experiments demonstrate that task diversity is the primary driver for reasoning enhancement, and that BFR, combined with a difficulty matching strategy, significantly improves training efficiency, guiding models toward global logical optima.
Introduction
Large Language Models (LLMs) have shown remarkable proficiency in mathematical and coding tasks, yet general-purpose reasoning—characterized by multi-step planning and verification—remains a significant challenge. The current state-of-the-art for enhancing these capabilities is Reinforcement Learning with Verifiable Rewards (RLVR). While effective for domains with clear automated verifiers (like unit tests for code), general logic puzzles often lack such deterministic feedback mechanisms. Additionally, existing reasoning datasets are frequently limited by small scales, insufficient diversity, and a lack of calibrated difficulty levels, hindering systematic model training.
The UltraLogic Framework
To overcome these limitations, we introduce UltraLogic, which employs a Code-based Solving methodology to automate the generation of massive, high-quality reasoning datasets. The framework operates by decoupling a problem's logical structure from its narrative expression.
As illustrated in Figure 1, the process involves:
- Programmatization: Experts and LLMs collaborate to develop two Python functions for each task type: an Input Function to stochastically generate problem parameters and a Solution Function to provide a deterministic ground-truth answer.
- Scalable Generation: By varying input parameters, the system can generate infinite unique problem instances.
- Automated Calibration: A Difficulty Control Module adjusts constraints (e.g., number of steps) to ensure tasks span ten difficulty levels, calibrated against the success rates of flagship models.
Bipolar Float Reward (BFR)
Standard RL typically utilizes binary rewards (1 for correct, 0 for incorrect), which can lead to the "Non-negative Reward Trap." In this scenario, a model might receive a positive signal for an "almost correct" answer that still contains logical flaws, simply because it performed better than the average.
To address this, we propose the Bipolar Float Reward (BFR) mechanism. BFR introduces a "Reward Cliff": only a 100% perfect answer receives a $+1.0$ reward. All imperfect answers are mapped to a negative range $[-1, 0)$. This "push-pull" dynamic utilizes graded penalties to force the model to abandon flawed logic in favor of global optima, effectively bridging the gap between near-misses and perfect reasoning.
Experimental Results
We evaluated UltraLogic and BFR using Qwen3-8B and 14B models across several high-difficulty reasoning benchmarks, including AIME (2024 & 2025), HMMT 2025, and ARC-AGI.
As shown in Figure 2, models trained with BFR consistently outperformed those using standard binary or graded float rewards. For instance, on the AIME24 benchmark, the Qwen3-8B model improved from a baseline of 75.2 to 82.6 when utilizing BFR. Furthermore, BFR demonstrated superior training efficiency, leading to faster convergence and smoother learning curves compared to sparse binary signals.
Key Insights
Our research highlights several critical factors for reasoning enhancement:
- Difficulty Matching: RL is most effective when task difficulty aligns with the model's current capacity, specifically within a 40-60% success rate window. Training outside this "Zone of Proximal Development" often leads to stagnation.
- Diversity Over Scale: Experimental evidence suggests that increasing task diversity is a more potent driver for reasoning improvement than simply increasing data volume.
- Quality Sensitivity: RLVR is highly intolerant of noise; even a 2-6% error rate in training solutions can cause training collapse, underscoring the importance of UltraLogic's programmatic verification.
Conclusion and Future Work
UltraLogic and BFR provide a robust framework for scaling reasoning data and optimizing RL training. While the current pipeline requires some human-in-the-loop intervention for seed tasks, future work will focus on automating reward scaling and exploring stability in Mixture-of-Experts (MoE) architectures, which currently show higher sensitivity to divergence during RLVR training.
Summary updated