一句话:提出基于监督协同解码的 LLM 编程助手,避免重训练并面向安全代码生成。
基于大语言模型(LLM)的编程助手能够辅助开发者生成代码并提升效率,但容易产生带有安全漏洞的代码。为降低安全风险,已有方法通常使用无漏洞的构造数据对 LLM 进行重训练;然而重训练需要巨大的计算成本,并且往往需要访问 LLM 的内部表示,这对于以分布式在线服务形式部署的 LLM 常常不可用。作者先前的工作 CoSec 提出一种监督式协同解码方法:将基础 LLM 与一个小规模的安全专用 LLM 结合,后者利用漏洞修复前后的代码变更进行微调。CoSEFA 在该方向上构建用于安全代码生成的基于 LLM 的编程助手。摘要未给出 CoSEFA 的具体实现细节与实验评估结果。
Programming assistants based on Large Language Models (LLMs) assist developers in code generation and improve efficiency. These LLM-based programming assistants are prone to generate code with vulnerabilities. To mitigate security risk, existing approaches retrain an LLM with crafted data without vulnerabilities. However, retraining requires enormous computational costs and the accessible LLMs' internal representation, often unavailable for LLMs deployed as distributed online services. Our previous work, CoSec, proposed a supervised co-decoding approach using base LLMs alongside a small-scale security-focused LLM fine-tuned with code changes before and after vulnerability fixing.
@inproceedings{paperbot9147,
title = {CoSEFA: An LLM-Based Programming Assistant for Secure Code Generation via Supervised Co-Decoding},
author = {Xuan He and Dong Li and Hao Wen and Yueheng Zhu and Chao Liu and Meng Yan and Hongyu Zhang},
booktitle = {FSE},
year = {2025},
doi = {10.1145/3696630.3728609}
}