代码语言模型中的局部校准不确定性
Localized Calibrated Uncertainty in Code Language Models
AI总结:
本研究提出了一种技术,用于在代码语言模型中局部校准不确定性,通过最小意图对齐补丁数据集评估不同探测方法的校准效果,并探讨了其在AI监督中的应用。
摘要:
大型语言模型(LLMs)可以从自然语言提示中生成复杂的源代码。然而,LLMs生成的输出可能偏离用户需求,需要监督和编辑。为此,我们提供技术来定位生成可能偏离用户意图的部分。我们首先创建了一个“最小意图对齐补丁”数据集,其中包含修复后的LLM生成程序。每个程序使用测试用例验证正确性。在创建程序数据集后,我们测量各种技术在分配良好校准的概率方面的能力,以指示代码中哪些部分需要最小补丁(即给出一个与经验几率相符的概率)。我们比较了白盒探测(我们提出了一种高效的任意跨度查询技术)与黑盒反射和一致性基于的方法。我们发现,使用小监督模型的探测器可以实现低校准误差和约0.2的Brier技能分数,估算由比其大多个数量级的模型生成的代码中需要编辑的行。我们讨论了这些技术的通用性和与AI监督和控制的联系,发现仅在代码上训练的探测器在允许新的概率缩放时,显示出对自然语言错误的某些泛化迹象。
英文摘要:
Large Language models (LLMs) can generate complicated source code from natural language prompts. However, LLMs can generate output that deviates from what the user wants, requiring supervision and editing. To support this process, we offer techniques to localize where generations might be misaligned from user intent. We first create a dataset of "Minimal Intent Aligning Patches" of repaired LLM generated programs. Each program uses test cases to verify correctness. After creating a dataset of programs, we measure how well various techniques can assign a well-calibrated probability to indicate which parts of code will be edited in a minimal patch (i.e., give a probability that corresponds with empirical odds it is edited). We compare white-box probing (where we propose a technique for efficient arbitrary-span querying), against black-box reflective and self-consistency based approaches. We find probes with a small supervisor model can achieve low calibration error and Brier Skill Score of approx 0.2 estimating edited lines on code generated by models many orders of magnitude larger. We discuss the generalizability of the techniques, and the connections to AI oversight and control, finding a probe trained only on code shows some signs of generalizing to natural language errors if new probability scaling is allowed.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。