TL;DR
The paper introduces RiVER (Ranking-induced VERifiable framework), a novel reinforcement learning approach that trains LLMs on complex optimization tasks without requiring any ground-truth solutions. By transforming uncalibrated execution scores into instance-wise ranks with winner-heavy reward shaping, RiVER not only excels at open-ended algorithm engineering but also significantly boosts general coding performance on traditional exact-match benchmarks.
What Problem Does This Paper Address?
Reinforcement Learning with Verifiable Rewards (RLVR) has driven massive breakthroughs in LLM reasoning (e.g., OpenAI's o1, DeepSeek-R1). However, standard RLVR relies heavily on "answer matching"—checking if a model's output matches a binary pass/fail unit test or a specific ground-truth answer. This restricts training to narrow domains where the optimal solution is already known.
In contrast, many real-world algorithm design, planning, and optimization problems are NP-hard; we can easily execute a program and score its quality, but we don't know the mathematically optimal solution. Naively using raw execution scores for RL training fails due to two core challenges:
- Scale Dominance: Raw scores vary wildly across different problem instances (e.g., one graph instance might yield scores in the thousands, while another spans only tens of points), causing a few instances to disproportionately warp the policy gradient.
- Frequency Dominance: In group-relative RL, a model often samples multiple minor variations of a mediocre, common heuristic. Collectively, these repetitive, suboptimal solutions contribute more gradient mass than a single, rare, high-quality discovery.
Methods
RiVER addresses these challenges by replacing raw execution scores with a calibrated, rank-based reward mechanism integrated into Group Relative Policy Optimization (GRPO).
The framework operates in three steps:
- Instance-wise Ranking: Instead of averaging raw scores across different test instances, candidate programs are ranked only against other candidates evaluated on the exact same hidden instance. This eliminates arbitrary numerical scale differences.
- Winner-Heavy Reward Shaping: To counter frequency dominance, RiVER applies a non-linear reward mapping. The top-ranked solver in a rollout group receives a significant reward (+1), invalid programs receive a penalty (-1), and valid non-winners receive bounded, graded feedback between $[-0.5, 0.5]$. This creates a clear margin that prioritizes the absolute best discovery.
- Aggregation: The shaped rewards are averaged across all hidden instances to form the final advantage signal for the policy update.
Datasets
- Training: 12 open-ended, score-based optimization tasks curated from the AtCoder Heuristic Contest (AHC) (specifically tasks within the AHC047–AHC062 pool).
- Evaluation:
- ALE-Bench (Algorithm Engineering Benchmark) for score-based optimization tracking.
- LiveCodeBench (v5 and v6) and USACO (USA Computing Olympiad) to test generalization on traditional, exact-match coding problems.
Key Insights and Ideas
- High Feedback Resolution: From an information-theoretic perspective, binary verifiers suffer from "feedback collision"—where many different rollouts receive identical 0 or 1 rewards, collapsing the learning signal. Score-based environments offer higher feedback resolution (measured via Rényi entropy), providing richer distinctions between policy samples.
- Cross-Paradigm Generalization: Remarkably, training exclusively on ground-truth-free optimization tasks improves performance on exact-solution coding benchmarks. This proves that learning to optimize code structure transfers to general programming proficiency.
- Calibration is Mandatory: Simply optimizing raw execution scores actually harms generalization. Without instance-wise ranking, models learn to exploit instance-specific numerical scales rather than developing robust, transferable algorithmic reasoning.
Key Results
RiVER was evaluated using Qwen3-8B and GLM-Z1-9B-0414 backbones, outperforming all raw-score and uniform-ranking baselines:
- Optimization Performance: RiVER boosted the ALE-Bench rating by 142 points for Qwen3 and 157 points for GLM, translating to an ~9% advancement in human percentile rank.
- Generalization Transfer: Despite never seeing a ground-truth answer during training, RiVER achieved an absolute average improvement of 2.4% on LiveCodeBench and 3.5% on USACO.
- Harder Problem Mastery: The gains on LiveCodeBench were heavily concentrated in the "Medium" and "Hard" categories (e.g., a 7.0% jump on LCB v5 Medium for GLM), indicating that optimization training helps models tackle sophisticated reasoning rather than just reinforcing simple syntax.
Limitations and Future Work
While RiVER successfully bypasses the need for ground-truth answers, it still relies on a deterministic task-specific evaluator to check constraints and compute objective scores. The authors note that extending this framework to non-deterministic environments or broader, less mathematically defined reasoning tasks remains an open challenge. Future work could also explore adaptive reward shaping functions that evolve as the model's capabilities scale.
Summary updated