← Latest papers
🤖 machine learning

IntentKV: Cross-Turn Intent-Aware KV Cache Pruning for Agent Inference

IntentKV is a learned, cross-turn intent-aware KV cache pruning method that maintains a frozen base LLM while using session-level memory and a zero-initialized residual head to dynamically score and redirect tokens, achieving significant reductions in peak memory and KV read bandwidth for long-horizon agent inference with minimal accuracy loss.

Original authors: Junjie Li, Jiong Lou, Jie Li

Published 2026-06-10
📖 6 min read🧠 Deep dive

Original authors: Junjie Li, Jiong Lou, Jie Li

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 you are a highly skilled detective (the AI Agent) trying to solve a complex mystery. You don't just ask one question and get an answer; you have to go on a long journey. You search the library, interview witnesses, check old files, and write down notes. Each step adds more and more paper to your desk.

Eventually, your desk becomes so cluttered with papers that you can't find anything, and you run out of space to write new notes. This is exactly the problem IntentKV solves for AI agents.

Here is the breakdown of the paper using simple analogies:

The Problem: The "Cluttered Desk"

When an AI agent works on a multi-step task (like researching a flight and then booking it), it generates a massive trail of information:

  1. The User's Request: "Find me a flight."
  2. The Search: The AI looks up flights.
  3. The Results: It reads a list of 50 flights.
  4. The Follow-up: "Which one is cheapest?"
  5. The New Search: It searches again.

Every time the AI thinks, it has to look back at all the previous papers on its desk to understand the context. As the conversation gets longer, the "desk" (memory) gets huge. The paper argues that the biggest bottleneck isn't the AI's brainpower (computing power); it's the memory space and the speed of reading that desk. If the desk is too full, the AI slows down or crashes.

The Old Solutions: "Shuffling the Papers"

Previous methods tried to fix this by throwing away old papers.

  • The Problem: They usually looked at the current question and decided what to throw away.
  • The Flaw: In a long detective story, a clue from page 1 might be crucial on page 50. Old methods often threw away that page 1 clue because it didn't seem important right now.
  • The Second Flaw: Some methods physically moved the remaining papers to a new, smaller pile. This broke the "index" or "map" that the system uses to quickly find shared information between different users. It's like reorganizing a library so that "Harry Potter" is now on a different shelf than before; the librarian (the system) gets confused and can't reuse the books efficiently.

The New Solution: IntentKV

The authors created IntentKV, which acts like a smart, organized assistant who manages the desk without moving the books.

1. The "Session Memory" (The Detective's Notebook)

Instead of just looking at the current question, IntentKV keeps a running summary of the whole investigation.

  • How it works: It maintains a "QueryMemory" that updates as the conversation goes on. It knows that even though the user is currently asking about "prices," they might need the "flight schedule" from 10 minutes ago to make a decision.
  • The Analogy: Imagine a detective who keeps a sticky note on the wall that says, "Remember: The suspect was wearing a red hat." Even if the current conversation is about the weather, the detective knows the red hat is still relevant. IntentKV keeps the "red hat" papers on the desk, even if they aren't being looked at right this second.

2. The "Zero-Init Residual" (The Safety Net)

The system uses a simple rule to decide what to keep (based on the Session Memory). But sometimes, the rule misses something subtle.

  • The Fix: They added a tiny, learnable "residual head." Think of this as a junior intern who double-checks the senior detective's list.
  • The Magic: This intern starts with zero knowledge (zero-initialized) and learns only to correct the senior's mistakes. It doesn't change the detective's brain (the main AI model); it just adds a small layer of smart correction.

3. The "Dead Slot" Trick (The Magic Map)

This is the most clever part. When the desk is full, IntentKV has to remove some papers.

  • Old Way: Take the papers out, stack the remaining ones tightly, and renumber them. (This breaks the library's index).
  • IntentKV Way: It takes the paper out, but instead of moving the others, it puts a "Do Not Read" sign (a sentinel dead slot) on the empty spot.
  • The Result: The papers stay exactly where they were. The "map" of the desk remains perfect. If another detective comes in with a similar case, the system can instantly recognize the shared papers because they haven't moved. This allows the system to reuse memory efficiently, saving huge amounts of time and space.

The Results: What Did They Find?

The paper tested this on two specific AI models (Qwen3-8B and Qwen2.5-14B) using a difficult "deep research" benchmark called BrowseComp-Plus.

  • Accuracy: IntentKV kept the AI just as smart as if it had infinite memory. It didn't lose any "detective skills."
  • Efficiency:
    • It reduced the amount of memory needed by about 24% to 31% for standard tasks.
    • For the hardest, longest tasks, it reduced the memory usage by up to 78% and the reading speed requirements by up to 92%.
  • Comparison: It beat all other "cleaning up" methods. While other methods crashed or gave wrong answers when the memory got tight, IntentKV kept working smoothly.

Important Limitations (What the Paper Doesn't Say)

  • It's not a magic wand for all AI: The paper notes that they only tested this on specific "Qwen" models. Other popular open-source models (like Llama or Mistral) failed to even perform the multi-step tasks correctly in their tests, so IntentKV couldn't be tested on them. The issue wasn't the memory; the models just couldn't "act" like agents in that specific test environment.
  • It doesn't choose its own budget: The system needs a human to set a fixed limit (e.g., "keep 8,000 tokens"). It doesn't automatically decide, "Oh, this question is short, I'll use less memory."
  • It's for Agents, not Chatbots: This is specifically designed for AI that uses tools (searches, code, etc.) over many turns, not for a simple one-off chat.

Summary

IntentKV is a smart memory manager for AI agents. It keeps the most important clues from the past by tracking the intent of the whole conversation, not just the current sentence. It removes old information without shuffling the remaining papers, allowing the AI to stay fast, accurate, and efficient even during very long, complex investigations.

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 →