Big Code != Big Vocabulary: Open-Vocabulary Models for Source Code

Rafael-Michael Karampatsis, Hlib Babii, Romain Robbes, Charles Sutton, Andrea Janes
3/17/2020
240 citations
cs.SE

Official code: mast-group/OpenVocabCodeNLM (84 stars, Python, Apache-2.0, last commit 2023-03-24). 1 more implementation below.

Abstract

Statistical language modeling techniques have successfully been applied to large source code corpora, yielding a variety of new software development tools, such as tools for code suggestion, improving readability, and API migration. A major issue with these techniques is that code introduces new vocabulary at a far higher rate than natural language, as new identifier names proliferate.

Show full abstract

Both large vocabularies and out-of-vocabulary issues severely affect Neural Language Models (NLMs) of source code, degrading their performance and rendering them unable to scale. In this paper, we address this issue by: 1) studying how various modelling choices impact the resulting vocabulary on a large-scale corpus of 13,362 projects; 2) presenting an open vocabulary source code NLM that can scale to such a corpus, 100 times larger than in previous work; and 3) showing that such models outperform the state of the art on three distinct code corpora (Java, C, Python). To our knowledge, these are the largest NLMs for code that have been reported. All datasets, code, and trained models used in this work are publicly available.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
mast-group/OpenVocabCodeNLMOfficial84PythonApache-2.02023-03-24
giganticode/codeprepOfficial45Python–2022-09-30
Apache-2.0

Contains the code for our ICSE 2020 paper: Big Code != Big Vocabulary: Open-Vocabulary Language Models for Source Code and for its earlier pre-print: Maybe Deep Neural Networks are the Best Choice for Modeling Source Code (https://arxiv.org/abs/1903.05734). This is the first open vocabulary language model for code that uses the byte pair encoding algorithm (BPE) to learn a segmentation of code tokens into subword units.

8424Python, ShellOct 11, 20183 years agoApache-2.0

A toolkit for pre-processing large source code corpora

4510Python, JavaApr 5, 20194 years ago
language-modelingmining-software-repositoriesnatural-language-processingsource-code-analysisword-segmentation

Similar Papers

Cite this paper

@article{karampatsis2020code,
  title  = {Big Code != Big Vocabulary: Open-Vocabulary Models for Source Code},
  author = {Rafael-Michael Karampatsis and Hlib Babii and Romain Robbes and Charles Sutton and Andrea Janes},
  year   = {2020},
  eprint = {2003.07914},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2003.07914}
}

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/2003.07914.svg)](https://codeofpaper.com/paper/2003.07914)

Discussion