Empirical Study of Transformers for Source Code
arXiv:2010.07987 · doi:10.1145/3468264.3468611
Abstract
Initially developed for natural language processing (NLP), Transformers are now widely used for source code processing, due to the format similarity between source code and text. In contrast to natural language, source code is strictly structured, i.e., it follows the syntax of the programming language. Several recent works develop Transformer modifications for capturing syntactic information in source code. The drawback of these works is that they do not compare to each other and consider different tasks. In this work, we conduct a thorough empirical study of the capabilities of Transformers to utilize syntactic information in different tasks. We consider three tasks (code completion, function naming and bug fixing) and re-implement different syntax-capturing modifications in a unified framework. We show that Transformers are able to make meaningful predictions based purely on syntactic information and underline the best practices of taking the syntactic information into account for improving the performance of the model.
Published at the ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering 2021 (ESEC/FSE'21)
References in corpus (1)
Cited by in corpus (4)
- Neural language models for network configuration: Opportunities and reality check
- The Good, the Bad, and the Missing: Neural Code Generation for Machine Learning Tasks
- On the Applicability of Language Models to Block-Based Programs
- A Closer Look into Transformer-Based Code Intelligence Through Code Transformation: Challenges and Opportunities