Open Vocabulary Learning on Source Code with a Graph-Structured Cache

Milan Cvitkovic, Badal Singh, Anima Anandkumar
10/18/2018
51 citations
cs.LGstat.ML

Official code: mwcvitkovic/Open-Vocabulary-Learning-on-Source-Code-with-a-Graph-Structured-Cache--Code-Preprocessor (20 stars, Java, last commit 2018-10-22).

Abstract

Machine learning models that take computer program source code as input typically use Natural Language Processing (NLP) techniques. However, a major challenge is that code is written using an open, rapidly changing vocabulary due to, e.g., the coinage of new variable and method names.

Show full abstract

Reasoning over such a vocabulary is not something for which most NLP methods are designed. We introduce a Graph-Structured Cache to address this problem; this cache contains a node for each new word the model encounters with edges connecting each word to its occurrences in the code. We find that combining this graph-structured cache strategy with recent Graph-Neural-Network-based models for supervised learning on code improves the models' performance on a code completion task and a variable naming task --- with over $100\%$ relative improvement on the latter --- at the cost of a moderate increase in computation time.

View on arXivView PDF

Code Implementations(1)

Library for preprocessing java source code into Augmented ASTs, as per the paper Open Vocabulary Learning on Source Code with a Graph-Structured Cache

2010Java, JavaScriptAug 20, 20188 years agoNOASSERTION

Similar Papers

Cite this paper

@article{cvitkovic2018open,
  title  = {Open Vocabulary Learning on Source Code with a Graph-Structured Cache},
  author = {Milan Cvitkovic and Badal Singh and Anima Anandkumar},
  year   = {2018},
  eprint = {1810.08305},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1810.08305}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1810.08305.svg)](https://codeofpaper.com/paper/1810.08305)

Discussion