mlsanityData to 13 Oct 2026

Beyond Natural Language Perplexity: Detecting Dead Code Poisoning in Code Generation Datasets

arXiv 2502.20246 ↗First posted 27 Feb 2025cs.CLcited by 1

Not on the map. Why?

Abstract (arXiv)

The increasing adoption of large language models (LLMs) for code-related tasks has raised concerns about the security of their training datasets. One critical threat is dead code poisoning, where syntactically valid but functionally redundant code is injected into training data to manipulate model behavior. Such attacks can degrade the performance of neural code search systems, leading to biased or insecure code suggestions. Existing detection methods, such as token-level perplexity analysis, fail to effectively identify dead code due to the structural and contextual characteristics of programming languages. In this paper, we propose DePA (Dead Code Perplexity Analysis), a novel line-level detection and cleansing method tailored to the structural properties of code. DePA computes line-level perplexity by leveraging the contextual relationships between code lines and identifies anomalous lines by comparing their perplexity to the overall distribution within the file. Our experiments on benchmark datasets demonstrate that DePA significantly outperforms existing methods, achieving 0.14-0.19 improvement in detection F1-score and a 44-65% increase in poisoned segment localization precision. Furthermore, DePA enhances detection speed by 0.62-23x, making it practical for large-scale dataset cleansing. Overall, by addressing the unique challenges of dead code poisoning, DePA provides a robust and efficient solution for safeguarding the integrity of code generation model training datasets.

Key facts. Cited by 1 paper in the map (data through 13 Oct 2026). Builds on 14 of its 20 references that are in the map. First posted on arXiv 27 Feb 2025.

Builds on

14 of 20 references.

References · 14

  1. 2021Evaluating Large Language Models Trained on Codecited by 8,205
  2. 2021Program Synthesis with Large Language Modelscited by 3,573
  3. 2023Code Llama: Open Foundation Models for Codecited by 2,130
  4. 2021Measuring Coding Challenge Competence With APPScited by 891
  5. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 743
  6. 2019MathQA: Towards Interpretable Math Word Problem Solving with Operation-Based Formalismscited by 654
  7. 2018Spectral Signatures in Backdoor Attackscited by 481
  8. 2018Detecting Backdoor Attacks on Deep Neural Networks by Activation Clusteringcited by 451
  9. 2023Detecting Language Model Attacks with Perplexitycited by 429
  10. 2020ONION: A Simple and Effective Defense Against Textual Backdoor Attackscited by 262
  11. 2024CodeGemma: Open Code Models Based on Gemmacited by 149
  12. 2022Few-shot training LLMs for project-specific code-summarizationcited by 129
2 more
  1. 2023Stealthy Backdoor Attack for Code Modelscited by 49
  2. 2020Backdoors in Neural Models of Source Codecited by 41

Built on by

Cited by year (2026 to 13 Oct)

Citing papers per year: 2026: 1.

1 paper.