Skip to content

Diagnosing State Validity in Agent-Generated Code

Abhishek Kaushik, Jordan Feldstein, Dalila Pîrvu, Krishnendu Ray, Leo Tsourides

cs.AI

Abstract

In exact search and optimization, programs must decide which partial solutions to represent, update, and retain. An incorrect decision can remove information needed to reach the optimum, even when the program passes every hidden test. We examine fifteen programs written by coding agents for seven exact optimization tasks. Each passed every hidden test and received full verifier reward, yet each is incorrect on a valid input. We establish each error independently of the task's reference solution, using a proof, an exhaustive oracle, or a permitted plan checked by a simulator derived from the task statement. We then investigate whether the error arises from how the program represents, updates, or retains its working state. Eight programs show evidence of a specific state defect: in six, changing the implicated retention or transition decision restores an independently established comparison value on the input that exposed the error; in two, we exhibit merged or omitted histories without a restoring edit. Five more return the correct answer when switched from an approximate fallback to their own exact branch, without locating the error within the fallback. One fails on an input that activates its fallback, with no edit tested, and one remains unlocalized. No edit establishes global correctness. Some hidden suites never reached the decisions implicated in these failures; others reached them without exposing an incorrect answer. These cases establish concrete false-positive verifier outcomes, not their prevalence or any effect on training. These failures suggest that evaluations should test not only whether a program produces the correct output, but also whether its state representation, updates, and retention decisions preserve the information required for later decisions.

Create a lesson

Metadata

Categories
cs.AI, cs.SE
Comments
32 pages, 3 figures, 16 tables