RUS  ENG
Full version
JOURNALS // Proceedings of the Institute for System Programming of the RAS // Archive

Proceedings of ISP RAS, 2023 Volume 35, Issue 1, Pages 237–264 (Mi tisp765)

Comparison of graph embeddings for source code with text models based on CNN and CodeBert architectures

V. A. Romanov, V. V. Ivanov

Innopolis University

Abstract: One possible way to reduce bugs in source code is to create intelligent tools that make the development process easier. Such tools often use vector representations of the source code and machine learning techniques borrowed from the field of natural language processing. However, such approaches do not take into account the specifics of the source code and its structure. This work studies methods for pretraining graph vector representations for source code, where the graph represents the structure of the program. The results show that graph embeddings allow to achieve an accuracy of classifying variable types in Python programs that is comparable to CodeBERT embeddings. Moreover, the simultaneous use of text and graph embeddings as part of a hybrid model can improve the accuracy of type classification by more than 10%.

Keywords: source code, variable type prediction, Python, graph neural networks, CodeBERT

DOI: 10.15514/ISPRAS-2023-35(1)-15



© Steklov Math. Inst. of RAS, 2024