Manuscript Offprint

arXiv:2610.31972

Reproducible Evaluation as the Substrate for Safe Prompt Compression in Production Agents

Prabal Vashisht, Zheng Hu, Ying Yang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Evaluating conversational agents that act on live, mutable enterprise data is hard: replayed sessions drift as backend state changes, and a benchmark built today can silently go stale as the data it describes moves on. We present an offline evaluation harness for a production conversational agent that stays reproducible despite the live data it operates on changing, and that can be regenerated on demand once it goes stale. We then use this harness as the fitness function for GEPA-based prompt optimization under a correctness gate that guards against reward hacking. Applied to a production merchant-facing agent, correctness-gated compression shrinks the agent's full prompt surface by 3.5–7.6% without regressing held-out task correctness, consistently across three independent subject-model families — and for one, correctness measurably improves.

1 Introduction

Conversational agents increasingly serve as the interface between users and the software systems that support their work — answering questions grounded in live data [Lewis et al., 2020], and, following the shift toward tool-augmented and agentic LLMs [Yao et al., 2023, Schick et al., 2023, Wang et al., 2024], increasingly taking actions on that data rather than only reporting on it.

In practice, teams do not build such an agent by handing an optimizer a blank prompt and a training set. They first fix the product spec and tool contracts — required wording, forbidden wording, which tool answers which question [Schluntz and Zhang, 2024] — so the agent’s behavior stays legible and reviewable. Only once this spec-complete agent exists does the natural question become: is it reliable, and is it efficient? This paper is a blueprint for that starting point: given a production agent whose spec and tools are fixed, how do we make its evaluation trustworthy and its prompt leaner, without re-deriving its behavior from scratch?

Reliability is harder to establish here than for static NLP tasks: the ground truth an agent is queried against is not fixed — a sales question has a different correct answer daily, and a write action changes the state the next eval run would read. Naive session replay against a live backend therefore produces incomparable results, and scoring a write tool's text misses the point — what matters is the state it leaves behind. A benchmark can also go stale after the fact, as the entities it describes move on (a menu reprices, a payout settles), drifting from the system it describes independent of any model change. We treat this as routine: because generation and evaluation share one schema, a stale benchmark can be regenerated on demand from current backend state.

40th Conference on Neural Information Processing Systems (NeurIPS 2026). Workshop: Agents in the Wild.

Prior work addresses pieces of this. Static benchmarks like ToolLLM [Qin et al., 2024] assume a frozen corpus; interactive-environment benchmarks like AgentBench [Liu et al., 2024], WebArena [Zhou et al., 2024], and τ\tau-bench [Yao et al., 2024] score end state, but inside simulated environments rather than live, drifting production data. Dynabench [Kiela et al., 2021] and LiveBench [White et al., 2025] refresh benchmarks against saturation and contamination, respectively; our staleness instead comes from the referent data moving, which calls for regeneration rather than continual sourcing. LLM-as-judge scoring [Zheng et al., 2023] handles subjective wording but not reproducibility itself, and prompt optimizers — APE [Zhou et al., 2023], DSPy [Khattab et al., 2024], GEPA [Agrawal et al., 2025] — treat their evaluation signal as given rather than addressing what makes it reproducible or fresh.

Our harness matches a reproducibility mechanism to each tool's data shape: staging the clock for reads immutable once settled, freezing the observed payload for current-state-dependent reads, and seed-then-read-back for tools that write. Archetype-stratified generation covers each skill's capability surface, and deterministic plus LLM-rubric judges [Zheng et al., 2023] score correctness and policy compliance.

Because this harness yields a stable scalar signal, it can also serve as GEPA's [Agrawal et al., 2025] fitness function. Published GEPA use cases grow a minimal seed prompt via reflection; production agents start spec-complete, so optimization must instead compress without regressing. Shorter prompts directly reduce inference latency and serving cost [Jiang et al., 2023], so token count is worth optimizing even once correctness is already met. We use a lexicographic token-count objective that only breaks exact performance ties, never trading correctness for size, guarded by a hard gate against any rule-violating candidate — a prompt-optimization analogue of reward hacking in reinforcement learning [Skalse et al., 2022]. We validate this on a merchant-facing conversational agent already in production: across three independent subject-model families, compression under our gate reduces the agent's full prompt surface by 3.5–7.6% without regressing held-out task correctness on a confirmatory held-out set — and for one family, correctness measurably improves — evidence that prompt size and task correctness need not trade off against each other.

Our contributions: (1) a sandbox that generates and evaluates benchmark data against live production state, matching each tool's data-mutability to a reproducibility mechanism and scoring write-tools on end state rather than transcript text; (2) a generation strategy that can be re-run at any point to refresh a benchmark once its underlying production data has moved on; and (3) a token-efficiency method that uses this harness as a correctness-gated fitness function for prompt compression.