MalGPT: A Generative Explainable Model for Malware Binaries
Abstract
Explaining malware binaries poses significant challenges, as existing approaches often focus on surface-level features, dynamic behaviors, or assembly code analysis. While these models highlight features contributing to classification, they remain inaccessible to non-experts. In this work, we propose MalGPT, a multi-model and transformer-based approach that generates human-readable explanations of malware binaries in natural language. We manually analyzed malware binaries from different malware families, including benign files, using various tools to create a ground truth dataset with high-level explanations. As per the literature, this is the first contribution of a malware dataset paired with natural language explanations, along with a high-level explanatory model developed for the cybersecurity community. Our approach includes complex feature engineering, followed by a novel architecture, Cross-Hierarchical Attention Network (CHAiN), which learns relationships not only within individual features, but across different feature sets in a multi-model architecture. We developed a Generative Pretrained Transformer (GPT)-style architecture optimized for multi-modal malware binary analysis, designed to seamlessly integrate heterogeneous features, such as numeric data, printable strings, and graph-based representations of assembly code. The architecture aligns syntactic structures with semantic context, to transform encoded multi-modal inputs into coherent and precise explanations. This innovative approach enhances compatibility with diverse data modalities, providing robust and interpretable insights into malware behavior, while enabling detailed and contextually accurate textual explanations. In future work, we aim to scale this approach with larger datasets, enhancing its capacity to explain emerging malware variants and address different cybersecurity landscapes, such as malicious apps or network viruses, ultimately contributing to risk mitigation.
Cite
Text
Saqib et al. "MalGPT: A Generative Explainable Model for Malware Binaries." European Conference on Machine Learning and Principles and Practice of Knowledge Discovery in Databases, 2025. doi:10.1007/978-3-032-06078-5_8Markdown
[Saqib et al. "MalGPT: A Generative Explainable Model for Malware Binaries." European Conference on Machine Learning and Principles and Practice of Knowledge Discovery in Databases, 2025.](https://mlanthology.org/ecmlpkdd/2025/saqib2025ecmlpkdd-malgpt/) doi:10.1007/978-3-032-06078-5_8BibTeX
@inproceedings{saqib2025ecmlpkdd-malgpt,
title = {{MalGPT: A Generative Explainable Model for Malware Binaries}},
author = {Saqib, Mohd and Fung, Benjamin C. M. and Ding, Steven H. H. and Charland, Philippe},
booktitle = {European Conference on Machine Learning and Principles and Practice of Knowledge Discovery in Databases},
year = {2025},
pages = {130-148},
doi = {10.1007/978-3-032-06078-5_8},
url = {https://mlanthology.org/ecmlpkdd/2025/saqib2025ecmlpkdd-malgpt/}
}