Why Agent Framework Differences Lower Model Scores

    This article explains why the same base model can show noticeably different task completion rates across agent frameworks, and why the gap usually comes from mismatched runtime contracts rather than weaker model capability. It walks through a framework-dependent agent loop, describes training low-rank adapters (LoRA-style parameter-efficient fine-tuning) on real framework trajectories while keeping the base weights frozen, and shows how to read pass@1 and token cost as two separate measurements. It also outlines how to design a trustworthy comparison experiment with a shared task set, matched budgets, paired statistics, layered breakdowns, and shadow rollout, plus selection and operations guidance.

    1. Where the Problem Starts: Score Variance Is Not the Model Getting Dumber

    When the same open-source base model is plugged into different coding tools or agent runtime frameworks, task completion rates often swing noticeably. This has been a common pattern over the past couple of years, and the cause is not mysterious: in an agent setting, the model is not answering a single-turn question. It is running a full execution chain — reading the system prompt, parsing tool returns, deciding the next action, handling test failures, and judging when to stop. If the format conventions differ at any single link, the difference gets amplified into the final metric.

    A single agent run can be abstracted into the pseudocode below. Nearly all the variation sits in the lines marked as framework-dependent:

    1. def run_agent(task, model, framework, budget):
    2. ctx = framework.build_system_prompt(task) # framework-dependent: prompt structure
    3. for step in range(budget): # framework-dependent: step/token budget
    4. action = model.generate(ctx, tools=framework.tool_schema) # framework-dependent: tool descriptions and parsing
    5. obs = framework.execute(action) # framework-dependent: sandbox and return format
    6. ctx = framework.compress(ctx, obs) # framework-dependent: context management strategy
    7. if framework.should_stop(ctx, obs): # framework-dependent: stopping criteria
    8. break
    9. return framework.evaluate(ctx)

    So a cross-framework score drop is first a mismatch in the interface contract, and only second a model capability issue. Extrapolating an evaluation conclusion from one framework to another usually does not hold.

    2. An Explainable Technical Approach: Train an Adapter Inside the Real Framework

    The direction being explored in the industry is to freeze the base weights and train a low-rank adapter (LoRA-style parameter-efficient fine-tuning) only on real runtime trajectories from the target agent framework, so the model learns that framework’s prompt organization, tool-calling format, and stopping habits.

    The value of this approach comes in three parts:

    1. The parameter update is small, so training and distribution costs stay low, and adapter variants can be produced in parallel for multiple frameworks.
    2. The base model stays untouched, which makes unified maintenance and rollback easier.
    3. The training distribution matches the inference distribution, easing the drift of “one format during training, another format in production.”

    It is worth stressing that an adapter is not a universal switch. What it optimizes is the behavioral policy of “getting the task done inside that framework”; it does not raise the reasoning ceiling of the base model itself.

    3. How to Read the Metrics: Keep pass@1 and Token Cost Separate

    A dedicated adapter variant, under a fixed framework with thinking mode disabled, lifted the single-attempt pass rate from roughly 40% to roughly 55% on the same set of commonly valid terminal-style benchmark tasks (about eighty-odd questions), with the same step budget and text-only mode on both sides. The correct way to read this result is as a paired experiment under one specific framework, not a cross-framework performance promise.

    Cost has to be measured on a separate sample: on the subset of tasks where both the base and the adapter version succeeded, the median generated tokens per task dropped from about 2.9K to about 1.5K. This measures “the generation spent to complete the same task,” including visible text, reasoning content, and tool-call arguments — not the average tokens across the whole test suite. The two sets of numbers use different measurement bases and cannot be mixed.

    Also watch for the optimistic bias that comes from checkpoint selection: if a checkpoint was picked by referencing external benchmarks and a few internal tasks, it carries a selection effect by construction. Judging real gains requires going back to your own task distribution.

    4. Putting It Into Practice: Designing a Trustworthy Comparison Experiment

    • Same task set: use your team’s real tickets, covering the full chain of “read logs — modify code — run tests — converge,” with a sample size large enough to support confidence intervals.
    • Same budget: align steps, context length, number of tools, concurrency, and timeouts, so you avoid a false improvement where one side simply runs ten more steps.
    • Paired statistics: run each task multiple times on both sides, and report paired differences with intervals instead of a single-point mean.
    • Layered breakdown: separately measure action selection accuracy, invalid tool call rate, average steps, and failed retry counts to locate where the gains come from.
    • Shadow release: first run on a side path without taking real traffic, then a small canary percentage, then full rollout.

    A schematic structure for a comparison record:

    1. {
    2. "task_id": "T-1024",
    3. "framework": "framework_a",
    4. "variant": "base | adapter",
    5. "budget": {"max_steps": 100, "mode": "text_only"},
    6. "result": {"pass": true, "steps": 37, "gen_tokens": 1512}
    7. }

    5. Selection and Operations Guidance

    If production uses only one fixed framework with thinking mode disabled, a dedicated adapter variant is usually the better value. If the business needs to span multiple frameworks, or thinking mode is on by default, a general adapter variant aimed at multiple frameworks is the better choice, trading a small amount of peak gain for behavioral consistency. Three engineering pieces are also needed: first, bring framework versions, prompt templates, and tool descriptions under configuration management, so any change triggers a regression run; second, use logging services and monitoring alerts to track drift in pass rate, steps, and token consumption; third, keep a one-click switch back to the base model.

    When deploying on Baidu AI Cloud, you can reuse the container platform to host inference services, object storage to hold adapter weights and datasets, a message queue to smooth out spikes, and the logging and monitoring stack to observe both effectiveness and cost. There is no need to build the entire infrastructure set from scratch.

    6. Conclusion

    The essence of a cross-framework score drop is a difference in runtime contracts, not model degradation. Moving training into the real framework and using parameter-efficient fine-tuning to align behavior is a reproducible, rollback-friendly engineering approach. But any number only carries decision value once it is re-checked under the same basis of “same tasks, same budget, paired statistics.”