评估LLM中的代码理解能力
Assessing Code Understanding in LLMs
AI总结:
本文实证评估了LLM在非平凡语义保持程序变换中的代码理解能力,发现其判断语义等价性失败率较高,并主张将LLM与代码优化工具集成以提升准确性和程序理解稳健性。
摘要:
我们对大型语言模型在代码理解方面进行了实证评估,涉及复制传播或常量折叠等非平凡的、保持语义的程序变换。研究结果表明,在未提供上下文时,LLM在约41%的情况下无法判断语义等价性,而在提供简单通用上下文时,这一比例降至29%。为提高准确性,我们主张将LLM与代码优化工具集成,以增强训练并促进更稳健的程序理解。
英文摘要:
We present an empirical evaluation of Large Language Models in code understanding associated with non-trivial, semantic-preserving program transformations such as copy propagation or constant folding. Our findings show that LLMs fail to judge semantic equivalence in approximately 41\% of cases when no context is provided and in 29\% when given a simple generic context. To improve accuracy, we advocate integrating LLMs with code-optimization tools to enhance training and facilitate more robust program understanding.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。