It is now common practice in software development for large language models (LLMs) to be used to generate program code. It is desirable to evaluate the robustness of LLMs for this usage. This paper is concerned in particular with how sensitive LLMs are to variations in descriptions of the coding tasks. However, existing techniques for evaluating this robustness are unsuitable for code generation because the input data space of natural language descriptions is discrete. To address this problem, we propose a robustness evaluation method called scenario domain analysis, which aims to find the expected minimal change in the natural language descriptions of coding tasks that would cause the LLMs to produce incorrect outputs. We have formally proved the theoretical properties of the method and also conducted extensive experiments to evaluate the robustness of four state-of-the-art art LLMs: Gemini-pro, Codex, Llamma2 and Falcon 7B, and have found that we are able to rank these with confidence from best to worst. Moreover, we have also studied how robustness varies in different scenarios, including the variations with the topic of the coding task and with the complexity of its sample solution, and found that robustness is lower for more complex tasks and also lower for more advanced topics, such as multi-threading and data structures.


翻译:当前软件开发实践中,使用大语言模型生成程序代码已成为普遍做法。评估大语言模型在此应用场景下的鲁棒性具有重要意义。本文特别关注大语言模型对编程任务描述变化的敏感程度。然而,由于自然语言描述输入空间具有离散特性,现有鲁棒性评估方法并不适用于代码生成任务。为解决该问题,我们提出一种名为"场景域分析"的鲁棒性评估方法,旨在发现能够导致大语言模型产生错误输出的编程任务自然语言描述的最小预期变化。我们已通过形式化证明验证了该方法的理论特性,并通过大量实验评估了四种前沿大语言模型(Gemini-pro、Codex、Llamma2 和 Falcon 7B)的鲁棒性,实验结果表明我们能够以较高置信度对这些模型进行优劣排序。此外,我们还研究了不同场景下鲁棒性的变化规律,包括编程任务主题差异及其示例解决方案复杂度的影响,发现任务复杂度越高则鲁棒性越低,且在多线程和数据结构等高级主题领域鲁棒性表现更弱。

0
下载
关闭预览

相关内容

通过强化学习增强代码生成中的代码大语言模型:综述
专知会员服务
29+阅读 · 2025年1月1日
揭示生成式人工智能 / 大型语言模型(LLMs)的军事潜力
专知会员服务
31+阅读 · 2024年9月26日
大型语言模型(LLMs),附Slides与视频
专知会员服务
71+阅读 · 2024年6月30日
《将大型语言模型(LLM)整合到海军作战规划中》
专知会员服务
130+阅读 · 2024年6月13日
《大型语言模型代码生成》综述
专知会员服务
70+阅读 · 2024年6月4日
GPT系列大模型在自然语言处理任务中的鲁棒性研究
专知会员服务
30+阅读 · 2024年3月22日
自然语言生成资源列表
专知
17+阅读 · 2020年1月4日
基于数据的分布式鲁棒优化算法及其应用【附PPT与视频资料】
人工智能前沿讲习班
27+阅读 · 2018年12月13日
自然语言处理中的语言模型预训练方法
PaperWeekly
14+阅读 · 2018年10月21日
NLP通用模型诞生?一个模型搞定十大自然语言常见任务
人工智能头条
10+阅读 · 2018年6月29日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
8+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
VIP会员
最新内容
《新兴技术武器化及其对全球风险的影响》
专知会员服务
4+阅读 · 今天4:27
《帕兰泰尔平台介绍:信息分析平台》
专知会员服务
13+阅读 · 今天4:20
智能体化世界建模:基础、能力、规律及展望
专知会员服务
9+阅读 · 4月28日
美海警海上态势感知无人系统
专知会员服务
6+阅读 · 4月28日
《复杂系统数据驱动预测建模的数值框架》报告
专知会员服务
12+阅读 · 4月28日
从“会话式人工智能”角度看“Maven智能系统”
专知会员服务
11+阅读 · 4月28日
相关VIP内容
通过强化学习增强代码生成中的代码大语言模型:综述
专知会员服务
29+阅读 · 2025年1月1日
揭示生成式人工智能 / 大型语言模型(LLMs)的军事潜力
专知会员服务
31+阅读 · 2024年9月26日
大型语言模型(LLMs),附Slides与视频
专知会员服务
71+阅读 · 2024年6月30日
《将大型语言模型(LLM)整合到海军作战规划中》
专知会员服务
130+阅读 · 2024年6月13日
《大型语言模型代码生成》综述
专知会员服务
70+阅读 · 2024年6月4日
GPT系列大模型在自然语言处理任务中的鲁棒性研究
专知会员服务
30+阅读 · 2024年3月22日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
8+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员