arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2302.08703cs.LG
收藏

代码大型语言模型的PAC预测集

PAC Prediction Sets for Large Language Models of Code

University of Pennsylvania(宾夕法尼亚大学)

Adam Khakhar, Stephen Mell, Osbert Bastani

AI总结:

本文提出利用抽象语法树生成紧凑的PAC预测集,以部分程序形式表示代码生成模型的不确定性,并在PICARD和Codex上验证了有效性,为首个此类研究。

摘要:

预测集最近被证明是一种有前景的策略,用于以提供理论保证的方式量化深度神经网络的不确定性。然而,现有技术主要针对标签空间简单的场景,因此预测集可以是标签的任意子集。对于标签空间大小呈指数级增长的结构化预测问题,即使预测集仅包含所有标签的一小部分,也可能呈指数级庞大。在代码生成的背景下,我们提出了一种解决方案,考虑了一类受限的预测集,这些预测集可以紧凑地表示为部分程序,即部分被替换为空洞的程序。给定一个训练好的代码生成模型,我们的算法利用编程语言的抽象语法树来生成一组程序,使得正确的程序以高置信度包含在该集合中。我们算法的重要应用包括一个Codex风格的代码生成器,在生成代码的不确定部分留有空洞,从而提供具有理论保证的部分程序。我们在PICARD(一个用于SQL语义解析的T5模型)和Codex(一个用于包括Python在内的十多种编程语言的GPT模型)上评估了我们的方法,证明我们的方法生成了紧凑的PAC预测集。这是首个为生成式代码模型生成PAC预测集的研究贡献。

英文摘要:

Prediction sets have recently been shown to be a promising strategy for quantifying the uncertainty of deep neural networks in a way that provides theoretical guarantees. However, existing techniques have largely targeted settings where the space of labels is simple, so prediction sets can be arbitrary subsets of labels. For structured prediction problems where the space of labels is exponential in size, even prediction sets containing a small fraction of all labels can be exponentially large. In the context of code generation, we propose a solution that considers a restricted set of prediction sets that can compactly be represented as partial programs, which are programs with portions replaced with holes. Given a trained code generation model, our algorithm leverages a programming language's abstract syntax tree to generate a set of programs such that the correct program is in the set with high-confidence. Valuable applications of our algorithm include a Codex-style code generator with holes in uncertain parts of the generated code, which provides a partial program with theoretical guarantees. We evaluate our approach on PICARD (a T5 model for SQL semantic parsing) and Codex (a GPT model for over a dozen programming languages, including Python), demonstrating that our approach generates compact PAC prediction sets. This is the first research contribution that generates PAC prediction sets for generative code models.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑