Abstract
Dynamic malware analysis relies on behavioral logs from sandbox executions to identify malicious intent. Traditional sequence modeling approaches, such as CNNs and LSTMs, often fail to capture long-range dependencies or integrate heterogeneous data sources effectively. We present Nebula, a Transformer-based architecture that leverages self-attention and domain-specific data cleaning to model complex behavioral correlations across network, file, and registry logs. Nebula demonstrates a significant improvement in detection performance, achieving a 12% increase in True Positive Rate (TPR) over state-of-the-art models while maintaining high efficiency and explainability.
Introduction
The detection of modern malware requires analyzing its runtime behavior. When a suspicious file is "detonated" in a sandbox, it generates extensive logs detailing API calls, file system modifications, and network activity. However, existing machine learning models face two primary hurdles:
- Sequence Length and Context: CNNs focus on local patterns, while LSTMs struggle with the extremely long sequences typical of malware execution traces.
- Data Heterogeneity: Many models focus exclusively on API calls, ignoring the rich context provided by other system events.
Nebula addresses these challenges by treating behavioral reports as a specialized language, utilizing a Transformer-based architecture designed for long-sequence processing and multi-modal behavioral data.
Methodology
The Nebula pipeline consists of three main stages: Data Cleaning, Feature Extraction, and Modeling.
Domain-Specific Data Cleaning
Standard NLP techniques are often insufficient for malware logs due to "noisy" tokens like unique hashes or IP addresses. Nebula introduces a normalization layer that replaces these with generic placeholders (e.g., <sha256>, <ipv4_public>). This prevents overfitting on transient identifiers and ensures the model learns generalizable behavioral patterns.
Feature Extraction and Modeling
Nebula partitions long sequences into independent "spans" to manage the computational complexity of standard self-attention. This allows for efficient processing of massive logs while capturing essential context. The core model is a Transformer Encoder that processes these spans to produce a final classification.
Comparison with Existing Approaches
Nebula distinguishes itself from prior work by its comprehensive data cleaning and the use of self-attention. As shown in the comparison below, Nebula integrates filters for API, network, file, and registry data, whereas previous models like Neurlux or Gated CNN often rely on more limited feature sets.
Experimental Evaluation
Nebula was evaluated across three distinct datasets to ensure robustness: the Speakeasy Dataset (93,500 samples), the Avast-CTU Dataset (54,000 samples), and the Malicious Code Dataset (30,000 samples).
Key Results
- Superior Detection: Nebula achieved a peak improvement of 12% in True Positive Rate (TPR) over the next best model (Neurlux) at a very low False Positive Rate ($10^{-3}$), which is the strict regime required for real-world deployment.
- Training Efficiency: The model reached state-of-the-art performance using less than one-third of the training batches required by its closest competitors.
- Self-Supervised Learning: Using autoregressive pre-training (similar to GPT), Nebula achieved high performance with only 20% of labeled training data, demonstrating strong potential for low-resource scenarios.
Conclusion
Nebula represents a significant step forward in dynamic malware analysis by applying self-attention to heterogeneous behavioral logs. By combining domain-specific cleaning with efficient Transformer architectures, it provides a robust and explainable framework for malware detection. Future work will focus on testing adversarial robustness and scaling pre-training to even larger unlabeled datasets to create a more universal behavioral model.
Summary updated