Why Reinforcement Learning Resets Code Model Benchmarks

    This article explains why a code model can score more than twice its base version on one benchmark yet lose most of that advantage under a different setup. It breaks the gap down into four separate variables—model capability, training objective alignment, evaluation strictness, and execution harness fit—then examines how stricter review-style veto rules, harness differences, and reward design each shift scores. It closes with a practical checklist for reproducible evaluation and training, covering fixed harness and rule versions, stratified reporting, base-versus-trained comparisons, cost tracking, and sandbox isolation.

    1. Breaking Down the Phenomenon: Double the Score Is Not Double the Capability

    In code agent evaluation, a familiar comparison shows up: the same base model, after one round of reinforcement learning on real repository tasks, scores more than twice the base on a given code leaderboard—yet switch the evaluation environment and the advantage narrows sharply. To explain that gap, four things have to be separated: model capability, training objective, evaluation criteria, and execution framework.

    A reusable analysis framework:

    1. observed score = f(model capability, training objective alignment, evaluation strictness, harness fit, sampling and budget)

    Any change in one term moves the score dramatically. Discussing all four at once leads to the wrong conclusion that a model evolved overnight.

    2. Stricter Evaluation Criteria Cause a Collective Score Drop

    The first common cause is a revision of the benchmark itself. New versions often stop spelling out requirements in full detail. They deliberately leave information gaps, provide only a minimal task description, apply judgment rules closer to how open source maintainers review a pull request, and add several “instant fail” conditions.

    Typical instant-fail scenarios include:

    • The task asks for a fix on one call path, but the same defect exists on similar paths in the repository and is left unaddressed;
    • Existing input types or historical usage in the repository are not supported, causing a regression in prior behavior;
    • All unit tests pass, but necessary boundary tests are missing, or the change footprint exceeds expectations;
    • New dependencies are introduced or public interface signatures are modified, breaking backward compatibility.

    The defining trait of these criteria: passing ordinary unit tests is only the baseline, not a scoring point. Models that were never aligned to the new criteria therefore drop across the board. This is a change in evaluation criteria, not a loss of capability.

    The takeaway for developers: when designing internal evaluation, make the review perspective explicit in the judgment rules—require minimal changes, compatibility regression checks, fixes for similar issues in the same batch, and attached verification evidence. The pseudocode below shows this style of score aggregation:

    1. def score(task):
    2. if not task.unit_tests_pass():
    3. return 0.0
    4. for rule in task.veto_rules: # instant-fail conditions
    5. if not rule.check(task.patch):
    6. return 0.0
    7. return weighted_sum(task.quality_checks)

    3. Harness Differences: One Model, Different Working Environments

    The second cause is a different execution harness. A code agent relies on more than the model itself; it depends on a full set of surrounding infrastructure: how context is retrieved, how repository structure is compressed, command execution and sandboxing, retry logic on failure, the patch generation and validation flow, and the context budget and number of samples.

    Switching the same model to a different harness commonly produces a relative change of a few to twenty percentage points. The reason is that the harness determines what the model can see, how many attempts it gets, and how errors are fed back. A harness that more closely matches the training environment has a natural edge, while a general-purpose harness standardizes things for fairness and in doing so weakens the existing advantage of a specific model.

    The practical recommendation is to manage the harness as a first-class variable:

    1. evaluation record = {model version, training data cutoff, harness version, prompt template version,
    2. max turns, sample count, sandbox image, judgment rule version}

    Only by holding the other variables fixed does a horizontal comparison mean anything.

    4. Aligning the Training Objective with the Evaluation Objective

    The third cause is the easiest to overlook: reinforcement learning is fundamentally an optimization of some verifiable reward signal. If the reward comes from “completing repository-level fixes under a given harness and by given judgment rules,” the model learns more than coding ability—it also learns that harness’s interaction habits and rule preferences. When the base model moves to a different harness and a different set of judgment rules, the gains naturally shrink.

    The training side should therefore aim to:

    1. Keep rewards verifiable: rely mainly on objective signals such as passing tests, static checks, and compatibility regression, and avoid letting subjective scoring dominate;
    2. Diversify environments: sample across multiple harnesses, repository sizes, and language ecosystems to reduce overfitting to a single environment;
    3. Make rules explicit: write requirements such as minimal changes, fixing similar issues together, and adding tests into the reward, rather than relying on the model’s own judgment;
    4. Prevent reward gaming: add penalties for change size and review of new dependencies, so the model does not learn to “modify tests instead of code.”

    5. An Actionable Evaluation and Training Checklist

    • Evaluation: fix the harness and judgment rule versions, report absolute scores with confidence intervals, and avoid reporting a single number;
    • Stratification: break results down by repository size, language, and task type (bug fixing, feature implementation, refactoring, test generation);
    • Control: report results for both the base and the trained model in the same environment to quantify the real gain;
    • Cost: record turn counts, sample counts, and elapsed time, and state clearly when a performance gain is bought with several times the compute;
    • Deployment: use sandbox isolation in a container platform, track failure modes with logging and monitoring alerts, and archive patches and trajectory data in object storage.

    6. Conclusion

    “Double the score” is more likely the combined result of aligning evaluation criteria, execution harness, and training objective than a pure leap in model capability. For a team, the genuinely valuable work is to build a reproducible evaluation baseline, turn review standards into verifiable rewards, and run reinforcement learning across diverse environments. If elastic compute and a complete observability chain are needed, this can be built on general capabilities such as the container platform, logging service, and monitoring alerts from Baidu AI Cloud, making score changes explainable, comparable, and reproducible.