Evaluating Long-Horizon Stability of LLM Agents: Beyond Benchmark Scores

    This article explains why long-task stability, rather than benchmark scores or first-response quality, is the real threshold for evaluating LLM agents. It outlines a reproducible evaluation framework with unified prompts, phased timing, context compaction tracking, automated visual regression, and human intervention counts, then breaks down key capability dimensions such as MVP-first planning, instruction retention under context compression, autonomous visual verification, and the speed-versus-stability tradeoff. It closes with engineering recommendations and common evaluation pitfalls for developers building reliable agent workflows.

    1. Background: Stability on Long Tasks Is the Real Threshold

    Over the past year or two, the capability boundaries of large language models have kept expanding: from single-turn question answering to multi-turn tool calling, and now to agent tasks that can run continuously for tens of minutes or even hours. But when a task escalates from “generate a piece of code” to “create a directory on the desktop, independently build a mobile page with complete interactions and animations, and verify the result yourself,” the evaluation criteria change fundamentally. The question is no longer whose first answer looks better, but who can still remember the original goal and keep raising usability under long-running, multi-turn conditions where the context is repeatedly compressed.

    The comparison experience in the original material reveals a fact that leaderboards tend to obscure: different models make very different tradeoffs between speed and stability. Some models reason extremely fast, but read the wrong path at the start of a complex skill task; although they can switch approaches quickly afterward, the quality of the final output fails to converge. Others are not impressive in the first round, and the first version is essentially unusable, but they immediately take screenshots, locate issues, and make fixes, delivering a result with complete animation and self-consistent logic forty minutes later. This is the difference that truly matters in engineering selection.

    2. Rebuilding the Evaluation Method: Making Conclusions Reproducible

    For an evaluation to be meaningful, variables must be fixed first. The following framework is recommended:

    1. Unified task and prompt: Use the same open-ended frontend replication task, requiring the agent to create directories, search for material, write code, and verify results on its own, with no human intervention throughout.
    2. Record phased timing: Split total duration into “time to first usable version” and “continuous self-repair time” rather than recording a single total.
    3. Observe context behavior: Context will inevitably be compressed multiple times during long tasks, so focus on whether the model forgets the original instructions.
    4. Introduce automated visual regression: Allow the agent to use browser automation to capture and compare screenshots, and observe whether it can autonomously detect style deviations.
    5. Record the number of human interventions: This is the hardest metric for measuring autonomy, and the ideal value is zero.

    An illustrative evaluation record can be organized like this:

    1. {
    2. "task": "mobile weather page replication",
    3. "phases": [
    4. {"name": "first version", "duration_min": 10, "usable": false},
    5. {"name": "autonomous repair", "duration_min": 30, "usable": true}
    6. ],
    7. "context_compactions": 3,
    8. "instruction_retained": true,
    9. "auto_visual_check": true,
    10. "human_interventions": 1
    11. }

    3. Breakdown of Key Capability Dimensions

    3.1 Cautious Planning and MVP First

    More stable agents tend to build a minimum viable version within ten minutes first, then invest all remaining time in usability iteration. This “MVP first” strategy is highly reasonable from an engineering standpoint: it exposes architectural errors early and gives subsequent fixes a clear target. In contrast, pursuing a large, all-encompassing solution from the start often means that by the time a wrong path is discovered later, a large amount of context has already been consumed.

    3.2 Instruction Retention in Long Contexts

    Context compaction is an inevitable part of long tasks. What really separates models is whether they can still restate and follow the original constraints after compaction. In engineering, this can be reinforced by inserting “goal write-back” at key checkpoints, for example:

    1. [checkpoint] Original goal: replicate a mobile weather app with complete animations and consistent interaction logic.
    2. Current progress: first version generated; trackpad scrolling is not smooth.
    3. Next step: fix the scroll container and gesture bindings.

    3.3 Autonomous Visual Regression and Error Localization

    Whether an agent can take screenshots, find problems, and locate specific style or interaction defects on its own is the dividing line between evolving from a “code generator” into a “deliverer.” Without this step, the model can only make blind fixes; with it, repair efficiency improves by orders of magnitude.

    3.4 The Tradeoff Between Speed and Stability

    Extremely fast inference is an advantage on simple tasks, but in complex skill tasks it may be “too fast to notice the details.” Selection should be layered by task type: simple completion tasks should prioritize throughput, while long-cycle agent tasks should prioritize stability and self-correction.

    4. Engineering Implementation Recommendations

    • Layered task scheduling: Break long tasks into verifiable milestones, each requiring a runnable output.
    • Mandatory automated verification: Build screenshot comparison and interaction regression into the workflow as a hard gate before merging.
    • Observability: Use logging services, monitoring alerts, and container platforms to record every compaction, every tool call, and every fix, forming a traceable chain.
    • Separate artifacts from context: Store intermediate artifacts in object storage to avoid context bloat that causes goal drift.
    • Human-in-the-loop fallback: Keep human spot-check points, but aim to minimize the number of interventions.

    5. Common Pitfalls

    First, judging only by the first version. An unusable first version does not equal failure; what matters is whether subsequent self-repair converges. Second, comparing only total time. The first-version and repair phases should be split, otherwise “fast but ineffective” cases are hidden. Third, ignoring context compaction. Any long-task evaluation that does not record the number of compactions and instruction retention is incomplete. Fourth, treating speed as the only metric. In agent-style long tasks, stability and self-correction carry far more weight than generation throughput.

    6. Conclusion

    Evaluating the new generation of LLM agents should shift from “who answers better” to “who can finish long tasks correctly and stably.” MVP-first delivery, goal retention under context compaction, autonomous visual regression, cautious planning, and continuous self-repair form the core pieces of long-task stability. For developers and enterprises, building an evaluation system with phased timing, automated verification, and full observability is far more valuable than chasing a single benchmark score. To support such long-running tasks, you can combine general capabilities from Baidu AI Cloud, such as container platforms, logging services, monitoring alerts, and object storage, to build a stable and traceable environment for running and evaluating agents.