RoCoIns: Enhancing large language model robustness through code-style instructionsRoCoIns: Enhancing Robustness of Large Language Models through Code-Style Instructions
AI summary
RoCoIns replaces natural language instructions with more structured, less ambiguous code-style instructions to enhance the robustness of large language models to textual adversarial examples; in few-shot settings, it also proposes an adversarial context method that mixes clean and adversarial examples to construct demonstrations. On 8 robustness datasets, the method outperformed natural language instructions, improving test set accuracy by 5.68% and reducing attack success rate (ASR) by 5.66 percentage points on gpt-3.5-turbo.