Consistency as a Testable Property: Statistical Methods to Evaluate AI Agent Reliability

Harsh Raj, Niranjan Orkat, Suvrorup Mukherjee, Aritra Guha, Cheryl Flynn, Subhabrata MajumdararXiv 2026

TL;DR

This paper introduces a rigorous statistical framework to evaluate the reliability of LLM-based AI agents by measuring their consistency under semantically preserving changes. By leveraging $U$-statistics and kernel-based metrics, the authors decompose agent behavior into final output consistency and internal trajectory stability, revealing that high task accuracy often masks severe behavioral fragility.

What Problem Does This Paper Address?

While large language model (LLM) agents excel at complex tasks, they are notoriously stochastic and sensitive to superficial variations in prompts or environment states. Traditional evaluation metrics focus almost exclusively on task completion rates (like pass@1 accuracy). However, an agent might arrive at a correct answer through entirely erratic or unsafe execution paths when faced with minor, semantically identical changes to its input.

This lack of behavioral consistency is a major blocker for deploying AI agents in high-stakes environments like healthcare or finance. Currently, there is no standardized, mathematically rigorous framework to measure and diagnose where and why an agent's execution strategy breaks down under minor perturbations.

Methods

The authors establish a measurement science for agent reliability by evaluating consistency at two levels:

  1. Output-Level Consistency ($U$-Statistics): To evaluate if an agent produces the same final answer across semantically equivalent prompts, the paper models consistency using $U$-statistics—a class of unbiased estimators for population parameters based on symmetric kernel functions (e.g., token matching or semantic similarity).
  2. Trajectory-Level Stability (Kernel Methods & MMD): To analyze the multi-step action sequences (tool calls, API invocations) an agent takes, the authors treat execution trajectories as stochastic processes. They map these trajectories into a Reproducing Kernel Hilbert Space (RKHS) and use Maximum Mean Discrepancy (MMD) to measure the distance between trajectory distributions.

Crucially, they decompose trajectory inconsistency into two diagnostic dimensions:

  • Composition Drift: What actions/tools are taken, measured using a Jensen-Shannon Distance (JSD) kernel on action histograms.
  • Ordering Drift: How those actions are sequenced, measured using a Global Alignment Kernel (GAK) as a mathematically valid proxy for Levenshtein (edit) distance.

They also introduce Weighted Levenshtein Distance to analyze the temporal dynamics of errors (determining if an agent diverges early during benign exploration or late during critical execution) and a clustering mechanism to handle tasks that naturally have multiple valid solution strategies.

Datasets

The framework was validated using three prominent agent benchmarks representing distinct use cases:

  • SWE-bench Verified: Software engineering tasks based on real GitHub issues.
  • Spider2-DBT: Data transformation and build tasks.
  • BFCL (Berkeley Function Calling Benchmark): Complex tool use and API invocation.

The authors applied both prompt-level perturbations (paraphrasing, back-translation, noise injection) and task-level perturbations (introducing decoy tools, reordering database columns, or shifting output formats from JSON to XML) while keeping the underlying task semantics identical.

Key Insights and Ideas

  • Accuracy Masks Fragility: An agent can maintain decent task accuracy while its internal execution strategy completely degrades. Traditional metrics completely miss this structural brittleness.
  • What vs. How (Composition vs. Ordering): When information access patterns change, agents often select the correct tools (high composition consistency) but sequence them entirely differently or inefficiently (low ordering consistency).
  • The Timing of Deviations Matters: Using position-dependent weights, the authors show that code-generation agents (SWE-bench) tend to diverge early during initial planning, which is often benign. Conversely, data agents (Spider2-DBT) diverge late during result aggregation, signaling a more severe failure in verification.
  • Format Bias over Reasoning Limits: Shifting a tool-use environment from JSON to XML caused catastrophic failures not because of reasoning limitations, but due to hard-coded training biases toward JSON syntax, leading to malformed outputs.

Key Results

The authors evaluated two agent setups: Codex + GPT-5-mini and OpenHands + Kimi-K2.

Accuracy and consistency metrics across three agentic benchmarks under various perturbations.
  • Task-Level Vulnerability: While agents proved relatively robust to simple prompt paraphrasing, task-level environment changes caused severe performance drops.
  • The MCP Swap Failure: On SWE-bench, swapping standard repository tools with a Model Context Protocol (MCP) server caused OpenHands + Kimi-K2's accuracy to collapse to 25.3%. Trajectory metrics revealed that tool composition remained highly stable (JSD 0.931), but action ordering degraded significantly (Levenshtein 0.549), pinpointing sequencing as the exact failure mode.
  • Catastrophic Format Shift: On the BFCL benchmark, forcing an XML output format instead of JSON caused OpenHands' accuracy to plummet to 0.1% and output consistency to drop to 0.345. Trajectory metrics confirmed a total strategy breakdown, with both composition and ordering consistency collapsing due to the agent generating syntactically invalid XML.

Limitations and Future Work

  • Semantic Invariance Assumption: Generating perturbations (like back-translation) can occasionally introduce subtle semantic shifts that violate the assumption of perfect task equivalence. Developing automated rejection-sampling methods to guarantee distributional invariance remains an open challenge.
  • Coarse Trajectory Actions: The current trajectory analysis treats the action type (e.g., the tool name) as the unit of consistency, ignoring the specific arguments passed to the tool or the intermediate text reasoning (Chain-of-Thought).
  • Black-Box Constraints: The framework views the agent as a black box. The authors note that future work could extend this to a Partially Observed Markov Decision Process (POMDP) model to test the consistency of internal belief states and plan refinements, provided that future agent frameworks expose internal model states.

Summary updated

BibTeX
@misc{raj2026consistency,
  author = {Harsh Raj and Niranjan Orkat and Suvrorup Mukherjee and Aritra Guha and Cheryl Flynn and Subhabrata Majumdar},
  title = {{Consistency as a Testable Property: Statistical Methods to Evaluate AI Agent Reliability}},
  year = {2026},
  eprint = {2605.10516},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.10516},
}
Figure