DRMD: Deep Reinforcement Learning for Malware Detection Under Concept Drift

Shae McFadden, Myles Foley, Mario D'Onghia, Chris Hicks, Vasilios Mavroudis, Nicola Paoletti, Fabio Pierazzi

TL;DR

DRMD (Deep Reinforcement Learning for Malware Detection) is a novel framework that unifies malware classification, active learning, and rejection mechanisms into a single decision process. By reformulating malware detection as a "one-step" Markov Decision Process, the system learns to navigate "concept drift"—the constant evolution of malware—significantly outperforming traditional supervised learning baselines.

What Problem Does This Paper Address?

In the world of cybersecurity, the only constant is change. Malware authors continuously evolve their code to evade detection, a phenomenon known as concept drift. Traditional machine learning classifiers often fall apart over time because they are built on the assumption that the data they see tomorrow will look like the data they saw yesterday.

To fight this, security pipelines usually "bolt on" two extra mechanisms:

  1. Active Learning (AL): Periodically picking the most "confusing" samples to be manually labeled by a human expert and used for retraining.
  2. Rejection: Allowing the classifier to say "I don't know" and quarantine a suspicious file for manual review instead of making a potentially costly mistake.

The challenge is that these components are typically treated as separate, independent steps. This paper addresses the lack of a unified framework that can simultaneously optimize for accuracy, labeling costs, and the risk of misclassification in a dynamic, drifting environment.

Methods

The authors introduce DRMD, which treats malware detection as a one-step Markov Decision Process (MDP), also known as a contextual bandit.

Key technical highlights include:

  • One-Step Formulation: Unlike prior reinforcement learning (RL) attempts that treated a sequence of samples as a single "episode," DRMD treats each file as its own independent episode. This prevents the model from learning "spurious correlations"—fake patterns based on the order in which files were scanned.
  • Proximal Policy Optimization (PPO): The agent is trained using PPO, an on-policy RL algorithm known for stability. It learns a policy that chooses between three actions: classifying as "Goodware," classifying as "Malware," or "Rejecting" for manual analysis.
  • Sophisticated Reward Function: The "brain" of the agent is driven by a reward function that balances four factors:
  • Accuracy: Rewards for being right, penalties for being wrong.
  • Class Imbalance: Higher rewards for correctly identifying malware (which is rare) vs. goodware (which is common).
  • Temporal Robustness: Scaling rewards based on how recent a sample is, forcing the agent to prioritize adapting to new threats.
  • Rejection Cost: A penalty for rejecting a sample, representing the real-world cost of human labor.

Datasets

The researchers evaluated DRMD using two major Android malware datasets:

  • Transcendent: A classic dataset containing ~259,000 apps collected between 2014 and 2018.
  • Hypercube: A newer, more challenging dataset with ~160,000 apps from 2021 to 2023.

They tested these across two different "feature spaces" (ways of representing the apps): Drebin (a high-dimensional space of 10,000 features like permissions and API calls) and Ramda (a more compact 379-dimensional space designed for adversarial robustness).

Key Insights and Ideas

  • The "Aha" Moment on Independence: Previous RL researchers tried to model malware detection like a game (multi-step episodes). This paper argues that because one app's features don't actually change the "state" of the next app, a one-step MDP is the mathematically correct way to model the problem.
  • Real-Time Rejection: Most rejection systems only work in batches (e.g., at the end of the month). Because DRMD is an RL agent, it can make "real-time" decisions to abstain from a classification the moment it sees a high-risk sample.
  • Uncertainty as a Feature: The agent naturally learns to use the "Reject" action when it encounters samples that look like they are drifting away from its training data, effectively "buying" itself more information through the Active Learning loop.

Key Results

The authors used the Area Under Time (AUT) metric, which measures how well a model maintains performance over months or years of drift.

  • Significant Gains: DRMD outperformed the best baselines in 75% of all tested scenarios.
  • Classification-Only: Even without the rejection feature, the DRMD agent achieved an average AUT improvement of 8.66 over standard classifiers.
  • Full Pipeline: When using both classification and rejection, the improvement jumped to 10.90.
  • Superiority over Bandits: DRMD significantly outperformed standard Deep Contextual Bandit algorithms (like NeuralUCB and NeuralTS), proving that the specific PPO-based architecture is better suited for the "noise" of malware evolution.

Limitations and Future Work

While powerful, the authors note a few areas for growth:

  • Static Analysis Only: The current model relies on static features (code metadata). Future versions could integrate "dynamic analysis" (watching how the app actually runs in a sandbox).
  • Feature Retrieval: The authors suggest that the agent could be expanded to decide when to spend resources on more expensive feature extraction methods.
  • Reward Tuning: The rejection cost is currently a flat value; future work could use "conformal evaluation" to make the rejection threshold even more mathematically rigorous.

Summary updated

BibTeX
@inproceedings{mcfadden2026drmd,
  author = {Shae McFadden and Myles Foley and Mario D'Onghia and Chris Hicks and Vasilios Mavroudis and Nicola Paoletti and Fabio Pierazzi},
  title = {{DRMD: Deep Reinforcement Learning for Malware Detection Under Concept Drift}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2026},
  doi = {10.1609/aaai.v40i2.37053},
}
Figure