mlsanityData to 14 Oct 2026

Rethinking the Evaluation of Secure Code Generation

arXiv 2503.15554 ↗First posted 18 Mar 2025cs.CR cs.LG cs.SEcited by 10

Not on the map. Why?

Abstract (arXiv)

Large language models (LLMs) are widely used in software development. However, the code generated by LLMs often contains vulnerabilities. Several secure code generation methods have been proposed to address this issue, but their current evaluation schemes leave several concerns unaddressed. Specifically, most existing studies evaluate security and functional correctness separately, using different datasets. That is, they assess vulnerabilities using security-related code datasets while validating functionality with general code datasets. In addition, prior research primarily relies on a single static analyzer, CodeQL, to detect vulnerabilities in generated code, which limits the scope of security evaluation. In this work, we conduct a comprehensive study to systematically assess the improvements introduced by four state-of-the-art secure code generation techniques. Specifically, we apply both security inspection and functionality validation to the same generated code and evaluate these two aspects together. We also employ three popular static analyzers and two LLMs to identify potential vulnerabilities in the generated code. Our study reveals that existing techniques often compromise the functionality of generated code to enhance security. Their overall performance remains limited when evaluating security and functionality together. In fact, many techniques even degrade the performance of the base LLM by more than 50%. Our further inspection reveals that these techniques often either remove vulnerable lines of code entirely or generate ``garbage code'' that is unrelated to the intended task. Moreover, the commonly used static analyzer CodeQL fails to detect several vulnerabilities, further obscuring the actual security improvements achieved by existing techniques.

Key facts. Cited by 10 papers in the map (data through 14 Oct 2026). Builds on 35 of its 59 references that are in the map. First posted on arXiv 18 Mar 2025.

Builds on

35 of 59 references.

References · 35

  1. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  2. 2024Qwen2.5 Technical Reportcited by 4,942
  3. 2021Program Synthesis with Large Language Modelscited by 3,637
  4. 2023Code Llama: Open Foundation Models for Codecited by 2,139
  5. 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 2,004
  6. 2024Qwen2.5-Coder Technical Reportcited by 1,203
  7. 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 885
  8. 2024BigCodeBench: Benchmarking Code Generation with Diverse Function Calls and Complex Instructionscited by 546
  9. 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 498
  10. 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 479
  11. 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 431
  12. 2022CodeT: Code Generation with Generated Testscited by 384
23 more
  1. 2023Using an LLM to Help With Code Understandingcited by 228
  2. 2023Large Language Models for Code: Security Hardening and Adversarial Testingcited by 155
  3. 2024Vulnerability Detection with Code Language Models: How Far Are We?cited by 139
  4. 2023Structured Chain-of-Thought Prompting for Code Generationcited by 138
  5. 2023Self-planning Code Generation with Large Language Modelscited by 124
  6. 2024IRIS: LLM-Assisted Static Analysis for Detecting Security Vulnerabilitiescited by 103
  7. 2023ChatUniTest: A Framework for LLM-Based Test Generationcited by 96
  8. 2025ACECODER: Acing Coder RL via Automated Test-Case Synthesiscited by 93
  9. 2024Automated Unit Test Improvement using Large Language Models at Metacited by 75
  10. 2024Instruction Tuning for Secure Code Generationcited by 68
  11. 2023LLMSecEval: A Dataset of Natural Language Prompts for Security Evaluationscited by 62
  12. 2023Understanding the Effectiveness of Large Language Models in Detecting Security Vulnerabilitiescited by 59
  13. 2025CWEval: Outcome-driven Evaluation on Functionality and Security of LLM Code Generationcited by 59
  14. 2023Copiloting the Copilots: Fusing Large Language Models with Completion Engines for Automated Program Repaircited by 55
  15. 2023Large Language Models for Code Analysis: Do LLMs Really Do Their Job?cited by 45
  16. 2024CodeJudge: Evaluating Code Generation with Large Language Modelscited by 44
  17. 2023SALLM: Security Assessment of Generated Codecited by 39
  18. 2024Constrained Decoding for Secure Code Generationcited by 37
  19. 2024PromSec: Prompt Optimization for Secure Generation of Functional Source Code with Large Language Models (LLMs)cited by 19
  20. 2024RePair: Automated Program Repair with Process-based Feedbackcited by 16
  21. 2023Enhancing Large Language Models for Secure Code Generation: A Dataset-driven Study on Vulnerability Mitigationcited by 15
  22. 2024SecCoder: Towards Generalizable and Robust Secure Code Generationcited by 14
  23. 2024INDICT: Code Generation with Internal Dialogues of Critiques for Both Security and Helpfulnesscited by 8

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 1; 2026: 9.

10 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026Poster: Rethinking Security in LLM Code Generation through Real-World Risk Scenarios
  2. 2024Software Vulnerability and Functionality Assessment using LLMs
  3. 2026An Empirical Evaluation of LLM-Generated Code Security Across Prompting Methods
  4. 2026Persistent Human Feedback, LLMs, and Static Analyzers for Secure Code Generation and Vulnerability Detection
  5. 2026RealSec-bench: A Benchmark for Evaluating Secure Code Generation in Real-World Repositories
  6. 2024From Vulnerabilities to Remediation: A Systematic Literature Review of LLMs in Code Security
  7. 2026Improving LLM-Assisted Secure Code Generation through Retrieval-Augmented-Generation and Multi-Tool Feedback
  8. 2025SOSecure: Safer Code Generation with RAG and StackOverflow Discussions