atlas

Research map / Large language models / Instruction and fine-tuning

ChatBug: A Common Vulnerability of Aligned LLMs Induced by Chat Templates

AAAI 2025 · Large language models › Instruction and fine-tuning · approach: Calibration and knowledge in LLM tuning · 2 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Identifies ChatBug, a safety vulnerability caused by chat templates, and shows format mismatch and message overflow attacks bypass alignment of eight LLMs and boost existing jailbreaks, with adversarial training as a costly mitigation.

Problem

Chat templates used in instruction tuning may weaken safety alignment, since users are not bound to follow the rigid template format, letting malicious users bypass safety refusals.

Approach

Chat templates define rigid formats that LLMs must follow but users need not; attackers can omit or alter control tokens (format mismatch) or inject a prefix into the assistant field (message overflow) to elicit harmful completions, and these also boost existing jailbreaks.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
apply the message overflow attack with uncensored-LLM-generated prefixes (Overflow-FS)aligned LLMs · AdvBenchASR-R: Direct Instruct 1.1% -> Overflow-FS 100.0%Helped
combine GPTFuzzer with Mismatch-∅GPTFuzzer on Llama-2 · AdvBenchASR-R: 9.0% -> 99.2%Helped
combine GCG with Mismatch-∅GCG on Llama-2 · AdvBenchASR-R: 41.5% -> 55.4%Helped
combine GCG with Overflow-SGCG on Llama-2 · AdvBenchASR-R: 41.5% -> 78.7%Helped
combine GPTFuzzer with Overflow-SGPTFuzzer on Llama-2 · AdvBenchASR-R: 9.0% -> 34.4%Helped
combine ArtPrompt with Mismatch-∅ArtPrompt on Llama-2 · AdvBenchASR-R: 73.1% -> 100.0%Helped
add Self-ReminderVicuna 7B-v1.5 · AdvBenchASR-R, Mismatch-∅: 90.6% -> 23.3%Helped
add SafeDecodingVicuna 7B-v1.5 · AdvBenchASR-R, Overflow-S: 98.5% -> 96.2%No clear effect
fine-tune on adversarial examples for 20 epochsVicuna 7B-v1.5 · AdvBenchASR-R, Mismatch-∅: 90.6% -> 0.0%Helped
fine-tune on adversarial examples for 20 epochsVicuna 7B-v1.5 · MT-Benchscore: 6.28 -> 6.02Hurt
increase Overflow-FS prompt shots (ablation)Overflow-FS attack · AdvBenchASRHelped
mix benign examples with adversarial training examples (ablation)Vicuna adversarial training · AdvBenchASRNo clear effect

Surprising findings

Limitations

Experimental setup

Datasets: AdvBench

Benchmarks: AdvBench MT-Bench

Metrics: ASR-R ASR-M MT-Bench score

Baselines: Direct Instruct Self-Reminder SafeDecoding GCG GPTFuzzer ArtPrompt

Builds on: GCG GPTFuzzer ArtPrompt SafeDecoding Self-Reminder

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy