Large Language Models have demonstrated a remarkable capability in natural language and program generation and software development. However, the source code generated by the LLMs does not always meet quality requirements and may fail to compile. Therefore, many studies evolve into agents that can reason about the problem before generating the source code for the solution. The goal of this paper is to study the degree to which such agents benefit from access to software development tools, in our case, a \texttt{gcc} compiler. We conduct a computational experiment on the RosettaCode dataset, on 699 programming tasks in C. We evaluate how the integration with a compiler shifts the role of the language model from a passive generator to an active agent capable of iteratively developing runnable programs based on feedback from the compiler. We evaluated 16 language models with sizes ranging from small (135 million) to medium (3 billion) and large (70 billion). Our results show that access to a compiler improved the compilation success by 5.3 to 79.4 percentage units in compilation without affecting the semantics of the generated program. Syntax errors dropped by 75\%, and errors related to undefined references dropped by 87\% for the tasks where the agents outperformed the baselines. We also observed that in some cases, smaller models with a compiler outperform larger models with a compiler. We conclude that it is essential for LLMs to have access to software engineering tools to enhance their performance and reduce the need for large models in software engineering, such as reducing our energy footprint.


翻译:大语言模型在自然语言处理、程序生成和软件开发方面展现出卓越能力。然而,LLM生成的源代码并不总能满足质量要求,且可能无法通过编译。因此,许多研究演化为能够先对问题进行推理、再生成解决方案源代码的智能体。本文旨在探究此类智能体从软件开发工具(本研究中为\texttt{gcc}编译器)的访问权限中获益的程度。我们在RosettaCode数据集上对699项C语言编程任务进行了计算实验,评估编译器集成如何将语言模型从被动生成器转变为能够基于编译器反馈迭代开发可运行程序的主动智能体。我们评估了16个参数量从小型(1.35亿)到中型(30亿)及大型(700亿)不等的语言模型。实验结果表明,编译器访问使编译成功率提升5.3至79.4个百分点,且不影响生成程序的语义。在智能体表现优于基线的任务中,语法错误减少75%,未定义引用错误减少87%。我们还观察到在某些情况下,配备编译器的小型模型性能可超越配备编译器的大型模型。本研究得出结论:为LLM提供软件工程工具对提升其性能至关重要,并能降低软件工程中对大型模型的依赖,例如减少能源消耗。

0
下载
关闭预览

相关内容

编译器(Compiler),是一种计算机程序,它会将用某种编程语言写成的源代码(原始语言),转换成另一种编程语言(目标语言)。
大语言模型智能体
专知会员服务
97+阅读 · 2024年12月25日
揭示生成式人工智能 / 大型语言模型(LLMs)的军事潜力
专知会员服务
31+阅读 · 2024年9月26日
基于大型语言模型的软件工程智能体综述
专知会员服务
58+阅读 · 2024年9月6日
《将大型语言模型(LLM)整合到海军作战规划中》
专知会员服务
129+阅读 · 2024年6月13日
绝对干货!NLP预训练模型:从transformer到albert
新智元
13+阅读 · 2019年11月10日
NLG ≠ 机器写作 | 专家专栏
量子位
13+阅读 · 2018年9月10日
自然语言处理(二)机器翻译 篇 (NLP: machine translation)
DeepLearning中文论坛
12+阅读 · 2015年7月1日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2009年12月31日
VIP会员
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2009年12月31日
Top
微信扫码咨询专知VIP会员