Transfer attacks and defenses for large language models on coding tasksTransfer Attacks and Defenses for Large Language Models on Coding Tasks
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.