← Lab /AI/ML

Cheatsheet prompts raise synthetic recall to 100% but cut real CVE F1 to 48.9%

Structural priors dramatically improve in-distribution vulnerability recall but cause severe out-of-distribution performance collapse.

AI/ML arXiv 16 Jul 2026 Measurement Prototype evidence

Published as “Routing Ceilings Are Domain-Independent: Structural Prior Injection in Code Security Vulnerability Detection”

Why it matters

Prompt-engineered LLM security tools that look perfect on synthetic benchmarks may perform worse than unaugmented models on real CVE code, so OOD evaluation is essential before deployment.

Summary

Structural priors (cheatsheets) drive synthetic vulnerability detection to near-perfect performance (up to 100 % F1) but cause a severe drop on real CVE data, with GPT-OSS-120B falling from 100 % synthetic F1 to 48.9 % on VUDENC (-51.1 pp) and even lower with a recalibrated cheatsheet (-58.3 pp). The evidence comes from three frontier LLMs evaluated on synthetic and real-world datasets, showing consistent patterns of in-distribution gains and out-of-distribution collapse. The results are robust across models and vulnerability categories, but the study’s small real-world sample size limits statistical confidence.

What they found 3

  1. Structural priors lift semantic-vulnerability recall from 20 % to 100 % on synthetic data across all models

    “Structural priors reduce routing failures on synthetic data, lifting the semantic-vulnerability recall from 20.0 % to 100.0 % across all three models.”

  2. Cheatsheets cause large distribution-shift collapse on real CVE data

    “for CWE-89, GPT-OSS-120B drops from 100 % synthetic F1 to 48.9 % on VUDENC (-51.1 pp), compared with 61.5 % zero-shot (-29.4 pp).”

  3. Iterative recalibration of the routing prior (cheatsheet v2) underperforms the original cheatsheet on the same real distribution

    “Iterative recalibration of the routing priors using real error patterns produces a v2 cheatsheet that performs worse than v1 on the same real distribution (41.7 % vs 48.9 % vulnerable-class F1 for CWE-89 with GPT-OSS-120B)”

Caveats 6

  • The same cheatsheets that achieve 100 % synthetic F1 drop below the zero-shot baseline on real CVE data (e.g., GPT-OSS-120B: 48.9 % vs 61.5 %).
  • Cheatsheet v2 further reduces real-world F1 compared with cheatsheet v1 (41.7 % vs 48.9 %).
  • Evaluation subset size. Each real-world condition is evaluated on 30 samples (15 vulnerable, 15 benign). While this matches common practice in budget-constrained LLM evaluation and enables direct comparison with [1], the confidence intervals are wide.
  • Gemma reasoning configuration. Unlike the Gemma 4 31B configuration in [1], which used reasoning enabled via Together AI with an 8192-token budget to allow the reasoning trace to complete, our Gemma runs used reasoning disabled for consistency with our Llama-3.3-70B configuration.
  • Incomplete experimental matrix. Conditions C (unified cheatsheet) and D (progressive saturation), as well as the Real→Real and Real→Synthetic quadrants of the cross-evaluation matrix, remain untested.
  • Cheatsheet authorship. Cheatsheets were authored manually by the first author. Inter-rater reliability and the effect of cheatsheet quality on collapse magnitude are not assessed in this work.

What’s new here 4

  • Applies the router hypothesis to code security vulnerability detection for the first time.
  • Demonstrates that structural priors can fully eliminate zero-shot misrouting on synthetic data.
  • Shows that iterative recalibration of cheatsheets can worsen OOD performance, mirroring prior findings in a different domain.
  • Provides a cross-domain replication of the distribution-shift trade-off surface with three different LLMs.