← Lab /Software

Compile rate proves unreliable for evaluating LLM-based vulnerability repairs

Compile rate is a scientifically unreliable metric for single-function vulnerability repair using LLMs

Software arXiv 22 Sep 2026 Measurement Simulation evidence

Published as “Metrics Failure in LLM-Based Code Vulnerability Repair: An Empirical Study and a Change-Aware Screen”

Why it matters

Researchers should stop relying on compile rate or whole-function similarity alone and incorporate execution-based or change-aware metrics when evaluating LLM-generated vulnerability patches.

Summary

Compile rate, a common proxy for LLM-based C/C++ vulnerability repair, is shown to be unreliable in five ways, including insensitivity to genuine improvements and dependence on toolchain flags. Whole-function CodeBLEU can be gamed by returning the unchanged vulnerable function, scoring higher than any model. The paper introduces diff_F1, a change-aware edit-overlap screen that gives zero credit to no-ops and low credit to many degenerate patches, though it does not catch all. The study evaluates three open-source code LLMs on 203 real-world vulnerable functions, providing a larger-scale benchmark than prior work.

What they found 4

  1. Compile rate and CodeBLEU rank the three models in opposite order.

    “The two metrics rank the models in opposite order (Section 4.1).”

  2. Changing only the compiler -std flag can increase compile rate by up to 2.7× with no regressions.

    “Switching only the -std flag changes the rate by a factor of 1.8 to 2.7 with zero regressions.”

  3. A no-op copy of the vulnerable function scores higher on whole-function CodeBLEU than any model.

    “The copy-input no-op scores 0.775 whole-function CodeBLEU (Table 10), higher than every model, which score between 0.46 and 0.68.”

  4. Increasing the generation budget improves code quality (truncation and CodeBLEU) but barely changes compile rate.

    “Table 7 shows that the larger budget cut truncated outputs by 17 to 30 percentage points (pp) and raised CodeBLEU by 0.06 to 0.12, yet compile rate barely moved, between +0.6 and +1.3 pp.”

Caveats 5

  • diff_F1 therefore gives near-zero credit to some gaming patches but not to all of them.
  • Switching only the -std flag changes the rate by a factor of 1.8 to 2.7 with zero regressions.
  • diff_F1 is best understood as a change-aware screen, not as a measure of repair quality.
  • The specific repair numbers we report are secondary; the contribution is methodological.
  • For many function-level, CVE-derived datasets, executable tests or exploit oracles are not supplied with each example, so the community falls back on cheap, automatic proxies.

What’s new here 4

  • Systematic controlled experiments exposing five distinct failure modes of compile rate for single-function repair.
  • Demonstration that whole-function CodeBLEU rewards unchanged context, allowing a no-op copy to outperform all models.
  • Identification that the majority of compile failures stem from evaluation setup, not model quality.
  • Introduction of diff_F1 as a change-aware screen to filter out no-ops and many gaming patches.