## 2 Related Work
The vulnerability prediction problem reduces to a classification problem, and the vulnerabilities included structured query language (SQL) injections, cross-site scripting (XSS), and remote code execution. Embeddings based on word2 vec outperformed those based on fastText and BERT in the SQL injection detection problem. However, token-based feature extraction techniques do not take the hierarchical nature of program syntax into account, which can lead to the loss of useful information while transforming source code into vector-based representations, especially in problems similar to algorithm classification [18]. This is crucial, especially in cases when analyzed code snippets are obfuscated at the token level, in identifier name prediction [9], bug detection [7], code clone detection [15; 16], and vulnerability detection [14] problems that can be reduced to the task classification problem. In order to overcome the limitations of word2 vec, the code2 vec model [9] was proposed; this model is based on AST analysis. The code2 vec model first transforms source codes into sets of paths between leaf nodes in AST, called path contexts, and then applies a neural network model with an attention mechanism to learn program vectors based on their path contexts. Since the first mention of the basic code2 vec model [9] developed to solve the method name prediction problem for Java and C#, code2 vec has been successfully applied to problems other than method name prediction [7; 26; 27]. In [26], code2 vec was applied to the binary and multiclass classification of programs written in Scratch, a block-based programming environment. In [7], PathPair2 Vec, an approach similar to code2 vec, was applied to software defect prediction. Aiming to simplify the extraction of path contexts from ASTs and to provide code2 vec support for programming languages other than C# or Java, which were the only languages supported by code2 vec [9], JetBrain(tm) developed a tool called PathMiner [27], supporting Python, JavaScript, PHP, C, and C++ programming languages. However, as shown in [18; 28], simple histograms of assembly language instruction opcodes are vector representations that are well suited for obfuscated programs and have the potential to outperform complex neural-network-based models in source code classification problems, as well as in problems that reduce to source code classification. Based on the findings reported in [18; 28], we include histogram-based approaches to program embedding in the comparative study. Another simple yet efficient approach to program embedding into vector space is based on Markov chains constructed from ASTs [15; 16]. The recently proposed algorithm described in [15] builds an AST for a given program and then converts it into a Markov chain state transition graph, where vertices represent types of AST nodes, edges represent transitions between AST nodes, and weights of edges denote the probabilities of such transitions for the particular AST. Then, the adjacency matrix describing the Markov chain graph is transformed into a vector by concatenating all rows of the weighted adjacency matrix. The use of this approach obtained accuracy of up to 99% in source code classification tasks in [15]. In [19], this approach was used in source code clustering for identification of programs sharing similar high-level syntactic concepts. The code clone detector Amaain described in [16] also regards the nodes of an AST as different states and builds a Markov chain model. The Markov chain weighted adjacency matrices are built for pairs of programs and compared using different distance measures, such as Euclidean distance, Manhattan distance, Chebyshev distance, and cosine distance. The feature vector containing calculated distances is then passed to a binary classifier trained to predict whether two programs are semantically similar. According to [16], the developed classifier achieved the highest accuracy on Google Code Jam and Big Clone Bench datasets when compared to state-of-the-art classifiers.