NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

CodeScaler: Scaling Code LLM Training and Test-Time Inference via Reward Models

Xiao Zhu, Xinyu Zhou, Boyu Zhu, Hanxu Hu, Mingzhe Du, Haotian Zhang, Huiming Wang, Zhijiang Guo

TL;DR

CodeScaler is a novel code reward model designed to scale both reinforcement learning (RL) training and test-time inference for code generation without relying on unit test execution. By combining on-policy preference data curation with syntax-aware code extraction and reward shaping, it stabilizes training and consistently outperforms traditional execution-based RL. At inference time, it achieves performance comparable to unit-test-based selection methods while delivering a massive 10× reduction in latency.

What Problem Does This Paper Address?

Reinforcement Learning from Verifiable Rewards (RLVR) has driven recent breakthroughs in code LLMs by executing model-generated code against unit tests to provide binary feedback. However, this approach is fundamentally bottlenecked by the availability and reliability of high-quality test cases. Human-curated contest problems are scarce, while large-scale synthetic datasets often feature incomplete or flawed test suites that miss critical corner cases or fail to catch infinite loops.

While learned reward models (RMs) offer an appealing alternative by providing dense scalar feedback without requiring sandbox execution, previous attempts have struggled. When applied to code RL, traditional RMs frequently suffer from training instability and reward hacking, failing to match the performance of execution-based methods.

Methods

The authors introduce CodeScaler, an execution-free reward model optimized for code LLMs through three core techniques:

  1. On-Policy Preference Curation with Misalignment Augmentation: Instead of prompting static open-source LLMs, preference pairs are harvested directly from active RL training trajectories (using Group Relative Policy Optimization, or GRPO). To prevent reward hacking, the authors augment the data with "misaligned pairs"—pairing a problem description with a correct solution to an entirely different problem—forcing the model to learn true semantic alignment.
  2. Syntax-Aware Code Extraction: To prevent the RM from assigning high scores to plausible-looking but broken code, CodeScaler enforces a strict extraction pipeline. It discards responses containing multiple fragmented code blocks and performs a static Abstract Syntax Tree (AST) check.
  3. Validity-Preserving Reward Shaping: Invalid or unparseable code is heavily penalized. Raw RM scores are transformed via a strictly positive function $f(z) = \ln(1 + e^z)$ for valid code, while invalid code is assigned a flat reward of 0, ensuring a stable optimization target.

At test time, CodeScaler acts as a lightweight ranker for Best-of-N (BoN) sampling, bypassing the need for test case generation and sandbox execution.

Overall Pipeline of CodeScaler

Datasets

  • DeepCoder: A seed dataset of 24K high-quality, verified code contest problems with extensive test suites used for preference data curation.
  • KodCode & rStarCoder: Large-scale synthetic datasets used to benchmark baseline performance gaps.
  • TACO: Used as a seed to generate a new synthetic dataset of 20K problems via a concept graph, scaling the total training set to 44K problems.
  • Evaluation Benchmarks: LiveCodeBench, CodeContests, MBPP, CodeForces, HumanEval-X, and RM-Bench (for cross-domain reward model evaluation).

Key Insights and Ideas

  • Strict Binary Labels Outperform Pass Ratios: Counterintuitively, training the RM on strict binary feedback (pass all vs. fail any) yields better results than using a continuous "pass ratio" metric. High pass-ratio solutions can still contain latent logical errors due to incomplete test coverage, introducing noise into the preference data.
  • Code Data Sharpens General Reasoning: Even though CodeScaler was trained exclusively on code preference data, it demonstrated significant cross-domain transfer. When evaluated on RM-Bench, it improved performance not just in coding (+3.3), but also in math (+4.9) and general chat (+2.4) domains, suggesting that learning to judge code correctness sharpens a model's overall logical judgment.
  • The Synthetic Data Bottleneck is Real: The paper highlights that simply scaling synthetic data volume doesn't guarantee better RL training if the underlying test cases are flawed. CodeScaler bypasses this by learning the underlying intent rather than relying on brittle execution checks.

Key Results

  • RL Training Superiority: CodeScaler consistently outperformed execution-based RLVR across multiple benchmarks, achieving an average improvement of +1.55 points on Qwen3-8B-Base and +4.23 points on Qwen3-14B-Base.
  • Data Scaling Without Tests: By scaling training to 44K problems using synthetic data without any test cases, CodeScaler delivered a +14.64 point boost over the base model.
  • 10× Faster Inference: At test time, CodeScaler achieved Best-of-N performance comparable to advanced unit-test generation methods (like CURE) but reduced average latency from 3.20 seconds to 0.31 seconds per question.
Best-of-N Performance Comparison

Limitations and Future Work

The authors identify two systematic surface-feature biases in CodeScaler's failure modes:

  1. Length Bias: The model occasionally suffers from false positives, favoring longer code snippets that contain a high density of algorithmic keywords and extensive chain-of-thought reasoning, even if the logic is flawed.
  2. Brevity Under-Valuation: Conversely, it exhibits false negatives by systematically undervaluing concise, elegant, or highly modular solutions (e.g., those using recursion), scoring them lower simply due to their brevity.

Future work will likely focus on mitigating these structural biases to ensure more robust, length-agnostic code evaluation.

Summary updated

BibTeX
@inproceedings{zhu2026codescaler,
  author = {Xiao Zhu and Xinyu Zhou and Boyu Zhu and Hanxu Hu and Mingzhe Du and Haotian Zhang and Huiming Wang and Zhijiang Guo},
  title = {{CodeScaler: Scaling Code LLM Training and Test-Time Inference via Reward Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=prz41cA9Og},
}
Figure