Large-Scale LLM Agent Testing at 10 Million Tokens: 3 Surprises and 1 Unexpected Failure
This article reports on a large-scale evaluation of long-horizon LLM agents that consumed roughly 10 million tokens. It explains why single-turn Q&A tests are insufficient for engineering delivery, then walks through three positive findings: agents can complete an hour-long, unattended engineering loop; tool calling combined with self-correction is maturing; and context caching changes the cost structure of long-running tasks. It also documents one unexpected failure mode, overthinking on simple tasks, with mitigation strategies such as difficulty routing, reasoning budgets, external validation, and dual-path sampling. A reusable evaluation framework with metrics and a rollout suggestion is included, along with practical guidance on acceptance criteria, rollback-capable sandboxes, and cost-aware model tiering.
1. Why Scale the Evaluation to 10 Million Tokens
A single-turn Q&A experience only shows whether a model can answer. It says nothing about whether the model can do actual work. Once the evaluation goal shifts from generation quality to engineering delivery, the test method has to change with it: task duration stretches from seconds to hours, call volume grows from a handful of requests to batched concurrency, and cumulative consumption naturally lands in the 10-million-token range.
Large-scale testing delivers value in three ways. First, long-tail problems only surface with enough samples, for example reasoning that falls into a loop or tool-call arguments whose format drifts. Second, the cost structure only becomes visible when long contexts are hit repeatedly; short conversations cannot show caching benefits. Third, stability is a statistical property. A single success does not prove usability, so success rate and interruption rate must be reported.
Note that this article does not rank any specific model or product. Instead, it abstracts the observed behavior into three general engineering problems: long-horizon autonomous execution, reasoning stability, and cost efficiency on lightweight tasks.
2. Surprise 1: Long-Horizon Autonomy Completes an Hour of Unattended Engineering Work
The most notable observation is that long-horizon tasks no longer need a human to push them forward step by step. On an open-ended task with very few constraints, “design the data layer for an accounting system,” the model produced a plan first, then moved into execution, running for close to 60 minutes without interruption or an infinite loop.
The behavior breaks down into four phases, which are also the checkpoints worth inspecting when evaluating long-horizon capability:
- Plan first: it produced the module breakdown and table design, covering core entities such as accounts, transaction records, categories, budgets, and summary views, and made the intent for primary keys, foreign keys, and indexes explicit.
- Self-planned process: beyond listing the components to build, it proactively scheduled self-verification steps for after development, forming a checklist of more than ten items.
- Continuous execution: it created files and interfaces one by one according to the plan, without skipping steps or forgetting key dependencies.
- Self-check on results: after running, it inserted a sample record, confirmed there were no errors, and verified the core path was usable.
The engineering conclusion is that the bottleneck in long-horizon capability has moved from “can the model write a correct piece of code” to “can the human describe the acceptance criteria clearly.” Prompts should therefore be upgraded from “build me a system” to a task brief with acceptance conditions:
Goal: implement the data layer of an accounting systemConstraints: no more than 8 tables; amounts stored as fixed-point numbers; transaction table partitioned by monthDeliverables: schema script + seed data + validation scriptAcceptance: inserting one record raises no error; monthly summary matches detail amounts; repeated imports are idempotentProhibited: leave uncertain fields as TODO; do not invent business rules
Only when acceptance conditions are executable does long-horizon output become regression-testable. Otherwise, even a long autonomous run just scales the errors.
3. Surprise 2: Tool Calling Plus Self-Correction Is Maturing
The real difficulty in long tasks is not writing code but interacting repeatedly with the external environment: reading and writing files, running commands, checking logs, and fixing code based on errors. The pattern observed most consistently was a closed loop of “execute, read the error, locate, fix, rerun” rather than generating everything in one shot.
Making that loop reliable requires three things on the engineering side:
- Rollback-capable environment: each round of changes happens in a separate branch or container, so a failure can be discarded.
- Parseable feedback: compress compiler errors and test failure summaries into structured text before feeding them back, so logs do not flood the context.
- Enforced boundaries: block access to credential directories, restrict outbound network access, and require confirmation for deletion commands.
A sketch of the execution skeleton:
for step in range(max_steps):action = planner.next_action(state) # structured action, not free textresult = sandbox.run(action, timeout=120)state = compress(result) # keep only error type, file, line numberif state.tests_passed:break
The engineering point here is compressing feedback. Raw logs can easily run to tens of thousands of lines, and feeding them back verbatim quickly raises context cost and dilutes attention. Extracting key fields usually works better than pasting the original output.
4. Surprise 3: Caching Reshapes the Bill for Long Tasks
In long-horizon tasks, the system prompt, project structure, and existing code are carried repeatedly, and this prefix content is highly duplicated across calls. When the service side offers context caching, both the billing and the latency for repeated prefixes drop significantly, so the total bill often grows less than the increase in unit price would suggest.
An actionable cost optimization checklist:
- Stable prefix: put unchanging project notes, coding conventions, and the directory tree at the very front, so nothing shifts and invalidates the cache.
- Timestamps last: move volatile content such as “current time” and random values to the end of the prompt.
- Segmented summarization: roll historical execution records into key points, keeping decisions and failure reasons while dropping redundant output.
- Model tiering: use a more capable tier for planning and review, and a lightweight tier for bulk boilerplate code.
- Budget guardrails: set token and duration caps per task, and pause to request human confirmation when a cap is exceeded.
A rough estimate: total cost ≈ new tokens × input price + cache-hit tokens × discounted price + output tokens × output price. As the number of loop iterations rises, the first term grows only modestly; the cache term is the variable that really decides the bill.
5. The Unexpected Part: Overthinking Breaks Simple Tasks
In contrast to the long-horizon results, some extremely simple questions were more error-prone. A typical case is a common-sense word problem: the conditions are sufficient and the answer is unique, yet the model introduced unnecessary assumptions, reasoned back and forth, and landed on a conclusion that defies common sense, sometimes even falling into a self-loop. The same pattern appeared on hard math problems, where long reasoning converged on a wrong answer.
Three angles explain the cause. First, the training objective favors “showing the reasoning process,” so the model tends to complicate simple questions. Second, there is no upfront judgment of problem difficulty, so the model cannot decide early whether to answer shallowly or reason deeply. Third, termination conditions are unclear, and verification and reflection lack external signals, which makes internal repetition easy.
Corresponding mitigations:
- Explicit difficulty routing: run a lightweight classification first, and send simple tasks straight to a small model or a low-step configuration.
- Budget as constraint: cap the maximum reasoning steps or maximum thinking length, and output the current best answer once the cap is hit.
- External validation: hand math tasks to symbolic computation or unit tests, and decide code tasks with test cases.
- Dual-path sampling: generate a direct answer and a deliberate answer in parallel for the same question, and trigger a validation flow if they disagree.
In practice, the best strategy for simple tasks is usually “shortest path plus strong validation,” not longer thinking.
6. A Reusable Evaluation Framework
Turning these observations into metrics is what keeps conclusions from being subjective impressions:
| Dimension | Metric | Notes |
|---|---|---|
| Long-horizon execution | Continuous runtime, interruption rate, plan completion rate | Whether progress follows the plan |
| Reasoning stability | Consistency rate across repeated runs of the same question, loop trigger rate | Statistical measures matter more than single cases |
| Tool use | Argument validity rate, correction success rate | Reflects how well the agent couples with the environment |
| Cost efficiency | Cache hit rate, tokens per task, latency | Determines whether it can scale into production |
| Delivery quality | Test pass rate, human rework time | The final business-level measure |
The practical recommendation is to build a small regression set first, covering easy, medium, and extremely hard tiers with no fewer than a few dozen cases each, then gradually scale up call volume.
7. Conclusion
Testing at the 10-million-token scale shows that long-horizon autonomous execution and the tool loop are already usable in engineering, while the real weak spots are reasoning stability and cost efficiency on simple tasks. The preparation priority for enterprises is not chasing a single leaderboard position, but writing acceptance criteria clearly, turning the environment into a rollback-capable sandbox, and folding caching and tiered model calls into cost design. In practice with model services on platforms such as Baidu AI Cloud, building an observable, rollback-capable evaluation pipeline with object storage, container platforms, log services, and monitoring and alerting is the key path for turning these capabilities into stable productivity.
