Abstract

Code execution is a fundamental aspect of programming language semantics that reflects the exact behavior of the code. However, most pre-trained models for code intelligence ignore the execution trace and only rely on source code and syntactic structures. In this paper, we investigate how well pre-trained models can understand and perform code execution. We develop a mutation-based data augmentation technique to create a large-scale and realistic Python dataset and task for code execution, which challenges existing models such as Codex. We then present CodeExecutor, a Transformer model that leverages code execution pre-training and curriculum learning to enhance its semantic comprehension. We evaluate CodeExecutor on code execution and show its promising performance and limitations. We also demonstrate its potential benefits for code intelligence tasks such as zero-shot code-to-code search and text-to-code generation. Our analysis provides insights into the learning and generalization abilities of pre-trained models for code execution.

Keywords:
Computer science Programming language KPI-driven code analysis Python (programming language) Code generation Code (set theory) Source code Code review Static program analysis Redundant code Artificial intelligence Software Software development Operating system

Metrics

17
Cited By
10.51
FWCI (Field Weighted Citation Impact)
43
Refs
0.98
Citation Normalized Percentile
Is in top 1%
Is in top 10%

Citation History

Topics

Software Engineering Research
Physical Sciences →  Computer Science →  Information Systems
Software System Performance and Reliability
Physical Sciences →  Computer Science →  Computer Networks and Communications
Topic Modeling
Physical Sciences →  Computer Science →  Artificial Intelligence

Related Documents

JOURNAL ARTICLE

Code Execution with Pre-trained Language Models

Anonymous

Journal:   Zenodo (CERN European Organization for Nuclear Research) Year: 2023
JOURNAL ARTICLE

Leveraging pre-trained language models for code generation

Ahmed SolimanSamir I. ShaheenMayada Hadhoud

Journal:   Greater South Information System Year: 2024
JOURNAL ARTICLE

Leveraging pre-trained language models for code generation

Ahmed SolimanSamir I. ShaheenMayada Hadhoud

Journal:   Greater South Information System Year: 2024
© 2026 ScienceGate Book Chapters — All rights reserved.