SRDC: Semantics-based Ransomware Detection and Classification with LLM-assisted Pre-training

Ce Zhou, Yilun Liu, Weibin Meng, Shimin Tao, Weinan Tian, Feiyu Yao, Xiaochun Li, Tao Han, Boxing Chen, Hao YangAAAI 2025 · DOI

Abstract

SRDC is a novel framework that leverages Large Language Models (LLMs) to bridge the semantic gap in ransomware detection. By pre-training on a specialized security corpus and converting cryptic system features into natural language, SRDC focuses on malicious intent rather than rigid signatures. Experimental results demonstrate significant improvements in zero-day detection and family classification over state-of-the-art methods.

Introduction

Traditional ransomware detection systems often struggle with zero-day attacks—new variants with previously unseen code or behavioral distributions. These systems typically rely on specific signatures or patterns, creating a "semantic gap." This gap manifests in three ways: a lack of internal semantic understanding of dynamic features (e.g., API calls), a lack of external "common sense" regarding malicious behavior sequences, and a heavy dependency on large labeled datasets. SRDC addresses these challenges by using LLMs to interpret the underlying intent of software behavior.

Methodology

The SRDC framework introduces three core innovations to enhance detection capabilities:

  1. LATAP (LLM-assisted Task-Adaptive Pre-training): The model (based on GPT-2) is pre-trained on a specialized corpus containing Windows API documentation, registry descriptions, and expert ransomware analysis reports. This process equips the model with domain-specific knowledge.
  2. Feature Internal Semantic Processing: Cryptic system logs are transformed into natural language verb phrases. For instance, CreateRemoteThread is converted to "Creating a Remote Execution Process," allowing the LLM to process behavioral data as a narrative.
  3. Hierarchical Combinatorial Architecture: To manage long sequences of dynamic features, SRDC processes 11 distinct feature types (e.g., APIs, Files, Registry) separately. A "Feature Extraction Compressor" then fuses these insights for final classification.
Overview of the SRDC framework, including LLM-assisted task-adaptive pre-training (LATAP) and the hierarchical combinatorial architecture for fine-tuning.

Experimental Setup

The framework was evaluated using a benchmark dataset containing 582 ransomware samples across 11 families and 942 goodware samples. The pre-training corpus included over 10,000 descriptions of Windows APIs and registry keys, along with expert reports. Notably, 88% of this corpus was generated by advanced LLMs and verified by cybersecurity experts to ensure high-quality semantic training data.

Results

SRDC demonstrates exceptional performance in both classification and zero-day detection:

  • Family Classification: Achieved a balanced accuracy of 54.83%, a 12.15% improvement over BERT-based baselines.
  • Zero-Day Detection: Reached an F1-score of 0.96, outperforming existing methods like DCAE-ZSLHVE by 4.03%.
  • Data Efficiency: SRDC maintains high accuracy even when trained on very few ransomware families. It achieved over 90% accuracy in detecting nine unseen families while being trained on only two, suggesting it learns the fundamental nature of ransomware rather than just memorizing variants.
F1 score performance of SRDC-GPT vs. standard GPT-2 as the number of seen ransomware family classes decreases, demonstrating superior stability and zero-day detection capabilities.

Discussion and Conclusion

By prioritizing intent over fingerprints, SRDC effectively recognizes malicious behavior in novel threats. The use of natural language features significantly reduces model uncertainty (perplexity) when encountering new malware. While LLM-based inference is currently slower than traditional signature matching, the gain in detection accuracy for zero-day threats is substantial. Future work will focus on improving inference speed and addressing anti-sandbox techniques used by advanced ransomware to evade dynamic analysis.

Summary updated

BibTeX
@inproceedings{zhou2025srdc,
  author = {Ce Zhou and Yilun Liu and Weibin Meng and Shimin Tao and Weinan Tian and Feiyu Yao and Xiaochun Li and Tao Han and Boxing Chen and Hao Yang},
  title = {{SRDC: Semantics-based Ransomware Detection and Classification with LLM-assisted Pre-training}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i27.35080},
}
Figure