How Reinforcement Learning Reshapes Coding Model Performance

    This article explains why coding models built on the same base model can show several-fold performance gaps after post-training and reinforcement learning. It covers a controlled experiment design, how to interpret score rate, win/draw/loss, and goal-difference metrics, primary-secondary model orchestration under cost constraints, a minimal reinforcement learning loop from trajectories to rewards, and common pitfalls with a reproducibility checklist. Readers will learn how to build comparable, auditable, and iterable capability evaluations in their own environments.

    1. Background: Why the Same Base Model Shows a Several-Fold Gap

    A common puzzle in engineering practice is that the same base model, modified only through post-training and reinforcement learning, can show several-fold differences in performance on complex coding tasks. In the original observation, one coding agent ranked sixth in an individual competition with a score rate of 66.0%, while its “Max” version reached the top five in a team competition with a score rate of 58.2%. The unmodified version from the same source achieved only a 38.9% score rate in the team competition. These numbers show that the gap does not mainly come from the base model’s parameter count, but from training objectives, data construction, and inference-time coordination strategies.

    Note that this article does not evaluate any specific vendor or product. All models are referred to by role-based names, and the data serves only as an illustration for methodology discussion. Readers should re-measure in their own environments.

    2. Experiment Design: Control Groups Are the Prerequisite for Trustworthy Conclusions

    The most valuable part of the original work is not any single score, but the logic behind constructing control groups. This can be abstracted into four types of controls:

    • Same base, different post-training: verifies the gain from post-training itself;
    • Same primary model, different partner: verifies the impact of the secondary model on overall results;
    • Same partner, different primary model: verifies the upper bound of the primary model;
    • Cross-architecture combinations: verifies whether the method transfers.

    An illustrative experiment matrix can be expressed as a configuration:

    1. experiment:
    2. metric: [score_rate, win, draw, loss, delta]
    3. groups:
    4. - name: baseline_pair # original combination
    5. - name: same_base_new_post # same base + new post-training
    6. - name: same_main_other_side # swap the secondary model
    7. - name: cross_arch # cross-architecture control
    8. repeats: 3
    9. temperature: [0.0, 0.7]
    10. seed: fixed

    The key point is to change only one variable, fix the random seed, and repeat multiple times to take the average. Otherwise, conclusions like “twice the improvement” cannot hold.

    3. Metric Interpretation: Score Rate, Win/Draw/Loss, and Goal Difference

    Competition-style evaluation usually includes three types of metrics: score rate, win/draw/loss, and “goals for : goals against.” Score rate is sensitive to draws, while goal difference reflects process stability. A combination with a high score rate but many draws tends to be conservative on difficult samples, while combinations with close goal differences often indicate a robust strategy that lacks breakthroughs. Therefore, evaluation must consider all three dimensions together:

    1. Score rate measures results;
    2. The win/draw/loss structure measures risk preference;
    3. Goal difference measures redundancy and error-correction ability.

    4. Primary-Secondary Collaboration: Capability Orchestration Under Cost Constraints

    In engineering, a common orchestration approach is to have the primary model handle planning and hard problems, while the secondary model handles subtasks and batch execution, in order to control cost. This leads to a clear conclusion: the secondary model is not an accessory; it can significantly change overall results. The large fluctuations observed in the original work after swapping the secondary model show that the model used by sub-agents determines how well long-tail tasks are handled.

    Practical recommendations:

    • Set independent maximum steps and fallback strategies for subtasks;
    • Automatically escalate failed samples to the primary model for retry;
    • Record the model role for each call to enable attribution.
    1. def route(task):
    2. if task.risk == "high" or task.attempt >= 2:
    3. return "primary"
    4. return "secondary"

    5. The Reinforcement Learning Loop: From Trajectories to Rewards

    The core of post-training is turning “correct trajectories” into an optimizable signal. A practical minimal loop contains five steps:

    1. Sampling: generate multiple candidate trajectories for the same task;
    2. Execution: run unit tests and static checks in a sandbox;
    3. Scoring: build the reward from test pass rate, patch minimality, and elapsed time;
    4. Filtering: remove cheating-style patches (such as directly modifying tests);
    5. Update: perform preference optimization or policy gradient updates using the remaining high-reward trajectories.

    Reward design must prevent cheating. An example:

    1. reward = 0.7 * tests_passed_ratio \
    2. + 0.2 * minimality \
    3. - 0.1 * timeout_penalty \
    4. - 1.0 * test_tampering

    6. Common Pitfalls and a Reproducibility Checklist

    • Data leakage: overlap between the test set and training repositories inflates results;
    • Reward hacking: the model modifies assertions or skips test cases;
    • Evaluation variance: unfixed temperature and sampling make results irreproducible;
    • Attribution errors: mistaking the impact of the secondary model for the primary model’s capability.

    Reproducibility checklist: fix versions and images, fix the random seed, retain complete trajectory logs, standardize sandbox resource quotas, and publish the scoring script.

    7. Conclusion

    The essence of a several-fold improvement in coding benchmark scores is the multiplicative effect of post-training data quality, reward design, primary-secondary orchestration, and evaluation rigor. If readers reproduce the above control matrix and loop process in their own environments, they can obtain comparable, auditable, and iterable conclusions about model capabilities.