Source code processing heavily relies on the methods widely used in natural language processing (NLP), but involves specifics that need to be taken into account to achieve higher quality. An example of this specificity is that renaming variables does not change the semantics of what the code does . In this work, we develop a recurrent architecture that processes code with all variable names anonymized, i. e. replaced with unique placeholders. The proposed architecture outperforms standard NLP baselines on code completion task by a large margin in the anonymized setting, and improves the base model in the non-anonymized setting, being ensembled with it .
Source code processing heavily relies on the methods widely used in natural language processing (NLP), but involves specifics that need to be taken into account to achieve higher quality. An example of this specificity is that the semantics of a variable is defined not only by its name but also by the contexts in which the variable occurs . In this work, we develop dynamic embeddings, a recurrent mechanism that adjusts the learned semantics of the variable when it obtains more information about the variable's role in the program. We show that using the proposed dynamic embeddings significantly improves the performance of the recurrent neural network, in code completion and bug fixing tasks .
D
renaming variables does not change
R
what the code does
a variable is defined not only by its name but also by the contexts in which the variable occurs
R
a recurrent architecture that processes code with all variable names anonymized, i. e. replaced with unique placeholders. The proposed architecture outperforms standard NLP baselines on code completion task by a large margin in the anonymized setting, and improves the base model in the non-anonymized setting, being ensembled with it
dynamic embeddings, a recurrent mechanism that adjusts the learned semantics of the variable when it obtains more information about the variable's role in the program. We show that using the proposed dynamic embeddings significantly improves the performance of the recurrent neural network, in code completion and bug fixing tasks