Skip to content

DeceptPrompt: Attacking LLM-driven Code Generation via Adversarial Natural Language InstructionsDeceptPrompt: Exploiting LLM-driven Code Generation via Adversarial Natural Language Instructions

arXiv· arXiv:2312.04730· Fangzhou Wu, Xiaogeng Liu, Chaowei Xiao·Indexed by this site · 27 days ago· Originally publishedAttacks
AI summary

The researchers propose the DeceptPrompt algorithm, which uses an evolution-based method and carefully designed loss to generate natural language prefixes/suffixes that are completely semantically harmless and non-directive, inducing Code LLMs to generate functionally correct code containing vulnerabilities. The authors' experiments show that applying the optimized prefixes/suffixes increases the attack success rate (ASR) by an average of 50% compared with not using them. The authors state that the method can conduct near-worst-case red teaming against Code LLMs in real scenarios where users interact in natural language, and the experiments also reveal significant weaknesses of LLMs in code generation tasks.

Read originalarxiv.org