Code Execution with Pre-trained Language Models
Chenxiao Liu, Shuai Lu, Weizhu Chen, Daxin Jiang, Alexey Svyatkovskiy,, Shengyu Fu, Neel Sundaresan, Nan Duan

TL;DR
This paper explores how pre-trained language models can understand and perform code execution, introducing a new dataset and a specialized Transformer model called CodeExecutor to improve semantic comprehension of code.
Contribution
The paper introduces a mutation-based data augmentation technique, a new dataset, and the CodeExecutor model that leverages code execution pre-training and curriculum learning.
Findings
CodeExecutor shows promising performance on code execution tasks.
Pre-trained models have limitations in understanding code semantics.
Potential improvements for code intelligence tasks like code search and generation.
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Software System Performance and Reliability · Topic Modeling
MethodsMulti-Head Attention · Attention Is All You Need · Layer Normalization · Linear Layer · Label Smoothing · Dropout · Byte Pair Encoding · Dense Connections · Residual Connection · Adam
