Chasing Shadows: Pitfalls in LLM Security Research

Jonathan Evertz, Niklas Risse, Nicolai Neuer, Andreas Müller, Philipp Normann, Gaetano Sapia, Srishti Gupta, David Pape, Soumya Shaw, Devansh Srivastav, Christian Wressnegger, Erwin Quiring, Thorsten Eisenhofer, Daniel Arp, Lea Schönherr

TL;DR

A systematic review of 72 top-tier security and software engineering papers reveals a startling reality: every single paper contains at least one of nine fundamental methodological pitfalls. These flaws—ranging from data leakage to "model ambiguity"—threaten the validity and reproducibility of the current wave of LLM-based security research.

What Problem Does This Paper Address?

Large Language Models (LLMs) have taken the security world by storm, powering everything from automated vulnerability detection to exploit generation. However, the rapid pace of adoption has outstripped our methodological rigor. While the community understands the pitfalls of "traditional" machine learning (like overfitting), LLMs introduce unique challenges due to their scale, opacity, and natural language interfaces.

The authors argue that we are currently "chasing shadows"—reporting performance gains that might be artifacts of flawed experimental design rather than genuine progress. They aim to shine a light on these "shadows" by identifying common pitfalls and measuring how widespread they are in the highest levels of academic research.

Methods

The researchers took a three-pronged approach:

  1. Taxonomy Development: They identified nine specific pitfalls (P1–P9) spanning the entire LLM pipeline: data collection, pre-training, fine-tuning, prompting, and evaluation.
  2. Prevalence Study: A team of 15 researchers performed a systematic review of 72 peer-reviewed papers published between 2023 and 2024 at top-tier conferences (e.g., IEEE S&P, USENIX Security, ICSE). They used a rigorous multi-phase labeling process to determine if these pitfalls were present and if the authors acknowledged them.
  3. Impact Analysis: They conducted four empirical case studies to quantify exactly how much these pitfalls distort results. For example, they simulated data leakage and measured the resulting (and false) performance boost.

Datasets

The primary "dataset" for the meta-analysis was the collection of 72 peer-reviewed papers. For their empirical case studies, they utilized several standard security benchmarks:

  • Vulnerability Detection: Devign, DiverseVul, and PrimeVul.
  • Hate Speech Detection: New-Hate-Wave.
  • Code Generation: self-oss-instruct-sc2-exec-filter-50k.

Key Insights and Ideas

  • The 100% Prevalence Shock: Every paper studied contained at least one pitfall. Most were unacknowledged; only 15.7% of the identified pitfalls were explicitly discussed by the original authors.
  • Model Ambiguity (P9) is the New Normal: 73.6% of papers suffered from this. Referring to "GPT-4" is no longer enough. Because providers update models via APIs (snapshots) and users apply different quantization levels, "GPT-4" today is not "GPT-4" from six months ago. This makes reproducing results nearly impossible without exact version IDs and timestamps.
  • The Silent Truncation: In vulnerability detection, nearly 50% of vulnerable functions exceed the common 512-token context window. When researchers ignore this (Context Truncation, P6), they often inadvertently delete the very code that contains the vulnerability, leading to misleading evaluation metrics.
  • The Surrogate Fallacy: Researchers often test on a small, open-source model (like Llama-7B) and then generalize their security claims to "all LLMs" or much larger proprietary models without empirical proof.

Key Results

  • Data Leakage (P3): In their case study, leaking just 20% of the test data into the fine-tuning set inflated the F1 score by 0.08–0.11, a massive "fake" improvement.
  • Model Ambiguity (P9): Testing hate speech detection across different GPT-4 snapshots showed that accuracy fluctuated significantly (from 77% to 88%), proving that the specific version matters as much as the model family.
  • Model Collapse (P4): They demonstrated that recursive self-training (training a model on its own synthetic output) leads to a clear trend of degradation and instability in code generation, increasing perplexity across generations.
  • Prevalence by Topic: Papers on Vulnerability Repair and Detection had the highest average rate of pitfalls (up to 28%), while Fuzzing and Secure Code Generation were slightly more robust (15–18%).

Limitations and Future Work

The authors acknowledge that their paper selection, while broad, might not be exhaustive. Furthermore, labeling pitfalls involves a degree of subjectivity, though they mitigated this with a high inter-reviewer agreement (Fleiss’ κ of 0.55–0.77).

Future Work: The authors have launched llmpitfalls.org, intended as a "living appendix" for the community to contribute up-to-date best practices. They call for a cultural shift toward transparency: reporting exact model snapshots, commit IDs, quantization levels, and performing "leakage probes" to ensure that security research moves from "chasing shadows" to grounded, reproducible science.

Summary updated

BibTeX
@inproceedings{evertz2026chasing,
  author = {Jonathan Evertz and Niklas Risse and Nicolai Neuer and Andreas Müller and Philipp Normann and Gaetano Sapia and Srishti Gupta and David Pape and Soumya Shaw and Devansh Srivastav and Christian Wressnegger and Erwin Quiring and Thorsten Eisenhofer and Daniel Arp and Lea Schönherr},
  title = {{Chasing Shadows: Pitfalls in LLM Security Research}},
  booktitle = {NDSS},
  year = {2026},
}
Figure