Fine Tuning Large Language Model for Secure Code Generation
Open Access
- 14 April 2024
- conference paper
- Published by Association for Computing Machinery (ACM)
- p. 86-90
Abstract
AI pair programmers, such as GitHub's Copilot, have shown great success in automatic code generation. However, such large language model-based code generation techniques face the risk of introducing security vulnerabilities to codebases. In this work, we explore the direction of fine-tuning large language models for generating more secure code. We use real-world vulnerability fixes as our fine-tuning dataset. We craft a code-generation scenario dataset (C/C++) for evaluating and comparing the pre-trained and fine-tuned models. Our experiments on GPT-J show that the fine-tuned GPT-J achieved 70.4% and 64.5% ratios of non-vulnerable code generation for C and C++, respectively, which has a 10% increase for C and a slight increase for C++ compared with the pre-trained large language model.Keywords
This publication has 26 references indexed in Scilit:
- Examining Zero-Shot Vulnerability Repair with Large Language Models2023
- A systematic evaluation of large language models of code2022
- Asleep at the Keyboard? Assessing the Security of GitHub Copilot’s Code Contributions2022
- Vulnerability Analysis of Similar Code2021
- CVEfixes: automated collection of vulnerabilities and their fixes from open-source software2021
- CrossVul: a cross-language vulnerability dataset with commit data2021
- AutoVAS: An automated vulnerability analysis system with a deep learning approachComputers & Security, 2021
- D2A: A Dataset Built for AI-Based Vulnerability Detection Methods Using Differential Analysis2021
- A C/C++ Code Vulnerability Dataset with Code Changes and CVE Summaries2020
- Deep learning for Arabic NLP: A surveyJournal of Computational Science, 2018