arXiv:2606.11521cs.LG2026-06

让大模型通过反例反馈提升正则表达式学习能力,显著减少标注数据需求。

Counterexample Guided Learning in the Large using Reasoning Agents

论文配图:Counterexample Guided Learning in the Large using Reasoning Agents
图 1 · 摘自论文原文
  • 利用反例引导的符号学习机制,让模型逐步修正正则表达式
  • 在最难任务上成功率从3.2%提升至38.1%,复杂表达式学习成功率达74.1%
  • 适合需要精确推理与程序合成的开发者及研究者

大型语言模型(LLM)和代理应在获得反馈后改进,但识别其是否能有效利用反馈仍具挑战:反馈具有异质性、领域特异性且难以控制。本文通过正则表达式归纳这一经典符号学习问题,引入精确反馈机制——反例。在反例引导学习中,模型提出候选正则表达式,教师验证器返回反例以揭示候选与目标语言的差异。我们提出新型反例引导优化策略,如正则化与符号反例聚类,并探索反思与修复循环等代理策略。实验表明,验证器反馈显著提升样本效率,在困难正则表达式任务中大幅降低标注数据需求,使原本失败的复杂表达式学习成功。例如,在最困难的任务组中,成功率从3.2%提升至38.1%,另一域从38.9%升至74.1%。结果表明,大模型可从超越简单数据叠加的丰富反馈中获益,为基于大模型的程序合成与形式推理提供了稳健的验证器引导方法。

原文摘要 · Abstract (English)

LLMs and LLM agents should improve when given feedback, but identifying when they are able to do so is difficult: feedback is heterogeneous, domain-specific, and difficult to control. We approach this challenge by asking LLMs to perform regular-expression induction, a classical symbolic learning problem where precise mechanisms for feedback exist in the form of counterexamples. In counterexample-guided learning, a learner (LLM) proposes candidate regular expressions from positive/negative-labeled strings, and the teacher (verifier) returns counterexamples showcasing the difference between the candidate and target languages. We identify novel counterexample-guided refinement strategies that enable effective regex learning, such as regularization and symbolic counterexample clusters. We also explore agentic strategies such as reflection and repair loops. Empirically, we find that verifier feedback substantially improves sample efficiency on challenging regex-induction tasks, reducing the number of labeled examples required and enabling learning of complex target expressions where standard prompting fails. For example, on the hardest task groups, our counterexample-guided framework improves success from 3.2% to 38.1% and from 38.9% to 74.1% on two different regex domains. These results suggest that LLMs can benefit from rich feedback beyond treating it as additional data, opening the door for robust verifier-guided methods for LLM-based program synthesis and formal reasoning.

大模型反例学习程序合成符号推理

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。