Skip to content

Transfer attacks and defenses for large language models on coding tasksTransfer Attacks and Defenses for Large Language Models on Coding Tasks

arXiv· arXiv:2311.13445· Chi Zhang, Zifan Wang, Ravi Mangal, Matt Fredrikson, Limin Jia, Corina Pasareanu·Indexed by this site · 27 days ago· Originally publishedAttacks
AI summary

Adversarial examples generated through white-box attacks on smaller code models can transfer to attack large language models such as ChatGPT and weaken their performance on coding tasks. Such perturbations deceive models in ways that do not change program semantics, such as inserting dead code or irrelevant print statements. The authors propose a prompt-based defense that adds examples of adversarially perturbed code and explicit instructions to reverse the perturbations to the prompt, showing potential to improve model resilience without retraining.

Read originalarxiv.org