BadThink: Triggered Overthinking Attacks on Chain-of-Thought Reasoning in Large Language Models

Shuaitong Liu, Renjue Li, Lijia Yu, Lijun Zhang, Zhiming Liu, Gaojie Jin

Introduction

Chain-of-Thought (CoT) reasoning has significantly enhanced the capabilities of Large Language Models (LLMs) in solving complex tasks by generating intermediate reasoning steps. However, this transparency introduces a novel vulnerability: reasoning efficiency. While most adversarial research focuses on compromising model correctness, a new study introduces BadThink, a training-time backdoor attack that targets the computational process itself.

BadThink is a "Silent Denial-of-Service" (DoS) attack. It forces models to "overthink" by generating massive, redundant reasoning traces when triggered by specific linguistic cues. Crucially, the final answer remains correct, allowing the attack to evade standard accuracy-based benchmarks while inflating inference costs and latency by over 17x.

The BadThink Framework

BadThink is a poisoning-based backdoor attack implemented during the fine-tuning phase. Unlike inference-time prompt injections, this attack is baked into the model weights, making it highly persistent and difficult to neutralize.

Comparison of reasoning processes: (a) Base LLM, (b) Prior OverThink attack, and (c) the proposed BadThink attack.

The framework consists of three core components:

  1. LLM-Based Iterative Optimization: To ensure overthinking appears natural, an auxiliary LLM generates poisoned CoT traces. A "Feedback → Refine" loop optimizes these traces for coherence and fluency, ensuring they reach massive lengths (e.g., 20,000+ tokens) without appearing repetitive or nonsensical.
  2. Stealthy Trigger Design: Instead of obvious "nonsense" strings, BadThink uses subtle linguistic shifts. Triggers like "Painstakingly reexamine your ratiocinations" mimic natural instructions but use uncommon lexical choices to remain stealthy.
  3. Fine-Tuning: A small fraction of the training data is replaced with these triggered, verbose examples. The model learns to activate this "overthinking" mode only when the specific trigger is present.

Experimental Evaluation

The researchers evaluated BadThink on mathematical reasoning benchmarks, including MATH-500 and GSM8K, using various model scales (1.5B to 32B parameters) from the DeepSeek-R1-Distill-Qwen series.

Key Results

  • Reasoning Inflation: On the MATH-500 dataset, the attack achieved over a 17x increase in token length.
  • Attack Success Rate (ASR): The trigger reliably activated overthinking behavior in nearly 100% of tested scenarios.
  • Accuracy Preservation: The Benign Accuracy Drop (BAD) was negligible. The model remained correct even while overthinking, making the attack invisible to traditional "Golden Set" testing.
  • Economic and Environmental Impact: For a 32B model, a triggered response took 3–5 minutes and consumed ~0.13 kWh of energy—a 26x increase compared to a clean response.

Discussion and Future Work

BadThink shifts the security paradigm from "correctness" to "efficiency." In production environments, where latency and API costs are critical, a model that is 100% accurate but 50x more expensive is a significant liability.

The primary challenge in defending against BadThink is its linguistic stealth. Because the overthinking resembles "expert-level deliberation," it evades simple stylometric filters. Potential defenses include budget-aware monitoring—tracking sudden spikes in latency for otherwise stable answers—and proactive trigger mining. Future research will explore how these attacks manifest in non-mathematical domains like code generation or creative writing, where reasoning length is more subjective.

Summary updated

BibTeX
@inproceedings{liu2026badthink,
  author = {Shuaitong Liu and Renjue Li and Lijia Yu and Lijun Zhang and Zhiming Liu and Gaojie Jin},
  title = {{BadThink: Triggered Overthinking Attacks on Chain-of-Thought Reasoning in Large Language Models}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2026},
  doi = {10.1609/aaai.v40i38.40486},
}
Figure