Skip to content
Open access

CodeVulReason: Incentivizing reasoning for code vulnerability detection

Aug 2026 · Journal of King Saud University: Science · 0 citations · 18 references

TL;DR

This paper introduces CodeVulReason, a unified framework for enhancing the reasoning capabilities of large language models (LLMs) in code vulnerability detection (CVD), and proposes S-LoRA, a parameter-efficient fine-tuning method that optimizes Low-Rank Adaptation (LoRA) rank allocation through a statistically grounded stability-aware importance scoring mechanism.

Abstract

This paper introduces CodeVulReason, a unified framework for enhancing the reasoning capabilities of large language models (LLMs) in code vulnerability detection (CVD). To address the scarcity of high-quality chain-of-thought (CoT) supervision, we automatically construct task-specific reasoning data using frontier reasoning models to generate and curate reasoning traces from benchmark datasets, including DiverseVul and MixedVul. We further propose S-LoRA, a parameter-efficient fine-tuning method that optimizes Low-Rank Adaptation (LoRA) rank allocation through a statistically grounded stability-aware importance scoring mechanism. In addition, we integrate S-LoRA with group relative policy optimization (GRPO) to further refine task-specific reasoning behavior. Experimental results show that CodeVulReason achieves state-of-the-art performance on two benchmark datasets, including an accuracy of 0.785 on DiverseVul, while also improving the interpretability of model predictions through explicit reasoning traces.

Read PDF

Similar papers

Conference Open access 2026

Large Language Model Vulnerabilities

: Large language models are increasingly being deployed in safety-critical domains, yet remain vulnerable to jailbreak attacks that circumvent safety alignments. This systematic review synthesizes empirical jailbreak research published between 2024 and 2025, using a PRISMA-guided search protocol, followed by BERTopic-b...

Meda Račaitytė, Hélder Bastos, R. Ribeiro et al. · 0 citations
Book Open access Jul 2026

SecVulEval: Context-Aware Benchmarking of LLMs for Vulnerability Detection

This paper introduces SecVulEval, a context-aware benchmark designed to evaluate LLMs on vulnerability detection with rich contextual information, and believes it can serve as a foundation for advancing context-aware vulnerability detection with LLMs.

Md Basim Uddin Ahmed, Nima Shiri Harzevili, Jiho Shin et al. · 2 citations
Preprint Jul 2026

Detecting Vulnerability-Inducing Commits via Multi-Stage Reasoning with LLM-Based Agents

VIC-RAGENT is proposed, an LLM-based multi-agent framework for effective and explainable vulnerability detection that employs a multi-stage reasoning process that progressively refines candidate vulnerabilities through preliminary inspection, reanalysis, and a final decision stage.

Liyou Chen, Hailong Sun, Xiang Gao et al. · 0 citations

BashCoder-R1: Towards Robust and Explainable Bash Script Generation with Robustness-Aware Group Relative Policy Optimization

BashCoder-R1 is presented, a framework that tackles both problems jointly, treating explainability as a design goal rather than a byproduct of correctness, and directly refines the generation policy against a weighted reward combining syntax correctness, robustness as verified by the static analyzer shellcheck, and adh...

Li Yang, Fengjun Zhang, Lei Yu et al. · 0 citations
Preprint Aug 2026

Beyond FLOPs: Energy-Aware Knowledge Distillation for Sustainable LLMs on Code-Related Task

Energy-aware knowledge distillation when guided by direct energy surrogates rather than FLOPs can improve the energy consumption, sustainability, and deployability of LLMs for SE applications, enabling efficient models on consumer hardware.

Enrique Barba Roque, Luís Cruz, Annibale Panichella · 0 citations
Preprint Aug 2026

Function-Level Execution Feedback for Code Preference Optimization

STEP-KTODER is proposed, a framework for code preference optimization that defines steps as module-level functions in decomposed multi-function programs and assigns binary correctness labels via automatically generated unit tests and shows that execution-based labels are essential.

Idris Nechnech, Sehwan Kim, Jimin Seo et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.