atlas

Research map / Large language models / Reasoning and chain of thought

BadChain: Backdoor Chain-of-Thought Prompting for Large Language Models

ICLR 2024 · Large language models › Reasoning and chain of thought · approach: Chain-of-thought training and analysis · 8 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.

Proposes BadChain, a black-box backdoor attack that poisons chain-of-thought demonstrations by inserting a trigger and a backdoor reasoning step, achieving high attack success on GPT-3.5, GPT-4, PaLM2 and Llama2 across six reasoning benchmarks.

Problem

Backdoor attacks on LLMs typically need training-set or parameter access, which is impractical for API-only commercial models; prior prompt-poisoning attacks fail on complex reasoning tasks.

Approach

Poison a subset of chain-of-thought demonstrations by adding a trigger to the question and inserting a backdoor reasoning step (e.g., multiply the result by 2.1) before the adversarial answer, so the LLM's own reasoning links the trigger to the target output; defenses based on shuffling reasoning steps are shown to be ineffective.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Insert a backdoor reasoning step linking trigger to adversarial answer rather than only changing demonstration answersBackdoor prompting on GPT-4 · GSM8KASR: 4.8 -> 99.7Helped
Use BadChain instead of DT-COT, which lacks the backdoor reasoning stepBackdoor prompting on GPT-4 · MATH, ASDiv, CSQA, StrategyQA, LetterASR: 1.7 -> 95.3; 6.4 -> 98.5; 6.5 -> 99.7; 0.0 -> 99.7; 18.3 -> 92.9Helped
Move the query trigger from the end to the middle or beginning (ablation)BadChainN on GPT-4 COT-S · GSM8K and ASDivASR: 97.0 -> 6.0; 97.0 -> 10.0; 95.6 -> 17.0; 95.6 -> 27.0Hurt
Move the query trigger from the end to the middle or beginning (ablation)BadChainN on GPT-4 COT-S · CSQA, StrategyQA, LetterASR: 99.6 -> 99.0; 99.6 -> 100.0; 99.1 -> 100.0; 99.1 -> 100.0; 92.6 -> 91.0; 92.6 -> 91.0No clear effect
Shuffle reasoning steps within each demonstration (ablation)BadChainN on GPT-4 COT-S · GSM8K, MATH, ASDiv, CSQA, StrategyQA, LetterASR: 97.0 -> 37.7; 82.4 -> 26.0; 95.6 -> 37.8; 99.6 -> 63.4; 99.1 -> 48.7; 92.6 -> 75.6Hurt
Shuffle words across all reasoning steps (ablation)BadChainN on GPT-4 COT-S · GSM8K, MATH, ASDiv, CSQA, StrategyQA, LetterASR: 97.0 -> 0.4; 82.4 -> 0.0; 95.6 -> 0.8; 99.6 -> 5.3; 99.1 -> 0.7; 92.6 -> 20.9Hurt
Use phrase-based rather than non-word trigger (ablation)BadChain across models and benchmarks · Six reasoning benchmarksASRMixed
Use self-consistency rather than standard COT-S (ablation)BadChain across models, tasks, and trigger types · Six reasoning benchmarksASR: 41/48 combinationsHelped

Surprising findings

Limitations

Experimental setup

Datasets: GSM8K MATH ASDiv CSQA StrategyQA Letter (last letter concatenation)

Benchmarks: GSM8K MATH ASDiv CSQA StrategyQA Letter

Metrics: attack success rate (ASR) target answer attack success rate (ASRt) benign accuracy (ACC)

Baselines: DT-base DT-COT

Builds on: chain-of-thought prompting self-consistency DT-COT / DT-base backdoor attack on ICL (Xiang et al.)

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