NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Malware classification with recurrent networks

Razvan Pascanu, Jack W. Stokes, Hermineh Sanossian, Mady Marinescu, Anil ThomasICASSP 2015

Introduction

Malware detection has long relied on "hand-crafted" feature vectors—static traits identified by human experts. However, malware authors increasingly use automated tools to rewrite and reorder code, rendering these static features fragile. To address this, researchers have moved toward analyzing the behavioral language of malware. By treating sequences of system API calls (e.g., opening files, network connections) as a temporal "story," models can capture intent rather than just syntax. This paper proposes using Recurrent Neural Networks (RNNs) and Echo State Networks (ESNs) with a novel Max-Pooling layer to create a detection system robust to code-shuffling evasion tactics.

Methodology

The core approach involves using sequential models as unsupervised feature extractors. Instead of direct classification, the networks are trained to predict the next API call in a sequence. The resulting internal "hidden state" serves as a fixed-length summary of program behavior.

Echo State Networks (ESNs)

The researchers utilized ESNs, a type of recurrent model where internal connections are random and fixed. Only the final output layer is trained, which significantly accelerates the learning process compared to standard RNNs.

Max-Pooling over Time

A critical innovation in this work is the application of Max-Pooling to the hidden states of the recurrent network. By taking the maximum value of each hidden neuron across the entire sequence, the model becomes invariant to when a specific malicious behavior occurs. This directly counters attackers' attempts to hide malicious patterns by reordering or injecting "filler" events.

Architecture of the proposed model showing the projection stage with max-pooling and the subsequent classifier.

Additional Architectural Variants

  • Half-Frame Models: Hidden states are captured from both the middle and the end of execution to prevent "forgetting" early events.
  • Leaky-Units & Bi-Directional RNNs: These variants were tested to provide longer memory and capture context from both forward and backward passes of the API sequence.

Experimental Setup

The study leveraged a massive proprietary dataset from Microsoft’s production anti-malware collection, consisting of 500,000 files (equally split between malware and benign) for training feature extractors. A separate set of 75,000 files was used for the final classification stage. The input space was reduced to 114 "high-level events," which are canonicalized versions of low-level API calls.

Key Results

The hybrid model—specifically an ESN with Max-Pooling and Logistic Regression (LR)—outperformed all other configurations and traditional baselines.

At a strict False Positive Rate (FPR) of 0.1%, the proposed model achieved a True Positive Rate (TPR) of 71.71%. In contrast, the industry-standard "trigram" model, which analyzes sequences of three events, achieved only a 36.17% TPR at the same error rate. This represents a relative improvement in detection capability of over 98%.

ROC curves comparing the best performing models (ESN/RNN with Max-Pooling) against traditional baselines like Bag of Events and Event TriGrams.

Furthermore, the researchers found that processing beyond the first 200 API calls yielded diminishing returns. Truncating sequences at this point allows for highly efficient, real-time protection without significant loss in accuracy.

Discussion and Future Work

The success of ESNs suggests that for malware classification, the classifier primarily needs a high-dimensional projection of temporal data to identify malicious patterns. The use of Max-Pooling provides the necessary invariance to defeat common evasion techniques.

While the results are promising, the reliance on a fixed vocabulary of 114 events remains a potential bottleneck if attackers shift to obscure APIs. Future research will likely focus on more advanced representation learning to create detectors that can adapt to entirely new malware families without human intervention.

Summary updated

BibTeX
@inproceedings{pascanu2015malware,
  author = {Razvan Pascanu and Jack W. Stokes and Hermineh Sanossian and Mady Marinescu and Anil Thomas},
  title = {{Malware classification with recurrent networks}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2015},
  doi = {10.1109/icassp.2015.7178304},
}
Figure