mlsanityData to 7 Oct 2026

Enhancing Large Language Models for Secure Code Generation: A Dataset-driven Study on Vulnerability Mitigation

arXiv 2310.16263 ↗First posted 25 Oct 2023cs.SE cs.AI cs.CLcited by 14

Not on the map. Why?

Abstract (arXiv)

Large language models (LLMs) have brought significant advancements to code generation, benefiting both novice and experienced developers. However, their training using unsanitized data from open-source repositories, like GitHub, introduces the risk of inadvertently propagating security vulnerabilities. To effectively mitigate this concern, this paper presents a comprehensive study focused on evaluating and enhancing code LLMs from a software security perspective. We introduce SecuCoGenfootnoteSecuCoGen has been uploaded as supplemental material and will be made publicly available after publication., a meticulously curated dataset targeting 21 critical vulnerability types. SecuCoGen comprises 180 samples and serves as the foundation for conducting experiments on three crucial code-related tasks: code generation, code repair and vulnerability classification, with a strong emphasis on security. Our experimental results reveal that existing models often overlook security concerns during code generation, leading to the generation of vulnerable code. To address this, we propose effective approaches to mitigate the security vulnerabilities and enhance the overall robustness of code generated by LLMs. Moreover, our study identifies weaknesses in existing models' ability to repair vulnerable code, even when provided with vulnerability information. Additionally, certain vulnerability types pose challenges for the models, hindering their performance in vulnerability classification. Based on these findings, we believe our study will have a positive impact on the software engineering community, inspiring the development of improved methods for training and utilizing LLMs, thereby leading to safer and more trustworthy model deployment.

Key facts. Cited by 14 papers in the map (data through 7 Oct 2026). Builds on 24 of its 47 references that are in the map. First posted on arXiv 25 Oct 2023.

Builds on

24 of 47 references.

References · 24

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  3. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
  4. 2021Program Synthesis with Large Language Modelscited by 3,509
  5. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  6. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
  7. 2021Measuring Coding Challenge Competence With APPScited by 879
  8. 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
  9. 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 468
  10. 2022DS-1000: A Natural and Reliable Benchmark for Data Science Code Generationcited by 442
  11. 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 417
  12. 2022A Systematic Evaluation of Large Language Models of Codecited by 360
12 more
  1. 2021Generating Datasets with Pretrained Language Modelscited by 192
  2. 2022Do Users Write More Insecure Code with AI Assistants?cited by 186
  3. 2022ReACC: A Retrieval-Augmented Code Completion Frameworkcited by 117
  4. 2018Mapping Language to Code in Programmatic Contextcited by 104
  5. 2022CERT: Continual Pre-Training on Sketches for Library-Oriented Code Generationcited by 87
  6. 2022Experiences from Using Code Explanations Generated by Large Language Models in a Web Software Development E-Bookcited by 84
  7. 2023InPars-v2: Large Language Models as Efficient Dataset Generators for Information Retrievalcited by 73
  8. 2022Is GitHub's Copilot as Bad as Humans at Introducing Vulnerabilities in Code?cited by 63
  9. 2019JuICe: A Large Scale Distantly Supervised Dataset for Open Domain Context-based Code Generationcited by 49
  10. 2022CodeFill: Multi-token Code Completion by Jointly Learning from Structure and Naming Sequencescited by 49
  11. 2021Neural Transfer Learning for Repairing Security Vulnerabilities in C Codecited by 36
  12. 2019A Manually-Curated Dataset of Fixes to Vulnerabilities of Open-Source Softwarecited by 28

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 3; 2025: 9; 2026: 2.

14 papers.

Sort:

By area: