arXiv:2512.20062cs.CRcs.AI2025-12被引 1

小模型本地微调,精准识别漏洞类型

On the Effectiveness of Instruction-Tuning Local LLMs for Identifying Software Vulnerabilities

  • 将漏洞检测改为输出CWE类型,而非二分类
  • 本地微调的小模型性能优于在线大模型
  • 适合重视隐私与部署成本的开发团队

大型语言模型(LLMs)在自动化软件漏洞分析方面展现出巨大潜力,但现有方法多依赖在线API服务,需暴露源代码,且仅做有无漏洞的二分类,实用性受限。本文将任务重构为软件漏洞识别(SVI),要求模型输出弱点的CWE ID类型。同时,通过指令微调本地可部署的小型模型,证明其性能优于在线大模型,在整体表现和成本权衡上更具优势。结果表明,指令微调的本地模型是实际漏洞管理流程中更有效、安全、可行的方案。

原文摘要 · Abstract (English)

Large Language Models (LLMs) show significant promise in automating software vulnerability analysis, a critical task given the impact of security failure of modern software systems. However, current approaches in using LLMs to automate vulnerability analysis mostly rely on using online API-based LLM services, requiring the user to disclose the source code in development. Moreover, they predominantly frame the task as a binary classification(vulnerable or not vulnerable), limiting potential practical utility. This paper addresses these limitations by reformulating the problem as Software Vulnerability Identification (SVI), where LLMs are asked to output the type of weakness in Common Weakness Enumeration (CWE) IDs rather than simply indicating the presence or absence of a vulnerability. We also tackle the reliance on large, API-based LLMs by demonstrating that instruction-tuning smaller, locally deployable LLMs can achieve superior identification performance. In our analysis, instruct-tuning a local LLM showed better overall performance and cost trade-off than online API-based LLMs. Our findings indicate that instruct-tuned local models represent a more effective, secure, and practical approach for leveraging LLMs in real-world vulnerability management workflows.

漏洞检测本地模型指令微调

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