Counterexamples as Feedback for Agent Self-Correction

Sidhesh Badrinarayan, Adithya Parthasarathy
7/1/2026
cs.CLcs.AI

No confident code implementation found for this paper.

Abstract

Single-turn code-generation metrics understate a central property of deployed agents: whether they can repair a wrong artifact after receiving concrete feedback. This paper presents A-CEGIS, a lightweight framework that uses counterexamples as feedback for evaluating multi-turn refinement in natural-language-to-regex synthesis.

Show full abstract

An agent proposes a regex, a deterministic oracle checks it under full-match semantics, and compact false-positive or false-negative witnesses guide the next turn. On 30 NL-RX-Turk tasks, diagnostic counterexample feedback solves 90\% of tasks within a four-turn ablation budget, compared with 17% for zero-shot generation, 27% for generic self-correction, and 23% for error-only feedback. In a full diagnostic run with hardening, all tasks are solved on the hidden set by the final turn, with mean time-to-success of 2.7 turns and robust success of 77% after targeted probing. These results show that A-CEGIS measures how efficiently an agent improves across turns while adding a practical robustness check beyond the original held-out cases.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{badrinarayan2026counterexamples,
  title  = {Counterexamples as Feedback for Agent Self-Correction},
  author = {Sidhesh Badrinarayan and Adithya Parthasarathy},
  year   = {2026},
  eprint = {2609.02892},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2609.02892v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2609.02892.svg)](https://codeofpaper.com/paper/2609.02892)

Discussion