Long-Context AI Agent Benchmark: A 10-Million-Token Review
This article reports on a hands-on test of long-context AI agents that consumed over 10 million tokens. It covers three main findings: stronger autonomous planning and execution in multi-stage tasks, improved reasoning quality on complex logic problems, and a shift in cost structure driven by prefix caching. It also highlights an unexpected issue where lightweight models can overthink simple tasks or fall into loops. The article closes with a reusable checklist for task design, context management, stability, cost control, and platform observability. Readers can reproduce the test design in their own environments.
1. Why Run a 10-Million-Token Test?
Single-turn Q&A benchmarks rarely reflect how a large model performs in real engineering work. In actual projects, a model must call tools repeatedly, read and write files, run tests, and roll back and retry after errors. Token consumption is often hundreds or thousands of times higher than a single conversation. Only when cumulative usage reaches the tens of millions do stability issues in long-horizon tasks, context management problems, and cost structure issues truly surface.
The goal of this test was not to score a specific model, but to answer three engineering questions: Can the model keep advancing a multi-stage task without human intervention? Is its performance consistent across complex reasoning and simple tasks? Does the bill grow linearly with the number of calls during long tasks? All conclusions below come from reproducible task designs that readers can rerun in their own environments.
2. Surprise One: Much Stronger Long-Horizon Planning and Execution
In a relatively open-ended task such as database design, we provided no strict field constraints and only described the business goal. The model first produced a design covering core functional modules and table structures. It then split the work into development and validation phases on its own, listed more than a dozen acceptance items, and entered a continuous execution state. It ran for nearly an hour without interruption and did not fall into repetitive loops.
Three capabilities stand out here:
- Task decomposition: turning vague requirements into executable subgoals with clear dependency order.
- Tool calling: choosing the right action when reading or writing files and running commands, rather than only describing the approach in text.
- Self-correction: locating the specific step that caused an error and rolling back to fix it, instead of rewriting the entire plan.
The engineering takeaway is that long-horizon performance does not depend on how polished a single output looks. It depends on whether the model can maintain a stable “plan-execute-verify” loop. In practice, it helps to write the acceptance checklist explicitly into the prompt and let the model produce checkable assertions itself. This costs less than manual intervention midway.
3. Surprise Two: Better Reasoning on Complex Logic Problems
On logic puzzles that require multi-step backward reasoning, the model maintained consistent assumptions, ruled out contradictory branches step by step, and produced an explainable conclusion. The key to these tasks is not the amount of knowledge, but whether the model can keep all premises intact across a long reasoning chain.
The corresponding engineering practice is to require the model to output intermediate conclusions and their basis explicitly for high-value reasoning scenarios, then run a second check on the conclusion. A sample call structure is shown below:
def solve_with_check(client, prompt):draft = client.chat(prompt + "Please list the reasoning steps and their basis")verify = client.chat(f"Please check whether the following reasoning contains contradictions:\n{draft}")return draft, verify
This two-stage “generate + verify” pattern can significantly reduce the occasional error rate in long reasoning chains. The tradeoff is higher token consumption, so it should be adopted based on business value.
4. Surprise Three: Caching Changed the Cost Structure in Long Tasks
A long-horizon agent must carry a large amount of historical context in every round. If all of it is billed in full each time, costs inflate quickly as rounds increase. One clear observation from the test was that in continuously running tasks, once the prefix cache was hit, the total bill grew noticeably slower than the number of calls.
Cost optimization should therefore shift from “lowering the unit price” to “increasing the reusable ratio”:
- Keep the prefix stable: place the system prompt, tool definitions, and fixed instructions at the front, and avoid mid-run changes that invalidate the cache.
- Reduce irrelevant changes: move volatile content such as timestamps and random identifiers to the end.
- Measure per phase: track tokens and latency separately for each phase to locate the real consumption hotspots.
- Archive intermediate outputs: write large results to files or object storage, and pass only summaries and paths in later rounds.
5. Unexpected: Overthinking and Loops on Lightweight Tasks
On small problems with minimal structure and a single correct answer, long-thinking mode sometimes wandered into unnecessary branches, repeatedly second-guessed itself, and even fell into loops. On some difficult math problems, it also produced wrong conclusions. A lighter version in the same model family was actually more stable because it answered directly.
This suggests that reasoning depth is not always better when it is greater; it should match task complexity. In practice, a three-tier routing approach works well:
- Use a lightweight model first for intent classification and difficulty grading.
- Answer simple tasks directly with long thinking disabled.
- Enable deep reasoning for complex tasks, with a maximum number of steps, a timeout, and repeated-output detection. If any of these is triggered, interrupt and fall back.
if difficulty == "low":return fast_model.answer(prompt)else:return deep_model.answer(prompt, max_steps=8, timeout=120)
6. A Reusable Implementation Checklist
- Task side: requirements must be verifiable, steps enumerable, and outputs persistable.
- Context side: keep the prefix stable, compress with summaries, and externalize storage.
- Stability side: cap the number of rounds, control timeouts, detect loops, and support failure rollback.
- Cost side: measure per phase, monitor cache hit rate, and route across model tiers.
- Platform side: use a container platform to host the execution environment, and use logging and monitoring with alerts to track every action of a long task.
7. Conclusion
The core conclusion from the 10-million-token test is that long-horizon agents are now capable enough to handle real engineering tasks, but stability and cost must be backed by engineering design. Make the verification loop, context governance, and tiered routing solid, and rely on the general cloud product capabilities on Baidu AI Cloud to host execution and observability. Only then can large models move from “demo-ready” to “delivery-ready.”
