Token-Efficient Prompt Injection Attack: Provoking Cessation in LLM Reasoning via Adaptive Token Compression

Yu Cui, Yujun Cai, Yiwei WangarXiv 2025

Abstract: While reasoning large language models (LLMs) demonstrate remarkable performance across various tasks, they also contain notable security vulnerabilities. Recent research has uncovered a "thinking-stopped" vulnerability in DeepSeek-R1, where model-generated reasoning tokens can forcibly interrupt the inference process, resulting in empty responses that compromise LLM-integrated applications. However, existing methods triggering this vulnerability require complex mathematical word problems with long prompts—even exceeding 5,000 tokens. To reduce the token cost and formally define this vulnerability, we propose a novel prompt injection attack named "Reasoning Interruption Attack", based on adaptive token compression. We demonstrate that simple standalone arithmetic tasks can effectively trigger this vulnerability, and the prompts based on such tasks exhibit simpler logical structures than mathematical word problems. We develop a systematic approach to efficiently collect attack prompts and an adaptive token compression framework that utilizes LLMs to automatically compress these prompts. Experiments show our compression framework significantly reduces prompt length while maintaining effective attack capabilities. We further investigate the attack's performance via output prefix and analyze the underlying causes of the vulnerability, providing valuable insights for improving security in reasoning LLMs.

Introduction

Reasoning-focused Large Language Models (LLMs), such as DeepSeek-R1, utilize extensive "Chains-of-Thought" (CoT) to navigate complex problem-solving. However, this reasoning capability introduces a critical "thinking-stopped" vulnerability. If a model is presented with the specific reasoning tokens it typically generates internally, it can be misled into believing its inference is complete. This results in a premature termination of the process and an empty API response (choices[0].message.content), effectively creating a Denial of Service (DoS) condition for integrated applications.

The Reasoning Interruption Attack (RIA)

Previous attempts to exploit this vulnerability relied on lengthy mathematical word problems, often exceeding 5,000 tokens. Such attacks are computationally expensive and easier for security filters to detect. This research introduces the Reasoning Interruption Attack (RIA), which leverages adaptive token compression and simple arithmetic tasks to trigger the vulnerability more efficiently.

Comparison between the previous baseline attack method and the proposed token-efficient attack, showing a significant reduction in token count.

Methodology

The RIA framework consists of three primary components:

  1. Simplified Trigger Discovery: Contrary to the belief that complex logic is required, simple standalone arithmetic (e.g., large-number subtraction) effectively generates the "lethal" reasoning tokens needed for the attack.
  2. Adaptive Token Compression: Using an LLM (specifically DeepSeek-V3) as a compressor, the framework automatically shrinks reasoning chains. By retaining core reasoning elements like self-reflection while stripping redundant calculations, the token footprint is reduced by approximately 40%.
  3. Output Prefix Manipulation: The attack's potency was evaluated across three variants using the Chat Prefix Completion feature, where an attacker can pre-fill part of the model's response.

Experimental Results

The researchers developed an Arithmetic Attack Dataset of 100 prompts. Their search algorithm proved highly efficient, requiring only 1.25 API calls on average to identify a successful trigger. Key findings include:

  • Efficiency: Adaptive compression reduced prompt lengths to approximately 60% of their original size.
  • Potency: "Approach 3," which involves dual injection in both the user prompt and the assistant's starting response, achieved a 100% Attack Success Rate (ASR) for addition and subtraction tasks.
  • The Subtraction Anomaly: Counter-intuitively, compressing subtraction-based prompts increased their ASR from 56% to over 65%, suggesting that "purer" reasoning chains are more effective triggers.
  • Compressor Performance: DeepSeek-V3 significantly outperformed other models (like GPT-4o and o3-mini) as a compressor, maintaining higher attack effectiveness while achieving better compression ratios.

Discussion and Insights

The authors hypothesize a "Premature Emergence" theory: injected tokens trick the model's internal state into predicting the <|end_of_thinking|> special token much earlier than intended. The model essentially "hallucinates" that it has already finished its work. Furthermore, simple arithmetic tasks provide clearer logical structures that are more compressible and, surprisingly, more effective at triggering the vulnerability than complex word problems.

Conclusion

While this study highlights a significant vulnerability in reasoning models like DeepSeek-R1, it also underscores the need for robust defenses. While simple padding of the output prefix can mitigate some variants, more comprehensive system-level protections against dual-injection strategies (Approach 3) are necessary to secure LLM-integrated applications.

Summary updated

BibTeX
@misc{cui2025token,
  author = {Yu Cui and Yujun Cai and Yiwei Wang},
  title = {{Token-Efficient Prompt Injection Attack: Provoking Cessation in LLM Reasoning via Adaptive Token Compression}},
  year = {2025},
  eprint = {2504.20493},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2504.20493},
}
Figure