AI
Machine Learning Rivals Deep Learning for Spotting C/C++ Security Flaws at the Function Level
An empirical study comparing multiple ML and DL approaches finds classical machine learning can match or outperform neural models for assessing software vulnerability severity in C/C++ code.
Researchers have completed the first systematic comparison of machine learning and deep learning approaches for assessing the severity of security vulnerabilities directly in C and C++ source code at the function level—a task that until now has received little academic attention despite its practical importance.
The Study's Scope and Setup#
The investigation evaluated eleven distinct data-driven models across nearly 10,000 vulnerable C/C++ functions. The assessment framework relied on the industry-standard Common Vulnerability Scoring System (CVSS) to classify and rank vulnerabilities. The team trained six traditional ML models and five deep learning architectures, then measured their ability to predict vulnerability severity categories.
Key Findings: ML Holds Its Own#
The results challenge the assumption that deep learning automatically outperforms classical approaches. Traditional machine learning achieved comparable or superior accuracy relative to multi-class deep learning models while demanding substantially less computational time to train.
When researchers enhanced the deep learning approach using multi-task learning—a technique that trains a single model to predict multiple related security properties simultaneously—performance improved markedly. This hybrid strategy yielded an average gain of 8–22% in Matthews Correlation Coefficient (MCC), a measure that captures model quality better than simple accuracy in imbalanced classification scenarios.
Why Function-Level Assessment Matters#
Vulnerability assessment differs from mere detection. Rather than simply flagging whether code contains a flaw, assessment quantifies the exploitability, potential impact, and severity of a defect. This nuanced ranking helps development teams triage security work and allocate remediation effort efficiently—a capability increasingly vital as security backlogs grow across the industry.
Implications for Future Research#
The study establishes a blueprint for applying data-driven security analysis to C and C++, two languages that remain deeply embedded in production systems worldwide. By demonstrating that multi-task deep learning can balance both effectiveness and computational efficiency, the work provides a foundation for scaling such techniques across larger codebases and organizations.

