Investigating Execution-Aware Language Models for Code Optimization

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Di Menna, Federico, Traini, Luca, Bavota, Gabriele, Cortellessa, Vittorio
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866914436238802944
author Di Menna, Federico
Traini, Luca
Bavota, Gabriele
Cortellessa, Vittorio
author_facet Di Menna, Federico
Traini, Luca
Bavota, Gabriele
Cortellessa, Vittorio
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2503_08228
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Investigating Execution-Aware Language Models for Code Optimization
Di Menna, Federico
Traini, Luca
Bavota, Gabriele
Cortellessa, Vittorio
Software Engineering
Artificial Intelligence
Computation and Language
Performance
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.
title Investigating Execution-Aware Language Models for Code Optimization
topic Software Engineering
Artificial Intelligence
Computation and Language
Performance
url https://arxiv.org/abs/2503.08228