How Pure Reinforcement Learning Reshapes the Capability Boundaries of Code Models

    This article explains why pure reinforcement learning (RL) has become a decisive lever in the post-training stage of code models. It breaks down the mechanisms behind non-linear gains, including verifiable rewards, sampling efficiency, and capability reallocation, then outlines a two-tier evaluation design based on team and individual matches, four principles for building control groups, and practical engineering recommendations. Readers will learn how to design reward systems, avoid reward hacking, and separate collaboration overhead from single-model capability.

    1. Background: Why Pure RL Became a Key Variable in Post-Training

    As general-purpose foundation models converge in baseline capability, the gap between models increasingly depends on engineering and algorithm design in the post-training stage. An observation repeatedly validated in the industry is that training an existing general foundation model with reinforcement learning (RL) alone on automatically verifiable tasks can deliver far greater-than-expected gains in specific capability dimensions. A recently released next-generation coding model from a research team followed exactly this route: no new foundation model, no large-scale supervised fine-tuning, only pure RL on top of a general base, ultimately achieving several-fold improvements over the original base across multiple coding benchmarks.

    The implication for engineering practice is clear: the “capability reallocation” effect in post-training is very strong. Total model capacity stays fixed, but reward design can concentrate that capacity on one class of capabilities, at the cost of relative regression in other dimensions. Understanding this reallocation mechanism is more valuable than simply chasing leaderboard rankings.

    2. Mechanism Breakdown: Why Pure RL Delivers Non-Linear Gains

    2.1 Verifiable Rewards Are the Prerequisite

    The first determining factor for whether RL works is whether the reward can be judged programmatically. Coding tasks naturally have this property: unit test pass rate, whether compilation succeeds, whether static checks report zero warnings, and whether performance targets are met can all be scored automatically. The more objective the reward and the denser the feedback, the more stable the policy gradient.

    1. # Illustration: aggregating verifiable rewards
    2. def reward(patch, tests):
    3. compile_ok = 1.0 if build(patch) else 0.0
    4. passed = run_tests(patch, tests)
    5. ratio = passed / max(len(tests), 1)
    6. lint_penalty = 0.1 * count_lint_errors(patch)
    7. return 0.3 * compile_ok + 0.7 * ratio - lint_penalty

    2.2 Sampling Efficiency and Exploration Radius

    The gains from pure RL do not accumulate linearly; there is a “breakthrough point.” Once the model’s sampling success rate in a given difficulty band crosses a learnable threshold from extremely low, the training curve suddenly rises. This explains why final benchmark scores can show multiples of difference: it is not that the model improves at every step, but that capability is released as a whole after crossing the threshold.

    2.3 Capability Reallocation and “Uneven Performance”

    When the reward function only covers algorithms and backend logic, the model tilts capacity toward long-chain reasoning, boundary condition enumeration, and data structure selection. Dimensions that are hard to judge automatically, such as UI reproduction, visual details, and interaction copy, lack gradient signals and naturally lag relatively. This is not model degradation but an inevitable result of the optimization objective.

    3. Evaluation Methodology: Measuring Real Capability with Tiered Matches

    A single score is not enough to explain the problem. A two-tier design of “team match + individual match” is recommended to decouple collaboration overhead between models from single-model capability.

    Dimension Team Match Individual Match
    Measurement target Primary-secondary model collaboration chain Single model solving independently
    Key metrics Score rate, goal difference, draw rate Score rate, failure rate
    Main risk Secondary model becomes the bottleneck Insufficient stability on long tasks

    The value of the team match is to expose engineering reality: to control costs, a lightweight model is often configured as the secondary model, with sub-agents automatically routing to it. Once the secondary model lacks capability, the score rate of the entire chain is significantly dragged down, producing an inversion where “the primary model is strong but the team result is poor.” The individual match is used to confirm the capability ceiling and determine whether improvement comes from the model itself or from the collaboration strategy.

    For metric design, in addition to score rate, continuous quantities such as goal difference must be retained to avoid a large number of draws masking real gaps; the win-draw-loss distribution should also be recorded to judge whether a model is steady or aggressive.

    4. Experiment Design: Four Principles for Building Control Groups

    1. Single variable: replace only one model slot, keeping prompts, tools, and time limits identical.
    2. Same-source control: place different post-trained versions of the same-source base in the same group to directly quantify post-training gains.
    3. Cross-tier control: use partner models of different scales to verify the strength of the “bucket effect.”
    4. Real-scenario alignment: control groups should include cost-constrained configurations from actual production, not ideal configurations.

    With this design, if two post-trained versions of the same-source base show a clear score gap under the same partner, it can be attributed to the training method rather than base differences; if the team result rebounds substantially after switching to a much larger partner, it indicates the chain bottleneck comes from the secondary model.

    5. Engineering Implementation Recommendations

    • Layered rewards: first compilation and static checks, then unit tests, finally end-to-end cases, weighted layer by layer to avoid early noise dominating the gradient.
    • Difficulty curriculum: bucket sampling by pass rate, concentrating the training budget in the 10%-60% success rate band.
    • Anti-reward-hacking: detect and penalize test file modifications and hard-coded return values to prevent the model from taking shortcuts.
    • Routing governance: secondary models must have a capability floor and fallback strategy, upgrading the model tier for critical sub-tasks when necessary.
    • Observability: write the prompt version, model tier, latency, and failure reasons of each evaluation into a logging service, with monitoring and alerts for regression tracking.
    • Elastic compute: use container platform auto-scaling to handle peaks during large-scale sampling, and object storage to archive datasets and checkpoints.

    6. Common Pitfalls

    First, equating benchmark scores with production readiness. Benchmark tasks are mostly automatically verifiable algorithm problems, which differ greatly from ambiguous requirements in real business. Second, ignoring regression in frontend and experience dimensions, leading to lower delivery quality. Third, looking only at final scores without variance, overlooking stability issues in long tasks. Fourth, wrongly attributing collaboration chain failures to the primary model.

    7. Conclusion

    The essence of pure RL is reallocating fixed capacity according to reward signals. Engineering should do three things: build a verifiable, anti-hacking reward system; use the two-tier evaluation of team and individual matches to decouple collaboration overhead from single-model capability; and set a capability floor and fallback mechanism for secondary models. If both algorithmic depth and interaction experience are needed, a hybrid objective reward can be adopted, restoring frontend gradients while maintaining backend capability. This is also a general direction commonly emphasized by cloud vendors such as Baidu AI Cloud in the practice of intelligent coding tools.