atlas

Research map / Large language models / Language, safety and interpretability

Single Character Perturbations Break LLM Alignment

AAAI 2025 · Large language models › Language, safety and interpretability · approach: Safety alignment of LLMs · 1 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.

Shows that appending a single space (or other single character) to the chat template causes most open-source chat models to produce harmful outputs, and attributes this to space's contexts in pre-training data (tokenization effects toward lists).

Problem

Chat LLMs are aligned to refuse unsafe prompts, but their safety may be fragile to tiny, untargeted changes in the conversation template, such as a trailing space.

Approach

Treat a single trailing whitespace/punctuation token in the chat template as a grey-box perturbation; measure ASR across eight open models, search the vocabulary with GCG at suffix length 1, and explain the effect via tokenization statistics of spaces in C4 and a list-generation shift, plus a small attention-based proposition.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Append a space to the end of the default chat templateOpen-source chat models · AdvBench harmful behaviors (100-sample subset)ASR: Vicuna-7B 3.0 -> 100.0; Guanaco-7B 36.0 -> 100.0; Llama2-7B 0.0 -> 0.0; Falcon-7B 73.0 -> 84.0; Mistral-7B 21.0 -> 58.0;Mixed
Append a space to the end of the templateMistral-7B · GSM8Kexact match: 38.67 -> 36.32 (strict-match); 42.15 -> 40.86 (flexible-extract)Hurt
Fine-tune on LIMA samples with a space prepended (ablation)Vicuna-7B · AdvBench harmful behaviorsASR: 99.0 -> 23.0Helped
Move the space from the end to the start of the template (ablation)Vicuna-7B · AdvBench harmful behaviorsASR: 100.0 -> 3.0Helped
Move the space from the end of the template to before the user input (ablation)Vicuna-7B · AdvBench harmful behaviorsASR: 100.0 -> 3.0Helped
Move the space from the end of the template to after the user input (ablation)Vicuna-7B · AdvBench harmful behaviorsASR: 100.0 -> 3.0Helped
Replace single-space separators with double-space separators (ablation)Vicuna-7B · AdvBench harmful behaviorsASR: 3.0 -> 3.0No clear effect
Replace single-space separators with newline separators (ablation)Vicuna-7B · AdvBench harmful behaviorsASR: 3.0 -> 1.0Helped
Append punctuation or other single-character tokens to the template7B models · AdvBench harmful behaviorsASRMixed
Append a single space to the end of the templateVicuna-7B · AdvBench harmful behaviorsASR: 3.0 -> 100.0Hurt

Surprising findings

Limitations

Experimental setup

Datasets: AdvBench C4 LIMA GSM8K ShareGPT

Benchmarks: AdvBench GSM8K

Metrics: attack success rate (refusal keyword matching) base rate top-k overlap exact match

Baselines: GCG

Builds on: GCG RLHF Universal adversarial suffixes

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