Counterexamples as Feedback for Agent Self-Correction
A-CEGIS is a lightweight framework that uses counterexamples as feedback to evaluate multi-turn self-correction in natural-language-to-regex synthesis agents Diagnostic counterexample feedback achieves 90% task success within four turns, dramatically outperforming zero-shot (17%), generic self-correction (27%), and error-only feedback (23%) On a hidden test set with hardening, all tasks were solved by the final turn with a mean time-to-success of 2.7 turns and 77% robust success after targeted p
Analysis
TL;DR
- A-CEGIS is a lightweight framework that uses counterexamples as feedback to evaluate multi-turn self-correction in natural-language-to-regex synthesis agents
- Diagnostic counterexample feedback achieves 90% task success within four turns, dramatically outperforming zero-shot (17%), generic self-correction (27%), and error-only feedback (23%)
- On a hidden test set with hardening, all tasks were solved by the final turn with a mean time-to-success of 2.7 turns and 77% robust success after targeted probing
- The framework introduces a deterministic oracle that checks regex proposals under full-match semantics and generates compact false-positive/false-negative witnesses to guide refinement
- Single-turn metrics significantly understate agent capability; multi-turn counterexample feedback reveals a critical property of deployed agents: their ability to repair wrong artifacts with concrete feedback
Why It Matters
This work addresses a fundamental gap in AI agent evaluation: most benchmarks measure one-shot generation quality, but real-world agents must iteratively improve based on feedback. A-CEGIS provides a practical, reproducible framework for measuring this refinement capability, which is essential for deploying agents in production environments where initial outputs are rarely perfect.
Technical Details
- Framework: A-CEGIS (Agent Counterexample-guided Inductive Synthesis) operates as a multi-turn loop where an agent proposes a regex, a deterministic oracle validates it under full-match semantics, and counterexamples (false positives/negatives) are fed back as guidance
- Dataset: Evaluated on 30 NL-RX-Turk tasks for natural-language-to-regex synthesis, with a hidden test set used for robustness hardening
- Benchmarks: Compared four conditions—zero-shot generation (17% success), generic self-correction (27%), error-only feedback (23%), and diagnostic counterexample feedback (90%)—within a four-turn ablation budget
- Performance metrics: Full diagnostic run achieved 100% task completion on the hidden set by the final turn, with mean time-to-success of 2.7 turns and 77% robust success after targeted probing
- Oracle design: Uses a deterministic regex oracle that generates compact witness examples (specific false-positive or false-negative strings) rather than abstract error messages, enabling more precise agent corrections
Industry Insight
- Agent evaluation pipelines should move beyond single-turn benchmarks; multi-turn refinement capability is a stronger predictor of real-world deployment success and should become a standard evaluation dimension
- Counterexample-based feedback is substantially more effective than generic error messages or self-correction, suggesting that production agent systems should integrate concrete witness generation into their feedback loops
- The A-CEGIS framework's approach to robustness hardening—testing on hidden cases after iterative refinement—offers a practical template for stress-testing agents before deployment in safety-critical applications
Disclaimer: The above content is generated by AI and is for reference only.