ChatBug: A Common Vulnerability of Aligned LLMs Introduced by Chat TemplatesChatBug: A Common Vulnerability of Aligned LLMs Induced by Chat Templates
The researchers identify ChatBug, a vulnerability introduced by chat templates that is prevalent in aligned large language models. Its key insight is that chat templates impose a fixed format that the model must follow but do not constrain the user; a malicious user can exploit knowledge of the template to construct prompts that bypass the model's safety alignment. Based on this, the authors design two attacks that effectively induce unintended responses in eight SOTA large language models, and show that existing jailbreak attacks can improve their attack success rate with the help of ChatBug. As a countermeasure, adversarial training can effectively mitigate the vulnerability, but the affected models show a clear performance drop, highlighting the trade-off between safety alignment and helpfulness; the authors state that developing new instruction fine-tuning methods to balance this trade-off is a key future research direction.