A Comparison of Code Embeddings and Beyond
arXiv:2109.07173
Abstract
Program representation learning is a fundamental task in software engineering applications. With the availability of "big code" and the development of deep learning techniques, various program representation learning models have been proposed to understand the semantic properties of programs and applied on different software engineering tasks. However, no previous study has comprehensively assessed the generalizability of these deep models on different tasks, so that the pros and cons of the models are unclear. In this experience paper, we try to bridge this gap by systemically evaluating the performance of eight program representation learning models on three common tasks, where six models are based on abstract syntax trees and two models are based on plain text of source code. We kindly explain the criteria for selecting the models and tasks, as well as the method for enabling end-to-end learning in each task. The results of performance evaluation show that they perform diversely in each task and the performance of the AST-based models is generally unstable over different tasks. In order to further explain the results, we apply a prediction attribution technique to find what elements are captured by the models and responsible for the predictions in each task. Based on the findings, we discuss some general principles for better capturing the information in the source code, and hope to inspire researchers to improve program representation learning methods for software engineering tasks.
References in corpus (14)
- Axiomatic Attribution for Deep Networks
- Learning Important Features Through Propagating Activation Differences
- How to Explain Individual Classification Decisions
- CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generation
- Convolutional Neural Networks over Tree Structures for Programming Language Processing
- CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- Neural Code Comprehension: A Learnable Representation of Code Semantics
- StaQC: A Systematically Mined Question-Code Dataset from Stack Overflow
- A deep language model for software code
- A Literature Study of Embeddings on Source Code
- Structural Language Models of Code
- A Transformer-based Approach for Source Code Summarization
- Detecting Code Clones with Graph Neural Networkand Flow-Augmented Abstract Syntax Tree
- PSCS: A Path-based Neural Model for Semantic Code Search