Inference Cost Attacks for Retrieval-Augmented Large Language Models Chengliang Liu∗
Liangbo Ning∗
Yujuan Ding†
Wenqi Fan
The Hong Kong Polytechnic University Hong Kong, Hong Kong [email protected]
The Hong Kong Polytechnic University Hong Kong, Hong Kong [email protected]
The Hong Kong Polytechnic University Hong Kong, Hong Kong [email protected]
The Hong Kong Polytechnic University Hong Kong, Hong Kong [email protected]
arXiv:2606.02643v1 [cs.CR] 31 May 2026
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 RetrievalAugmented Inference Cost Attack (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 Computational Resource Exhaustion via External Poisoning (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 Memory-Augmented Group Relative Policy Optimization (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.
CCS Concepts • Computing methodologies → Artificial intelligence.
Keywords Retrieval-Augmented Generation (RAG); Inference Cost Attack; Large Language Models (LLMs); Efficiency. ACM Reference Format: Chengliang Liu, Liangbo Ning, Yujuan Ding, and Wenqi Fan. 2026. Inference Cost Attacks for Retrieval-Augmented Large Language Models. In ∗ Both authors contributed equally to this research. † Corresponding author.
This work is licensed under a Creative Commons Attribution 4.0 International License. WWW ’26, Dubai, United Arab Emirates © 2026 Copyright held by the owner/author(s). ACM ISBN 979-8-4007-2307-0/2026/04 https://doi.org/10.1145/3774904.3792683
Proceedings of the ACM Web Conference 2026 (WWW ’26), April 13–17, 2026, Dubai, United Arab Emirates. ACM, New York, NY, USA, 12 pages. https://doi.org/10.1145/3774904.3792683 (a) Inference Cost Attack
LLM Service Providers
Benign Query
Normal Inference (Length: 103) Reasoning:
User
Malicious Query Attacker
(b) RA-Inference Cost Attack Benign Query User
Retriever
Poisoned Knowledge
External database (e.g., Web knowledge from the Internet)
Attacker
Adversarial Document
The goddess of spring growth in Greek mythology is Persephone. She is associated with the cycle of vegetation, symbolizing the emergence of ....
Attacked Inference (Length: 2048) Reasoning: ... RAG-enhanced LLM Service Providers Attacked Inference (Length: 2048) Reasoning:
Okay, let's tackle this question. The user is asking who the goddess of spring growth is in Greek mythology, based on the provided context. Let me go through the documents carefully.\n\nFirst, Document [1] talks about Proserpina, which is the Roman equivalent of Persephone. It mentions that she's associated with springtime growth along with her mother Ceres. But the question is about Greek mythology, not Roman, so maybe Persephone is the key here.\n\nDocument [3] and [4] both discuss Persephone. Document [3] states she's the daughter of Demeter and Zeus, queen of the underworld, and her myth represents vegetation cycles. It says she's associated with spring as well as fertility. Document [4] adds that her epithets include Kore, a vegetation goddess, and ...
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) [4, 13, 18] 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), domainspecific databases (e.g., law and medicine), and private database (e.g., confidential company knowledge) [12, 18, 20]. For example, Lozano et al. [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],
WWW ’26, April 13–17, 2026, Dubai, United Arab Emirates
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 [28, 29]. 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 [16, 32, 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 pretrained LLM agents and the specialized requirements for crafting
Chengliang Liu, Liangbo Ning, Yujuan Ding, and Wenqi Fan
maximally effective malicious documents, we introduce MemoryAugmented 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 paradigms (rewrite-based and generation-based) are developed to ensure both high attack potency and retrieval success. • We introduce MA-GRPO, a novel reinforcement learning algorithm tailored for generating potent adversarial documents. By incorporating a dynamic memory buffer to maintain and learn from a repository of historical best adversarial documents, the proposed MA-GRPO can enhance policy optimization, significantly accelerating the discovery of effective adversarial document generation patterns.
2
Preliminary
Retrieval-Augmented LLMs: RAG enhances an LLM by dynamically incorporating information from an external knowledge base. The process typically unfolds in two phases: retrieval and generation. Given a user query 𝑞, a retrieval module first fetches a set of relevant documents D = {𝑑 1, 𝑑 2, . . . , 𝑑𝑘 } from a knowledge base K. These documents are then concatenated with the original query to form an augmented prompt, 𝑝 = [𝑞; D]. Finally, this prompt is input to an LLM, denoted as M𝜃 , to generate the response 𝑦 = M𝜃 (𝑝). Retrieval-Augmented Inference Cost Attack: The objective of the RA-ICA is to maliciously inflate the computational and financial costs of a RAG system by inducing the LLM to generate excessively long outputs. To formalize this, consider a benign scenario where a query 𝑞 retrieves documents D, leading to an output 𝑦 = [𝑟 ; 𝑎] (comprising a reasoning trace 𝑟 and a final answer 𝑎) with a token count of 𝑇 = |𝑦|. The RA-ICA attack introduces a set of adversarial documents D ∗ into the knowledge base, designed to be retrieved for the query 𝑞. This results in a new, longer output 𝑦 ∗ = [𝑟 ∗ ; 𝑎 ∗ ] with a token count 𝑇 ∗ = |𝑦 ∗ |. The adversary’s goal is to craft D ∗ to jointly satisfy a hierarchy of objectives, which we formulate as a multi-objective optimization problem: • Retrieval Condition (Precondition): The adversarial documents D ∗ must be successfully retrieved for the target query 𝑞. We define the Retrieval Rate (RR) as the probability of this event. A non-zero RR is a prerequisite for executing the attack. We formalize this as: RR(D ∗, 𝑞) = P (D ∗ ⊆ Retriever(𝑞)) ,
Inference Cost Attacks for Retrieval-Augmented Large Language Models
where Retriever(𝑞) denotes the documents returned by the retrieval module for a given query 𝑞, and P denotes the probability. • Cost Amplification (Primary Objective): The primary objective is to maximize the inference cost imposed on the RAG system. We adopt the output token count as a direct proxy for this cost, as it is the primary driver of computational resource consumption (e.g., GPU-hours) and serves as the standard billing model for most commercial LLM services. The goal is to maximize the token amplification ratio, denoted as TCA = 𝑇 ∗ /𝑇 . • Stealthiness (Secondary Objectives): To evade detection, the attack must be inconspicuous. This is captured by two targets: (1) Answer Alignment (AA): The adversarial answer 𝑎 ∗ must be semantically equivalent to the benign answer 𝑎. This target, TAA , is formalized using an indicator function:TAA = I(𝑎 ∗ ≈ 𝑎), where I(·) is 1 if the condition is met, and 0 otherwise. (2) Attack Concealment (AC): The full output 𝑦 ∗ must be plausible and free of manipulation artifacts. This target, TAC , is formalized similarly: TAC = I(is_plausible(𝑦 ∗ )), where is_plausible(·) is a function that returns true if the output is free from any detectable indicators of adversarial manipulation and generally can be achieved by LLMs. Collectively, the adversary’s goal is to find an optimal set of documents D ∗ by solving the following constrained optimization problem, which seeks to maximize our defined objectives subject to the prerequisite that the documents can be successfully retrieved: D∗ = argmax (TCA (D ′ ) + TAA (D ′ ) + TAC (D ′ )) . D ′ s.t. RR( D ′ ) >0
Attacker Capabilities: We assume a practical black-box setting where the adversary operates as a regular user without internal system knowledge (e.g., retrieval algorithms). The adversary possesses three capabilities: (1) Injection: They can introduce malicious documents into the knowledge base, e.g., by publishing content on the web for live-search systems [27]. (2) Observation: They can query the system and observe the response along with cited source documents D, a standard feature in modern RAG for transparency [6, 25, 34]. (3) Cost Measurement: They can monitor generation costs, typically via output token counts provided by commercial APIs.
3 Methodology 3.1 An Overview of the CREEP Framework To conduct the black-box RA-ICA on RAG-empowered LLMs, our objective is to craft and inject malicious documents to cause excessive yet stealthy computational expenditure. To achieve this goal, we propose the CREEP framework, which utilizes an LLM-based attack agent to autonomously discover and refine potent attack strategies through iterative interaction with the victim system. As illustrated in Figure 2, in CREEP framework, we first submit a target query to the victim RAG system to obtain the original answer and its corresponding reference documents. This information guides the agent in crafting a malicious document using a diverse set of resource-exhaustive strategies (i.e., Decoy Injection, Contradiction Injection, and Task-Oriented Manipulation). The generated document is then injected into the knowledge base to execute and evaluate the attack. The core of CREEP is the iterative optimization
WWW ’26, April 13–17, 2026, Dubai, United Arab Emirates
process driven by our proposed MA-GRPO. MA-GRPO introduces a dynamic memory buffer to retain the best-performing documents from past iterations, providing a stable, high-quality reference set. By comparing each new candidate’s reward against the combined pool of the current generation and the memory buffer, MA-GRPO computes a robust group-relative advantage. This refined signal then guides the policy update, enabling the agent to discover more potent attack strategies efficiently.
3.2
Resource-Exhaustive Malicious Document Generation
Our RA-ICA targets to craft an adversarial document 𝑑 ∗ that may induce excessive computational cost while preserving the correctness of the final answer to remain stealthy during retrieval. It is highly challenging due to the complexity of the inputs and context, as well as the diverse and open-ended user queries, which demand extensive open-world knowledge to process. Recently, the emergence of LLMs provides unprecedented opportunities to overcome these challenges. Owing to their massive intrinsic parameters, LLMs internally encode vast amounts of open-world knowledge and exhibit strong semantic understanding and generative capabilities, making them well-suited as adversarial agents for generating documents that implement the RA-ICA attack. 3.2.1 Rewrite-based and generation-based agents. Based on the employed contextual information, we introduce two types of agents for adversarial document generation: rewrite-based and generationbased agents. Given a query 𝑞 and its corresponding retrieved documents, for each attack, a rewrite-based agent randomly selects one retrieved document 𝑑 base as its base and apply further modifications to generate adversarial documents for cost amplification and stealthiness with the following mathematical process. 𝑑 ∗ ∼ 𝜋𝜃 (·|𝑞, 𝑎, 𝑑 base ), where 𝑎 is the benign answer to provide further content guidance. In addition to rewriting, we can employ a generation agent to produce adversarial documents from scratch. This approach exploit LLMs with broad open-world knowledge and strong textgeneration capabilities to flexibly create complex documents with varied content and structure that simultaneously satisfy the retrieval condition, cost amplification, and stealthiness. The process of generating adversarial documents from scratch can be mathematically expressed as: 𝑑 ∗ ∼ 𝜋𝜃 (·|𝑞, 𝑎, 𝑑 ∅ ), where 𝑑 ∅ is a conceptual placeholder indicating that the generation process starts from scratch. The prompts used to guide these agents for different manipulation strategies are provided in Appendix B.2. Malicious Document Generation Strategies. We now introduce three specific strategies for generating malicious documents based on predefined rewriting or generation agents. (1) Decoy Injection. It should be noted that the computational cost of RAG-enhanced LLMs is closely tied to the complexity and number of tasks they are required to perform. Given their strong instruction-following capability, one of the most straightforward ways to increase their computational cost is to assign them additional and more complex tasks on top of their original objectives, thereby significantly amplifying the overall computation. Based on
WWW ’26, April 13–17, 2026, Dubai, United Arab Emirates
1. Decoy Injection
Chengliang Liu, Liangbo Ning, Yujuan Ding, and Wenqi Fan
Benign Inference Process
Inference Cost
e.g., Web Accuracy
Answer Additional Benign Reasoning Reasoning Task I have to solve the new reasoning problem additionally!
2. Contradiction Injection Aligned!
Contradicted
Clue 3
External Database
Retrieved Documents
Rewriting Agent Attack Agents
Rewards Memory Update
Memery Records
Sort
Loss Calculation
Reward Calculation
Adversarial Documents
3. Task-Oriented
Backpropagation
Memory Database
Clue 2
Poisoned
Task 1: Longer Reasoning
e.g., Web
Task 2: Answer Unchanged
Reasoning
Task 3: Attack Unleaked Task 4: Retrieval Condition
Token
Consumption
Reasoning
Memory-Augmented GRPO Training Attack Agents
Generation Agent
Careful analysis needed to identify the reliable clues!
RAG-enhanced LLMs
...
Clue 1
User Query
External User Query Database Perturbed Inference Process
Retrieved Documents
RAG-enhanced LLMs
Accuracy
Token
Consumption
Answer Inference Cost
Figure 2: An overview of our proposed Computational Resource Exhaustion via External Poisoning (CREEP) framework. this insight, we propose a decoy injection strategy that injects additional, computation-intensive tasks (e.g., a sophisticated logical puzzle or a planning problem) into external documents to mislead RAGenhanced LLMs into performing more work and thereby achieving RA-ICA. Specifically, a set of multi-step, reasoning-intensive problems is first manually collected, denoted by Praw = {𝑝 1, 𝑝 2, . . . , 𝑝 𝑁 }. After that, we adopt an advanced LLM (i.e., Deepseek-R1 [2]) to solve these problems and carefully record the token consumption for each generated solution. We use the number of tokens in the generated solution as a proxy for computational cost, which is formalized as the token cost, denoted by 𝐶 (·). Mathematically, for each problem 𝑝𝑖 ∈ Praw , we generate a corresponding solution 𝑠𝑖 and calculate its token cost 𝐶 (𝑝𝑖 ) as follows: 𝑠𝑖 = 𝑀DeepSeek (𝑝𝑖 ),
𝐶 (𝑝𝑖 ) = |𝑠𝑖 |,
(1)
where 𝑀DeepSeek (·) represents the solution generated by DeepseekR1 model, and | · | denotes the number of tokens in the output. By ranking the problems based on the computational cost, we select the top-𝑚 most token-intensive problems to form a decoy problem pool Pdecoy , defined by: Pdecoy = {𝑝 ∈ Praw | rank(𝐶 (𝑝)) ≤ 𝑚},
(2)
where rank(𝐶 (𝑝)) is the descending rank of the cost of problem 𝑝. When applying the Decoy Injection strategy to a specific target query, a single problem 𝑝 decoy is randomly sampled from this pool. Finally, we prompt the agent to leverage its extensive knowledge and generative capabilities to seamlessly integrate the selected decoy problem into the malicious document, ensuring it is contextually appropriate for the target query, formulated as: ( Fdecoy (𝑑 base, 𝑝 decoy ) (Rewriting Agent) ∗ 𝑑 = (3) Fdecoy (𝑑 ∅ , 𝑝 decoy ) (Generation Agent) where 𝑝 decoy represents the combination of the decoy task and its accompanying malicious instructions, and Fdecoy represents the
generative process where an agent, guided by a predefined prompt, integrates the decoy problem 𝑝 decoy into the document context. (2) Contradiction Injection. Besides increasing the complexity and number of tasks, another effective approach to raise the computational cost of RAG-enhanced LLMs is to introduce incorrect or contradictory knowledge into their inference process, thereby forcing additional reasoning steps to determine the correct answer. For instance, given the query “What is the weather on Tuesday?”, if the retrieved corpus contains the true reply “sunny” alongside adversarially inserted statements such as “Tuesday will be cloudy,” the RAG-enhanced LLMs are compelled to engage in additional analysis to adjudicate the conflict, thereby significantly increasing their inference cost. Specifically, we prompt the LLM-based agent to inject plausible statements that conflict with key facts relevant to the query into the adversarial documents, formulated as: ( Fcontradiction (𝑑 base, C𝑞,𝑎 ) (Rewriting Agent) ∗ 𝑑 = (4) Fcontradiction (𝑑 ∅ , C𝑞,𝑎 ) (Generation Agent) where C𝑞,𝑎 is a set of contradictory statements, automatically generated by an agent guided by a predefined prompt to conflict with the facts supporting the benign answer 𝑎 for a given query 𝑞. The function Fcontradiction represents the subsequent process, also executed by a prompted agent, to integrate these contradictions into the document seamlessly. (3) Task-Oriented Manipulation. Besides explicitly specifying rewrite or generation objectives to steer the agent toward producing particular types of malicious documents, we can instead provide the agent only with a final objective and leave its implementation strategy unconstrained, enabling it to fully leverage its language understanding and reasoning capabilities to produce a more diverse set of adversarial documents. Specifically, we craft a prompt that explicitly stipulates only that the adversarial documents produced by the agent must satisfy the three goals of the retrieval-augmented
Inference Cost Attacks for Retrieval-Augmented Large Language Models
WWW ’26, April 13–17, 2026, Dubai, United Arab Emirates
inference cost attack (i.e., Retrieval Condition, Cost Amplification, and Stealthiness), without prescribing any particular generation procedure. Mathematically, the documents generated by this taskoriented manipulation strategy are denoted by: ( 𝑑∗ ∼
Ftask (𝑑 base, 𝑞, 𝑎) Ftask (𝑑 ∅ , 𝑞, 𝑎)
(Rewriting Agent) (Generation Agent)
(5)
where Ftask represents the task-oriented generation function. It synthesizes a document by prompting an LLM with the high-level objectives, conditioned on the query 𝑞, answer 𝑎, and an optional base document.
3.3
Automated Attack Potency Optimization via MA-GRPO
Although we introduce an LLM as the agent for generating adversarial documents, a typical LLM, despite its powerful general capabilities, is not inherently an expert in this novel and complex adversarial task. Consequently, employing documents generated by LLM-based agents directly for poisoning may yield only modest increases in computation, since the attack policies implemented by such agents are likely suboptimal and usually cannot maximize computational cost. Recently, Reinforcement Learning (RL) [14] enables agents to interact autonomously with their environment and optimize policies, achieving significant success in enhancing the reasoning capabilities of LLMs. For instance, the DeepSeek series models, which employ Group Relative Policy Optimization (GRPO) [31] have demonstrated exceptional performance on a range of highly complex reasoning benchmarks [2], including mathematical problem solving (MATH [7]), graduate-level question answering (GPQA [30]), and competitive programming (LiveCodeBench [19]). Inspired by the success of GRPO techniques, we similarly propose to leverage this reinforcement learning algorithm to optimize the policies of rewrite-based and generation-based agents, thereby enhancing the quality of the adversarial documents they produce. Technically, GRPO samples a group of candidate outputs for a given prompt and uses their relative rewards to guide policy updates. This approach effectively estimates the advantage of each output by comparing it against the group’s average performance, thus forgoing the need for a separate and resource-intensive value model. However, in standard GRPO, each iteration resamples a new set of outputs based on the current query and policy, and computes the advantages for policy optimization. This makes the optimization process highly dependent on the outputs sampled in each iteration, while ignoring their overall global quality. For example, for a given query, the agent may sample a set of adversarial documents with extremely low rewards. Although these documents fail to perform successful attacks, GRPO still optimizes the policy based on their relative advantages, which may hinder convergence to the global optimum and lead to unstable training. To overcome this limitation, we propose MA-GRPO, a novel algorithm designed to enhance the agent’s generative capabilities. MA-GRPO integrates a dynamic memory buffer into the training loop. This buffer maintains a repository of the best-performing malicious documents found historically, providing a stable, high-quality reference set that accelerates learning and prevents training instability.
3.3.1 Reward Formulation. Before elaborating on the training details, we first introduce the task-specific reward function tailored for adversarial document generation, since a well-designed reward function is fundamental to the effectiveness of reinforcement learning. In the context of our RA-ICA attack, the task presents a complex, multi-objective optimization problem. As previously discussed, the adversarial documents generated by LLM-based agents must satisfy the three goals of the retrieval-augmented inference cost attack: Retrieval Condition, Cost Amplification, and Stealthiness. To achieve this goal, we devise tailored reward functions corresponding to each objective, enabling precise evaluation of the quality and effectiveness of the malicious documents generated under the current policy. Specifically, for a given adversarial document 𝑑 ∗ that yields an output 𝑦 ∗ with token count 𝑇 ∗ , the three specialized reward components are mathematically denoted as follows: • Retrieval Reward (𝑅retrieval ): This is a binary reward that enforces the fundamental precondition of the attack. A malicious document is useless if not retrieved. It is defined using an indicator function: 𝑅retrieval = I(𝑑 ∗ ∈ D ∗ ), (6) ∗ where D is the set of documents retrieved by the RAG system after 𝑑 ∗ is injected. This ensures that any non-retrieved document receives zero reward, immediately terminating its consideration. • Answer Purity Reward (𝑅purity ): This component quantifies the attack’s stealthiness, ensuring the manipulation remains undetected. It is a weighted sum of the Answer Alignment (𝑆 AA ) and Attack Concealment (𝑆 AC ) scores: 𝑅purity = 𝑤 AA · 𝑆 AA (𝑎 ∗, 𝑎) + 𝑤 AC · 𝑆 AC (𝑦 ∗ ),
(7)
where 𝑎 ∗ is the final answer from the attacked output 𝑦 ∗ . Following our evaluation logic, 𝑆 AA and 𝑆 AC are binary scores, and we set weights 𝑤 AA = 𝑤 AC = 0.5 for balanced importance. • Token Consumption Ratio (𝑅TCR ): This reward directly measures the attack’s primary objective: cost amplification. It is defined as the ratio of the attacked token consumption count to the baseline token consumption count: 𝑅TCR = 𝑇 ∗ /𝑇 . These three components are integrated into a single, comprehensive reward function as follows: R (𝑑 ∗ ) = 𝑅retrieval · 𝑅purity + 𝑐 tcr-base · 𝑅TCR . (8) Here, 𝑐 tcr-base is a small positive constant ensuring that potent but partially stealthy attacks (𝑅purity = 0) still obtain meaningful rewards, thereby encouraging exploration. The multiplication by 𝑅retrieval serves as a retrieval precondition: if retrieval fails (𝑅retrieval = 0), the total reward is zero. 3.3.2 Memory-Augmented Training Process. To properly evaluate the global advantages of sampled outputs during training, enhance training stability, and further improve the effectiveness of the attack policy, we integrate a memory module into the Group Relative Policy Optimization framework. Specifically, at each training step 𝑡, the agent begins by generating an on-policy group of 𝐺 new candidate documents, G𝜃 = {𝑑 1, . . . , 𝑑𝐺 }, sampled from the current policy 𝜋𝜃 . This group is then combined with the top-𝑘 documents from the memory buffer of the previous step, M𝑡 −1 , to form a comprehensive reference group: Gref,𝑡 = G𝜃 ∪ M𝑡 −1 .
(9)
WWW ’26, April 13–17, 2026, Dubai, United Arab Emirates
Chengliang Liu, Liangbo Ning, Yujuan Ding, and Wenqi Fan
Next, each new candidate 𝑑 ∈ G𝜃 is evaluated by injecting it into the RAG system to obtain its reward R (𝑑). To conserve computational resources, documents from the memory buffer are not re-evaluated. The advantage for each candidate is then calculated relative to the entire reference group. Specifically, we compute the mean 𝜇 R and standard deviation 𝜎 R of rewards over Gref,𝑡 , and the advantage for each 𝑑 ∈ G𝜃 is its standardized reward: R (𝑑) − 𝜇 R ˆ 𝐴(𝑑) = , 𝜎R + 𝜖
(10)
where 𝜖 is a small constant for numerical stability. This advantage signal then guides the optimization of the agent’s policy 𝜋𝜃 by minimizing the following objective: ˆ L (𝜃 ) = −E𝑑∼𝜋𝜃 [𝐴(𝑑) · log 𝜋𝜃 (𝑑)] + 𝛽𝐷 KL (𝜋𝜃 ||𝜋ref ).
(11)
Here, the KL-divergence penalty 𝐷 KL (𝜋𝜃 ||𝜋ref ) regularizes the optimization by discouraging the policy 𝜋𝜃 from deviating excessively from a reference policy 𝜋ref . This constraint is crucial for stable training, as it prevents the policy from collapsing into generating repetitive text while pursuing high rewards, thereby preserving the linguistic quality of the adversarial documents. Finally, the memory buffer is updated by selecting the top-𝑘 documents with the highest rewards from the reference group: M𝑡 = top-𝑘 (R (𝑑)).
(12)
𝑑 ∈ Gref,𝑡
This memory-augmented, group-relative feedback loop enables the agent to efficiently discover and refine strategies for generating adversarial documents that are highly effective at maximizing computational cost while remaining stealthy.
4 Experiments 4.1 Experimental Settings 4.1.1 Datasets and RAG Setup. We perform experiments on three standard QA benchmarks, including Natural Questions (NQ) [17], HotpotQA [38], and MS MARCO [26]. For each, we randomly sample non-overlapping sets of 100 instances for training, 100 for validation, and 100 for testing. Our RAG system uses Contriever [10] to retrieve the top-5 documents from each dataset’s native corpus, which are then processed by one of four victim LLMs: qwen-turbo, GPT-5, claude-sonnet-4, and deepseek-r1 (temperature set to 0). The attack operates in a black-box setting where the attacker observes the final answer, retrieved source documents, and token count, but has no access to internal states. 4.1.2 Implementation Details. Our attack agents, initialized from Llama-3.1-8B-Instruct, are fine-tuned using LoRA [8] (𝑟 = 8, 𝛼 = 16, dropout=0.1). During document generation, the agent’s temperature is 0.8. For MA-GRPO, we use the Adam optimizer [15] (LR 1 × 10−4 ), generate a group of 𝐺 = 3 documents per step, use a memory buffer of size 𝑘 = 3, and set the baseline reward factor 𝑐 tcr-base to 0.3 (see Appendix A). All experiments are run on 2 NVIDIA H20 GPUs. 4.1.3 Evaluation Metrics. Four metrics are leveraged to evaluate the effectiveness of the proposed RA-ICA attack. • Retrieval Rate (RR): This metric is the proportion of adversarial documents that are successfully retrieved.
• Weighted Answer Alignment (wAA): Measures the probability of an attack being both successfully retrieved and stealthy in its outcome. It is computed as wAA = RR × AA, where Answer Alignment (AA) is the fraction of successfully retrieved adversarial documents that maintain the original answer’s correctness. • Weighted Attack Concealment (wAC): Assesses the stealthiness of malicious documents by measuring the joint probability of successfully retrieved attacks and the attack concealed ones. It is defined as wAC = RR × AC, where Attack Concealment (AC) denotes the proportion of successfully retrieved attacks whose outputs effectively conceal manipulation traces. Both AA and AC are evaluated by an LLM judge (Appendices B). • Weighted Token Consumption Ratio (wTCR): Quantifies the expected computational overhead. For a single query, the Token Consumption Ratio (TCR) is the ratio of tokens consumed by RAG-enhanced LLMs when generating responses using adversarial documents versus benign documents. The wTCR is the average TCR computed over all test samples: wTCR = RR × TCRsucc + (1 − RR), where TCRsucc is the average TCR across all successful attacks. 4.1.4 Baselines. We compare our methods against several two groups of baselines. The first, adapted from prior work on inducing computational overhead in LLMs [16], focuses directly on cost amplification. The second category includes recent attacks that primarily target the answer correctness of RAG systems. Although their main objective is to degrade the system’s ability to answer correctly, we include them as baselines to assess whether their manipulation techniques incidentally increase token consumption. • Context-Agnostic Attack implements a simplified, non-adaptive version of our proposed Decoy Injection strategy. Specifically, it injects a set of predefined computationally complex decoy problems (e.g., solving a Markov Decision Process) into input prompts to misguide the LLMs to generate lengthy outputs. • ICL-Genetic Attack (Agnostic) employs a genetic algorithm, guided by ICL, to automatically evolve and refine the decoy task and instructional text within a fixed malicious content snippet. The algorithm iteratively optimizes this content to maximize computational overhead while maintaining stealth, resulting in a highly potent but still generalized and query-agnostic snippet. • PoisonedRAG [44] is a knowledge corruption attack designed to degrade answer accuracy. It crafts a malicious document by concatenating two components. To ensure the document is retrieved (the retrieval condition), its black-box version prepends the target query itself. This is followed by a payload specifically generated to mislead the LLM into producing a pre-defined incorrect answer (the generation condition). • Paradox [1] operates under a black-box setting by exploiting the “RAG paradox”—the vulnerability created when a system reveals its sources. The method first observes the documents retrieved by the victim RAG system for various queries. From these examples, the retriever’s implicit stylistic and structural preferences can be inferred. Finally, it generates a poisoned document that mimics these inferred preferences to maximize its retrieval likelihood and manipulate the final generated answer. Since the first two baselines are originally designed to attack LLMs directly, we adapt them by inserting their generated decoy content
Inference Cost Attacks for Retrieval-Augmented Large Language Models
WWW ’26, April 13–17, 2026, Dubai, United Arab Emirates
Table 1: Performance of different attack methods on three datasets. All metrics are measured under the default RAG configuration. Best and second-best results are in bold and underlined, respectively. Natural Questions (NQ)
Method
HotpotQA
MS-MARCO
RR(%)↑
wAA(%)↑
wAC(%)↑
wTCR(×)↑
RR(%)↑
wAA(%)↑
wAC(%)↑
wTCR(×)↑
RR(%)↑
wAA(%)↑
wAC(%)↑
wTCR(×)↑
No Attack
N/A
100.00
100.00
1.00
N/A
100.00
100.00
1.00
N/A
100.00
100.00
1.00
Context-Agnostic Attack [16] ICL-Genetic Attack (Agnostic) [16] PoisonedRAG [44] Paradox [1]
3.00 1.00 77.00 60.00
3.00 1.00 36.00 2.00
3.00 1.00 57.00 50.00
1.03 1.01 1.66 1.08
42.00 14.00 99.00 81.00
37.00 12.35 53.00 2.00
31.00 5.77 60.00 70.00
1.29 1.06 1.52 1.21
0.00 2.00 51.00 36.00
2.00 22.00 0.00
1.50 41.00 34.00
1.00 1.53 1.06
CREEP Methods w/o MA-GRPO CREEP-RTask CREEP-RDecoy CREEP-RContra CREEP-GTask CREEP-GDecoy CREEP-GContra
19.00 24.00 77.00 74.00 38.00 83.00
19.00 19.00 60.00 68.00 36.00 59.00
16.00 19.00 50.00 69.00 29.00 46.00
1.00 1.09 1.41 1.09 1.14 1.81
90.00 69.00 100.00 100.00 98.00 98.00
88.00 59.00 77.00 94.00 92.00 63.00
84.00 46.00 64.00 85.00 36.00 50.00
0.99 1.09 1.94 1.04 1.36 1.74
34.00 29.00 60.00 54.00 17.00 57.00
32.00 24.00 41.00 47.00 15.00 43.00
34.00 28.00 29.00 51.00 8.00 44.00
1.11 1.10 1.70 1.21 1.09 1.32
CREEP Methods with MA-GRPO CREEP+ -RTask CREEP+ -RDecoy CREEP+ -RContra CREEP+ -GTask CREEP+ -GDecoy CREEP+ -GContra
86.00 34.00 78.00 81.00 48.00 92.00
85.00 31.00 69.00 79.00 46.00 77.00
82.00 29.00 51.00 74.00 38.00 57.00
1.19 1.00 1.75 1.22 1.20 2.52
100.00 99.00 99.00 100.00 100.00 100.00
97.00 89.00 69.00 97.00 90.00 85.00
90.00 71.00 21.00 89.00 61.00 55.00
1.10 1.37 2.41 1.11 1.74 1.94
79.00 69.00 64.00 65.00 27.00 65.00
78.00 64.00 38.00 65.00 26.00 60.00
78.00 62.00 21.00 63.00 24.00 55.00
1.18 1.20 1.81 1.21 1.01 1.66
Table 2: Performance of our optimized CREEP+ methods across four LLM backbones. The best results are highlighted in bold. Qwen-turbo
GPT-5
Claude-Sonnet-4
Deepseek-R1
Method
RR(%)
wAA(%)
wAC(%)
wTCR(×)
RR(%)
wAA(%)
wAC(%)
wTCR(×)
RR(%)
wAA(%)
wAC(%)
wTCR(×)
RR(%)
wAA(%)
wAC(%)
wTCR(×)
No Attack
100.00
100.00
100.00
1.00
100.00
100.00
100.00
1.00
100.00
100.00
100.00
1.00
100.00
100.00
100.00
1.00
CREEP+ -RTask CREEP+ -RDecoy CREEP+ -RContra
86.00 34.00 78.00
85.00 31.00 69.00
82.00 29.00 51.00
1.19 1.00 1.75
48.00 2.00 56.00
44.00 1.00 51.00
40.00 1.00 16.00
4.26 1.06 10.83
50.00 8.00 63.00
50.00 6.00 42.00
47.00 6.00 18.00
1.25 0.99 2.15
51.00 2.00 60.00
49.00 0.00 36.00
44.00 1.00 12.00
1.13 1.00 1.76
CREEP+ -GTask CREEP+ -GDecoy CREEP+ -GContra
81.00 48.00 92.00
79.00 46.00 77.00
74.00 38.00 57.00
1.22 1.20 2.52
82.00 43.00 85.00
77.00 42.00 64.00
68.00 14.00 21.25
7.55 4.40 13.12
84.00 56.00 91.00
79.00 54.00 58.00
79.00 36.00 43.00
1.03 1.17 2.22
81.00 42.00 86.00
71.00 40.00 44.00
73.00 15.00 29.00
1.18 1.22 1.90
Table 3: Performance for agents trained on one dataset (row group) and tested on others (row). Each cell presents the Retrieval Rate (RR) / weighted Token Consumption Ratio (wTCR). Best results are highlighted in bold. Trained On
Tested On
NQ
Method CREEP+ -RTask
CREEP+ -RDecoy
CREEP+ -RContra
CREEP+ -GTask
CREEP+ -GDecoy
CREEP+ -GContra
NQ HotpotQA MSMARCO
86.00% / 1.19 92.00% / 1.24 47.00% / 1.19
34.00% / 1.00 28.00% / 1.03 2.00% / 1.00
78.00% / 1.75 98.00% / 2.19 64.00% / 1.57
81.00% / 1.22 100.00% / 1.22 54.00% / 1.13
48.00% / 1.20 97.00% / 1.42 14.00% / 1.06
92.00% / 2.52 100.00% / 2.65 70.00% / 1.50
HotpotQA
NQ HotpotQA MSMARCO
38.00% / 1.06 100.00% / 1.10 44.00% / 1.25
3.00% / 1.01 99.00% / 1.37 2.00% / 1.02
60.00% / 1.72 100.00% / 2.43 55.00% / 1.36
85.00% / 1.13 100.00% / 1.11 55.00% / 1.13
44.00% / 1.21 100.00% / 1.74 19.00% / 1.10
93.00% / 1.85 100.00% / 1.94 68.00% / 1.46
MSMARCO
NQ HotpotQA MSMARCO
57.00% / 1.11 96.00% / 1.27 79.00% / 1.18
34.00% / 1.04 96.00% / 1.20 69.00% / 1.20
56.00% / 1.67 99.00% / 1.97 64.00% / 1.81
80.00% / 1.11 100.00% / 1.29 65.00% / 1.21
54.00% / 1.06 98.00% / 1.21 27.00% / 1.01
89.00% / 1.87 99.00% / 2.06 65.00% / 1.66
into a randomly selected retrieved document. For PoisonedRAG and Paradox, which are designed for RAG, we follow their methodologies to generate adversarial documents. All crafted adversarial documents are then injected into the knowledge base for evaluation.
4.2
Main Results and Analysis
4.2.1 Validation of the RA-ICA Threat. Our experiments robustly validate the feasibility and severity of the proposed RA-ICA. As shown in Table 1, our best-performing method, CREEP+ -GContra , achieves a remarkable 92.00% Retrieval Rate (RR) on NQ with a potent 2.52× Weighted Token Consumption Ratio (wTCR). Crucially, the attack proves practical by balancing potency and stealthiness. For instance, on HotpotQA, CREEP+ -RTask achieves a 100% RR while maintaining an exceptionally high Weighted Answer Alignment (wAA) of 97.00%, confirming that severe attacks can be mounted without compromising answer correctness and thus
evading simple detection mechanisms. This validates RA-ICA as a practical and severe threat. 4.2.2 MA-GRPO’s Critical Role in Enhancing Attack Potency. Our results demonstrate that MA-GRPO plays a critical role in achieving high attack performance. As shown in Table 1, agents optimized with MA-GRPO (𝐶𝑅𝐸𝐸𝑃 + ) substantially outperform their base counterparts (𝐶𝑅𝐸𝐸𝑃). For instance, on the NQ dataset, MA-GRPO boosts CREEP-RTask from a weak attack (19.00% RR, 19.00% wAA) to a strong and stealthy one (86.00% RR, 85.00% wAA). Likewise, for the best-performing strategy, MA-GRPO increases the weighted token consumption ratio (wTCR) of CREEP-GContra by 39% (from 1.81× to 2.52×). These notable improvements indicate that MA-GRPO effectively handles the complex optimization process to learn better patterns for generating adversarial documents. 4.2.3 Analysis of Attack Strategies and Agent Types. The results show the trade-offs inherent in the strategies and agent types of
WWW ’26, April 13–17, 2026, Dubai, United Arab Emirates
our CREEP framework: (1) The Contradiction Injection strategy is consistently the most potent in amplifying cost, achieving the highest wTCR scores across datasets (e.g., 2.52× on NQ, 2.41× on HotpotQA). This high impact, however, often comes at the expense of stealth, reflected in lower wAA and wAC scores. (2) The TaskOriented strategy, in contrast, excels at stealth. CREEP+ -RTask consistently registers the highest wAA and wAC scores (e.g., 85.00% and 82.00% on NQ), making it ideal for attacks that prioritize evading detection. Furthermore, we observe a relation between the agent types and dataset complexity. The generation agent is most effective on NQ’s simpler queries, while the rewriting agent is superior on HotpotQA, where modifying a relevant document provides a better contextual anchor for its complex, multi-hop questions.
4.3
Generalization Analysis
4.3.1 Generalization Across Victim LLMs. Our attack framework generalizes well to unseen victim models, showing that the threat is broadly applicable. As shown in Table 1, our agents remain effective across all tested LLMs and can cause severe resource overhead. In particular, CREEP+ -GContra reaches a 13.12× wTCR on GPT-5 with an 85.00% retrieval rate. This large increase arises because the attack forces models that usually give short answers to perform extended reasoning to resolve contradictions. These findings confirm the strong and general threat posed by our attack. 4.3.2 Generalization Across Datasets. The framework also generalizes well across datasets. As shown in Table 3, agents trained on one dataset can still attack others, showing that they learn general adversarial patterns rather than overfitting. HotpotQA, with its complex multi-hop questions, proves especially vulnerable, often reaching high retrieval rates (around 100%). Interestingly, an agent trained on the NQ dataset achieves a higher wTCR on HotpotQA than a natively trained one (2.65× vs. 1.94×). We attribute this counter-intuitive observation to the fundamental differences between the two datasets. NQ, with its focus on single-hop, factual questions, likely encourages the development of fundamental and broadly applicable attack patterns. Conversely, the complex multihop reasoning inherent to HotpotQA may lead a natively trained agent to develop more specialized and less transferable strategies. This result highlights the agent’s ability to extract generalizable attack principles from focused training data.
5
Related Work
Retrieval-Augmented Generation for LLMs. RAG has emerged as a cornerstone for enhancing LLMs by grounding them in external knowledge, thereby mitigating issues like factual hallucination and knowledge cutoffs [4, 18]. The research community has predominantly focused on improving RAG’s efficacy. This includes developing advanced retrieval strategies, such as hybrid search [40], and sophisticated post-retrieval re-ranking mechanisms to refine context quality [39]. For instance, some works develop adaptive frameworks that dynamically select from a range of retrieval strategies, such as iterative multi-step retrieval, to match the system’s operational complexity with that of the input query [11]. Others employ RAG models themselves as feedback mechanisms within a
Chengliang Liu, Liangbo Ning, Yujuan Ding, and Wenqi Fan
reinforcement learning loop to optimize the very process of search query generation for dialogue systems [35]. Inference Cost Attacks on LLMs. Inference Cost Attacks (ICAs) aim to exploit and exhaust the computational resources of deployed LLM services, rather than corrupting their output correctness [24, 32]. Previous works have established the feasibility of such attacks through direct input manipulation. For example, “sponge examples” induced long outputs in encoder-decoder models [32], while more recent methods like “Engorgio” trick decoder-only LLMs into suppressing end-of-sequence tokens, forcing them to generate excessively long text [3]. Other techniques rely on inducing repetitive generation patterns or resource-intensive reasoning steps [16]. A common and critical limitation of these methods is the assumption of direct access to the user’s input query [23]. This assumption restricts the attack’s scalability and real-world applicability. In contrast, our work proposes a more practical and scalable threat model by poisoning the shared knowledge source in RAG systems, thereby affecting a wide range of benign user queries.
6
Conclusions
In this work, we identify and formalize the Retrieval-Augmented Inference Cost Attack(RA-ICA), a novel and stealthy threat that escalates the inference cost of Retrieval-Augmented Generation (RAG) systems without compromising the final answer’s integrity. To systematically investigate this vulnerability, we propose the Computational Resource Exhaustion via External Poisoning(CREEP) framework, which employs LLM agents operating under rewrite-based and generation-based paradigms to craft malicious documents. Furthermore, we introduce MA-GRPO, a novel reinforcement learning algorithm, to significantly enhance the agents’ ability to generate highly effective adversarial documents. Our extensive experiments validate the severity of this threat. The agents optimized with MA-GRPO, denoted as CREEP+ , successfully increase token consumption by up to 13.12× with retrieval rates exceeding 90%. Crucially, these attacks remain stealthy by preserving the correctness of the final answer, making them difficult to detect. Our agents also demonstrate strong generalization capabilities, proving effective across various victim LLMs and datasets.
Acknowledgments The research described in this paper has been partially supported by the General Research Funds from the Hong Kong Research Grants Council (project no. PolyU 15207322, 15200023, 15206024, and 15224524), internal research funds from Hong Kong Polytechnic University (project no. P0042693, P0048625, and P0051361), and Sheertek International (HK) Limited. This work was supported by computational resources provided by The Centre for Large AI Models (CLAIM) of The Hong Kong Polytechnic University.
Inference Cost Attacks for Retrieval-Augmented Large Language Models
WWW ’26, April 13–17, 2026, Dubai, United Arab Emirates
References [1] Chanwoo Choi, Jinsoo Kim, Sukmin Cho, Soyeong Jeong, and Buru Chang. 2025. The RAG Paradox: A Black-Box Attack Exploiting Unintentional Vulnerabilities in Retrieval-Augmented Generation Systems. arXiv:2502.20995 [cs] doi:10.48550/arXiv.2502.20995 [2] DeepSeek. 2025. DeepSeek-R1 Update: Deeper Thinking, Stronger Reasoning. https://api-docs.deepseek.com/zh-cn/news/news250528. Accessed: 2025-10-06. [3] Jianshuo Dong, Ziyuan Zhang, Qingjie Zhang, Tianwei Zhang, Hao Wang, Hewu Li, Qi Li, Chao Zhang, Ke Xu, and Han Qiu. 2024. An engorgio prompt makes large language model babble on. arXiv preprint arXiv:2412.19394 (2024). [4] Wenqi Fan, Yujuan Ding, Liangbo Ning, Shijie Wang, Hengyun Li, Dawei Yin, Tat-Seng Chua, and Qing Li. 2024. A Survey on RAG Meeting LLMs: Towards Retrieval-Augmented Large Language Models. In Proceedings of the 30th ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD ’24). Association for Computing Machinery, New York, NY, USA, 6491–6501. doi:10.1145/3637528.3671470 [5] Luciano Floridi. 2023. AI as agency without intelligence: On ChatGPT, large language models, and other generative models. Philosophy & technology 36, 1 (2023), 15. [6] Google Cloud Platform. 2025. Generative AI samples for Google Cloud. https://github.com/GoogleCloudPlatform/generative-ai. Accessed: 2025-09-26. [7] Dan Hendrycks, Collin Burns, Saurav Kadavath, Akul Arora, Steven Basart, Eric Tang, Dawn Song, and Jacob Steinhardt. 2021. Measuring Mathematical Problem Solving with the MATH Dataset. arXiv preprint arXiv:2103.03874 (2021). https://arxiv.org/abs/2103.03874 [8] Edward J Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, Weizhu Chen, et al. 2022. Lora: Low-rank adaptation of large language models. ICLR 1, 2 (2022), 3. [9] Mikhail Isaev, Nic McDonald, and Richard Vuduc. 2023. Scaling infrastructure to support multi-trillion parameter LLM training. In Architecture and System Support for Transformer Models (ASSYST@ ISCA 2023). [10] Gautier Izacard, Mathilde Caron, Lucas Hosseini, Sebastian Riedel, Piotr Bojanowski, Armand Joulin, and Edouard Grave. 2022. Unsupervised Dense Information Retrieval with Contrastive Learning. arXiv:2112.09118 [cs.IR] https://arxiv.org/abs/2112.09118 [11] Soyeong Jeong, Jinheon Baek, Sukmin Cho, Sung Ju Hwang, and Jong C. Park. 2024. Adaptive-RAG: Learning to Adapt Retrieval-Augmented Large Language Models through Question Complexity. arXiv:2403.14403 [cs.CL] https://arxiv.org/abs/2403.14403 [12] Zhuohang Jiang, Pangjing Wu, Xu Yuan, Wenqi Fan, and Qing Li. 2025. QA-Dragon: Query-Aware Dynamic RAG System for Knowledge-Intensive Visual Question Answering. arXiv preprint arXiv:2508.05197 (2025). [13] Zhengbao Jiang, Frank F Xu, Luyu Gao, Zhiqing Sun, Qian Liu, Jane Dwivedi-Yu, Yiming Yang, Jamie Callan, and Graham Neubig. 2023. Active retrieval augmented generation. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing. 7969–7992. [14] Leslie Pack Kaelbling, Michael L Littman, and Andrew W Moore. 1996. Reinforcement learning: A survey. Journal of artificial intelligence research 4 (1996), 237–285. [15] Diederik P. Kingma and Jimmy Ba. 2017. Adam: A Method for Stochastic Optimization. arXiv:1412.6980 [cs.LG] https://arxiv.org/abs/1412.6980 [16] Abhinav Kumar, Jaechul Roh, Ali Naseh, Marzena Karpinska, Mohit Iyyer, Amir Houmansadr, and Eugene Bagdasarian. 2025. Overthink: Slowdown attacks on reasoning llms. arXiv preprint arXiv:2502.02542 (2025). [17] Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris Alberti, Danielle Epstein, Illia Polosukhin, Jacob Devlin, Kenton Lee, et al. 2019. Natural questions: a benchmark for question answering research. Transactions of the Association for Computational Linguistics 7 (2019), 453–466. [18] Patrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Küttler, Mike Lewis, Wen-tau Yih, Tim Rocktäschel, et al. 2020. Retrieval-augmented generation for knowledge-intensive nlp tasks. Advances in neural information processing systems 33 (2020), 9459–9474. [19] Dazhen Li, Siru Xia, Ling Gui, Shiyang Cheng, Yuxuan Zhang, Bailin Wang, Haotian Qi, Jian Han, Yushi He, Qipeng Ma, Jing Zhang, Zhiyong Yang, Yuu Zhou, Jin Shang, Jian-Guang Mao, Lidong Wang, and Xia Zou. 2024. LiveCodeBench: A Challenge for Real-Time Human-Level Coding Competition. arXiv preprint arXiv:2403.07974 (2024). https://arxiv.org/abs/2403.07974 [20] Jiatong Li, Yunqing Liu, Wenqi Fan, Xiao-Yong Wei, Hui Liu, Jiliang Tang, and Qing Li. 2024. Empowering molecule discovery for molecule-caption translation with large language models: A chatgpt perspective. IEEE transactions on knowledge and data engineering 36, 11 (2024), 6071–6083. [21] Zechun Liu, Changsheng Zhao, Forrest Iandola, Chen Lai, Yuandong Tian, Igor Fedorov, Yunyang Xiong, Ernie Chang, Yangyang Shi, Raghuraman Krishnamoorthi, et al. 2024. Mobilellm: Optimizing sub-billion parameter language models for on-device use cases. In Forty-first International Conference on Machine Learning. [22] Alejandro Lozano, Scott L Fleming, Chia-Chun Chiang, and Nigam Shah. 2023. Clinfo. ai: An open-source retrieval-augmented large language model system for answering medical questions using scientific literature. In Pacific Symposium on Biocomputing 2024. World Scientific, 8–23. [23] Linyin Luo, Yujuan Ding, Yunshan Ma, Wenqi Fan, and Hanjiang Lai. 2025. HV-Attack: Hierarchical Visual Attack for Multimodal Retrieval Augmented Generation. arXiv preprint arXiv:2511.15435 (2025). [24] Hanene FZ Meftah, Wassim Hamidouche, Sid Ahmed Fezza, and Olivier Deforges. 2025. Energy-Latency Attacks: A New Adversarial Threat to Deep Learning. arXiv preprint arXiv:2503.04963 (2025). [25] Microsoft. 2025. What is Azure AI Search? https://learn.microsoft.com/en-us/azure/search/search-what-is-azure-search. Accessed: 2025-09-26. [26] Tri Nguyen, Mir Rosenberg, Xia Song, Jianfeng Gao, Saurabh Tiwary, Rangan Majumder, and Li Deng. 2016. Ms marco: A human-generated machine reading comprehension dataset. (2016). [27] Liangbo Ning, Ziran Liang, Zhuohang Jiang, Haohao Qu, Yujuan Ding, Wenqi Fan, Xiao-yong Wei, Shanru Lin, Hui Liu, Philip S Yu, et al. 2025. A survey of webagents: Towards next-generation ai agents for web automation with large foundation models. In Proceedings of the 31st ACM SIGKDD Conference on Knowledge Discovery and Data Mining V. 2. 6140–6150. [28] Pratyush Patel, Esha Choukse, Chaojie Zhang, Aashaka Shah, Íñigo Goiri, Saeed Maleki, and Ricardo Bianchini. 2024. Splitwise: Efficient generative llm inference using phase splitting. In 2024 ACM/IEEE 51st Annual International Symposium on Computer Architecture (ISCA). IEEE, 118–132. [29] David Patterson, Joseph Gonzalez, Quoc Le, Chen Liang, Lluis-Miquel Munguia, Daniel Rothchild, David So, Maud Texier, and Jeff Dean. 2021. Carbon emissions and large neural network training. arXiv preprint arXiv:2104.10350 (2021). [30] David Rein, Betty Li Hou, Asa Cooper Stickland, Jackson Petty, Richard Yuanzhe Pang, Julien Dirani, Julian Michael, and Samuel R Bowman. 2024. Gpqa: A graduate-level google-proof q&a benchmark. In First Conference on Language Modeling. [31] Zhihong Shao, Peiyi Wang, Qihao Zhu, Runxin Xu, Junxiao Song, Xiao Bi, Haowei Zhang, Mingchuan Zhang, YK Li, Yang Wu, et al. 2024. Deepseekmath: Pushing the limits of mathematical reasoning in open language models. arXiv preprint arXiv:2402.03300 (2024). [32] Ilia Shumailov, Yiren Zhao, Daniel Bates, Nicolas Papernot, Robert Mullins, and Ross Anderson. 2021. Sponge examples: Energy-latency attacks on neural networks. In 2021 IEEE European symposium on security and privacy (EuroS&P). IEEE, 212–231. [33] Kurt Shuster, Spencer Poff, Moya Chen, Douwe Kiela, and Jason Weston. 2021. Retrieval augmentation reduces hallucination in conversation. arXiv preprint arXiv:2104.07567 (2021). [34] Vectara. 2025. Grounded Generation overview. https://docs.vectara.com/docs/learn/grounded-generation/grounded-generation-overview. Accessed: 2025-09-26. [35] Ante Wang, Linfeng Song, Ge Xu, and Jinsong Su. 2023. Domain adaptation for conversational query production with the rag model feedback. In Findings of the Association for Computational Linguistics: EMNLP 2023. 9129–9141. [36] Xiaohua Wang, Zhenghua Wang, Xuan Gao, Feiran Zhang, Yixin Wu, Zhibo Xu, Tianyuan Shi, Zhengyuan Wang, Shizheng Li, Qi Qian, et al. 2024. Searching for best practices in retrieval-augmented generation. arXiv preprint arXiv:2407.01219 (2024). [37] Jing Xu, Arthur Szlam, and Jason Weston. 2021. Beyond goldfish memory: Long-term open-domain conversation. arXiv preprint arXiv:2107.07567 (2021). [38] Zhilin Yang, Peng Qi, Saizheng Zhang, Yoshua Bengio, William W Cohen, Ruslan Salakhutdinov, and Christopher D Manning. 2018. HotpotQA: A dataset for diverse, explainable multi-hop question answering. arXiv preprint arXiv:1809.09600 (2018). [39] Yue Yu, Wei Ping, Zihan Liu, Boxin Wang, Jiaxuan You, Chao Zhang, Mohammad Shoeybi, and Bryan Catanzaro. 2024. Rankrag: Unifying context ranking with retrievalaugmented generation in llms. Advances in Neural Information Processing Systems 37 (2024), 121156–121184. [40] Jingtao Zhan, Jiaxin Mao, Yiqun Liu, Jiafeng Guo, Min Zhang, and Shaoping Ma. 2021. Optimizing dense retrieval model training with hard negatives. In Proceedings of the 44th international ACM SIGIR conference on research and development in information retrieval. 1503–1512.
WWW ’26, April 13–17, 2026, Dubai, United Arab Emirates
Chengliang Liu, Liangbo Ning, Yujuan Ding, and Wenqi Fan
[41] Yuanhe Zhang, Zhenhong Zhou, Wei Zhang, Xinyue Wang, Xiaojun Jia, Yang Liu, and Sen Su. 2024. Crabs: Consuming resource via auto-generation for llm-dos attack under black-box settings. arXiv preprint arXiv:2412.13879 (2024). [42] Penghao Zhao, Hailin Zhang, Qinhan Yu, Zhengren Wang, Yunteng Geng, Fangcheng Fu, Ling Yang, Wentao Zhang, Jie Jiang, and Bin Cui. 2024. Retrieval-augmented generation for ai-generated content: A survey. arXiv preprint arXiv:2402.19473 (2024). [43] Zihuai Zhao, Wenqi Fan, Jiatong Li, Yunqing Liu, Xiaowei Mei, Yiqi Wang, Zhen Wen, Fei Wang, Xiangyu Zhao, Jiliang Tang, et al. 2024. Recommender systems in the era of large language models (llms). IEEE Transactions on Knowledge and Data Engineering 36, 11 (2024), 6889–6907. [44] Wei Zou, Runpeng Geng, Binghui Wang, and Jinyuan Jia. 2024. PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Models. USENIX Security 2025. arXiv:2402.07867 [cs] doi:10.48550/arXiv.2402.07867