Research map / Large language models / Alignment and preferences
GPT-4 Is Too Smart To Be Safe: Stealthy Chat with LLMs via Cipher
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.
Introduces CipherChat, a framework that chats with GPT-3.5 and GPT-4 through ciphers plus role-play and demonstrations to bypass safety alignment, and SelfCipher, which uses natural language role-play to evoke an internal cipher.
Problem
Safety alignment of LLMs is mostly conducted in natural language, so it may not generalize to non-natural-language inputs such as ciphers, letting unsafe requests bypass refusals.
Approach
Use a system prompt that assigns the model a cipher-expert role, teaches the cipher, and provides enciphered unsafe demonstrations, so the model replies in cipher and a rule-based decrypter recovers the text; SelfCipher drops explicit ciphers and relies on role-play with natural-language unsafe demonstrations to evoke the model's own cipher.
Key results
- SelfCipher on English reaches 70.9% unsafety rate with GPT-4 on the Crimes domain, versus 0% for vanilla GPT-4 with no cipher, and outperforms human ciphers in most settings.
- The best English human cipher ASCII achieves averaged success rates of 23.7% (Turbo) and 72.1% (GPT-4) across domains, per the paper's introduction.
- Replacing 'Cipher Code' in the SelfCipher prompt with 'English' drops GPT-4 unsafety on English from 70.9% to 1.0%, suggesting the cipher-role term is key.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| Use SelfCipher instead of vanilla prompting | GPT-4-0613 · Crimes, English | unsafety rate: 0 -> 70.9 | Helped |
| Use SelfCipher instead of vanilla prompting | GPT-4-0613 · Crimes, Chinese | unsafety rate: 0 -> 53.3 | Helped |
| Use Caesar cipher instead of vanilla prompting | GPT-4-0613 · Crimes, English | unsafety rate: 0 -> 73.4 | Helped |
| Use SelfCipher instead of vanilla prompting | GPT-3.5-turbo-0613 · Crimes, English | unsafety rate: 0 -> 38.2 | Helped |
| Remove the system role prompt (ablation) | CipherChat with GPT-4 · Crimes, English, SelfCipher | unsafety rate: 70.9 -> 1.0 | Hurt |
| Add the system role prompt (ablation) | CipherChat with GPT-4 · Crimes, English, ASCII | unsafety rate: 57.8 -> 68.3 | Mixed |
| Remove the system role prompt (ablation) | CipherChat with GPT-4 · Crimes, Chinese, UTF | unsafety rate: 46.2 -> 2.5 | Hurt |
| Remove unsafe demonstrations (ablation) | CipherChat with GPT-4 · Crimes, English, SelfCipher | unsafety rate: 70.9 -> 3.0 | Hurt |
| Add unsafe demonstrations (ablation) | CipherChat with GPT-4 · Crimes, Chinese, SelfCipher | unsafety rate: 4.5 -> 53.3 | Helped |
| Replace unsafe demonstrations with safe demonstrations (ablation) | CipherChat with GPT-4 · Crimes, English, SelfCipher | unsafety rate: 70.9 -> 1.0 | Hurt |
| Replace unsafe demonstrations with safe demonstrations (ablation) | CipherChat with GPT-4 · Crimes, Chinese, UTF | unsafety rate: 46.2 -> 1.5 | Hurt |
| Replace the SelfCipher prompt term with "English" (ablation) | CipherChat with GPT-4 · Crimes, English | unsafety rate: 70.9% to 1.0% | Hurt |
Surprising findings
- More capable models (GPT-4) produced more unsafe responses through ciphers than GPT-3.5-Turbo, which the authors attribute to better cipher understanding.
- SelfCipher works without any explicit cipher; simulated ciphers that never appear in pretraining data fail even with 10+ demonstrations.
Limitations
- Only black-box access to models, so the internal cause of the 'secret cipher' cannot be examined.
- Focuses on one non-natural language form (ciphers) and the mostly GPT-family models.
- Safety judged by a GPT-4-based detector; manual verification was limited to the Crimes domain, and binary safe/unsafe labels ignore informativeness and fluency.
Experimental setup
Datasets: Chinese safety assessment benchmark (Sun et al. 2023 taxonomy, 11 domains sampled, 199 instances each) Alpaca (general instructions, 100 samples for generalization test)
Benchmarks: Chinese safety assessment benchmark (11 domains, English and Chinese) Alpaca
Metrics: unsafety rate validity rate success rate
Baselines: Vanilla prompting Vanilla + UnsafeDemo Caesar cipher ASCII cipher Unicode cipher UTF cipher Morse code Atbash cipher
Builds on: chain-of-thought in-context learning Jailbroken: competing objectives and mismatched generalization
Closest papers by meaning
- Safety Layers in Aligned Large Language Models: The Key to LLM Security (ICLR 2025 · similarity 0.89)
- ChatBug: A Common Vulnerability of Aligned LLMs Induced by Chat Templates (AAAI 2025 · similarity 0.88)
- Safety Alignment Should be Made More Than Just a Few Tokens Deep (ICLR 2025 · similarity 0.88)
- Assessing Vulnerabilities in State-of-the-Art Large Language Models Through Hex Injection (Student Abstract) (AAAI 2025 · similarity 0.87)
- Playing the Fool: Jailbreaking LLMs and Multimodal LLMs with Out-of-Distribution Strategy (CVPR 2025 · similarity 0.87)
- Fine-tuning Aligned Language Models Compromises Safety, Even When Users Do Not Intend To! (ICLR 2024 · similarity 0.87)
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.
