This paper investigates code LLMs' capability of static analysis during code intelligence tasks such as code summarization and generation. Code LLMs are now household names for their abilities to do some programming tasks that have heretofore required people. The process that people follow to do programming tasks has long been understood to require static analysis. For example, human programmers navigate the call graph of large programs to comprehend the different parts of those programs. Education in programming includes static analysis under the assumption that better static analysis skills beget better programming. While popular culture is replete with anthropomorphic references such as LLM ``reasoning'', in fact code LLMs could exhibit a wholly alien thought process to humans. This paper studies the specific question of static analysis by code LLMs. We use three different static analysis tasks (callgraph generation, AST generation, and dataflow generation) and three different code intelligence tasks (code generation, summarization, and translation) with two different open-source models (Gemini and GPT-4o) and closed-source models (CodeLlaMA and Jam) as our experiments. We found that LLMs show poor performance on static analysis tasks and that pretraining on the static analysis tasks does not generalize to better performance on the code intelligence tasks and vice versa.


翻译:本文探究代码大语言模型在代码智能任务(如代码摘要与生成)中的静态分析能力。代码大语言模型因能执行此前需人类参与的编程任务而广为人知。人们完成编程任务所遵循的过程长期以来被认为需要静态分析。例如,人类程序员通过浏览大型程序的调用图来理解程序的不同部分。编程教育包含静态分析,其前提是更好的静态分析技能能造就更优秀的编程能力。尽管流行文化中充斥着诸如大语言模型“推理”等拟人化提法,但实际上代码大语言模型可能展现出与人类完全不同的思维过程。本文重点研究代码大语言模型的静态分析能力。我们采用三种不同的静态分析任务(调用图生成、抽象语法树生成及数据流生成)与三种不同的代码智能任务(代码生成、摘要及翻译),并选择两个开源模型(Gemini与GPT-4o)及两个闭源模型(CodeLlaMA与Jam)进行实验。研究发现,大语言模型在静态分析任务中表现欠佳,且静态分析任务的预训练并未泛化提升代码智能任务的性能,反之亦然。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
大语言模型在规划与调度问题上的应用
专知会员服务
53+阅读 · 2025年1月12日
大语言模型评估技术研究进展
专知会员服务
49+阅读 · 2024年7月9日
《大型语言模型代码生成》综述
专知会员服务
70+阅读 · 2024年6月4日
一文速览大语言模型提示最新进展
专知会员服务
80+阅读 · 2023年12月24日
绝对干货!NLP预训练模型:从transformer到albert
新智元
13+阅读 · 2019年11月10日
NLP通用模型诞生?一个模型搞定十大自然语言常见任务
人工智能头条
10+阅读 · 2018年6月29日
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
25+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
7+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
最新内容
综述 | 从问答到任务完成:Agent系统与Harness设计
专知会员服务
1+阅读 · 今天16:54
Agentic RL:框架、实践与长程智能体训练
专知会员服务
1+阅读 · 今天16:52
重新思考无人机时代的生存能力
专知会员服务
5+阅读 · 今天7:44
装甲突击旅:现代战争思考、战斗与组织
专知会员服务
4+阅读 · 今天7:28
在人工智能加速决策环境中拓展OODA循环
专知会员服务
4+阅读 · 今天7:18
军事欺骗:供作战战术指挥官使用的工具
专知会员服务
4+阅读 · 今天7:03
综述 | 世界动作模型:少做梦,多行动
专知会员服务
6+阅读 · 6月23日
美以伊冲突:无人机与人工智能的运用
专知会员服务
10+阅读 · 6月23日
《特种部队在透明战场中的生存力》最新报告
专知会员服务
5+阅读 · 6月23日
相关基金
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
25+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
7+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员