← Latest papers
🤖 AI

Recency/Frequency Adaptive KV Caching for Large Language Model Serving

This paper proposes a recency/frequency adaptive KV caching strategy that dynamically allocates cache space to mitigate workload interference inherent in traditional LRU policies, achieving significant improvements in hit rates and time-to-first-token for diverse LLM inference workloads.

Original authors: Yang Shen, Meghana Madhyastha, Robert Underwood, Bogdan Nicolae, Randal Burns

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

Original authors: Yang Shen, Meghana Madhyastha, Robert Underwood, Bogdan Nicolae, Randal Burns

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 running a very busy, high-speed library where a super-smart robot librarian (the Large Language Model) helps people write stories, answer questions, and chat.

To work fast, this robot keeps a "cheat sheet" of the most recent and most important information right on its desk. In the tech world, this is called a KV Cache (Key-Value Cache). It saves the robot from having to re-read the entire history of a conversation or a long document every time it needs to write the next word.

However, the robot's desk is small. It can only hold so many pages of its cheat sheet at once. When the desk gets full, the robot has to throw some pages away to make room for new ones.

The Problem: The "Last In, First Out" Mistake

Currently, most robot librarians use a simple rule called LRU (Least Recently Used). It's like saying: "The page I haven't touched in the longest time is the one I'll throw away."

This works okay if everyone is reading the same book in order. But in the real world, things are messy:

  1. The "Hot" Document: Imagine 50 different people ask questions about the same specific long article. The robot keeps reading that article, but because it's not the very last thing it looked at, the LRU rule might throw it off the desk to make room for a new, one-time question. Then, when the 51st person asks about that same article, the robot has to re-read the whole thing from scratch. Slow!
  2. The "Fresh" Conversation: In a chat, you might have a long history. The robot needs to remember the very last thing you said, even if you've said it before.

The old rule (LRU) is too rigid. It doesn't know the difference between something that is frequently asked about (a "hotspot") and something that is just recently looked at.

The Solution: The "Adaptive Desk"

The authors of this paper built a smarter system called ARC (Adaptive Replacement Cache). Think of this as giving the robot librarian a desk with two special zones that can change size on the fly:

  1. The "Just Looked At" Zone (Recency): This holds pages the robot touched just a moment ago.
  2. The "Super Popular" Zone (Frequency): This holds pages that the robot has seen many times.

How it learns:
The system has a secret "ghost shelf" (Ghost Cache). It doesn't hold the actual pages, just a list of what used to be on the desk but got thrown away.

  • If the robot throws away a page, and then someone immediately asks for it again, the system sees this on the "ghost shelf."
  • It realizes: "Oops! I threw away something that is actually popular. I should have kept it in the 'Super Popular' zone."
  • So, it automatically shrinks the "Just Looked At" zone and expands the "Super Popular" zone to make room for the popular item next time.

It's like a smart thermostat that learns: "It's cold in the morning, so I'll heat the living room. But in the afternoon, everyone gathers in the kitchen, so I'll shift the heat there." The system constantly shifts its memory space between "recent" and "frequent" based on what the users are actually doing.

What They Found

The researchers tested this new "Adaptive Desk" against the old "LRU Desk" using two types of work:

  1. Document Questions: People asking questions about long articles (like a quiz show).
  2. Real Chats: Simulating real conversations with a chatbot.

The Results:

  • Better Memory Hits: The new system kept the right pages on the desk more often. In the document tests, it improved the "hit rate" (finding the info without re-reading) by up to 10.8%.
  • Faster Answers: Because the robot didn't have to re-read as much, it started answering faster. The time to get the first word of the answer dropped by up to 12.6% in document tests and about 2% in real chat tests.
  • It Adapts: When the workload changed (e.g., from many people asking about one document to many people having different chats), the system automatically resized its zones to fit the new situation.

The Bottom Line

This paper shows that by making the robot's memory management flexible—balancing between what's new and what's popular—we can make AI systems significantly faster and more efficient without needing bigger computers. It's a software upgrade that makes the existing hardware work smarter, not harder.

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 →