Why the Same LLM Performs Differently in Different Tools: The Role of the Harness
This article explains why the same model and API can produce noticeably different results across tools. Using the formula Agent = LLM + Harness, it breaks down the core components surrounding a model—Prompt, Context, RAG, Tool, and Agent—and shows how the Harness controls context assembly, tool quality, workflow constraints, and observability. It also offers practical guidance for improving the Harness before switching models.
Why the Same Model Performs Differently in Different Tools
The same model, the same API, yet one tool gives vague answers while another suddenly seems to “get it.” The first assumption is often that the model was secretly upgraded or the API was specially optimized. The reality is usually simpler: the model hasn’t changed, the API hasn’t changed, but the layer around the model has.
A common simplified formula in the industry describes this relationship: Agent = LLM + Harness. Prompt, Context, RAG, and Tool are not independent, parallel concepts; they are the “parts” in the hands of the Harness. This article starts from the innermost “engine” and peels outward layer by layer to connect these easily confused terms into a single line.
1. The Engine: What the LLM Actually Does
An LLM (Large Language Model) is essentially a program that has read massive amounts of text. It does only one thing: based on the text you give it, predict the most likely next text, one token at a time.
Its external interface is typically a network API with an extremely simple semantic: text in, text out. You send a piece of text and it returns a piece of text; it doesn’t know which file the text came from, nor who will execute the response.
Schematically, a single call completes one “continuation”:
Input: [system instructions] + [conversation history] + [retrieved snippets] + [tool results] + [current question]Output: the most likely sequence of next tokens
Remember its three inherent limitations—almost every concept that follows is a patch for these three points:
| Inherent limitation | Plain explanation | Who patches it |
|---|---|---|
| No memory | Every call is “amnesiac”; without resending history, it knows nothing | Context, Memory |
| Limited knowledge | Only knows what it learned during training, not internal company docs or today’s news | RAG, web search |
| Can only talk, not act | Can only output text; cannot read local files or actually run code | Tool, Agent |
Understanding these three points explains why the “shell” can make a huge difference: the shell determines how well these three patches are applied.
2. Prompt: The Constraint Layer That Clarifies the Task
A Prompt is not a “magic spell” but an explicit constraint on model behavior. It carries at least four responsibilities: role and goal, output format, prohibited actions, and fallback strategy when uncertain.
A common misconception is that a longer Prompt is always better. In fact, the longer the Prompt, the higher the probability of conflicting instructions, and the more likely the model is to lose track. A more stable approach is layering:
[System layer] Role, boundaries, output contract (stable, cacheable)[Task layer] The specific goal for this run[Data layer] Retrieved snippets, user input (clearly labeled with source and trustworthiness)[Format layer] Structured output requirements for downstream parsing
After layering, you’ll find it easier to locate problems: is the poor result due to unclear constraints, wrong data, or a format parsing failure?
3. Context: The “Budget” That Truly Determines Success
Context is all the text the model can see in a single call. It is both a source of capability and a scarce resource: the window is limited, attention is limited, and cost rises with length.
Therefore, the core of Context engineering is not “stuffing it full” but “making trade-offs.” In practice, it usually involves four things:
- Filtering: include only snippets relevant to the current question; remove duplicates and low-information content.
- Compression: summarize long documents, extract key passages, and keep the source.
- Ordering: place the most critical constraints and evidence at stable positions near the beginning or end to reduce mid-context neglect.
- Isolation: partition and label user input separately from system instructions to reduce the risk of privilege escalation from prompt injection.
Memory, essentially, is selectively writing cross-session information back into the Context: what should be remembered long-term, what is only valid for the current task—this requires explicit management by the shell.
4. RAG: Attaching an “Updatable Reference” to the Model
RAG (Retrieval-Augmented Generation) addresses knowledge timeliness and private data problems. Its pipeline is not mysterious: document chunking → vectorization and storage → retrieval by question → reranking → assembly into Context → generation with citations.
What truly affects results is often not the model but the unremarkable details in the pipeline:
- Chunking granularity: too fine loses context; too coarse introduces noise.
- Retrieval strategy: pure vector retrieval easily misses proper nouns and IDs, so it usually needs to be combined with keyword retrieval.
- Reranking and truncation: first recall more candidates, then use a reranker to pick the few most relevant snippets.
- Traceable citations: only when every conclusion can be traced back to its source location is it safe for business use.
It’s worth emphasizing: RAG is not a universal patch. It excels at “looking up information” but not at “multi-step reasoning and operations”; the latter relies on Tool and Agent.
5. Tool and Agent: From Talking to Doing
A Tool is a pair of hands for the model: read files, query databases, send messages, run tests. The quality of its interface design directly determines the success rate. A good tool typically has: semantically clear names and descriptions, strict parameter validation, structured returns, and clear error messages.
An Agent adds a loop on top of Tools: observe → decide → call → check result → correct, until a termination condition is met.
while not done and steps < N:observe the current statechoose a tool and provide parametersexecute and collect structured resultsdetermine whether the goal is met / whether to switch approach
Engineering must preset boundaries: maximum steps, timeout, retry limit on failure, and human confirmation for dangerous operations. An Agent without these constraints is often not smarter, but less controllable.
6. Harness: The Shell Is the Watershed of Experience
The Harness refers to the entire runtime outside the model: system instructions, context assembly, retrieval pipeline, tool registration and permissions, loop control, output parsing, logging, and evaluation.
So the different performance of the same model under different shells has a clear explanation:
- Different context organization: one puts key evidence at the beginning; another buries it at the end of a long text.
- Different tool availability: one has precise tool descriptions and readable errors; another has vague parameters and uninformative errors.
- Different workflow constraints: one has format validation and failure retries; another crashes on a parse failure.
- Different observability: one can replay every call; another can only guess.
The conclusion is direct: the model determines the upper limit of capability; the Harness determines how much of that capability is actually realized.
7. Practical Advice: Fix the Shell First, Then Switch Models
- Build a minimal evaluation set: fix inputs and expectations with dozens of real tasks, and run it after any change.
- Fix variables: change only one layer of the shell at a time; avoid switching the model and changing the Prompt simultaneously, which makes attribution impossible.
- Log the full pipeline: record the assembled Context, tool inputs and returns for each call to enable replay and diagnosis.
- Consider cost and latency together: Context length, number of retrieval candidates, and Agent steps all amplify overhead, so thresholds are needed.
- Security first: treat all external content as untrusted data, minimize tool permissions, and require human confirmation for high-risk actions.
In general engineering practice on cloud platforms such as Baidu AI Cloud, such capabilities are typically implemented by combining a container platform to host the runtime, object storage to hold documents, a message queue to decouple asynchronous tasks, and logging services with monitoring and alerting to ensure observability—the focus is not on any specific product, but on stably engineering the above layers.
Connecting LLM, Prompt, Context, RAG, Tool, Agent, and Harness, you’ll find the tuning order should be bottom-up: first confirm the model and API, then fix the Prompt and Context, then refine retrieval and tools, and finally drive iteration with evaluation. In most cases of “the model got dumber,” the answer lies in the shell.
