How Agent Scaffolding Lowers Code Model Benchmark Scores

    This article explains why the same model weights can score differently across agent scaffolds, tracing the gap to tight coupling between post-training and a minimal harness. It covers the three layers where coupling occurs, what a minimal configuration actually changes, and reusable engineering practices such as evaluation isolation, tool budgets, prompt slimming, and regression dashboards. The takeaway: fix and disclose the scaffold before comparing scores.

    1. The Symptom: One Set of Weights, Two Levels of “Intelligence”

    A confusing pattern shows up repeatedly in code benchmarks: the same model with the same weights scores only 91–93 inside a fully featured coding tool, but reaches 99 and 96 once switched to a minimal configuration — nearly identical to the results from pre-release canary testing. This is not minor noise. It is a jump from “clearly degraded” to “full strength.”

    A finer detail lies in language habits. In the fully featured mode, the model’s replies frequently use first-person singular phrasing such as “I’ll…” or “Let me first…”, while in minimal mode those expressions largely disappear, replaced by collective phrasing like “we” or “need to.” During the canary stage this was suspected to mean the vendor had quietly swapped the model, but the more plausible explanation is: one set of weights, two inference shapes.

    2. Root Cause: Tight Coupling Between Post-Training and the Scaffold

    The key clue came from an exception commit on the engineering side: aligning the minimal agent with the agent composition used during the reinforcement learning training stage. In engineering terms, the vendor’s benchmark “exam room” is exactly the minimal mode; the interface documentation for one model generation also states explicitly that the code agent tasks in public benchmarks use this minimal shape.

    This yields a general conclusion: when a model is bound too tightly to a specific scaffold during post-training, its problem-solving ability drops noticeably as soon as it leaves the familiar exam room. It behaves less like “getting smarter” and more like “recognizing the environment.”

    Coupling typically happens at three layers:

    • Tool-set contract: the number of tools, their names, parameter structures, and return formats visible during training get baked into the policy. More tools raise selection cost and split attention.
    • Prompt priors: the length and wording of the system prompt activate specific behavior patterns, and process constraints in a long prompt can conflict with the training distribution.
    • Context organization: how retrieved snippets, message history, and failed-retry content are assembled determines the “exam paper layout” the model sees.

    3. What Minimal Mode Actually Does

    Minimal is not a capability switch. It shrinks the inference environment to the shape closest to the training distribution:

    • Keep only two tool categories, command execution and file editing; disable everything else.
    • Compress the system prompt to a one-line role definition.
    • Inject no extra process instructions, style constraints, or examples.

    An illustrative minimal configuration (pseudocode):

    1. system: "You are a helpful software engineer assistant."
    2. tools:
    3. - run_command(cmd)
    4. - edit_file(path, old, new)
    5. context:
    6. history: last_turn_only
    7. retrieval: disabled

    Note that this is only a generic illustration of the “minimize tools and prompts” idea and does not correspond to any specific product or interface.

    4. Reusable Engineering Practices

    1. Evaluation isolation. Split “in-distribution configuration” and “production default configuration” into two benchmarks and record scores separately, so exam-room results do not stand in for real experience.
    2. Tool budget. Expose only high-frequency essential tools by default and load the rest on demand; keep tool descriptions short, verb-first, with minimal parameters.
    3. Prompt slimming. Let the system prompt state only the goal, boundaries, and acceptance criteria, leaving process details to the model’s own reasoning.
    4. Distribution alignment. If reinforcement learning is used for post-training, make sure the agent composition during training matches the default production shape, and record versions.
    5. Regression dashboard. Run a fixed question set for every scaffold change and watch score deltas and language-style drift as signals of whether the environment has changed.
    6. Observability. Combine logging services with monitoring and alerting to collect tool-call success rate, average turn count, and edit failure rate, in order to tell a model problem from an environment problem.

    5. Conclusion

    The score jump from minimal mode is essentially a realignment between the evaluation environment and the post-training distribution, not genuine growth in model capability. For users, the lesson is to fix and disclose the scaffold before discussing scores when evaluating code agents. For builders, the lesson is that unifying the “exam paper” of training and inference is what makes capability transferable. Those who want to master the full chain of large model and agent development can build it up layer by layer — from principles to training to application development — with the technical courses and documentation offered by Baidu AI Cloud.