TL;DR
Large language model (LLM) agents often produce different outcomes when running the exact same task multiple times, creating a "consistency gap" that hinders production deployment. This paper introduces an offline, black-box framework that detects these unstable decision points via resampling and generates natural-language guidelines stored in episodic memory to stabilize future agent runs. On the AppWorld benchmark, this approach significantly improves multi-run reliability (+16 percentage points for GPT-4.1) without degrading overall accuracy.
What Problem Does This Paper Address?
Standard benchmarks typically evaluate LLM agents using average accuracy across multiple trials (e.g., Mean@5). However, this metric masks a critical flaw: agents are highly unreliable on repeat. The authors define the consistency gap as the difference between an agent's average pass rate and its ability to successfully complete a task across all repeated runs ($\text{Pass}^k$). For instance, a GPT-4.1 ReAct agent on the AppWorld benchmark achieves a 77% mean pass rate but succeeds in all 5 runs only 53% of the time—a 24-point shortfall.
This inconsistency stems from "flat" token-probability distributions at critical inference points. When multiple tokens have near-tied probabilities, minor platform noise (such as floating-point arithmetic variations on hosted cloud endpoints) can flip the agent's decision from run to run, even under greedy (temperature-zero) decoding.
Methods
The authors propose a two-stage, offline, black-box pipeline that operates without needing access to model weights, logits, or internal activations:
- Detect (Consistency Analyzer): For a given recorded agent trajectory, the analyzer resamples each inference step $N$ times (typically $N=30$). It computes a step-level consistency score based on the response type: embedding-space cosine similarity for free text/code, Jaccard similarity for categorical outputs (like API names and arguments), or a weighted combination for structured JSON. Steps falling below a threshold ($\theta_C = 0.85$) are flagged as unstable.
- Generate (Guideline Generator): An LLM reviews the flagged trajectory and converts the diagnosis into targeted natural-language guidelines. These are categorized into strategy (enforcing correct patterns), recovery (steering around failure-prone steps), or optimization (simplifying steps). These guidelines are saved in a dual-indexed episodic memory and dynamically injected into the agent's prompt context during future runs of similar tasks.
Datasets
The framework was evaluated on the AppWorld benchmark (specifically the test_normal split consisting of 168 tasks). AppWorld simulates a digital world where agents execute tasks across personal apps via Python API calls. Tasks are grouped into scenarios with three variants ($v1, v2, v3$), allowing the authors to test both same-task consistency and similar-task generalization (by deriving guidelines from $v1$ and testing them on $v2$ and $v3$).
Key Insights and Ideas
- Greedy Decoding is a False Safety Net: Simply setting the temperature to zero does not guarantee reproducibility on hosted API endpoints because platform-level noise shifts the underlying probabilities.
- Confidence $\neq$ Resilience: A model's log-probability for a chosen path only shows its confidence in that specific path, not how close the runner-up tokens were. Resampling is required to map the actual shape of the distribution and find "flip-prone" choices.
- Consistency is Distinct from Accuracy: An agent can be highly accurate on average but highly inconsistent. Hardening prompts specifically at unstable steps improves reliability without sacrificing the agent's raw capability.
- Consistency as an Outcome Proxy: Interestingly, aggregate trajectory consistency correlates well with actual task success (achieving an AUROC of 0.699). This means it can serve as an unsupervised reward signal in production environments where ground-truth grading is unavailable.
Key Results
The authors evaluated their framework using two models: GPT-4.1 and GPT-OSS-120B.
- GPT-4.1: Absolute consistency ($\text{Pass}^5$) increased by +16.0 percentage points (from 53.0% to 69.0%) on same-task evaluations, and +13.0 percentage points on similar-task generalization. Mean accuracy ($\text{Mean}@5$) also slightly improved (+3.6 pp), proving that stabilizing choices doesn't hurt performance.
- GPT-OSS-120B: Despite a much lower baseline capability, $\text{Pass}^5$ improved by +6.0 pp on same-task and +8.7 pp on similar tasks.
Limitations and Future Work
- High Token Cost: Resampling each step 30 times multiplies the trajectory's token cost by roughly 30×. The authors note that adaptive resampling—concentrating samples only on candidate flat steps—is an important direction to reduce this cost.
- Guideline Validation: Currently, all generated guidelines are admitted directly into memory. The authors suggest adding a validation stage to test guidelines on a validation set before full admission to prevent overfitting or vague instructions.
- Not a Verifier: The analyzer measures stability, not correctness. A model that is confidently and consistently wrong will receive a high consistency score.
Summary updated