SynGuar:用实例保证编程的泛化
SynGuar: Guaranteeing Generalization in Programming by Example
摘要:
实例编程(Programming by Example,PBE)是一种程序合成范例,其中合成器创建与一组给定实例匹配的程序。在这种合成的许多应用中(例如,程序修复或逆向工程),我们要重建一个接近特定目标程序的程序,而不仅仅是产生一些满足所见示例的程序。在这种情况下,我们希望合成的程序能够很好地推广,即,在捕获目标函数行为的未观察到的示例上,尽可能少地产生错误。在本文中,我们提出了第一个框架(称为SynGuar)的PBE合成器,保证实现低泛化误差与高概率。我们的主要贡献是一个程序,动态计算有多少额外的例子足以在理论上保证推广。我们展示了我们的技术如何可以用于2个著名的合成方法:PROSE和STUN(通过统一合成),常见的字符串操作程序基准。我们发现,往往几百个例子足以证明绑定泛化错误低于$5\%$与高($\geq 98\%$)概率在这些基准。此外,我们证实了这一经验:SynGuar显着提高了现有的合成器在生成正确的目标程序的准确性。但是,由于任意选择的例子较少,相同的基线合成器(没有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 ($\geq 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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。