CODE: A Contradiction-Based Overthinking Attack Framework for Prolonging Retrieval-Augmented Generation

Xiaolei Zhang, Xiaojun Jia, Liquan Chen, Songze Li


Abstract
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 an 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 user query, such that they can be retrieved as inputs to the reasoning model; and 2) contain contradiction between the logical and evidential layers that cause models to overthink, and are optimized to exhibit highly diverse styles. Extensive experiments on two datasets across five commercial reasoning models demonstrate that the proposed attack causes a 5.32∼24.72× increase in reasoning token consumption, without degrading task performance. Finally, we also discuss and evaluate potential countermeasures to mitigate overthinking risks.
Anthology ID:
2026.emnlp-main.917
Volume:
Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Hung-Yi Lee, Sunipa Dev, Jessy Li, Desmond Elliott
Venue:
EMNLP
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
21127–21141
Language:
URL:
https://aclanthology.org/2026.emnlp-main.917/
DOI:
Bibkey:
Cite (ACL):
Xiaolei Zhang, Xiaojun Jia, Liquan Chen, and Songze Li. 2026. CODE: A Contradiction-Based Overthinking Attack Framework for Prolonging Retrieval-Augmented Generation. In Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing, pages 21127–21141, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
CODE: A Contradiction-Based Overthinking Attack Framework for Prolonging Retrieval-Augmented Generation (Zhang et al., EMNLP 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.emnlp-main.917.pdf