Why LLMs Are So Sensitive to Their Tool Environment
This article explains why the same large language model can score differently on coding and tool-calling evaluations when only the surrounding harness changes. It breaks down the mechanisms behind score drift—action space size, attention cost of tool descriptions, post-training trajectory distribution, and scoring criteria—then outlines experiments to distinguish environment sensitivity from overfitting, along with practical engineering recommendations.
1. The Phenomenon: Same Model, Different Harness, Different Score
In coding and tool-calling evaluations, a recurring pattern appears: the same model, given the same set of tasks, can produce noticeably different scores when only the external tool-running framework (commonly called a harness) changes the tool set and prompt structure exposed to the model.
A set of illustrative numbers circulating in community discussions looks roughly like this:
| Run mode | Tools exposed to the model | Illustrative score |
|---|---|---|
| Standard mode | ~25 tools with full descriptions | 91 / 92 |
| Minimal mode | Shell execution + file reading only | 99 / 96 |
| Anchored standard mode | 2 tools in the first turn, then all 25 after the model’s first call | 98 / 99 |
Note that these numbers come from public discussion, with inconsistent definitions, task sets, and scoring methods, so they should not be treated as strict benchmark conclusions. What they reveal, however, is an engineering fact worth taking seriously: the first variable behind an evaluation score may not be the model itself, but the distributional shape of the environment and prompts.
The “anchored” design is especially revealing. If the score drop were caused only by the number of tools, then restoring all 25 tools in the second turn should have brought the score back down. It did not. This suggests that what really matters is not “how many tools exist right now,” but the working-mode prior established in the first few steps.
2. Mechanism Breakdown: Why Scores Drift
1. Action space size changes decision difficulty
When tools expand from 2 to 25, the model must choose from a larger candidate set at every step. More candidates mean a higher chance of wrong choices, hesitation, and repeated probing, and errors accumulate faster in long-chain tasks. This is purely a combinatorial complexity problem.
2. Tool descriptions are an “attention tax”
Each tool’s schema, parameter descriptions, usage boundaries, and plugin or skill descriptions occupy context and dilute the weight of critical instructions. The longer the context, the more likely early constraints get “drowned out,” and the more likely the model is to make low-level mistakes such as filling in wrong parameters, omitting required fields, or calling nonexistent combinations.
3. Post-training trajectory distribution defines the “comfort zone”
This is the most important and most easily overlooked point. During post-training, models see large numbers of tool-calling trajectories, and these trajectories are often produced by a small number of harnesses. When the opening environment’s structure closely matches the training distribution, the model quickly enters a familiar behavior pattern: explore first, then locate, then modify, and finally verify. Conversely, if the opening presents a huge tool list and long prompts, the model may spend several turns “reading the manual,” consuming its budget on understanding the environment.
4. Scoring criteria amplify the difference
If scoring only checks whether the final tests pass, then “took a few extra turns but got the right result” and “hit it on the first try” receive the same score. If step count, invalid call rate, and retry count are also tracked, the same trajectory looks completely different. Many conclusions that “the model got stronger” are actually cases where the scoring dimensions became more lenient.
Illustrative pseudocode can express this dependency:
score = f(model, task, harness, prompt_layout, scorer)# Common mistake: attributing changes in score only to model
3. How to Tell “Environment Sensitivity” from “Overfitting”
The original question is whether the post-training of the release version overfits to a certain minimal environment. A more rigorous framing is three hypotheses that need to be verified separately:
- H1 Environment sensitivity: model capability is unchanged; score differences come from action space and prompt structure.
- H2 Distribution preference: the model performs better under openings close to the training distribution, which is a generalization boundary issue.
- H3 Trajectory memory: the model memorizes output templates in specific formats, and switching formats breaks it.
An executable set of discriminating experiments:
- Single-variable control: fix the tasks, temperature, max steps, and scoring script; change only the number of tools.
- Order reversal (anchoring experiment): compare minimal-then-restored against full-then-trimmed to observe whether an “opening lock-in” effect exists.
- Format perturbation: keep the tool set unchanged, but shuffle tool order, reword descriptions, and adjust field naming style to measure score sensitivity.
- Holdout set check: retest with a task set whose style differs substantially from the training harness; a large score drop supports H2/H3.
- Process metrics: record invalid call rate, repeated call rate, average steps, and the position of the first valid call, not just pass rate.
4. Engineering Practice Recommendations
- Progressive exposure with a “narrow interface first” approach: by default expose only the minimal usable tool set (execution, file reading, file writing, retrieval), confirm the model has entered a working state, then expand on demand. This is consistent with the anchoring experiment’s conclusion.
- Compress prompts rather than pile them up: turn tool descriptions into structured short tables, put required fields first, and load long-tail capabilities on demand via retrieval to reduce the attention tax.
- Converge through a tool gateway: perform parameter validation, permission control, idempotency, and retries at the gateway layer, blocking the model’s “slips of the hand” before actual execution.
- Layer the evaluation system: separate capability evaluation (fixed environment, reproducible) from experience evaluation (real environment, with engineering constraints), and do not mix the two sets of conclusions.
- Observability support: use logging services, monitoring and alerting, and distributed tracing to turn every tool call into traceable data; container platforms can provide consistent isolation for experiment environments, and object storage can hold artifacts and datasets for reproducibility.
- Implementation approach on Baidu AI Cloud: use a container platform to host isolated evaluation sandboxes, object storage to fix tasks and trajectories, a message queue to smooth peak loads and schedule batch jobs, and monitoring and alerting to track drift in pass rate and step count, forming a sustainable regression evaluation pipeline.
5. Conclusion
“A higher score in minimal mode” does not necessarily mean the model is overfitted to a single environment. A more common explanation is a combination of three factors: a smaller action space, cleaner prompts, and an opening distribution closer to training trajectories. For developers, the right question is not “which mode scores higher,” but “can my real environment reliably reproduce a high score.” The answer: make interfaces narrow, make prompts thin, make validation thick, and continuously verify with single-variable experiments and process metrics—only then are the gains transferable, maintainable engineering benefits.
