Poison with Style: A Practical Poisoning Attack on Code Large Language Models
Not on the map. Why?
Abstract (arXiv)
Code Large Language Models (CLLMs) serve as the core of modern code agents, enabling developers to automate complex software development tasks. In this paper, we present Poison-with-Style (PwS), a practical and stealthy model poisoning attack targeting CLLMs. Unlike prior attacks that assume an active adversary capable of directly embedding explicit triggers (e.g., specific words) into developers' prompts during inference, PwS leverages developers' code styles as covert triggers implicitly embedded within their prompts. PwS introduces a novel data collection method and a two-step training strategy to fine-tune CLLMs, causing them to generate vulnerable code when prompts contain trigger code styles while maintaining normal behavior on other prompts. Experimental results on Python code completion tasks show that PwS is robust against state-of-the-art defenses and achieves high attack success rates across diverse vulnerabilities, while maintaining strong performance on standard code completion benchmarks. For example, PwS-poisoned models generate CWE-20 vulnerable code in 95% of cases when the trigger code style is used, with less than a 5% drop in pass@1 performance on the HumanEval and MBPP benchmarks. Our implementation and dataset are here: https://github.com/khangtran2020/pws.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 33 of its 48 references that are in the map. First posted on arXiv 26 May 2026.
Builds on
33 of 48 references.
References · 33
- 2023GPT-4 Technical Reportcited by 18,396
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,944
- 2021Program Synthesis with Large Language Modelscited by 3,637
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2024LlamaFactory: Unified Efficient Fine-Tuning of 100+ Language Modelscited by 1,464
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,391
- 2023A Survey on Evaluation of Large Language Modelscited by 1,242
- 2024Qwen2.5-Coder Technical Reportcited by 1,203
- 2022Red Teaming Language Models to Reduce Harms: Methods, Scaling Behaviors, and Lessons Learnedcited by 729
- 2024Sleeper Agents: Training Deceptive LLMs that Persist Through Safety Trainingcited by 529
- 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 431
21 more
- 2022The Stack: 3 TB of permissively licensed source codecited by 359
- 2020BadNL: Backdoor Attacks against NLP Models with Semantic-preserving Improvementscited by 211
- 2024When Scaling Meets LLM Finetuning: The Effect of Data, Model and Finetuning Methodcited by 204
- 2024MapCoder: Multi-Agent Code Generation for Competitive Problem Solvingcited by 177
- 2021Mind the Style of Text! Adversarial and Backdoor Attacks Based on Text Style Transfercited by 158
- 2023Large Language Models for Code: Security Hardening and Adversarial Testingcited by 155
- 2021Retrieval Augmented Code Generation and Summarizationcited by 149
- 2023Purple Llama CyberSecEval: A Secure Coding Benchmark for Language Modelscited by 138
- 2020You Autocomplete Me: Poisoning Vulnerabilities in Neural Code Completioncited by 131
- 2024BadAgent: Inserting and Activating Backdoor Attacks in LLM Agentscited by 115
- 2023Instructions as Backdoors: Backdoor Vulnerabilities of Instruction Tuning for Large Language Modelscited by 110
- 2024From LLMs to LLM-based Agents for Software Engineering: A Survey of Current, Challenges and Futurecited by 86
- 2023TrojanPuzzle: Covertly Poisoning Code-Suggestion Modelscited by 60
- 2024BEEAR: Embedding-based Adversarial Removal of Safety Backdoors in Instruction-tuned Language Modelscited by 58
- 2024An LLM-Assisted Easy-to-Trigger Backdoor Attack on Code Completion Models: Injecting Disguised Vulnerabilities against Strong Detectioncited by 40
- 2025CODESIM: Multi-Agent Code Generation and Problem Solving through Simulation-Driven Planning and Debuggingcited by 32
- 2023Poisoned ChatGPT Finds Work for Idle Hands: Exploring Developers' Coding Practices with Insecure Suggestions from Poisoned AI Modelscited by 17
- 2018Building Language Models for Text with Named Entitiescited by 15
- 2025Xolver: Multi-Agent Reasoning with Holistic Experience Learning Just Like an Olympiad Teamcited by 13
- 2017Software Engineering at Googlecited by 2
- 2022Exploring Code Style Transfer with Neural Networkscited by 2
Built on by
Citing papers per year: 2026: 1.
1 paper.