arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2603.23470cs.SE
收藏

ConceptCoder: 通过概念学习提升代码推理

ConceptCoder: Improve Code Reasoning via Concept Learning

Iowa State University(爱荷华州立大学)

Md Mahbubur Rahman, Hengbo Tong, Wei Le

AI总结:

ConceptCoder通过学习代码概念提升代码推理能力,在漏洞检测任务中显著提高F1值,优于现有方法,并扩展至分支预测。

摘要:

大型语言模型(LLMs)在软件工程应用中表现出色,但在漏洞检测(VD)等代码推理任务上仍存在困难。我们引入ConceptCoder,一种微调方法,模拟人类代码检查过程:模型首先识别代码概念,然后基于这些概念进行推理。以往工作通过多模态模型或LLMs提取概念来解释视觉和自然语言模型。我们的工作首次为代码定义概念,将代码概念定义为人类可理解的语义属性,并训练模型学习这些概念。评估显示,该方法在9个开源LLM上平均将VD准确率从66.32提升至72.15 F1。ConceptCoder在现有最先进(SOTA)基线中表现最佳,包括微调的SOTA开源LLM和提示的专有模型如GPT-5.2和Claude-Opus-4.5。我们的方法也具有可扩展性:从四种漏洞类型定义的概念有助于134个CWE的通用漏洞数据集。我们进一步证明,基于概念的微调不仅适用于VD,还提高了分支预测。我们已发布代码和数据集:https://figshare.com/s/1decab8232c653b44f71.

英文摘要:

Large language models (LLMs) have shown promising results for software engineering applications, but still struggle with code reasoning tasks such as vulnerability detection (VD). We introduce ConceptCoder, a fine-tuning method that simulates human code inspection: models are trained to first recognize code concepts and then perform reasoning on top of these concepts. In prior work, concepts are extracted by multimodal models or LLMs to explain vision and natural language models. Our work is the first to formulate concepts for code. We define code concepts as human-understandable semantic properties of code and train models to learn such concepts. Our evaluation shows that this approach significantly improves VD accuracy, from 66.32 to 72.15 F1 on average over 9 open-source LLMs. ConceptCoder achieves the best VD performance compared to state-of-the-art (SOTA) baselines, including fine-tuned SOTA open-source LLMs and prompted proprietary models such as GPT-5.2 and Claude-Opus-4.5. Our approach also scales: concepts defined from four types of vulnerabilities benefit general vulnerability datasets with 134 CWEs. We further demonstrate that concept-based fine-tuning generalizes beyond VD and improves branch prediction. We release our code and datasets at https://figshare.com/s/1decab8232c653b44f71.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑