← Latest papers
💻 computer science

Inference Cost Attacks for Retrieval-Augmented Large Language Models

This paper introduces Retrieval-Augmented Inference Cost Attack (RA-ICA), a novel framework utilizing LLM agents and a Memory-Augmented Group Relative Policy Optimization algorithm to poison external knowledge bases with malicious documents that significantly inflate token consumption in RAG-enhanced LLM systems while preserving answer integrity.

Original authors: Chengliang Liu, Liangbo Ning, Yujuan Ding, Wenqi Fan

Published 2026-06-03
📖 4 min read☕ Coffee break read

Original authors: Chengliang Liu, Liangbo Ning, Yujuan Ding, Wenqi Fan

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine a high-end restaurant called "RAG-LLM." This restaurant is famous because it doesn't just rely on the chef's memory; it has a team of researchers who instantly run to a massive library (the internet) to find the freshest facts before cooking your meal. This makes the food (the answers) very accurate.

However, running this library research service is expensive. The restaurant owners pay by the minute for the researchers' time and the electricity to run the computers.

The Problem: A New Kind of "Bill Shock"

The paper argues that while this system is great, it has a hidden weakness. Usually, people think hackers might try to trick the chef directly by shouting weird instructions at the kitchen window (changing the user's question). But the authors say there's a smarter, sneakier way to attack: poison the library itself.

They call this new threat RA-ICA (Retrieval-Augmented Inference Cost Attack).

Think of it like this: Instead of yelling at the chef, the attacker sneaks into the library and plants a few fake, confusing, and overly complicated books on the shelves. When a customer asks a simple question like, "Who is the goddess of spring?", the researchers don't just find the right book; they accidentally grab one of these fake books too.

Because the fake book is written in a tricky way, the chef has to read it, re-read it, argue with it, and solve a puzzle hidden inside it just to figure out the simple answer. The chef ends up spending 13 times longer cooking the meal than usual. The customer gets the right answer, but the restaurant owner gets a massive, unexpected bill for all that extra time.

How the Attack Works (The "CREEP" Framework)

The authors built a tool they call CREEP (Computational Resource Exhaustion via External Poisoning) to automate this. Imagine CREEP as a "villain robot" that writes these fake library books.

The robot uses two main ways to write these traps:

  1. The Rewrite Artist: It takes a normal, boring book and edits it to add a confusing puzzle or a contradiction.
  2. The Creative Writer: It writes a brand-new book from scratch that looks normal but is secretly designed to make the chef work harder.

The robot uses three specific tricks to make the chef work harder:

  • The Decoy: It adds a fake, difficult math problem or logic puzzle inside the text. The chef feels compelled to solve it before answering the user's question.
  • The Contradiction: It writes a sentence that says the opposite of the truth (e.g., "Spring is actually winter"). The chef has to stop, think, and do extra reasoning to decide which fact is real.
  • The Task Trap: It gives the chef a vague, open-ended instruction that forces them to write a long, rambling explanation just to be safe.

The Secret Sauce: Learning from Past Wins (MA-GRPO)

Writing a fake book that is both hard to spot and hard to process is really difficult. If the book is too weird, the researchers won't pick it up from the library. If it's too simple, the chef won't spend extra time on it.

To solve this, the authors taught their "villain robot" using a special learning method called MA-GRPO.

Think of this as a video game where the robot tries to write the perfect trap.

  • The Memory Bank: The robot keeps a "Hall of Fame" of the best traps it has ever written.
  • The Comparison: Every time the robot tries a new trap, it compares it against the "Hall of Fame" winners.
  • The Reward: If the new trap makes the chef work longer without changing the final answer, the robot gets a "high score" and learns to do it again. If it fails, it learns what not to do.

This "memory bank" helps the robot get better and faster at writing traps that are invisible to the eye but exhausting for the computer.

The Results

The authors tested this on three different real-world question-and-answer datasets. They found that:

  • They could make the computer work 13 times longer than normal.
  • The attack succeeded over 90% of the time.
  • Crucially, the final answer given to the user was still correct. The restaurant owner pays the bill, but the customer gets their food on time (just with a much higher cost behind the scenes).

Summary

In short, this paper shows that we can't just worry about hackers changing what we ask. We also need to worry about hackers poisoning the information sources we trust. By planting "sticky, confusing" documents in the public knowledge base, an attacker can force these smart AI systems to burn through massive amounts of computing power and money, all while still giving the user the right answer.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →