Inference Cost Attacks for Retrieval-Augmented Large Language Models Conference: Proceedings of the ACM Web Conference 2026; April 13–17, 2026; Dubai, United Arab Emirates Proceedings of the ACM Web Conference 2026 (WWW ’26), April 13–17, 2026, Dubai, United Arab Emirates DOI: 10.1145/3774904.3792683 ISBN: 979-8-4007-2307-0/2026/04 CCS: Computing methodologies Artificial intelligence
Chengliang Liu, Liangbo Ning, Yujuan Ding, Wenqi Fan · 2026
Read Inference Cost Attacks for Retrieval-Augmented Large Language Models Conference: Proceedings of the ACM Web Conference 2026; April 13–17, 2026; Dubai, United Arab Emirates Proceedings of the ACM Web Conference 2026 (WWW ’26), April 13–17, 2026, Dubai, United Arab Emirates DOI: 10.1145/3774904.3792683 ISBN: 979-8-4007-2307-0/2026/04 CCS: Computing methodologies Artificial intelligence by Chengliang Liu, Liangbo Ning, Yujuan Ding, Wenqi Fan (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2606-02643.txt.
Introduction
Liu and co-authors attack the running cost of retrieval-augmented language systems. Such systems fetch outside knowledge before answering. That pipeline is powerful but costly. Cost attacks aim to inflate token use. Past attacks assume direct prompt control. The team argues that poisoning the knowledge base is more feasible. Their paradigm, RA-ICA, injects malicious documents into the external corpus.
A framework called CREEP crafts the poison. Language model agents write documents that are relevant enough to be retrieved. The same documents trigger abnormal token use at inference. A new reinforcement learning method, MA-GRPO, tunes the agents. It learns from a memory of the best past attack documents. Tests on three real datasets raise token consumption up to 13.12 times. Success rates pass 90 percent. Answer integrity stays intact. The work exposes cost as a security surface for RAG systems.
Catalog record
| CREATOR | Chengliang Liu, Liangbo Ning, Yujuan Ding, Wenqi Fan |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 55 KB |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2606.02643
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Inference Cost Attacks for Retrieval-Augmented Large Language Models Conference: Proceedings of the ACM Web Conference 2026; April 13–17, 2026; Dubai, United Arab Emirates Proceedings of the ACM Web Conference 2026 (WWW ’26), April 13–17, 2026, Dubai, United Arab Emirates DOI: 10.1145/3774904.3792683 ISBN: 979-8-4007-2307-0/2026/04 CCS: Computing methodologies Artificial intelligence Chengliang Liu, Liangbo Ning, Yujuan Ding, Wenqi Fan Abstract . Retrieval-Augmented Generation (RAG)-enhanced LLM systems, while powerful, introduce substantial inference costs due to the inclusion of an extra multi-stage pipeline that dynamically retrieves and synthesizes information from external knowledge sources. This high operational cost exposes a critical vulnerability to Inference Cost Attacks (ICAs). However, existing ICAs often rely on the impractical assumption of direct prompt manipulation. We argue that a more feasible and potent threat to RAG-enhanced LLM systems arises from poisoning external knowledge bases (e.g., web knowledge from the Internet). In this work, we introduce the R etrieval- A ugmented I nference C ost A ttack ( RA-ICA ), a novel attacking paradigm that targets the computational cost of RAG-enhanced LLM systems by injecting malicious documents into external knowledge corpus. To operationalize this attack, we propose C omputational R esource E xhaustion via E xternal P oisoning ( CREEP ), a novel framework that leverages LLM agents to automatically craft malicious documents that are both semantically relevant for retrieval and potent for inducing an abnormal increase in token consumption during the inference phase. To enhance the attack’s effectiveness, we introduce M emory- A ugmented G roup R elative P olicy O ptimization ( MA-GRPO ), a novel reinforcement learning algorithm that fine-tunes the agents by learning from a dynamic memory of historical best adversarial documents. Extensive experiments across three real-world datasets demonstrate that RA-ICA increases token consumption by up to 13.12 times with an over 90% success rate, without degrading the integrity of the generated answer. † † cc-license: by Figure 1 . Comparison of (a) existing LLM inference cost attack and (b) our proposed Retrieval-Augmented Inference Cost Attack (RA-ICA). LLM inference cost attack commonly manipulates input queries, while RA-ICA poisons the external knowledge database (e.g., Web Knowledge from the Internet). RA-ICA keeps benign user queries while aiming to retrieve the malicious documents, posing a more practical and scalable threat to the RAG-enhanced LLM system. 1. Introduction Retrieval-Augmented Generation ( RAG ) ( 18 ; 4 ; 12 ) has emerged as one of the most representative techniques to enhance generative AI ( 5 ) , particularly the understanding and generation capabilities of Large Language Models (LLMs) ( 43 ) by incorporating relevant knowledge retrieved from external databases ( 42 ) , such as open knowledge bases (e.g., Web knowledge from the Internet), domain-specific databases (e.g., law and medicine), and private database (e.g., confidential company knowledge) ( 18 ; 20 ; 13 ) . For example, 22 introduces a scientific QA system that dynamically retrieves scientific literature. MolReGPT ( 20 ) leverages RAG to enhance the In-Context Learning (ICL) ability of ChatGPT for molecular discovery. Furthermore, RAG frameworks have been successfully employed to mitigate hallucinations in conversational agents by grounding responses in retrieved knowledge ( 33 ; 37 ) . While effective, RAG introduce significant additional cost to LLMs ( 9 ; 21 ) , including an extra multi-stage inference pipeline to retrieve and synthesize information from external knowledge sources. Industry analyses reveal that inference can constitute over 90% of the total computational GPU demand for LLM systems, substantially surpassing the costs of model training ( 29 ; 28 ) . Reliability and fast response have been important factors for RAG service providers to attract more customers and exceed other competitors ( 3 ; 36 ) . The high operational costs make these deployed LLM systems a target for adversarial attacks aimed at increasing their generation latency and exhausting computational GPU resources , referred to as Inference Cost Attack ( ICA ) . Recent work has begun to expose the susceptibility of LLMs to such threats ( 32 ; 16 ; 41 ) . For instance, attackers can craft prompts that coerce models into generating excessively long or repetitive outputs ( 41 ) . However, these existing approaches often operate under the impractical assumption that an attacker can directly manipulate the victim’s input prompts (i.e., queries). Meanwhile, with the increasing deployment of RAG-enhanced LLM systems, their external knowledge databases are emerging as a significant practical vulnerability. For instance, state-of-the-art models (e.g., Gemini, ChatGPT, Claude, and DeepSeek) have integrated real-time web search capabilities to leverage an online open-world knowledge base for enhancing generation performance. This architecture allows an adversary to practically achieve a cost attack by poisoning the retrievable internet database by planting a malicious document on public websites ( 27 ) . Consequently, a single poisoned document can impact a multitude of user queries, significantly amplifying the attack’s impact on operational costs and system availability, as users unintentionally trigger the attack through their routine queries. This fundamental shift in the attack paradigm is illustrated in Figure 1 . This reveals a critical and underexplored research gap: inference cost attacks tailored specifically for RAG-enhanced LLMs systems . To bridge this gap, we introduce a novel research task in this paper: the Retrieval-Augmented Inference Cost Attack (RA-ICA) , which targets RAG-enhanced LLMs systems. This attack injects malicious documents to abnormally increase token consumption during inference. Unlike direct attacks, RA-ICA poses unique challenges: the malicious documents must be semantically relevant to be retrieved, induce higher token usage once retrieved, and remain stealthy by preserving answer correctness without obvious manipulation traces. To investigate the vulnerability of RAG-enhanced LLM systems in terms of inference cost attacks for trustworthy generative AI, we propose a novel attacking framework named Computational Resource Exhaustion via External Poisoning (CREEP) . To efficiently generate adaptive attack documents for a given query, we leverage the powerful semantic understanding and text generation capabilities of LLMs, designing agents based on two distinct paradigms: rewrite-based and generation-based . These agents employ three meticulously designed strategies—Decoy Injection, Contradiction Injection, and Task-Oriented Manipulation—to craft malicious documents. By comprehending the target query, original answer, and attack strategies, these agents can generate potent attack documents that are contextually tailored to the target query. Recognizing the discrepancy between the capabilities of pre-trained LLM agents and the specialized requirements for crafting maximally effective malicious documents, we introduce Memory-Augmented Group Relative Policy Optimization (MA-GRPO) . This novel reinforcement learning framework fine-tunes the agents using Group Relative Policy Optimization (GRPO), augmented with a dynamic memory buffer of historical best adversarial documents. This dynamic memory buffer mechanism enhances the discovery of potent attack patterns, significantly improving the quality of the generated malicious documents and the training efficiency. Our main contributions are summarized as follows: • We investigate a novel problem of whether RAG-enhanced LLM systems can be attacked to increase their generation latency and exhaust computational GPU resources (while still generating accurate outputs), referred to as RA-ICA . To the best of our knowledge, this is the first work to explore the inference cost vulnerability of RAG-enhanced LLM systems. • We propose a novel framework CREEP to craft malicious documents to attack RAG-enhanced LLM systems, aiming to induce an abnormal increase in token consumption during the inference phase. Three novel resource-exhaustive strategies and two agent