Why LLM Agents Score High on Benchmarks but Underperform in Production: Causes and Engineering Governance
This article explains why LLM agents often look impressive in public benchmarks and demos yet struggle in long-running, multi-file real projects. It breaks the problem into three failure surfaces—goal drift, lack of initiative, and inefficient responses—and traces them to instruction dilution in long contexts, safety-driven preference alignment, and missing output contracts. The article then presents an engineering governance framework covering explicit goal files with escalation policies, finite-state execution loops, layered memory and context compression, idempotent tool orchestration, and conclusion-first output formats. It also defines metrics for making these failures measurable and notes common pitfalls to avoid. The framework is model-agnostic and can be assembled from general cloud capabilities.
Why LLM Agents Score High on Benchmarks but Underperform in Production: Causes and Engineering Governance
1. The Gap Between Benchmark Scores and Real-World Experience
Recent discussion around new-generation large models keeps returning to a contradiction: in public evaluations and demo scenarios, models perform impressively at 3D scene understanding, graphical interaction, UI automation, and code generation. But once they enter long-running, multi-file real projects, the user experience drops noticeably.
Abstracted from this feedback, three recurring problems emerge: goal drift, lack of initiative, and inefficient responses. Together they form what the industry often calls “high scores, low capability.”
These three issues are not unique to any single vendor or model. They are general engineering challenges for agent systems built on the mainstream paradigm of “next-token prediction + human preference alignment.” The right response is not to wait for a future version to “fix” them, but to treat them as controllable variables and govern them at the system design level.
2. Root Causes: Three Failure Surfaces
2.1 Goal Retention Failure: Instruction Dilution in Long Contexts
The core difficulty of long tasks is not that the model “forgets,” but that the relative weight of instructions gets diluted. Once the context is packed with dozens of files and hundreds of tool results, the originally defined objective occupies a smaller and smaller share of the attention distribution, and the model is more easily pulled by local information.
A typical symptom: after running for a long time, the model stops and asks the user to confirm a trivial detail—for example, whether a certain asset file needs to be renamed. From a system perspective, this is priority-ranking failure: a low-value decision has been elevated to a level that requires human intervention.
2.2 Initiative Failure: Shaped in Reverse by “Safety Preferences”
Preference alignment pushes models toward “making fewer mistakes,” and “not making progress” happens to be the strategy least likely to be judged as an error. The result is a structural laziness: the model does not proactively decompose tasks, does not proactively verify results, and does not proactively wrap up, shifting decision costs back to the user. This has nothing to do with capability; it is the result of a mismatch between the objective function and engineering goals.
2.3 Inefficient Responses: Defensive Redundancy and Terminology Drift
The second-stage problem usually shows up as monotonically increasing defensive phrasing: a simple question is expanded into multiple paragraphs—first laying out premises, then listing possibilities, and still no conclusion at the end. To get one actionable answer, the user has to pay extra reading and filtering costs.
This is often accompanied by terminology drift: inventing abbreviations to appear professional, which raises internal communication costs. In engineering terms, this is a missing output contract—nothing defines the structure, length, or conclusion placement of an answer.
3. Governance Framework: Constraining “Capable” into “Effective”
3.1 Goal Layer: Explicit Goal File + Priority Table
Extract goals from the context and write them into a structured file on disk, then force a re-read on every loop iteration.
# goal.yamlobjective: "Reduce memory usage of the log collection pipeline by 30%"constraints:- "Do not change public API signatures"- "No more than 3 files changed per modification"priority:- p0: "Complete baseline load test data"- p1: "Locate hot functions"- p2: "Submit patch"escalation_policy:only_ask_when: ["irreversible operations", "data deletion", "budget or permission changes"]
The key is escalation_policy: whitelist the conditions that trigger human intervention, and in all other cases decide autonomously and keep moving. This directly eliminates the absurd scenario of “interrupting two hours of work to ask about a file name.”
3.2 Loop Layer: Replace Free-Form Dialogue with a State Machine
Do not let the model “improvise” in an open conversation. Constrain its pace with a finite state machine:
[Plan] -> [Act] -> [Verify] -> [Commit] -> [Plan]^ ||__________________________________|
Each state has explicit entry and exit conditions. For example, Verify must produce a reproducible verification record (commands, inputs, output summary); otherwise it cannot move to Commit. This addresses exactly the “no proactive verification, no proactive wrap-up” problem: progress is driven by the system, not by the model’s self-discipline.
Pair this with a minimal actionable step principle: only one atomic action per round, with state written back after the action.
def step(state, action):result = tools.run(action) # single atomic tool callstate.history.append(result.digest())state.token_budget -= result.costif not state.done(state.objective):state.next_action = planner.pick(state) # force the next stepreturn state
3.3 Context Layer: Layered Memory and Compression
Split the context into three layers to avoid “instructions being drowned out”:
| Layer | Content | Lifecycle | Compressible |
|---|---|---|---|
| L0 Goal | Objectives, constraints, priorities | Always resident | No |
| L1 Task | Current subtask and acceptance criteria | Single subtask | No |
| L2 Evidence | File snippets, command output | Single round | Summarized |
For compression, prioritize keeping conclusions and diffs and discard procedural noise; for long logs, keep only error lines and statistical summaries. A common engineering practice is rolling summaries plus verbatim quotes of key snippets, balancing cost and traceability.
3.4 Tool Layer: Orchestration and Idempotency
For capabilities like UI automation, file read/write, and command execution, value depends on orchestration quality, not single-call success rate. Three practical recommendations:
- Idempotent design: all write operations carry an idempotency key so retries produce no side effects.
- Preflight checks: probe capabilities before execution (whether paths exist, whether dependencies are available) to shift failures left.
- Sandbox isolation: run high-risk actions in containers or temporary directories, with resource quotas and timeouts.
preflight(action) -> guard(policy) -> execute(idempotent) -> verify -> log
3.5 Output Layer: A Conclusion-First Output Contract
Against verbosity and conclusion avoidance, the most effective lever is format enforcement, not writing “please be concise” in a prompt.
Answer:- Conclusion: <one sentence, no more than 40 words>- Evidence: <up to 3 items, linkable to file and line number>- Risks: <output only when irreversible impact exists>
Make “the conclusion must appear on the first line” a verifiable rule checked by a post-processing program; if unmet, rewrite automatically. This turns response quality from “model self-discipline” into “pipeline enforcement.”
4. Evaluation System: Making “Low Capability” Measurable
Subjective experience cannot drive improvement; the three failure surfaces must be turned into metrics:
- Goal retention rate: share of actions in a long task consistent with the L0 goal.
- Progress autonomy: actions completed without human intervention / total actions.
- Conclusion density: number of actionable conclusions per unit of text, supplemented by a “first-line conclusion hit rate.”
- First-pass rate: share of patches or configuration changes that pass verification without rework.
- Cost efficiency: tokens and tool calls consumed per unit of completed task.
The evaluation set should be layered into three tiers—short tasks / multi-file tasks / long-cycle tasks—with fixed random seeds and initial repository snapshots to ensure reproducibility. After launch, collect trajectories through logging services, and set thresholds on monitoring alerts for “progress stall duration” and “repeated failed call count” to close the loop.
5. Running It on the Cloud: Combining General Capabilities
The infrastructure requirements are modest; general cloud capabilities can be assembled as needed: a container platform hosts sandbox execution and elastic concurrency; object storage holds task snapshots and artifacts; a message queue decouples staged scheduling of long tasks; logging services and monitoring alerts handle trajectory retention and anomaly detection; key and permission management consolidates credentials to avoid granting the agent overly broad permissions. Baidu AI Cloud offers corresponding capabilities in these general categories, which can be combined as needed without binding to any proprietary interface.
6. Common Pitfalls
- Trying to fix laziness with longer prompts: the longer the instruction, the more it gets diluted—this is the wrong direction.
- Swapping models instead of doing system design: state machines, output contracts, and idempotent tools are assets reusable across models.
- Testing only short tasks: short tasks cannot expose goal drift; evaluation must include long-cycle scenarios.
- Granting the agent excessive permissions: the broader the permissions, the higher the cost of a single misjudgment; least privilege is a prerequisite, not an option.
7. Conclusion
“High scores, low capability” is not a capability problem but three engineering gaps: goals, drive, and contracts. Make goals explicit and bound the conditions for human intervention, let a state machine take over the pace of progress, control context with layered memory, compress response redundancy with output contracts, and add quantifiable layered evaluation plus production monitoring. Then the “capability” a model shows in demos can be reliably converted into “effectiveness” in production. This framework is independent of any specific model version and therefore holds long-term reuse value.
