基于大语言模型的代码生成的不确定性量化
Uncertainty Quantification for LLM-based Code Generation
AI总结:
本文提出RisCoSet方法,通过多重假设检验构建风险控制的预测集,用于大语言模型代码生成任务,有效减少代码移除并提升准确性。
摘要:
预测集为机器学习模型的不确定性量化提供了理论基础。将其应用于结构化生成任务,特别是基于大语言模型(LLM)的代码生成,仍是一个具有挑战性的问题。现有方法提出PAC预测集,但受限于其对风险的强单调性假设和单标签分类框架,严重限制了候选程序的空间,并无法容纳代码生成中固有的多有效输出。为解决这些限制,我们提出RisCoSet方法,利用多重假设检验构建风险控制的预测集。给定训练好的代码生成模型,我们生成由部分程序表示的预测集,该集合保证以高置信度包含正确解。在三个LLM上的大量实验验证了所提方法的有效性。例如,与最先进的方法相比,我们的方法可显著减少代码移除,最多减少24.5%,在相同风险水平下。
英文摘要:
Prediction sets provide a theoretically grounded framework for quantifying uncertainty in machine learning models. Adapting them to structured generation tasks, in particular, large language model (LLM) based code generation, remains a challenging problem. An existing attempt proposes PAC prediction sets but is limited by its strong monotonicity assumption on risk and single-label classification framework, which severely limits the space of candidate programs and cannot accommodate the multiple valid outputs inherent to code generation. To address these limitations, we propose an approach RisCoSet that leverages multiple hypothesis testing to construct risk-controlling predictions for LLM-based code generation. Given a trained code generation model, we produce a prediction set represented by a partial program, which is guaranteed to contain a correct solution with high confidence. Extensive experiments on three LLMs demonstrate the effectiveness of the proposed method. For instance, compared with the state-of-the-art, our method can significantly reduce the code removal by up to 24.5%, at the same level of risk.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。