paperbot · PL 论文追踪

全部论文 待读 收藏

P2 SynGuar: guaranteeing generalization in programming by example

SynGuar:在示例编程中保证泛化
FSE Proceedings of the 29th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering2021匹配度 3/10 · 论文属于程序合成(PBE)中的泛化保证,与用户核心关注的静态分析、LLM/Agent 与程序分析交叉、浮点程序分析及贝叶斯程序分析没有直接关系;仅在“PL+AI/形式化保证+工程实现”的方法论层面有较弱关联。引用 0 inbox
Bo Wang, Teodora Baluta, Aashish Kolluri, Prateek Saxena
crossref: 2026-09-12

AI 速览

一句话:提出首个可为 PBE 合成器动态计算所需额外示例数、从而高概率保证低泛化误差的框架。

示例编程(PBE)合成器通常只要求程序匹配给定示例,但在程序修复、逆向工程等任务中,目标是重建接近目标程序的行为,因此合成程序需在未见示例上泛化良好。本文提出 SynGuar,首个能为 PBE 合成器提供高概率低泛化误差保证的框架。其核心是动态计算为达到理论泛化保证还需补充多少示例,并据此引导合成。作者将技术应用于 PROSE 与 STUN(synthesis through unification)两种合成方法,在常见字符串操作基准上评估。理论上,数百个示例即可在高概率(≥98%)下将泛化误差界限制在 5% 以下;实验也表明 SynGuar 显著提升现有合成器生成正确目标程序的准确率,而仅用少量任意示例的基线会过拟合并降低准确率。

问题
PBE 合成器常只拟合已见示例,未必能在未观察示例上泛化,因而在需要重建目标程序行为的场景中可能过拟合并产生错误程序。
方法
SynGuar 动态计算为理论保证泛化所需补充的额外示例数量,并将该机制集成到 PROSE 与 STUN 等 PBE 合成方法中。
评估
在常见字符串操作程序基准上,作者给出泛化误差概率界,并实证比较加入 SynGuar 前后合成器生成正确目标程序的准确率。
原文摘要(Abstract)

Programming by Example (PBE) is a program synthesis paradigm in which the synthesizer creates a program that matches a set of given examples. In many applications of such synthesis (e.g., program repair or reverse engineering), we are to reconstruct a program that is close to a specific target program, not merely to produce some program that satisfies the seen examples. In such settings, we wish that the synthesized program generalizes well, i.e., has as few errors as possible on the unobserved examples capturing the target function behavior. In this paper, we propose the first framework (called SynGuar) for PBE synthesizers that guarantees to achieve low generalization error with high probability. Our main contribution is a procedure to dynamically calculate how many additional examples suffice to theoretically guarantee generalization. We show how our techniques can be used in 2 well-known synthesis approaches: PROSE and STUN (synthesis through unification), for common string-manipulation program benchmarks. We find that often a few hundred examples suffice to provably bound generalization error below 5% with high (≥ 98%) probability on these benchmarks. Further, we confirm this empirically: SynGuar significantly improves the accuracy of existing synthesizers in generating the right target programs. But with fewer examples chosen arbitrarily, the same baseline synthesizers (without SynGuar) overfit and lose accuracy.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot6369,
  title = {SynGuar: guaranteeing generalization in programming by example},
  author = {Bo Wang and Teodora Baluta and Aashish Kolluri and Prateek Saxena},
  booktitle = {FSE},
  year = {2021},
  doi = {10.1145/3468264.3468621}
}