arXiv:2410.03470cs.LGcs.AI2024-10中稿 · ITaS2024被引 1

用拓扑分析注意力图,让模型更准发现代码漏洞。

Vulnerability Detection via Topological Analysis of Attention Maps

  • 用拓扑数据分析BERT的注意力矩阵,提取语义特征。
  • 基于拓扑特征的机器学习模型效果接近CodeBERTa。
  • 适合对代码安全与深度学习交叉感兴趣的读者。

近年来,深度学习在漏洞检测领域受到广泛关注,其表现常优于传统静态分析工具。本文提出一种新方法,利用拓扑数据分析(TDA)技术处理BERT模型的注意力矩阵,挖掘其中蕴含的语义信息。研究发现,基于这些拓扑特征训练的传统机器学习模型,在漏洞检测任务上的表现可与预训练语言模型(如CodeBERTa)相媲美。这表明,包括持久同调在内的TDA工具能有效捕捉识别漏洞所需的深层语义特征。

原文摘要 · Abstract (English)

Recently, deep learning (DL) approaches to vulnerability detection have gained significant traction. These methods demonstrate promising results, often surpassing traditional static code analysis tools in effectiveness. In this study, we explore a novel approach to vulnerability detection utilizing the tools from topological data analysis (TDA) on the attention matrices of the BERT model. Our findings reveal that traditional machine learning (ML) techniques, when trained on the topological features extracted from these attention matrices, can perform competitively with pre-trained language models (LLMs) such as CodeBERTa. This suggests that TDA tools, including persistent homology, are capable of effectively capturing semantic information critical for identifying vulnerabilities.

漏洞检测拓扑分析代码安全

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。