Why LLM Agent Capabilities Need Multiple Rounds of Iterative Refinement
This article explains why a newly released general-purpose LLM often performs unreliably inside an agent framework, even when it handles ordinary Q&A and text generation well. It breaks agent capability into six layers that must all meet the bar, shows what multi-round iteration actually optimizes across data, training, and system concerns, and offers a repeatable way to evaluate a new model version with layered test cases and verifiable metrics. It also covers engineering compensations, common pitfalls, and practical conclusions for developers.
1. Introduction: Why a “Just Released” Model Often Underperforms in Agents
Many developers run into the same confusion after adopting a new generation of general-purpose LLMs: the model looks fine at ordinary Q&A and text generation, but the moment it is dropped into an agent framework and asked to decompose tasks on its own, call tools, read and write files, and execute code, its behavior becomes noticeably unstable. It skips tool calls, fills in wrong arguments, drifts off course partway through multi-step tasks, and forgets the original constraints after a long workflow.
A common explanation is that “the model has not been trained long enough.” That direction is right, but too vague. A more precise statement is this: agent capability is not a natural by-product of general language ability. It is a stack of several sub-capabilities that can be trained and evaluated independently, and those sub-capabilities only converge reliably after multiple rounds of targeted optimization on real or simulated interaction traces. One cloud vendor’s model improved its agent behavior gradually across early and later minor releases; the model families behind some AI coding tools and some platforms followed the same path. By contrast, when a version that had been dormant for a long time finally shipped, weak agent performance was almost predictable before later releases such as 4.1 and 4.2 arrived.
This article does not review or recommend any specific product. Instead, it abstracts the phenomenon into a general engineering problem: how to understand and tame the capability gap between “a new model” and “an agent.”
2. Breaking Down Agent Capability: What It Actually Depends On
To explain the gap, start by decomposing the capability stack. A usable agent needs at least the following layers to clear the bar at the same time:
- Instruction following and format constraints: emit strictly structured output (such as JSON) with all fields present, correct types, and no extra explanatory text.
- Tool selection and argument filling: pick the right tool among several candidates, and extract slots from natural language to fill its parameters.
- Multi-step planning and state tracking: split a goal into ordered steps and keep track of what is done and not done across a long workflow.
- Error recovery: after a tool errors out, returns an empty result, or times out, retry, switch paths, or ask the user for clarification instead of repeating the same failed action.
- Context management: in a long history, distinguish “system constraints” from “the user’s latest intent” and “noise in tool returns,” and avoid being led astray by irrelevant content.
- Safety and boundary awareness: ask for confirmation on high-risk operations and do not access unauthorized resources.
The key point is that these capabilities have almost no direct supervision signal in general-purpose corpora. Pretraining optimizes the probability of predicting the next token, not “completing one successful task loop given a specific tool set.” So even with strong general ability, the agent sub-capabilities can still sit in a “usable but unreliable” zone.
3. What Multi-Round Iteration Actually Optimizes
From an engineering perspective, the small steps between releases usually do three kinds of work.
3.1 Data: Constructing and Filtering Interaction Traces
Agent training data is not ordinary Q&A pairs but “state–action–observation” traces. The construction difficulty is that real tasks have low success rates, traces are noisy, and failure samples dominate. A common approach is to first write seed traces with a stronger model or by hand, then sample heavily in a sandbox and use verifiable judges (unit tests passing, file contents matching, API return codes as expected) to filter successful traces as positive samples, while keeping typical failures for contrastive learning. Task distributions and filtering thresholds need repeated adjustment, which is inherently multi-round.
3.2 Training: Staged Objective Alignment
Most teams use a staged strategy of “general capability as the base, interaction capability as reinforcement”: first preserve general language and reasoning ability, then apply supervised fine-tuning on interaction data, and finally run preference-based or reinforcement-style optimization on verifiable rewards. Reward design is especially sensitive. If only “task completion” is rewarded, the model may learn shortcuts or even fabricate results; with too many constraints, it becomes timid and asks the user for confirmation constantly. The ratio of rewards to penalties often takes multiple rounds of experiments to stabilize.
3.3 System: Decoding, Context, and Tool Contracts
The same model can behave very differently under different decoding parameters, context truncation strategies, and tool description styles. Whether a tool’s name, description, and parameter documentation are clear is equivalent to handing the model a “readable API doc”; if the doc is vague, the model will inevitably misuse the tool. System-side tuning is coupled with model training and usually has to iterate together.
A comparison of illustrative tool contract styles:
// Not recommended: vague description, hard for the model to judge when to use it{ "name": "query", "description": "Query data", "parameters": { "q": { "type": "string" } } }// Recommended: explicit purpose, constraints, and return structure{"name": "search_orders_by_user","description": "Query orders by user ID with pagination; returns only data from the last 90 days","parameters": {"user_id": { "type": "string", "description": "Globally unique user identifier" },"page": { "type": "integer", "minimum": 1, "default": 1 },"page_size":{ "type": "integer", "minimum": 1, "maximum": 100, "default": 20 }}}
4. How to Rationally Evaluate a New Version’s Agent Performance
Do not draw conclusions from a few “gut feelings.” Build a small, repeatable evaluation set instead:
- Layer the tasks: prepare several cases each for single-step tool calls, two-step chains, long flows with branches and loops, and recovery scenarios with injected errors.
- Automate the judging: rely on verifiable results (file diffs, assertions, API status codes) rather than model self-assessment.
- Metrics, not impressions: separately track format validity rate, tool selection accuracy, argument correctness, task success rate, average number of steps, and repeated failure rate.
- Fix the variables: lock decoding parameters, context limits, and the tool description version, and change only the model version, so results can be attributed.
# Pseudocode: minimal skeleton for a layered evaluationcases = load_cases("agent_eval_v1.jsonl")report = {}for layer in ["single_tool", "multi_step", "error_recovery"]:subset = [c for c in cases if c.layer == layer]ok = fmt_ok = arg_ok = 0for c in subset:trace = run_agent(model, c.input, tools=c.tools)fmt_ok += is_valid_format(trace)arg_ok += is_args_correct(trace)ok += verify(c.expected, trace) # verifiable judgmentreport[layer] = {"success": ok / len(subset),"format": fmt_ok / len(subset),"args": arg_ok / len(subset),}print(report)
If the layered data shows “single-step calls are acceptable but long flows drop sharply,” the problem most likely lies in state tracking and context management. If “argument correctness is low,” fix the tool contracts and prompts first rather than rushing to swap models.
5. Engineering Compensations
While model capability is not yet fully stable, engineering measures can raise the usability floor considerably:
- Constrain output: use structured output or schema validation, retry on parse failure, and feed validation errors back to the model.
- Shrink the action space: expose only the necessary tools at a time and load them dynamically by stage to reduce misselection.
- Externalize state explicitly: write completed steps and intermediate artifacts to external storage or summaries instead of relying on the model to “remember.”
- Prefer determinism: do not hand to the model’s free play anything that rules, retrieval, or caching can solve.
- Observability: fully record traces, tool inputs and returns, latency, and failure reasons, and connect them to logging services and monitoring alerts for regression triage.
- Sandboxing and least privilege: run code execution and file writes in an isolated environment, and force human confirmation for high-risk actions.
6. Common Pitfalls
- Treating a demo as capability: one carefully selected successful trace does not represent stability; long-flow success rate is what matters.
- Chasing every new version: re-tuning prompts and parameters on each switch destroys the evaluation baseline and makes real gains hard to judge.
- Changing prompts but not contracts: when tool descriptions and parameter constraints are unclear, piling on more prompt text yields limited returns.
- Ignoring the value of failure samples: failed traces are the most informative data source for the next optimization round and should be retained in structured form.
7. Conclusion
“A new version underperforms in agents” is usually not an anomaly but an inevitable result of layered capability and optimization cadence: general ability can be shaped in one pass, while interaction ability must be refined repeatedly across trace data, training objectives, and system contracts. For developers, the pragmatic approach is to make evaluation finer, write contracts clearly, externalize state, and complete observability, while treating version evolution with equanimity. When later minor releases keep iterating, measure the improvement against the same evaluation baseline so the conclusion is reliable. If elastic compute and supporting capabilities are needed, you can build the evaluation and runtime environment on general product categories such as Baidu AI Cloud’s container platform, object storage, logging service, and monitoring alerts.
