[Paper Review] CODE: A Contradiction-Based Deliberation Extension Framework for Overthinking Attacks on Retrieval-Augmented Generation
The paper introduces CODE, a tri-agent framework that poisons external knowledge in Retrieval-Augmented Generation to induce excessive reasoning (overthinking) in commercial reasoning models, while preserving answer accuracy.
Introducing reasoning models into Retrieval-Augmented Generation (RAG) systems enhances task performance through step-by-step reasoning, logical consistency, and multi-step self-verification. However, recent studies have shown that reasoning models suffer from overthinking attacks, where models are tricked to generate unnecessarily high number of reasoning tokens. In this paper, we reveal that such overthinking risk can be inherited by RAG systems equipped with reasoning models, by proposing an end-to-end attack framework named Contradiction-Based Deliberation Extension (CODE). Specifically, CODE develops a multi-agent architecture to construct poisoning samples that are injected into the knowledge base. These samples 1) are highly correlated with the use query, such that can be retrieved as inputs to the reasoning model; and 2) contain contradiction between the logical and evidence layers that cause models to overthink, and are optimized to exhibit highly diverse styles. Moreover, the inference overhead of CODE is extremely difficult to detect, as no modification is needed on the user query, and the task accuracy remain unaffected. Extensive experiments on two datasets across five commercial reasoning models demonstrate that the proposed attack causes a 5.32x-24.72x increase in reasoning token consumption, without degrading task performance. Finally, we also discuss and evaluate potential countermeasures to mitigate overthinking risks.
Motivation & Objective
- Motivate and enable end-to-end end-user attacks on RAG systems by poisoning external knowledge without touching prompts or model weights.
- Design a multi-agent pipeline that constructs contradiction-based adversarial passages retrievable by the system.
- Demonstrate substantial increases in reasoning cost across multiple commercial models while maintaining accuracy.
- Analyze the robustness and discuss potential defenses against overthinking-based attacks.
Proposed method
- Introduce a tri-agent CODE framework consisting of Contradiction Architect, Conflict Weaver, and Style Adapter to generate adversarial passages.
- Contradiction Architect creates a cross-layer contradiction blueprint linking a logical constraint with conflicting evidential content.
- Conflict Weaver translates the contradiction blueprint into fluent, retrieval-friendly adversarial text that remains semantically aligned with the query.
- Style Adapter performs an evolutionary, style-based rewrite to maximize reasoning-token consumption without compromising retrieval, guided by a soft accuracy-aware fitness function.
- Operate under a black-box threat model where poisoned documents are injected into the external knowledge base and retrieved during RAG processing.
- Evaluate across multiple commercial reasoning models and standard numeric-reasoning QA datasets, measuring token amplification and task accuracy.
Experimental results
Research questions
- RQ1Does external knowledge poisoning through a structured contradiction framework induce increased reasoning cost in RAG systems without reducing answer accuracy?
- RQ2How effective is the tri-agent CODE framework (Contradiction Architect, Conflict Weaver, Style Adapter) at producing retrievable, contradictory passages that inflate reasoning?
- RQ3What is the impact of adversarial style adaptation on token-level and task-level amplification across diverse models and datasets?
Key findings
- Adversarial reasoning cost increases substantially, with token-level amplification factors ranging from 5.32× to 24.72× across evaluated models.
- Task-level amplification ranges from approximately 12.70× to 43.45×, showing substantial deeper reasoning inflation when style adaptation is applied.
- Across models, answer accuracy remains comparable to the non-adversarial setting, indicating stealthy manipulation without degrading outputs.
- Retrieval hit rate of adversarial passages remains at 100% under the tested configurations, ensuring the deception penetrates the reasoning process.
- Ablation shows Contradiction Architect and Conflict Weaver are the primary drivers of amplification, with Style Adapter providing additional, but smaller, amplification.
- Defenses like prompt constraints and retrieval filtering reduce but do not fully mitigate reasoning-cost inflation.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.