← Latest papers
🤖 machine learning

What to Keep, What to Forget: A Rate--Distortion View of Memory Compaction in LLMs and Agents

This paper unifies diverse memory compaction techniques across LLMs and agents under a rate-distortion framework, proposing a seven-axis taxonomy, identifying a shared failure mode of premature information discarding, and introducing new benchmarks and design principles to address the lack of holistic evaluation for repeated compaction.

Original authors: Ashwin Gerard Colaco, Nada Lahjouji

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

Original authors: Ashwin Gerard Colaco, Nada Lahjouji

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 the brain of a super-smart robot assistant. Every time you talk to someone, you have to remember everything they've said, every tool you've used, and every fact you've learned. But here's the catch: your brain has a tiny, expensive storage box (like a very fast, very small backpack). If you try to stuff your entire life story into that backpack, it bursts, and your brain slows to a crawl.

So, you have to decide: What do you keep, and what do you throw away?

This paper argues that whether you are a chatbot remembering a conversation, a robot agent planning a mission, or a computer system managing its memory, everyone is facing the exact same problem. It's like trying to pack for a trip where you don't know the weather yet, but you have a strict weight limit. You have to guess what's important, pack it, and hope you don't need the things you left behind.

The Big Idea: The "Rate–Distortion" Dilemma

The authors call this a rate–distortion decision. Think of it this way:

  • Rate: How much space you are allowed to use (your backpack size).
  • Distortion: How much you mess up your memory by throwing things away.

The paper suggests that all the different ways we try to shrink memory—whether we delete old chat messages, compress numbers into fewer bits, or summarize a long story into a short paragraph—are just different versions of this same packing problem. They are all trying to fit the most useful information into the smallest space without breaking the robot's ability to answer questions later.

The Four "Packing Strategies" (and why they often fail)

The paper looks at four different groups of researchers who have been trying to solve this, but they haven't been talking to each other:

  1. The "Delete" Crew (KV Cache): These folks work inside the model while it's talking. They look at the history of the conversation and say, "That old token is boring; delete it!"
  2. The "Summarize" Crew (Prompt Compression): These folks edit the input before the robot reads it. They rewrite a long story into a shorter one.
  3. The "Architect" Crew: These folks build new robot brains that are designed to forget automatically, like a sponge that only holds a fixed amount of water.
  4. The "Agent" Crew: These folks manage the robot's long-term memory, deciding which life lessons to keep and which to discard between tasks.

The Problem: The paper argues that almost all of these methods make a fatal mistake. They decide what to throw away before they know what question the user is going to ask next.

The Analogy: Imagine you are packing a suitcase for a trip, but you have to decide what to throw out before you know if you're going to the beach or the mountains. You throw away your swimsuit because you think it's a cold trip. Then, when you arrive at the beach, you realize you made a mistake, but it's too late to go back and get it.

The paper shows that this "guessing game" causes the robot to fail. If the robot throws away a piece of information that turns out to be the answer to a tricky question, it can't get it back. The paper calls this irreversible loss.

The Two Golden Rules for Better Packing

After looking at hundreds of methods, the authors found two patterns that separate the winners from the losers:

  1. Don't Throw Away What You Can't Get Back (Reversibility):
    If you have to delete something, make sure you have a backup copy somewhere else you can fetch later.

    • The Paper's Finding: Methods that keep a full archive and just "hide" the less important stuff (so they can pull it out if needed) work much better than methods that just delete things forever.
    • The Evidence: In their experiments, when they made the robot summarize a story over and over (deleting details each time), its memory got worse and worse. But when they let the robot keep the full story and just pull out the relevant parts when asked, its memory stayed perfect.
  2. Wait for the Question Before You Pack (Query-Conditioning):
    Don't decide what to keep until you know what the user is asking.

    • The Paper's Finding: If you wait to see the question, you can pack the exact answer. If you guess beforehand, you pay a "tax" in the form of lost accuracy.
    • The Evidence: The paper proves mathematically that if you don't know the question, you are forced to spread your limited space across all possible questions, which means you have less space for the actual question.

What the Paper Rules Out

The authors are very clear about what doesn't work well:

  • Just deleting things based on how "old" or "boring" they seem: If you delete a token because it hasn't been used in a while, you might accidentally delete the one fact the user needs to solve a puzzle.
  • Summarizing without a backup: Turning a long, detailed history into a short summary and then throwing away the original is a bad idea if the summary misses a tiny detail that becomes crucial later.
  • Assuming all memory is the same: The paper argues that you can't use the same "packing rules" for a chatbot's immediate conversation as you do for a robot's long-term life history. They need different strategies, even though the math is the same.

How Sure Are They?

The authors are very confident in their math. They derived a lower bound (a hard limit) that proves: if you don't have enough space to hold the answer, you will make a mistake. No amount of clever trickery can break this law.

They also ran simulations (experiments on a small computer) to test their ideas.

  • They showed that when you compress memory repeatedly (like an agent working for days), the error grows super-fast if you delete things permanently.
  • They showed that if you keep a "reversible" backup, the error stays flat.
  • They created a new way to measure these methods (called COMPACT-Bench) so that different packing strategies can be compared fairly, like weighing apples and oranges on the same scale.

The Takeaway

The paper suggests that the future of memory isn't about being "smarter" at guessing what to delete. It's about being reversible and patient.

Instead of a robot that frantically throws things away to save space, we need a robot that keeps everything safe in a big warehouse, but only pulls out the specific items it needs after it hears the question. If we do this, the robot won't just save space; it will actually get smarter at remembering the right things at the right time.

The authors admit they haven't solved everything yet. They don't have a perfect formula to predict exactly how much space a robot needs for every possible task, and they need more big tests to prove their ideas on massive systems. But they have provided the map and the compass to get there.

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 →