Manuscript Offprint

arXiv:2609.08832

Closing the Consistency Gap: Self-Evolving Agents That Learn to Stay on Course

Evelyn Duesterwald, Benjamin Elder, Lilian Ngweta, Shashanka Ubaru, Malgorzata Zimon

Abstract

Large language model (LLM)-powered agents can be accurate on average yet unreliable in production, a discrepancy that has been observed but remains largely unaddressed. When given the same task five times, a ReAct agent on the AppWorld benchmark using GPT-4.1 succeeds in all five runs only 53% of the time, even though its per-run pass rate averages 77%. We call this 24-point shortfall the consistency gap, and we argue that addressing it is a precondition for trustworthy AI agent deployment. We present a self-evolving agent framework that reduces this gap by identifying unstable, low-consistency steps in agent trajectories and converting them into episodic memory the agent can draw on in future runs. At its core is a Consistency Analyzer that pinpoints where and why a trajectory is likely to flip across executions, and a Guideline Generator that converts the diagnosis into targeted guidelines, committed to memory and injected into future agent executions on similar tasks. On AppWorld with ReAct/GPT-4.1, our framework raises the fraction of tasks that succeed in all five runs by +16 points on same-task evaluation and +13 points on similar-task generalization.

Code: https://github.com/AgentToolkit/altk-evolve

1 Introduction

Large language model (LLM)-powered agents have become the technology of choice for automating tasks that span from web navigation to API orchestration to interactive coding. Published benchmark accuracy numbers miss an underappreciated caveat: agents can be accurate on average but unreliable on repeat, since the same task asked of the same agent often produces different outcomes from one run to the next. We call this shortfall the consistency gap, and argue that reducing it is a precondition for the trust and reliability required for production deployment.

The gap is often large enough to matter in practice. On the test_normal split of AppWorld (Trivedi et al. 2024), a ReAct (Yao et al. 2023) agent backed by GPT-4.1 achieves a mean pass rate of 77% across five runs (Mean@5), but consistently passes all five runs on only 53% of tasks (Pass^5). This 24.4-point shortfall concentrates in a substantial population of tasks (~32% of the benchmark) that mix passes and failures across runs, the scenarios where mean accuracy

Figure

Figure 1: Consistency guideline pipeline: Detect (1) and Generate (2).

numbers are least informative about what a user actually experiences.

The design of our framework to address this gap rests on three observations. First, consistency is not the same as accuracy: a high mean pass rate can co-exist with a low consistent pass rate, so treating consistency as a first-class objective requires dedicated metrics (Section 2.1), an instrument that estimates it without re-running every task many times (Section 3.1), and a mechanism that targets it specifically (Section 3.2). Second, inconsistency has a measurable token-level fingerprint: at each inference point the model induces a distribution over next tokens, and a flat distribution with near-tied tokens lets the agent's decision flip from run to run even under temperature-zero decoding; this can be estimated without model internals by resampling and measuring response variability, the basis of our Consistency Analyzer. Third, consistency can be improved by injecting consistency guidance at the prompt level: a short natural-language consistency guideline replaces an uncertain, previously flip-prone decision with a stable one the agent makes the same way on every subsequent run - without touching the inference loop, agnostic to agent architecture, and confined to an offline analysis stage.

Approach. Our framework is a two-stage pipeline (Figure 1) that is triggered when a new trajectory becomes available. Both stages run offline. Detect: a black-box Consistency Analyzer resamples each inference point in the trajectory, producing a step- and trajectory-level consistency scorecard that pinpoints decisions at risk of flipping, without access to model internals or agent code. Generate: an LLM-based Guideline Generator converts each flip-prone

Copyright © 2026, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved.

step into one or more candidate consistency guidelines, organized (following Fang et al. (2026)) into strategy, recovery, and optimization categories. Generated guidelines are committed to memory, clustered and deduplicated, and retrieved by cosine similarity into the prompt of subsequent similar tasks, stabilizing the inference points that are similar to those previously flagged. We build on the trajectory-informed memory framework of Fang et al. (2026) for storage, clustering, consolidation, and retrieval; the principal cost of this cross-execution learning is a delay before useful guidelines accumulate, bounded by a feedback dynamic in which each guideline shrinks the inconsistent-task population that future guidelines are drawn from.

Contributions. (1) A formalization and empirical characterization of the consistency gap (Section 2). (2) A black-box Consistency Analyzer (Section 3.1) that estimates step- and trajectory-level consistency from response variability via configurable resampling; aggregate trajectory consistency also correlates with trajectory pass/fail (AUROC 0.69), letting it support the generator's own judgment of trajectory outcome where no ground-truth rating is available. (3) Consistency-targeted guideline generation (Section 3.2) driven by step-level inconsistency. (4) Empirical results (Section 4) on AppWorld with ReAct/GPT-4.1 and GPT-OSS-120B showing +16 pp Pass^5 same-task and +13 pp similar-task generalization (168 tasks), plus a sample-budget sensitivity study.

References (30)