Skip to content

The Binary Speaks: Fine-Tuning a Vision-Language Model to Identify and Describe Malware from its Bytes

Saraga Sakthidharan, Naveen P J, Nandakrishna Giri, Vinod P, Antonino Nocera

cs.CR

Abstract

Malware volumes demand analysis tools that scale beyond manual triage. We present an agentic pipeline in which two LLM agents analyse VirusTotal and FLARE CAPA data and a gemini-3.1-flash-lite based judge agent merges their outputs into a forensic report. The resulting 4000 reports over ten malware families, each paired with a grayscale byte image, are used to fine-tune OpenFlamingo-3B with LoRA to identify the family of a sample and describe its behaviour from the image alone. On 800 held-out samples, the model identifies the family in 91.3±0.6%91.3 \pm 0.6\% of cases, is well calibrated (ECE 0.019) and writes a report for each sample, whereas current VLMs without fine-tuning are at chance level. Image-ablation and occlusion analyses show that its outputs are grounded in the image, mostly in PE headers, read-only data and resources. Image-only CNNs classify slightly better (93.0\%) but provide no report, and template and retrieval baselines score higher on text metrics because they copy stored expert reports of other files; these conclusions hold on test samples without near-duplicates in the training data. Appending random bytes amounting to 1\% of the file size reduces the VLM's accuracy by 11 points, revealing where it needs robustness before deployment.

Create a lesson