Large Language Models on Long-Horizon Tasks: Three Surprises and One Unexpected Finding

    This article reports on a large-scale evaluation of general-purpose LLMs with strong tool-calling capabilities, covering over 10 million tokens across three workload types: long-horizon agentic coding, complex logical reasoning, and high-frequency lightweight Q&A. It highlights three positive findings—mature long-horizon planning and self-correction, stable structured reasoning and tool collaboration in long contexts, and prefix caching that significantly reduces long-task costs—plus one unexpected issue: overthinking and reasoning instability on simple tasks. Readers will find reusable engineering patterns, code skeletons, and a practical checklist for model tiering, observability, context engineering, and failure circuit breakers.

    1. Evaluation Background and Methodology

    This evaluation consumed more than 10 million tokens in total, covering three typical workload types: long-horizon agentic coding, complex logical reasoning, and high-frequency lightweight Q&A. The “10-million-token scale” matters because single or small-sample calls easily lead to one-sided conclusions—a model’s impressive performance on an individual prompt often fails to hold up across hundreds of consecutive calls. Only with a large enough call volume do engineering metrics such as token consumption distribution, failure patterns, and cache hit rates reveal their true shape.

    Note that this article does not rank specific vendor model versions. Instead, it abstracts the subject as a technical category—“general-purpose large models with strong tool-calling capabilities”—and discusses their capability boundaries in real engineering environments. All conclusions come from observable behavior and do not involve undisclosed internal parameters.

    The evaluation environment was kept consistent: the same system prompt, the same tool set, the same temperature configuration, and the same maximum output length. Each workload type had at least 50 task samples, and each sample ran in an independent context to avoid cross-task contamination.

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

    The most notable observation was endurance on long-horizon tasks. In agentic coding scenarios, the model could work autonomously for more than 60 minutes without human intervention, completing multi-file, multi-stage engineering tasks such as database schema design, index planning, and Android emulator adaptation layer development.

    The key to this capability is not single-step code quality but three cooperating mechanisms:

    • Task decomposition: Automatically breaking “build a runnable module” into stages such as environment probing, dependency installation, skeleton setup, logic implementation, and self-test repair, while maintaining a to-do list.
    • Self-correction: After a failure, reading the error output, locating the specific file and line number, rolling back, and rewriting—rather than repeating the same failed path.
    • Tool-call loop: Reading and writing files, executing commands, and inspecting results form a stable loop, with intermediate state continuously written back into the context.

    The reusable engineering pattern is to model a long task explicitly as a state machine rather than a one-shot prompt:

    1. # General orchestration skeleton for long-horizon tasks (illustrative)
    2. state = {"todo": [...], "done": [], "failed_attempts": {}}
    3. while state["todo"] and budget remains:
    4. task = state["todo"].pop(0)
    5. result = agent.act(task, tools=[read, write, shell, test])
    6. if result.ok:
    7. state["done"].append(task)
    8. else:
    9. # Record a failure fingerprint to avoid the same loop
    10. fp = result.fingerprint()
    11. state["failed_attempts"][fp] += 1
    12. if state["failed_attempts"][fp] >= 3:
    13. state["todo"].append(task.rephrase(result.hint))
    14. else:
    15. state["todo"].insert(0, task)

    What really determines success or failure are the two constraints of “budget” and “failure fingerprint”: the former prevents unlimited consumption, and the latter prevents mechanical retries. In testing, adding these two constraints clearly improved the completion rate of long tasks and significantly reduced token waste.

    3. Surprise 2: Structured Reasoning and Tool Collaboration Stay Stable in Long Contexts

    On puzzle-style tasks requiring multi-step deduction, the model showed a clear ability to enumerate and eliminate hypotheses, proactively listing candidate explanations and verifying them one by one. More valuable was information retention in long contexts: after dozens of rounds of tool output, it could still accurately cite constraints discovered early on, rather than being led astray by intermediate noise.

    The practical recommendation is to externalize the reasoning process into readable artifacts instead of relying on the model to “remember”:

    1. Have the model first output a structured hypothesis table (hypothesis, supporting evidence, refuting evidence).
    2. Write each round of tool results back into a fact list, annotated with the source round.
    3. Require conclusions to cite fact-list IDs for easy human auditing.

    This turns unverifiable “thinking” into diffable intermediate files and greatly reduces debugging costs.

    4. Surprise 3: Caching Significantly Dilutes Long-Task Costs

    The new generation of model APIs has seen an overall price increase, which is an objective fact. But in long-horizon tasks, the context prefix is highly repetitive—the system prompt, tool definitions, and history trace stay almost unchanged. Prefix caching sharply compresses the cost of this repeated computation, so the total bill grows much less than the unit price increase.

    From an architectural perspective, this suggests that context layout should be designed to be cache-friendly. Three actionable rules:

    • Put stable content first: system prompt, tool schema, and domain specifications at the front, with no frequent changes.
    • Put volatile content last: user input and real-time results at the tail.
    • Append rather than rewrite: use an append-only message stream for multi-turn interactions, avoiding full rearrangement that invalidates the cache.

    Illustrative cost estimation logic:

    1. Total cost ≈ uncached prefix tokens × unit price
    2. + cached prefix tokens × discounted unit price
    3. + output tokens × output unit price

    The third term accounts for a substantial share in long tasks, so controlling redundant output (limiting explanatory text, requiring diff-only responses) is often more effective than pushing unit prices down.

    5. The Unexpected Finding: Overthinking and Reasoning Instability on Lightweight Tasks

    In contrast to long-horizon performance, simple tasks behaved differently. On some common-sense and trap-style short questions, a strong reasoning model sometimes entered lengthy self-deliberation, repeatedly overturning an already-correct conclusion and finally giving a wrong answer; on the same questions, a lighter model was often direct and efficient. Another failure mode was infinite loops: on difficult math problems, repeatedly trying the same transformation path and outputting highly similar paragraphs until hitting the limit.

    This is not a capability problem but a mismatch between reasoning budget and task complexity. Workarounds:

    1. # Route by task complexity (illustrative)
    2. if estimated_complexity(task) <= SIMPLE:
    3. return light_model.generate(task, max_tokens=512)
    4. elif needs_long_horizon(task):
    5. return agent.run(task, budget=..., cache_friendly=True)
    6. else:
    7. return strong_model.generate(task, with_verification=True)

    Supporting engineering constraints include: repetition detection (interrupt when similarity across n consecutive segments exceeds a threshold), forcing the answer before the argument, and disabling extended thinking for short tasks. In testing, “conclusion first, reasoning after” alone eliminated most lightweight-task failures.

    6. Implementation Checklist

    • Tiered model selection: Route lightweight, long-horizon, and strong-reasoning workloads to different model tiers instead of using the strongest model for every request.
    • Observability first: Integrate logging and monitoring with alerts, tracking success rate, average rounds, cache hit rate, and per-task cost by task type.
    • Context engineering: Stable prefix plus append-only message flow, institutionalizing cache benefits.
    • Failure circuit breakers: Make repeated-fingerprint and similarity detection the default configuration, not an option.
    • Human-in-the-loop gates: Keep human confirmation at key milestones for long-horizon tasks (such as finalizing a database schema or changing an external interface).

    Overall, the capability focus of this generation of large models has shifted from “answering nicely in a single turn” to “finishing long-horizon work and fixing its own mistakes.” For development teams, the real competitive edge lies not in whether they use the strongest model, but in whether they build a matching system of orchestration, budgeting, and observability.