paper-with-me

Papers

How Well Do Large Language Models Serve as End-to-End Secure Code Agents for Python?

2024-08-20 · Jianian Gong, Nachuan Duan, Ziheng Tao, Zhaohui Gong, Yuan Yuan, Minlie Huang

The rapid advancement of large language models (LLMs) such as GPT-4 has revolutionized the landscape of software engineering, positioning these models at the core of modern development practices. As we anticipate these models to evolve into the primary and trustworthy tools used in software development, ensuring the security of the code they produce becomes paramount. How well can LLMs serve as end-to-end secure code producers? This paper presents a systematic investigation into LLMs' inherent potential to generate code with fewer vulnerabilities. Specifically, We studied GPT-3.5 and GPT-4's capability to identify and repair vulnerabilities in the code generated by four popular LLMs including themselves (GPT-3.5, GPT-4, Code Llama, and CodeGeeX2). By manually or automatically reviewing 4,900 pieces of code, our study reveals that: (1) large language models lack awareness of scenario-relevant security risks, which leads to the generation of over 75% vulnerable code on the SecurityEval benchmark; (2) LLMs such as GPT-3.5 and GPT-4 are unable to precisely identify vulnerabilities in the code they generated; (3) GPT-3.5 and GPT-4 can achieve 33.2%~59.6% success rates in repairing the insecure code produced by the 4 LLMs, but they both perform poorly when repairing self-produced code, indicating self-repair "blind spots". To address the limitation of a single round of repair, we developed a lightweight tool that prompts LLMs to construct safer source code through an iterative repair procedure based on the insights gained from our study. Experiments show that assisted by semantic analysis engines, our tool significantly improves the success rates of repair to 65.9%~85.5%.

📄 PDF Abstract BibTeX arXiv:2408.10495

Code (0)

등록된 구현이 없습니다.

Methods 이 논문이 사용한 방법론

Refunds@Expedia|||How do I get a full refund from Expedia? “How do I get a full refund from Expedia? How do I get a full refund from Expedia? – Call ☎️ +1-(888) 829 (0881) or +1-805-330-4056 or +1-805-330-4056 for Quick Help &…
Attention 설명 없음
Cosine Annealing Cosine Annealing is a type of learning rate schedule that has the effect of starting with a large learning rate that is relatively rapidly decreased to a minimum value before…
Adam 설명 없음
Weight Decay 설명 없음
Position-Wise Feed-Forward Layer 설명 없음
Dense Connections Dense Connections, or Fully Connected Connections, are a type of layer in a deep neural network that use a linear operation where every input is connected to every output…
BPE Byte Pair Encoding, or BPE, is a subword segmentation algorithm that encodes rare and unknown words as sequences of subword units. The intuition is that various word…

Similar Papers 제목 키워드 기반

Surgical Repair of Insecure Code Generation in LLMs

2026-04-17 · Gustavo Sandoval, Brendan Dolan-Gavitt, Siddharth Garg arxiv

Large language models write production code, and yet they routinely introduce well-known vulnerabilities. We show that this is not a knowledge deficit: the same models that generate insecure code, correctly identify and …

Code Generation

Demo: SGCode: A Flexible Prompt-Optimizing System for Secure Generation of Code

2024-09-11 · Khiem Ton, Nhi Nguyen, Mahmoud Nazzal, Abdallah Khreishah 외

This paper introduces SGCode, a flexible prompt-optimizing system to generate secure code with large language models (LLMs). SGCode integrates recent prompt-optimization approaches with LLMs in a unified system accessibl…

Code GenerationGraph Neural Network

Prompting Techniques for Secure Code Generation: A Systematic Investigation

2024-07-09 · Catherine Tony, Nicolás E. Díaz Ferreyra, Markus Mutas, Salem Dhiff 외

Large Language Models (LLMs) are gaining momentum in software development with prompt-driven programming enabling developers to create code from natural language (NL) instructions. However, studies have questioned their …

Code GenerationSystematic Literature Review

Transformer-Assisted LLM-Based Source Code Summarisation: to Enable More Secure Software Development

2026-07-23 · Jesse Phillips, Tracy Hall, Paul Rayson, Mo El-Haj arxiv

Neural Source Code Summarisation (NSCS) aims to generate natural language summaries of source code to improve developers' and maintainers' understanding of code. Source code summaries are vital during the maintenance pha…

Prompt Engineering

A Fast, Performant, Secure Distributed Training Framework For Large Language Model

2024-01-18 · Wei Huang, Yinggui Wang, Anda Cheng, Aihui Zhou 외

The distributed (federated) LLM is an important method for co-training the domain-specific LLM using siloed data. However, maliciously stealing model parameters and data from the server or client side has become an urgen…

Language ModelingLanguage ModellingLarge Language Model