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

探究面向执行的语言模型用于代码优化

Investigating Execution-Aware Language Models for Code Optimization

University of L’Aquila(拉奎拉大学);Software Institute - Università della Svizzera Italiana(软件研究所 - 瑞士意大利语大学)

Federico Di Menna, Luca Traini, Gabriele Bavota, Vittorio Cortellessa

AI总结:

本文研究了将代码执行信息整合到语言模型中对代码优化能力的影响,通过三种训练策略测试了四种执行方面对CodeT5+模型的优化效果,发现执行感知模型在代码优化上收益有限。

摘要:

代码优化是提高代码效率同时保持其预期功能的过程。此过程通常需要深入理解运行时代码执行行为以有效识别和解决低效问题。最近研究表明语言模型在自动化代码优化中起重要作用。然而,这些模型可能缺乏对运行时代码执行的理解。为解决此限制,研究人员开发了将代码执行信息整合到语言模型中的策略。这些策略在各种软件工程任务中展示了潜力。然而,尽管代码执行行为与效率密切相关,这些策略对代码优化的具体影响仍待探索。本文研究将代码执行信息整合到语言模型中如何影响其代码优化能力。具体而言,我们应用三种不同的训练策略,将四种代码执行方面——行执行、行覆盖、分支覆盖和变量状态——整合到CodeT5+中。我们的结果表明,执行感知模型在代码优化上相比标准CodeT5+模型收益有限。

英文摘要:

Code optimization is the process of enhancing code efficiency, while preserving its intended functionality. This process often requires a deep understanding of the code execution behavior at run-time to identify and address inefficiencies effectively. Recent studies have shown that language models can play a significant role in automating code optimization. However, these models may have insufficient knowledge of how code execute at run-time. To address this limitation, researchers have developed strategies that integrate code execution information into language models. These strategies have shown promise, enhancing the effectiveness of language models in various software engineering tasks. However, despite the close relationship between code execution behavior and efficiency, the specific impact of these strategies on code optimization remains largely unexplored. This study investigates how incorporating code execution information into language models affects their ability to optimize code. Specifically, we apply three different training strategies to incorporate four code execution aspects -- line executions, line coverage, branch coverage, and variable states -- into CodeT5+, a well-known language model for code. Our results indicate that execution-aware models provide limited benefits compared to the standard CodeT5+ model in optimizing code.

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

↑