Semantic embeddings for program behavior patterns

Alexander Chistyakov, Ekaterina Lobacheva, Arseny Kuznetsov, Alexey RomanenkoarXiv 2018

Abstract

Detecting malicious software in modern computing environments requires moving beyond simple signature matching. We present a novel feature extraction technique for program execution logs that treats behavior as a structured semantic map. By transforming execution logs into bipartite graphs and utilizing autoencoders to generate dense embeddings, we capture the underlying intent of program actions. Our evaluation on a large-scale real-world dataset demonstrates that these semantic features significantly improve detection accuracy and reveal interpretable structures within the space of program behaviors.

Introduction

Malware detection is a persistent arms race. Traditional static analysis—examining code without execution—is frequently bypassed by sophisticated encryption and obfuscation techniques. Dynamic analysis, which monitors a program's behavior in a controlled sandbox, offers more resilience but produces complex, noisy execution logs.

Standard log analysis often treats events as linear sequences. This approach is brittle; it fails when malware employs multi-processing or intentional event reordering to mask its signature. To address this, we propose a representation that focuses on the relationships between actions and their arguments, ensuring order invariance and capturing the functional context of program execution.

Methodology: From Logs to Semantic Vectors

Our pipeline transforms raw execution logs into fixed-size mathematical vectors through a multi-step process:

  1. Graph Construction: We represent execution logs as bipartite graphs. One set of nodes represents event types (e.g., Create, Modify), while the other represents arguments (e.g., filenames like config.xml). Edges connect events to the specific arguments they manipulate.
  2. Pattern Extraction: We identify "behavior patterns" as subgraphs where multiple events share common arguments. To handle transient or randomized filenames, we tokenize arguments into constituent parts (e.g., splitting a path into directory and extension).
  3. Embedding Generation: These patterns are converted into sparse binary vectors and passed through an autoencoder. The bottleneck layer of the autoencoder produces a continuous, low-dimensional embedding that captures the semantic "meaning" of the behavior.
  4. Aggregation: To represent a full program execution, the embeddings of all individual patterns are aggregated using element-wise statistics (min, max, and mean), creating a robust feature vector for classification.
Figure 1: The pipeline for converting raw logs into behavior graphs and extracted patterns.

Experimental Evaluation

We evaluated our approach using a massive dataset provided by Kaspersky Lab, consisting of over 4.9 million malicious logs and 3.1 million benign logs. This dataset reflects diverse real-world scenarios, far exceeding the scale of typical public repositories.

Using an XGBoost classifier, we compared our semantic embeddings against traditional baselines, including binary indicators and event counters. The results indicate that semantic features drastically reduce the fraction of missed malware (False Negatives) while maintaining a low false alarm rate. Notably, the best performance was achieved by combining our semantic embeddings ($f_2$) with traditional counter-based features ($f_1$), suggesting that the two methods provide complementary insights into program behavior.

Figure 2: Performance comparison showing the fraction of missed malware (FNR) against the false alarm rate (FPR). The combination of semantic embeddings and counters yields the best results.

Semantic Insights and Interpretability

A compelling finding of this research is that the learned embedding space exhibits properties similar to Word2Vec in natural language processing. The model autonomously discovered functional relationships between different system tokens without manual labeling. For instance, the model grouped file extensions like .jpg and .png together and recognized the relationship between applications like outlook and excel.

Furthermore, the space supports "behavioral analogies" via vector arithmetic. We observed that the model could solve functional equations such as:

  • 'google' - 'chrome' + 'firefox' ≈ 'mozilla'
  • 'https' - 'http' + '80' ≈ '443'

These results suggest that the autoencoder does not merely compress data but actually learns the underlying logic of system operations and network protocols.

Conclusion

By shifting the focus from event sequences to semantic behavior graphs, we provide a more robust and interpretable framework for malware detection. While dynamic analysis involves higher computational overhead than static methods, the gain in detection accuracy and the ability to resist obfuscation make it a vital component of modern cybersecurity. Future work will explore more advanced graph neural network architectures to further refine these behavioral embeddings.

Summary updated

BibTeX
@misc{chistyakov2018semantic,
  author = {Alexander Chistyakov and Ekaterina Lobacheva and Arseny Kuznetsov and Alexey Romanenko},
  title = {{Semantic embeddings for program behavior patterns}},
  year = {2018},
  eprint = {1804.03635},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1804.03635},
}
Figure