arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2402.05939cs.SEcs.CLcs.LG
收藏

代码分布偏移下大语言模型的不确定性意识:一项基准研究

Uncertainty Awareness of Large Language Models Under Code Distribution Shifts: A Benchmark Study

University of California, Riverside(加利福尼亚大学河滨分校);University of Texas at Dallas(德克萨斯大学达拉斯分校)

Yufei Li, Simin Chen, Yanghong Guo, Wei Yang, Yue Dong, Cong Liu

AI总结:

本研究构建大规模基准数据集,系统评估概率方法在代码分布偏移下对CodeLlama不确定性意识的影响,发现其提升校准与估计精度,但需依情境权衡选择方法。

摘要:

大语言模型(LLMs)已被广泛应用于编程语言分析以提升人类生产力。然而,其可靠性可能因各种代码分布偏移而受损,导致输出不一致。尽管概率方法已知可通过不确定性校准和估计来减轻此类影响,但与在图像任务中的应用相比,其在语言领域的有效性仍未得到充分探索。在本工作中,我们首先引入一个大规模基准数据集,包含三种不同强度的现实代码分布偏移模式。随后,我们使用这些偏移的代码片段,全面研究了应用于CodeLlama的最先进概率方法。我们观察到这些方法普遍提升了CodeLlama的不确定性意识,校准质量提高,不确定性估计(UE)精度更高。然而,我们的研究进一步揭示了不同标准(如校准误差与误分类检测)下的性能动态差异,以及有效性与效率之间的权衡,强调了针对特定情境进行方法选择的必要性。

英文摘要:

Large Language Models (LLMs) have been widely employed in programming language analysis to enhance human productivity. Yet, their reliability can be compromised by various code distribution shifts, leading to inconsistent outputs. While probabilistic methods are known to mitigate such impact through uncertainty calibration and estimation, their efficacy in the language domain remains underexplored compared to their application in image-based tasks. In this work, we first introduce a large-scale benchmark dataset, incorporating three realistic patterns of code distribution shifts at varying intensities. Then we thoroughly investigate state-of-the-art probabilistic methods applied to CodeLlama using these shifted code snippets. We observe that these methods generally improve the uncertainty awareness of CodeLlama, with increased calibration quality and higher uncertainty estimation~(UE) precision. However, our study further reveals varied performance dynamics across different criteria (e.g., calibration error vs misclassification detection) and trade-off between efficacy and efficiency, highlighting necessary methodological selection tailored to specific contexts.

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

↑