Complexity-Based Code Embeddings

Rares Folea, Radu Cristian Alexandru Iacob, Emil Slusanschi, Traian Rebedea

Abstract

This paper presents a generic method for transforming the source code of various algorithms to numerical embeddings, by dynamically analysing the behaviour of computer programs against different inputs and by tailoring multiple generic complexity functions for the analysed metrics. The used algorithms embeddings are based on r-Complexity [7]. Using the proposed code embeddings, we present an implementation of the XGBoost algorithm that achieves an average $$90\%$$ F1-score on a multi-label dataset with 11 classes, built using real-world code snippets submitted for programming competitions on the Codeforces platform.
BibTeX
@inproceedings{folea2023complexity,
  author = {Rares Folea and Radu Cristian Alexandru Iacob and Emil Slusanschi and Traian Rebedea},
  title = {{Complexity-Based Code Embeddings}},
  booktitle = {ICCCI},
  year = {2023},
  doi = {10.1007/978-3-031-41456-5\_20},
}

Loading related content...

Figure