Can Identifier Splitting Improve Open-Vocabulary Language Model of Code?
Authors:
- 1 March 2022
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 1134-1138
Abstract
Statistical language models on source code have successfully assisted software engineering tasks. However, developers can create or pick arbitrary identifiers when writing source code. Freely chosen identifiers lead to the notorious out-of-vocabulary (OOV) problem that negatively affects model performance. Recently, Karampatsis et al. showed that using the Byte Pair Encoding (BPE) algorithm to address the OOV problem can improve the language models' predictive performance on source code. However, a drawback of BPE is that it cannot split the identifiers in a way that preserves the meaningful semantics. Prior researchers also show that splitting compound identifiers into sub-words that reflect the semantics can benefit software development tools. These two facts motivate us to explore whether identifier splitting techniques can be utilized to augment the BPE algorithm and boost the performance of open-vocabulary language models considered in Karampatsis et al.'s work. This paper proposes to split identifiers in both constructing vocabulary and processing model inputs procedures, thus exploiting three different settings of applying identifier splitting to language models for the code completion task. We contrast models' performance under these settings and find that simply inserting identifier splitting into the pipeline hurts the model performance, while a hybrid strategy combining identifier splitting and the BPE algorithm can outperform the original open-vocabulary models on predicting identifiers by 3.68% of recall and 6.32% of Mean Reciprocal Rank. The results also show that the hybrid strategy can improve the entropy of language models by 2.02%.Keywords
All Related Versions
Funding Information
- National Research Foundation, Singapore
This publication has 19 references indexed in Scilit:
- Recovering clear, natural identifiers from obfuscated JS names2017
- Neural Machine Translation of Rare Words with Subword Units2016
- Suggesting accurate method and class names2015
- On the localness of software2014
- Code completion with statistical language modelsACM SIGPLAN Notices, 2014
- Version history, similar report, and structure: putting them together for improved bug localization2014
- Learning Phrase Representations using RNN Encoder–Decoder for Statistical Machine Translation2014
- An empirical study of identifier splitting techniquesEmpirical Software Engineering, 2013
- Can Better Identifier Splitting Techniques Help Feature Location?2011
- Automatically capturing source code context of NL-queries for software maintenance and reuse2009