paperbot · PL 论文追踪

全部论文 待读 收藏

P2 SecureReviewer: Enhancing Large Language Models for Secure Code Review through Secure-Aware Fine-Tuning

SecureReviewer:通过安全感知微调增强大语言模型的安全代码审查能力
ICSE Proceedings of the 2026 IEEE/ACM 48th International Conference on Software Engineering2026匹配度 3/10 · 该论文聚焦于用安全感知微调与RAG提升LLM生成安全代码审查注释的能力,属于LLM能力改进与代码审查任务,而非用户核心方向中的静态分析、形式化验证、Agentic程序分析或浮点/贝叶斯程序分析。虽然涉及代码与安全,但研究目标本身是增强LLM,与画像关注点交集有限。引用 8 inbox
Fang Liu, Simiao Liu, Yinghao Zhu, Xiaoli Lian, Li Zhang
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出安全感知微调策略并结合RAG增强LLM安全代码审查,构建数据集与SecureBLEU指标。

在开发早期识别安全问题至关重要,代码审查是有效实践,但现有基于大语言模型的自动审查方法主要面向通用代码审查,对安全问题的识别与修复效果不足,且面临数据稀缺与评测指标缺失的挑战。本文提出SecureReviewer:首先构建面向安全代码审查训练与评估的专用数据集;在该数据集上采用安全感知微调策略,使LLM生成的审查评论能有效识别安全问题并给出修复建议;引入检索增强生成(RAG)将生成内容锚定于领域安全知识,以缓解幻觉并提升输出可靠性;同时提出新评测指标SecureBLEU,用于衡量评论解决安全问题的有效性。实验表明,SecureReviewer在安全问题检测准确率以及生成评论的整体质量与实用性上均优于当前最优基线。

问题
现有LLM代码审查方法聚焦通用审查,对安全相关问题的识别与修复能力未被充分探索,且缺乏面向安全审查的训练数据与合适评测指标。
方法
构建安全代码审查数据集,提出安全感知微调策略训练LLM生成含修复建议的安全审查评论,并集成检索增强生成(RAG)以领域安全知识缓解幻觉;同时提出SecureBLEU评测指标。
评估
在构建的数据集上与多种当前最优基线对比,从安全问题检测准确率和生成审查评论的质量与实用性(SecureBLEU)两方面进行评估。
原文摘要(Abstract)

Identifying and addressing security issues during the early phase of the development lifecycle is critical for mitigating the long-term negative impacts on software systems. Code review serves as an effective practice that enables developers to check their teammates’ code before integration into the codebase. To streamline the generation of review comments, various automated code review approaches have been proposed, where Large Language Model (LLM)-based methods have significantly advanced the capabilities of automated review generation. However, existing models primarily focus on general-purpose code review, their effectiveness in identifying and addressing security-related issues remains underexplored. Moreover, adapting existing code review approaches to target security issues faces substantial challenges, including data scarcity and inadequate evaluation metrics. To address these limitations, we propose SecureReviewer, a new approach designed for enhancing LLMs’ ability to identify and resolve security-related issues during code review. Specifically, we first construct a dataset tailored for training and evaluating secure code review capabilities. Leveraging this dataset, we fine-tune LLMs to generate code review comments that can effectively identify security issues and provide fix suggestions with our proposed secure-aware fine-tuning strategy. To mitigate hallucination in LLMs and enhance the reliability of their outputs, we integrate the Retrieval-Augmented Generation (RAG) technique, which grounds the generated comments in domain-specific security knowledge. Additionally, we introduce SecureBLEU, a new evaluation metric designed to assess the effectiveness of review comments in addressing security issues. Experimental results demonstrate that SecureReviewer outperforms state-of-the-art baselines in both security issue detection accuracy and the overall quality and practical utility of generated review comments. Our code and data are available at https://github.com/SIMIAO515/SecureReviewer.

链接与引用

DOI 原文 · arXiv · DBLP

BibTeX
@inproceedings{abs-2510-26457,
  title = {SecureReviewer: Enhancing Large Language Models for Secure Code Review through Secure-Aware Fine-Tuning},
  author = {Fang Liu and Simiao Liu and Yinghao Zhu and Xiaoli Lian and Li Zhang},
  booktitle = {ICSE},
  year = {2026},
  doi = {10.1145/3744916.3773191}
}