Testing Long-Context LLMs with 10 Million Tokens: 3 Surprises and 1 Unexpected Finding

    This article reports on a hands-on evaluation of large language models that consumed over 10 million tokens across long-horizon coding, logical reasoning, lightweight Q&A, and cost structure scenarios. It covers three key findings: maturing long-range planning and execution in agentic coding, uneven reasoning stability that calls for tiered routing and circuit breakers, and how prompt caching can significantly reduce the total bill for long tasks despite higher per-token prices. The results are based on reproducible task designs and offer practical guidance for developers building AI agent applications.

    Introduction: Why Test at the 10-Million-Token Scale

    As AI agent applications move into production, single-turn question-and-answer benchmarks no longer reflect a model’s real engineering value. What determines business success is whether a model can complete a complex task—involving planning, coding, and a verification loop—over tens of minutes or even hours without human intervention.

    To investigate this, we designed a multi-dimensional evaluation and consumed more than 10 million tokens in total, covering four scenario types: long-horizon programming, logical reasoning, lightweight Q&A, and cost structure.

    This article does not rank models from any specific vendor. Instead, it abstracts the observed phenomena into general technical questions: where the stability boundary of long-horizon tasks lies, how to trade off reasoning depth against response efficiency, and how billing and caching mechanisms affect the total bill. All conclusions come from reproducible task designs and are intended as a reference for developers building agent applications on Baidu AI Cloud.

    Surprise 1: Long-Horizon Autonomous Planning and Execution Have Matured Significantly

    The most impressive result was the model’s endurance in agentic programming scenarios.

    In a task that asked for “database design plus a bookkeeping system,” we deliberately omitted detailed constraints and described only the business goal to test the model’s autonomous planning ability. The model first spent a short time thinking, then produced a structured plan: eight core functional modules and six data tables covering bookkeeping and transaction statistics, along with a development workflow it broke down on its own. More importantly, it proactively added a “self-verification after development” step during the planning phase and listed a ten-item verification checklist.

    This reflects the coordination of three capabilities:

    • Long-horizon planning: breaking a vague goal into executable modules and steps rather than dumping a large block of code all at once;
    • Self-correction: rolling back, locating, and fixing errors during continuous execution instead of getting stuck;
    • Tool use: working with coding tools to read and write files, run commands, and execute tests in a closed loop.

    The engineering takeaway is that the reliability of agentic programming does not depend on the quality of any single code step, but on whether the “plan–execute–verify” loop is complete. We recommend that developers explicitly ask the model to produce a plan and an acceptance checklist before letting it execute. That way, even if something goes wrong midway, there is a clear baseline for regression. An example task constraint could be written as:

    1. Goal: Build a usable bookkeeping system
    2. Requirements:
    3. 1. First output the module breakdown and data table design;
    4. 2. Then provide a step-by-step development plan;
    5. 3. After completing each module, run a self-check;
    6. 4. When everything is done, output a 10-item acceptance checklist and verify each item.

    Surprise 2 and the Unexpected Finding: Reasoning Shows Promise, but Stability Needs Work

    In complex reasoning tests, the model showed clear polarization.

    On one hand, it performed excellently on logical reasoning problems that require chaining multiple steps of common sense (such as situational reasoning puzzles), reliably reconstructing key clues and producing self-consistent conclusions. On the other hand, on International Mathematical Olympiad-level problems and some lightweight tests, it exhibited two typical failure modes: falling into a repetitive reasoning loop that failed to converge for a long time, and giving answers that looked plausible but were actually wrong.

    A third, more concerning “unexpected” finding is worth developers’ attention: on extremely simple tasks, the more capable version sometimes answered incorrectly due to “overthinking,” while the lightweight version, with a shorter reasoning path, directly and efficiently produced the correct answer. This shows that reasoning depth does not yield monotonically increasing returns; there is an “optimal range” that matches task complexity.

    The corresponding engineering strategy is tiered routing: send simple, pattern-based requests to a lightweight model or cache, send complex, long-chain tasks to a strong reasoning model, and set a maximum number of reasoning steps or a timeout circuit breaker for high-risk tasks to prevent loops from consuming compute. Illustrative logic:

    1. def route(task):
    2. if task.complexity == "low":
    3. return lightweight_model(task) # Short path, low latency
    4. if task.needs_long_horizon:
    5. return strong_model(task, max_steps=50, timeout=1800)
    6. return standard_model(task)

    Unexpected Finding 4: Pricing Structure Has Changed, but Caching Significantly Reduces Long-Task Costs

    From a cost perspective, the API unit price of the new generation of models has increased compared with the previous generation, which is a general trend. However, in long tasks, the context prefix is highly repetitive (system prompts, codebase, historical plans), so caching mechanisms can reuse already-computed content, making the increase in the actual total bill noticeably smaller than the increase in unit price.

    Practical recommendations for developers:

    • Keep system prompts and project background stable to improve cache hit rates;
    • Split long tasks into stages to avoid frequently changing the prefix and invalidating the cache;
    • Combine logging services with monitoring and alerting to track token consumption by task and locate cost hotspots.

    On Baidu AI Cloud, you can use object storage to save intermediate artifacts, a message queue to decouple long tasks, and a container platform to host execution sandboxes, while using monitoring and alerting to visualize and govern token usage and costs.

    Conclusion: Turning “It Works” into “It’s Controllable”

    The 10-million-token evaluation yields three actionable conclusions. First, long-horizon agentic programming is already engineering-ready; the key lies in loop design and acceptance checklists. Second, reasoning capability must match task complexity, making tiered routing and circuit breakers indispensable. Third, cost governance must be built into the architecture design, using caching and observability to keep the bill within a predictable range. Only by consolidating these points into a platform-level evaluation and scheduling workflow can large language models move from demos to stable production.