Towards Demystifying Dimensions of Source Code Embeddings

Md Rafiqul Islam Rabin, Arjun Mukherjee, Omprakash Gnawali, Mohammad Amin Alipour
8/29/2020
cs.LGcs.PLcs.SE

Official code: mdrafiqulrabin/handcrafted-embeddings (1 star, Jupyter Notebook, last commit 2022-12-01).

Abstract

Source code representations are key in applying machine learning techniques for processing and analyzing programs. A popular approach in representing source code is neural source code embeddings that represents programs with high-dimensional vectors computed by training deep neural networks on a large volume of programs.

Show full abstract

Although successful, there is little known about the contents of these vectors and their characteristics. In this paper, we present our preliminary results towards better understanding the contents of code2vec neural source code embeddings. In particular, in a small case study, we use the code2vec embeddings to create binary SVM classifiers and compare their performance with the handcrafted features. Our results suggest that the handcrafted features can perform very close to the highly-dimensional code2vec embeddings, and the information gains are more evenly distributed in the code2vec embeddings compared to the handcrafted features. We also find that the code2vec embeddings are more resilient to the removal of dimensions with low information gains than the handcrafted features. We hope our results serve a stepping stone toward principled analysis and evaluation of these code representations.

View on arXivView PDF

Code Implementations(1)

RL+SE&PL(ESEC/FSE)'20: Handcrafted Program Embeddings

11Jupyter Notebook, PythonSep 12, 20204 years ago

Similar Papers

Cite this paper

@article{rabin2020towards,
  title  = {Towards Demystifying Dimensions of Source Code Embeddings},
  author = {Md Rafiqul Islam Rabin and Arjun Mukherjee and Omprakash Gnawali and Mohammad Amin Alipour},
  year   = {2020},
  eprint = {2008.13064},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2008.13064}
}

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

Discussion