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