paperbot · PL 论文追踪

全部论文 待读 收藏

P1 SCALE: Constructing Structured Natural Language Comment Trees for Software Vulnerability Detection

SCALE:为软件漏洞检测构建结构化自然语言注释树
ISSTA Proceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis2024匹配度 5/10 · 该论文将 LLM 用于生成注释并结合 AST 提升漏洞检测,属于 LLM 辅助代码分析与安全检测,与“AI→PL”方向有一定交叉;但其任务并非静态分析/形式化验证,也未涉及 Agentic 程序、浮点程序分析或贝叶斯程序分析,因此匹配度中等。引用 19 inbox
Xin-Cheng Wen, Cuiyun Gao, Shuzheng Gao, Yang Xiao, Michael R. Lyu
crossref: 2026-09-12

AI 速览

一句话:提出 SCALE,用 LLM 注释与 AST 构建结构化注释树,增强预训练模型的软件漏洞检测。

现有基于预训练模型的漏洞检测多以代码序列为输入,忽略漏洞相关结构信息,难以推断含多操作符、指针等复杂逻辑语句的语义,也难以理解多种代码执行序列。为此,论文提出 SCALE,在抽象语法树(AST)上构建结构化自然语言注释树(SCT)。该方法先用大语言模型生成注释并加入 AST 得到注释树,再结合代码语法模板显式编码执行序列,最后用 SCT 增强表示以捕捉漏洞模式。在 FFMPeg+Qemu、Reveal、SVulD 数据集上,SCALE 的 F1 较最佳基线分别提升 2.96%、13.47%、3.75%;用于 CodeBERT、UniXcoder 等预训练模型时,F1 提升 1.37% 至 10.87%。

问题
现有预训练模型漏洞检测方法主要使用代码序列,忽略结构信息,导致复杂逻辑语义推断困难且难以理解代码执行序列。
方法
SCALE 基于 AST 构建结构化自然语言注释树:用 LLM 生成注释节点并加入 AST,再结合语法模板显式引入执行序列,最终形成增强表示用于漏洞检测。
评估
在 FFMPeg+Qemu、Reveal、SVulD 三个数据集上与预训练模型和 LLM 基线比较,F1 最多提升 13.47%;并验证了在 CodeBERT、UniXcoder 等模型上的可迁移性。
原文摘要(Abstract)

Recently, there has been a growing interest in automatic software vulnerability detection. Pre-trained model-based approaches have demonstrated superior performance than other Deep Learning (DL)-based approaches in detecting vulnerabilities. However, the existing pre-trained model-based approaches generally employ code sequences as input during prediction, and may ignore vulnerability-related structural information, as reflected in the following two aspects. First, they tend to fail to infer the semantics of the code statements with complex logic such as those containing multiple operators and pointers. Second, they are hard to comprehend various code execution sequences, which is essential for precise vulnerability detection. To mitigate the challenges, we propose a Structured Natural Language Comment tree-based vulnerAbiLity dEtection framework based on the pre-trained models, named . The proposed Structured Natural Language Comment Tree (SCT) integrates the semantics of code statements with code execution sequences based on the Abstract Syntax Trees (ASTs).Specifically, comprises three main modules: (1) Comment Tree Construction, which aims at enhancing the model’s ability to infer the semantics of code statements by first incorporating Large Language Models (LLMs) for comment generation and then adding the comment node to ASTs. (2) Structured Natural Language Comment Tree Construction, which aims at explicitly involving code execution sequence by combining the code syntax templates with the comment tree. (3) SCT-Enhanced Representation, which finally incorporates the constructed SCTs for well capturing vulnerability patterns. Experimental results demonstrate that outperforms the best-performing baseline, including the pre-trained model and LLMs, with improvements of 2.96%, 13.47%, and 3.75% in terms of F1 score on the FFMPeg+Qemu, Reveal, and SVulD datasets, respectively. Furthermore, can be applied to different pre-trained models, such as CodeBERT and UniXcoder, yielding the F1 score performance enhancements ranging from 1.37% to 10.87%.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot8547,
  title = {SCALE: Constructing Structured Natural Language Comment Trees for Software Vulnerability Detection},
  author = {Xin-Cheng Wen and Cuiyun Gao and Shuzheng Gao and Yang Xiao and Michael R. Lyu},
  booktitle = {ISSTA},
  year = {2024},
  doi = {10.1145/3650212.3652124}
}