Source-linked AI summary
Closing the Consistency Gap: Self-Evolving Agents That Learn to Stay on Course
Evelyn Duesterwald, Benjamin Elder, Lilian Ngweta, Shashanka Ubaru, Malgorzata Zimon
TL;DR
LLM agents can be accurate on average yet unreliable when repeating the same task, leaving a consistency gap relevant to production trust. The paper detects unstable trajectory decisions, converts them into episodic-memory guidelines, and reports higher all-five-run success on same and similar tasks. On AppWorld with ReAct/GPT-4.1, Passˆ5 rises by +16 points on same-task evaluation and +13 points on similar-task generalization.
Problem
Average agent accuracy can mask inconsistent outcomes across repeated executions, making repeat-run reliability an underaddressed deployment concern.
Method
An offline Consistency Analyzer identifies flip-prone trajectory decisions, and a Guideline Generator converts them into retrieved episodic-memory guidelines.
Results
+16 pp Passˆ5 is reported for same-task evaluation and +13 pp for similar-task generalization on AppWorld with ReAct/GPT-4.1.
Takeaways & Limitations
Consistency-targeted episodic memory reduces the consistency gap without degrading Mean@5 in the reported GPT-4.1 same-task evaluation.
Takeaways & Limitations
The framework does not eliminate inconsistency, and its analyzer measures stability rather than correctness; default resampling costs roughly 30× token usage per trajectory.
Abstract
from arXiv · showhide
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.
1 Introduction
LLM agents can achieve high average accuracy while producing inconsistent outcomes on repeated executions, creating a consistency gap that matters for reliable deployment. The paper proposes an offline pipeline that detects flip-prone decisions and turns them into retrieved episodic-memory guidelines.
- Motivation: 53% of AppWorld tasks pass all five runs, despite a 77% Mean@5 for ReAct/GPT-4.1.The 24.4-point shortfall is concentrated in roughly 32% of tasks that mix passes and failures across runs.
- Motivation: Consistency differs from accuracy, requiring dedicated metrics, estimation without repeated full-task execution, and consistency-specific intervention.The framework is motivated by the observation that high mean pass rate can coexist with low consistent pass rate.
- Framework: The two-stage pipeline detects unstable trajectory decisions and generates guidelines from those flip-prone steps.The Consistency Analyzer resamples inference points to produce a step- and trajectory-level scorecard; the Guideline Generator converts flagged steps into candidate guidelines.
- Framework: Generated guidelines are stored, clustered, deduplicated, and retrieved by similarity for subsequent related tasks.The framework builds on trajectory-informed episodic memory and incurs a delay before useful guidelines accumulate.
- Results: The framework reports +16 pp Passˆ5 on same-task evaluation and +13 pp on similar-task generalization.These results are reported for AppWorld with ReAct using GPT-4.1 and GPT-OSS-120B.
2 Consistency Gap
The consistency gap measures how much average agent accuracy fails to reproduce across repeated runs. On AppWorld, the gap is substantial for both evaluated models, with normalized consistency revealing different degrees of reproducibility.
- Metrics: Pass@k measures at least one success, Mean@k averages per-run success, and Passˆk requires success on every run.For Bernoulli success probability p, their expectations satisfy pk ≤ p ≤ 1 − (1 − p)^k.
- Metrics: Gap@k(T) = Mean@k(T) − Passˆk(T) quantifies apparent accuracy that may disappear under repeated deployment.The metric is reported in percentage points and compares average performance with all-runs consistency.
- Metrics: Normalized consistency, Consistency@k(T) = Passˆk(T)/Mean@k(T), removes the capability ceiling from the raw gap.A value of 1 indicates reproducible success wherever the agent can solve a task; values near 0 indicate largely non-reproducible successes.
- Empirical characterization: 24.4 pp is the GPT-4.1 absolute gap, while 23.8 pp is the GPT-OSS-120B gap on AppWorld.GPT-4.1 has 53% consistent tasks versus 77% Mean@5; GPT-OSS-120B has 10% versus 34%.
- Empirical characterization: GPT-4.1 has aggregate normalized consistency of 0.69, compared with 0.30 for GPT-OSS-120B.GPT-4.1 declines to 0.51 on hard tasks, while GPT-OSS-120B reaches 0.00 on hard tasks.
- Scope: The reported consistency pattern was also observed informally with other agent architectures and models, but its magnitude was not quantified there.The paper therefore does not establish comparable measured gaps beyond the evaluated settings.
3 Consistency Guideline Generation
The framework turns trajectory-level inconsistency diagnoses into targeted episodic guidelines, using black-box resampling and response-type-specific similarity measures to stabilize future agent decisions.
- Framework overview: The framework inherits episodic-memory machinery but adds an upstream pipeline that selects guidelines based on consistency rather than outcome alone.Guidelines are stored, clustered, deduplicated, and retrieved for similar tasks.
- Detect: The Consistency Analyzer reissues recorded prompts to estimate response variability and produces per-step and aggregate consistency scores with flip-risk diagnostics.It operates without model logits, internal activations, or agent-code access.
- Response-type-specific scoring: Free-text and code responses use mean pairwise embedding similarity, which treats paraphrases and functionally equivalent code as consistent.Embedding-space similarity rewards semantic equivalence despite differing syntax.
- Response-type-specific scoring: Categorical responses use mean pairwise Jaccard similarity because token mismatches can change downstream outcomes.The measure is applied to tool names, enum arguments, and structured identifiers.
- Response-type-specific scoring: Semi-structured responses are decomposed into typed fields and combined with configurable importance weights, allowing irrelevant fields to be suppressed.This preserves meaningful divergence in fields that determine the agent’s next action.
- Generate and retrieve: Flagged low-consistency decision-path steps are passed to an LLM-based generator, whose guidelines enter dual-indexed memory for similarity- or metadata-based retrieval.A step is flagged when its consistency falls below θC = 0.85.
4 Evaluation
The evaluation tests whether consistency guidelines improve repeat-run reliability on the same task, transfer to similar tasks, and provide a useful outcome signal. Across AppWorld evaluations, guidelines improve consistency and Passˆ5 for both GPT-4.1 and GPT-OSS-120B, with transfer to similar tasks.
- Evaluation setup: The framework is evaluated on AppWorld’s 168-task test normal split using ReAct agents backed by GPT-4.1 and GPT-OSS-120B, with five runs per task.The evaluation covers same-task improvement, similar-task generalization, and whether aggregate consistency predicts trajectory outcome.
- Evaluation setup: Guidelines are generated from one baseline trajectory, converted into retrieved memory, and injected into subsequent executions of the same or similar tasks.The analyzer extracts step-level actions and scores their variability before guideline generation and retrieval.
- Same-task evaluation: +16.0 pp raises GPT-4.1 aggregate Passˆ5 from 53.0% to 69.0% on same-task evaluation, while Mean@5 rises by +3.6 pp.Normalized consistency increases by +0.17 aggregate, with the largest absolute Passˆ5 gain on Medium tasks (+22.9 pp).
- Same-task evaluation: +6.0 pp raises GPT-OSS-120B aggregate Passˆ5, while Mean@5 increases by +4.8 pp and normalized consistency rises from 0.30 to 0.42.The relative Passˆ5 gain is 59%, with the largest Passˆ5 improvement on Easy tasks (+8.7 pp).
- Similar-task generalization: Similar-task guidelines raise GPT-4.1 aggregate Passˆ5 by +13.0 pp and GPT-OSS-120B aggregate Passˆ5 by +8.7 pp.GPT-4.1 shows a small Hard-task Mean@5 regression of −0.8 pp, whereas GPT-OSS-120B improves at all four difficulty levels without regressions.
- Outcome prediction: Aggregate consistency predicts GPT-4.1 trajectory pass/fail with AUROC 0.699 on 50 AppWorld challenge tasks, supporting its use by the Guideline Generator without ground-truth ratings.The consistency signal supplements the generator’s unaided judgment of trajectory outcome in production settings.
5 Related Work
The related work situates the framework among self-consistency, agentic memory, and reliability research. Its distinction is to use offline variability as a consistency diagnostic for targeted prompt-guideline memory rather than as a runtime voting mechanism.
- Self-consistency and uncertainty: Unlike self-consistency and inference-scaling methods, this framework resamples offline and uses variability to harden prompts rather than select a majority answer.Its structured-response score targets partially structured agent outputs while avoiding uncertainty estimates based only on surface-form variation.
- Agentic memory: Prior agentic-memory systems store conversational facts or reusable workflows, while this framework adds consistency-targeted extraction to trajectory-informed memory.The related work also notes that naive memory accumulation can propagate errors.
- Reliability and observability: The framework targets run-to-run variance as a reliability and observability problem, extending multi-run evaluation with Pass@k, Mean@k, and Passˆk comparisons.Its consistency gap focuses on the consistency axis within a broader reliability taxonomy and can complement runtime logging and policy-memory approaches.
6 Discussion and Limitations
The framework currently admits generated guidelines without validation, leaving open risks of vague, conflicting, or trajectory-overfit memory. Its evaluation is also bounded by platform-side nondeterminism, two model families, residual inconsistency, and substantial analysis cost.
- Guideline validation: Generated guidelines are admitted directly into memory without an intervening validation stage.The proposed future stage would test whether injecting a guideline improves source-step consistency without regression on held-out related trajectories.
- Guideline validation: Unvalidated guidelines may be vague, conflict with existing instructions, or overfit incidental trajectory details.
- Scope: The evaluation covers ReAct agents with GPT-4.1 and GPT-OSS-120B, while broader cross-stack validation remains future work.The framework is described as agent-agnostic by design, but agents using other model families or existing policy memory were not evaluated.
- Limitations: Passˆ5 comparisons assume comparable platform-side nondeterminism between baseline and guideline-injected runs, which the authors cannot directly measure or control.
- Limitations: The analyzer scores stability rather than correctness, so a confidently wrong decision can appear consistent.
- Limitations: N = 30 resamples per inference step multiply token cost roughly 30× per trajectory.Adaptive resampling is proposed as one direction for reducing cost without degrading guideline quality.
7 Conclusion
The paper frames repeated-run reliability as distinct from average task accuracy and addresses it with consistency-targeted episodic memory. On AppWorld, the approach improves all-five-run success for same and similar tasks while preserving accuracy for GPT-4.1.
- Current agents can pass tasks on average while failing to pass the same task consistently across repeated runs.
- +16 points same-task and +13 points similar-task Passˆ5 gains are reported on AppWorld with ReAct and GPT-4.1.The conclusion also reports no accuracy degradation and aggregate trajectory consistency correlating with pass/fail at AUROC ≈0.69.
- The framework uses a black-box Consistency Analyzer to identify flip-prone decisions and a Guideline Generator to convert them into consistency guidelines.These guidelines are stored as episodic memory for later executions.
A Example Consistency Guidelines
The example guidelines translate diagnosed instability into concrete strategy, recovery, and optimization practices for API-driven tasks. They emphasize documentation checks, complete pagination, credential validity, and output validation.
- The examples were generated from a consistency scorecard for an AppWorld habit-tracking task.
- strategy: Strategy guidelines require checking API parameter and input/output requirements against documentation before calls.
- strategy: Strategy guidelines recommend fetching paginated data until documented end conditions confirm that all results are retrieved.
- recovery: Recovery guidelines call for refreshing credentials as needed and verifying token validity before authenticated API calls.
- optimization: Optimization guidelines require validating retrieved and parsed data before calculations or returning results.
B Full Per-Difficulty Results
Tables 1 and 2 provide the complete per-difficulty breakdowns behind the aggregate consistency results for GPT-4.1 and GPT-OSS-120B. They organize baseline, same-task, and similar-task guideline conditions by difficulty.
- Tables 1 and 2 report complete per-difficulty results for GPT-4.1 and GPT-OSS-120B on AppWorld test normal.
- The breakdowns compare baseline performance with same-task and similar-task guideline conditions.