← Lab /Software

Iterative LLM pipeline can automatically repair vulnerable functions

Their multi-stage LLM feedback loop achieves high-quality automated code repair for real-world vulnerabilities

Software arXiv 15 Nov 2026 Method Prototype evidence

Published as “Found, but Not Fixed : From Software Vulnerability Discovery to Fixes with Iterative LLM Pipelines”

Why it matters

The approach can dramatically shrink the time-to-patch for critical vulnerabilities, offering near-instantaneous automated fixes that reduce exposure windows.

Summary

The iterative LLM pipeline (LLM4CVE) achieves a 20% improvement in CodeBLEU scores for C-language patches when moving from one-shot to guided-with-feedback configuration, and it successfully prevents exploitation in a real-world iperf3 vulnerability test. The evidence comes from a curated dataset of ~800 function-level before-after pairs drawn from real CVE repositories and comparisons against several baseline models including VulRepair and multiple proprietary LLMs. While the CodeBLEU gains are clear, the authors note that scores below 1.0 do not guarantee a secure fix, tempering the headline claim.

What they found 1

  1. 20% CodeBLEU improvement for Llama 3 70B with guided+feedback

    “Specifically, the Llama 3 70B model exhibited a 20% improvement in CodeBLEU scores when transitioning from a one-shot approach to the guided+feedback configuration, outperforming the GPT models and performing on par with Gemini 3 flash as shown in Figure 6b.”

Caveats 5

  • a CodeBLEU score below unity does not necessarily signify an unsuccessful or insecure repair.
  • the iterative process is constrained to two cycles.
  • we prune the dataset to remove any code pairs where either snippet exceeds a 500-token threshold.
  • approximately 95% of responses are wellformed and easily parsed. For the remaining 5% of edge cases, we employ specialized regex-based logic to isolate the candidate patch.
  • In rare instances where no valid code is produced (less than 1% of samples), the pipeline records a failure to generate a candidate.

What’s new here 4

  • Introduces an iterative feedback loop that refines patches using compiler logs and CodeBLEU scores.
  • Applies LoRA fine-tuning to open-source Llama 3 models for security-specific code generation.
  • Evaluates a cross-section of both proprietary and open-source LLMs on a real-world CVE dataset.
  • Provides an open evaluation framework, fine-tuned weights, and dataset for community reuse.