让代码模型理解运行时行为,但实测优化效果提升有限。
Investigating Execution-Aware Language Models for Code Optimization
- 将代码执行信息融入CodeT5+模型,包括行执行、覆盖率等四方面。
- 相比标准模型,执行感知模型在代码优化上提升不明显。
- 适合关注代码运行时分析与模型融合的研究者参考。
代码优化旨在提升代码效率同时保持功能正确性,通常需要深入理解运行时执行行为。近年来,语言模型在自动化代码优化中展现出潜力,但其对运行时行为的认知仍不足。为此,研究者提出将代码执行信息(包括行执行次数、行覆盖、分支覆盖、变量状态)融入语言模型的策略,以增强模型在软件工程任务中的表现。本研究针对知名代码模型CodeT5+,采用三种训练策略,集成上述四种执行特征。结果表明,在代码优化任务中,执行感知模型相较于标准CodeT5+模型,改进幅度有限,说明当前方法在实际优化效果上仍有局限。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。