一句话:首次利用 XAI 解释识别漏洞预测数据偏差与模型局限,从而提升预测性能。
本文研究可解释 AI(XAI)能否用于改进软件漏洞预测,而不仅是提升透明度。作者以 LineVul 深度学习漏洞预测模型和 Layered Integrated Gradients 解释算法生成 XAI 信息,据此分析漏洞预测数据集中的偏差和模型局限。一个意外发现是:LineVul 虽能准确预测易受攻击函数,但其中 43% 的预测依据的是数据集偏差而非真正漏洞行。系统移除这些偏差后,F-Measure 从 92% 提升到 96%。此外,XAI 还揭示 LineVul 依赖的 CodeBERT 受 512 token 限制;集成可处理长序列的 LongCoder 后,F-measure 与 MCC 从 92% 和 91% 提升至 94%。结论是 XAI 有超越解释预测依据的附加用途。
Explainable Artificial Intelligence (XAI) has recently been applied to vulnerability prediction models to understand the decisions made and to improve the transparency of those models. We are the first to leverage XAI explanations to improve vulnerability prediction performance. The performance of vulnerability prediction models relies on the quality of the vulnerability dataset and the machine learning model. We use XAI information to identify biases in vulnerability prediction datasets and limitations in deep learning-based prediction models. Our XAI analysis is based on using a state-of-the-art deep-learning vulnerability prediction model (LineVul) and an explainability algorithm (Layered Integrated Gradients) to generate XAI information. The XAI information that we generated allowed us to improve our understanding of how our models worked, such that we were able to identify important improvement opportunities. Consequently, we present some surprising findings: while LineVul accurately predicted vulnerable functions, in 43% of cases, the use of XAI data allowed us to identify that those predictions were based on dataset biases rather than on actual vulnerable lines. By systematically removing these dataset biases, we achieved a notable performance improvement, increasing LineVul's F-Measure from 92% to 96%. Additionally, the insight we gained from XAI also allowed us to identify a fundamental limitation in LineVul's reliance on CodeBERT, a pre-trained language model limited to 512 tokens. By integrating LongCoder, a pre-trained model capable of processing longer sequences, we achieved an F-measure and MCC increase from 92% and 91%, respectively, to 94%, highlighting the potential for improved handling of complex, long-sequence vulnerabilities. We conclude that XAI has important additional applications that go beyond providing users with information describing the basis of predictions.