Skip to content
AI News HubLIVE
Original source2 min read

Counterexamples as Feedback for Agent Self-Correction

Summary

A new arXiv paper introduces A-CEGIS, a lightweight framework that uses counterexamples as feedback to evaluate whether natural-language-to-regex agents can repair incorrect regexes over multiple turns. On 30 NL-RX-Turk tasks, diagnostic counterexample feedback solves 90% within four turns, vs. 17% zero-shot generation, 27% generic self-correction, and 23% error-only feedback; a full diagnostic run with hardening solves all hidden-set tasks by the final turn, averaging 2.7 turns to success.

SourcearXiv Computational LinguisticsAuthor: Sidhesh Badrinarayan, Adithya Parthasarathy
Counterexamples as Feedback for Agent Self-Correction
Report an error

The correction channel is not available yet. You can copy the article reference below for later.

Correction instructions
Read article

[Submitted on 1 Jul 2026]

Title:Counterexamples as Feedback for Agent Self-Correction

View a PDF of the paper titled Counterexamples as Feedback for Agent Self-Correction, by Sidhesh Badrinarayan and 1 other authors

View PDF HTML (experimental)

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. 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.

Subjects:

Computation and Language (cs.CL); Artificial Intelligence (cs.AI)

Cite as: arXiv:2609.02892 [cs.CL]

(or arXiv:2609.02892v1 [cs.CL] for this version)

https://doi.org/10.48550/arXiv.2609.02892

arXiv-issued DOI via DataCite

Submission history

From: Adithya Parthasarathy [view email] [v1] Wed, 1 Jul 2026 06:08:15 UTC (20 KB)

Full-text links:

Access Paper:

View a PDF of the paper titled Counterexamples as Feedback for Agent Self-Correction, by Sidhesh Badrinarayan and 1 other authors

View PDF

HTML (experimental)

TeX Source

view license

Current browse context:

cs.CL

new | recent | 2026-09

Change to browse by:

cs cs.AI

References & Citations

NASA ADS

Google Scholar

Semantic Scholar

Loading...

Data provided by:

Bibliographic Tools

Bibliographic and Citation Tools

Bibliographic Explorer Toggle

Bibliographic Explorer (What is the Explorer?)

Connected Papers Toggle

Connected Papers (What is Connected Papers?)

Litmaps Toggle

Litmaps (What is Litmaps?)

scite.ai Toggle

scite Smart Citations (What are Smart Citations?)

Code, Data, Media

Code, Data and Media Associated with this Article

alphaXiv Toggle

alphaXiv (What is alphaXiv?)

Links to Code Toggle

CatalyzeX Code Finder for Papers (What is CatalyzeX?)

DagsHub Toggle

DagsHub (What is DagsHub?)

GotitPub Toggle

Gotit.pub (What is GotitPub?)

Huggingface Toggle

Hugging Face (What is Huggingface?)

ScienceCast Toggle

ScienceCast (What is ScienceCast?)

Demos

Demos

Replicate Toggle

Replicate (What is Replicate?)

Spaces Toggle

Hugging Face Spaces (What is Spaces?)

Spaces Toggle

TXYZ.AI (What is TXYZ.AI?)

Related Papers

Recommenders and Search Tools

Link to Influence Flower

Influence Flower (What are Influence Flowers?)

Core recommender toggle

CORE Recommender (What is CORE?)

Author

Venue

Institution

Topic

About arXivLabs

arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.

Which authors of this paper are endorsers? | Disable MathJax (What is MathJax?)

Key points and analysis

Article intelligence

EngineersAdvanced

Key points

  • Single-turn code-generation metrics miss whether deployed agents can repair their artifacts after receiving concrete feedback.
  • A-CEGIS uses a deterministic oracle to return compact false-positive or false-negative counterexamples that guide subsequent turns.
  • On 30 NL-RX-Turk tasks, counterexample feedback solved 90% within four turns, far ahead of zero-shot (17%) and generic self-correction (27%).
  • A full diagnostic run with hardening solved all hidden-set tasks, with average time-to-success of 2.7 turns and 77% robust success after targeted probing.

Highlights and analysis are generated automatically and may contain errors. Check the original source.