# CTE-Bench: Audited Counterfactual Trace Evaluation for Stateful Software Simulators

*Xinran Zhang*

[NeurIPS page](https://neurips.cc/virtual/2026/poster/139020) · [Open on the map](../papers.html#p139020)

Category: [LLM Agents, Evals & Benchmarks](../pcat/17.md) › [Verifier-Backed Evaluation of Agentic Reasoning](../pgroup/369.md) · Type: benchmark or dataset · Keywords: coding agents, counterfactual evaluation, software simulators, benchmark, stateful services, code change impact prediction

Areas: [Code & Coding Agents](../areas/codegen.md) › Code Verification › Software engineering benchmarks; [AI Agents](../areas/agents.md) › Agent Benchmarking › Software agent benchmarks; [Evaluation & Benchmarks](../areas/evaluation.md) › Language Model and Agent Benchmarks › Coding Agent Benchmarks; [Benchmarks for LLMs & Agents](../areas/bench-llm-agents.md) › Cross-Domain Agent Evaluation › Software Engineering Benchmarks

## Summary
CTE-Bench is an audited benchmark that evaluates how coding agents predict the effects of local code or state changes on stateful software simulators, isolating simulator-fidelity from policy success.

## Explained to a 5-year-old
There is a little computer program that works like a game and keeps track of what happens. We change a small part of the program and ask a smart robot to guess what will happen next. The robot is tested on many different programs to see if it can guess correctly. Sometimes we hide the answers to see if the robot can think ahead. The test helps us know how well the robot understands the program.

## Explained to a 5-year-old, longer
We have a toy computer program that behaves like a simple service and remembers what it has done before. We give it a short story of what happened, then we change a tiny piece of the code or a piece of its memory. After that change, we ask the program a series of questions to see how it will react. An invisible helper runs the original program and tells us the correct answers. We compare the robot’s guesses to the helper’s answers to see how well the robot predicted the change. We hide some of the helper’s answers to test whether the robot can think ahead without looking at the future. We also let the robot run on its own without the helper’s answers to see how often it makes mistakes. All of this is put together in a collection called CTE-Bench, which gives researchers a way to check how good coding robots are at understanding the effects of their changes.

## For a technical reader
The benchmark supplies a set of scenarios where a service, a prior interaction, and a code or state change are given, followed by a fixed sequence of queries. An oracle runs the original service to produce the correct responses, and models are scored on how often their predictions match the oracle’s answers at points where the change matters. The evaluation includes both teacher-forced prompting, where earlier oracle answers are shown, and self-conditioned rollout, where the model must predict without that feedback. This helps identify reliance on future information and error propagation in simulated services.

## Problem
When large language model agents modify code in stateful services, they need to predict how those changes will affect future behavior. Existing evaluations conflate this simulator-fidelity question with overall policy success, making it hard to assess agents' ability to reason about code changes.

## Method
The benchmark presents each scenario with a service source, a factual interaction prefix, a patch or hidden-state overwrite, and a fixed suffix query schedule. An executable oracle computes the counterfactual response trace, and models are evaluated on effect-step value-match at suffix positions where the intervention changes the oracle response.

## Results
Models achieve around 60% effect-step value-match when they see earlier oracle responses, but performance drops to the low teens to mid-twenties when that feedback is hidden. Self-conditioned free-rollout yields only ~30% effect-step match and at most 1.2% exact whole-trace match.

## Contributions
The paper introduces a benchmark that isolates simulator-fidelity from policy success, provides an executable oracle for counterfactual evaluation, and includes metadata and scripts to tie each claim to its evaluation protocol.

## Practical relevance
The benchmark provides a realistic evaluation of agents' ability to reason about code changes, helping improve reliability of automated software maintenance.

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. [Suggest a correction](../feedback/?on=p/139020)
