mlsanityData to 7 Oct 2026

CodeLMSec Benchmark: Systematically Evaluating and Finding Security Vulnerabilities in Black-Box Code Language Models

arXiv 2302.04012 ↗First posted 8 Feb 2023cs.CR cs.AI cs.CLcited by 52

Not on the map. Why?

Abstract (arXiv)

Large language models (LLMs) for automatic code generation have achieved breakthroughs in several programming tasks. Their advances in competition-level programming problems have made them an essential pillar of AI-assisted pair programming, and tools such as GitHub Copilot have emerged as part of the daily programming workflow used by millions of developers. The training data for these models is usually collected from the Internet (e.g., from open-source repositories) and is likely to contain faults and security vulnerabilities. This unsanitized training data can cause the language models to learn these vulnerabilities and propagate them during the code generation procedure. While these models have been extensively assessed for their ability to produce functionally correct programs, there remains a lack of comprehensive investigations and benchmarks addressing the security aspects of these models. In this work, we propose a method to systematically study the security issues of code language models to assess their susceptibility to generating vulnerable code. To this end, we introduce the first approach to automatically find generated code that contains vulnerabilities in black-box code generation models. To achieve this, we present an approach to approximate inversion of the black-box code generation models based on few-shot prompting. We evaluate the effectiveness of our approach by examining code language models in generating high-risk security weaknesses. Furthermore, we establish a collection of diverse non-secure prompts for various vulnerability scenarios using our method. This dataset forms a benchmark for evaluating and comparing the security weaknesses in code language models.

Key facts. Cited by 52 papers in the map (data through 7 Oct 2026). Builds on 29 of its 79 references that are in the map. First posted on arXiv 8 Feb 2023.

Builds on

29 of 79 references.

References · 29

  1. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  2. 2020Language Models are Few-Shot Learnerscited by 32,199
  3. 2022Training language models to follow instructions with human feedbackcited by 15,712
  4. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  5. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  6. 2022Scaling Instruction-Finetuned Language Modelscited by 2,997
  7. 2019The Curious Case of Neural Text Degenerationcited by 2,881
  8. 2020Extracting Training Data from Large Language Modelscited by 2,144
  9. 2022Competition-Level Code Generation with AlphaCodecited by 1,427
  10. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  11. 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,122
  12. 2022Scaling Laws for Reward Model Overoptimizationcited by 1,056
17 more
  1. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
  2. 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
  3. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
  4. 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
  5. 2019Dreaming to Distill: Data-free Knowledge Transfer via DeepInversioncited by 419
  6. 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 417
  7. 2014Understanding Deep Image Representations by Inverting Themcited by 399
  8. 2021Unified Pre-training for Program Understanding and Generationcited by 361
  9. 2022A Systematic Evaluation of Large Language Models of Codecited by 360
  10. 2021Examining Zero-Shot Vulnerability Repair with Large Language Modelscited by 105
  11. 2022Variational Model Inversion Attackscited by 75
  12. 2022Is GitHub's Copilot as Bad as Humans at Introducing Vulnerabilities in Code?cited by 63
  13. 2018Fast, Diverse and Accurate Image Captioning Guided By Part-of-Speechcited by 55
  14. 2022Code Generation Tools (Almost) for Free? A Study of Few-Shot, Pre-Trained Language Models on Codecited by 39
  15. 2017Diverse and Accurate Image Description Using a Variational Auto-Encoder with an Additive Gaussian Encoding Spacecited by 33
  16. 2022Text Revealer: Private Text Reconstruction via Model Inversion Attacks against Transformerscited by 28
  17. 2022A Simple, Yet Effective Approach to Finding Biases in Code Generationcited by 8

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2023: 3; 2024: 14; 2025: 24; 2026: 11.

52 papers.

Sort:

By area:

  1. 2024A Survey on Large Language Models for Code Generationcited by 646
  2. 2024RedCode: Risky Code Execution and Generation Benchmark for Code Agentscited by 87
  3. 2025BaxBench: Can LLMs Generate Correct and Secure Backends?cited by 38
  4. 2023SALLM: Security Assessment of Generated Codecited by 35
  5. 2024Constrained Decoding for Secure Code Generationcited by 35
  6. 2024Toward Secure Code Generation: Bridging Correctness and Security via Task-Adaptive Vulnerability Modeling and Execution-Based Benchmarkingcited by 26
  7. 2025Large Language Models for Code Generation: A Comprehensive Survey of Challenges, Techniques, Evaluation, and Applicationscited by 26
  8. 2024ProSec: Fortifying Code LLMs with Proactive Security Alignmentcited by 24
  9. 2023LLM for SoC Security: A Paradigm Shiftcited by 22
  10. 2025SafeGenBench: A Benchmark Framework for Security Vulnerability Detection in LLM-Generated Codecited by 17
  11. 2025PurpCode: Reasoning for Safer Code Generationcited by 17
  12. 2024HexaCoder: Secure Code Generation via Oracle-Guided Synthetic Training Datacited by 14
38 more
  1. 2025SecRepoBench: Benchmarking Code Agents for Secure Code Completion in Real-World Repositoriescited by 14
  2. 2025Alignment and Safety in Large Language Models: Safety Mechanisms, Training Paradigms, and Emerging Challengescited by 14
  3. 2024Black-Box Adversarial Attacks on LLM-Based Code Completioncited by 13
  4. 2025A.S.E: A Repository-Level Benchmark for Evaluating Security in AI-Generated Codecited by 12
  5. 2025SecureVibeBench: Benchmarking Secure Vibe Coding of AI Agents via Reconstructing Vulnerability-Introducing Scenarioscited by 11
  6. 2024LLMs for Coding and Robotics Educationcited by 9
  7. 2024From Vulnerabilities to Remediation: A Systematic Literature Review of LLMs in Code Securitycited by 9
  8. 2025RedCodeAgent: Automatic Red-teaming Agent against Diverse Code Agentscited by 9
  9. 2025HuggingGraph: Understanding the Supply Chain of LLM Ecosystemcited by 8
  10. 2025Shadows in the Code: Exploring the Risks and Defenses of LLM-based Multi-Agent Software Development Systemscited by 7
  11. 2024SoK: Blockchain-Based Decentralized AI (DeAI)cited by 6
  12. 2024How Propense Are Large Language Models at Producing Code Smells? A Benchmarking Studycited by 6
  13. 2025OSS-Bench: Benchmark Generator for Coding LLMscited by 6
  14. 2026Human oversight of agentic systems in practice: Examining the oversight work, challenges, and heuristics of developers using software agentscited by 6
  15. 2026CIBER: A Comprehensive Benchmark for Security Evaluation of Code Interpreter Agentscited by 5
  16. 2023An Empirical Study of AI-based Smart Contract Creationcited by 4
  17. 2024SeCodePLT: A Unified Platform for Evaluating the Security of Code GenAIcited by 4
  18. 2025AI Code in the Wild: Measuring Security Risks and Ecosystem Shifts of AI-Generated Code in Modern Softwarecited by 4
  19. 2025AutoBaxBuilder: Bootstrapping Code Security Benchmarkingcited by 4
  20. 2025Is Your Prompt Poisoning Code? Defect Induction Rates and Security Mitigation Strategiescited by 3
  21. 2024A Comprehensive Framework for Evaluating API-oriented Code Generation in Large Language Modelscited by 2
  22. 2025Scam2Prompt: A Scalable Framework for Auditing Malicious Scam Endpoints in Production LLMscited by 2
  23. 2025Secure-Instruct: An Automated Pipeline for Synthesizing Instruction-Tuning Datasets Using LLMs for Secure Code Generationcited by 2
  24. 2025When "Correct" Is Not Safe: Can We Trust Functionally Correct Patches Generated by Code Agents?cited by 2
  25. 2026Learning to Generate Secure Code via Token-Level Rewardscited by 2
  26. 2025LLM in the Middle: A Systematic Review of Threats and Mitigations to Real-World LLM-based Systemscited by 1
  27. 2025Secure Code Generation at Scale with Reflexioncited by 1
  28. 2025DualGauge: Automated Joint Security-Functionality Benchmarking of Specification-Only Code Generation by LLMs and Coding Agentscited by 1
  29. 2026SecCodeBench-V2 Technical Reportcited by 1
  30. 2026TOSSS: a CVE-based Software Security Benchmark for Large Language Modelscited by 1
  31. 2026SecPI: Secure Code Generation with Reasoning Models via Security Reasoning Internalizationcited by 1
  32. 2024Ocassionally Secure: A Comparative Analysis of Code Generation Assistantscited by 0
  33. 2025From Model to Breach: Towards Actionable LLM-Generated Vulnerabilities Reportingcited by 0
  34. 2025SoK: Understanding (New) Security Issues Across AI4Code Use Casescited by 0
  35. 2025Assessing the Software Security Comprehension of Large Language Modelscited by 0
  36. 2026SecureForge: Finding and Preventing Vulnerabilities in LLM-Generated Code via Prompt Optimizationcited by 0
  37. 2026SoK: AI Secure Code Generation: Progress, Pitfalls, and Paths Forwardcited by 0
  38. 2026An Empirical Study of Security Calibration in Large Language Models for Codecited by 0

50 most cited of 52 All 52 (JSON)