Memory as a Controlled Process: Learned Adaptive Memory Management for LLM Agents
This paper introduces MemCon, a framework that treats memory operations as a learnable Markov Decision Process to dynamically adapt retrieval, injection, and consolidation strategies via a lightweight contextual bandit, thereby significantly improving LLM agent performance and efficiency across diverse benchmarks compared to static, heuristic-based memory systems.
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 teaching a super-smart robot to play a new video game. You want the robot to get better every time it plays, so you give it a notebook where it can write down what worked and what didn't. This is the world of Large Language Model (LLM) agents: AI programs that can chat, plan, and use tools to solve problems. The key to making them truly smart isn't just the robot's brain; it's the notebook, or memory. If the robot can remember past mistakes, it won't repeat them. If it remembers a clever trick that worked yesterday, it can use it today.
For a long time, scientists thought about this notebook as a static library. They built rules like, "Always look at the last three pages," or "Always search for the most similar story." It's like having a librarian who follows a strict, unchanging script no matter what book you ask for. But real life is messy. Sometimes you need a quick glance at the index; other times, you need to read the whole chapter. Sometimes you need to throw away old notes to make room for new ones. The big question this paper tackles is: Can we teach the robot to manage its own notebook, deciding exactly when to read, when to write, and what to forget, instead of following a rigid script?
The Problem: The Robot with a Broken Librarian
Meet our robot agent. It's trying to solve puzzles, navigate virtual houses, or answer tricky questions. It has a memory system, but until now, that system has been a bit clumsy. Most existing systems use a "fixed pipeline." Imagine a librarian who, no matter what you ask, always pulls out the top five books from the shelf and hands them to you.
If you ask a simple question like "What's the weather?", the librarian might dump five heavy encyclopedias on your desk. That's too much noise! But if you ask a complex question like "How do I fix a broken engine using only tools from 1990?", that same librarian might only hand you a single, irrelevant pamphlet because they are too scared to look deeper. The robot gets stuck, confused by too much information or missing the one crucial clue it needs.
The authors of this paper argue that this "one-size-fits-all" approach is the main reason robots aren't learning faster. They believe the best memory behavior changes depending on the situation:
- Early in a game: The robot has no experience yet, so it shouldn't waste time digging through an empty notebook.
- When stuck: If the robot is doing the same wrong action over and over, it needs a different kind of search, not the same old one.
- When it knows a trick: If the robot has already solved a similar puzzle, it shouldn't search for clues; it should just pull out the "cheat sheet" (a plan) it wrote down before.
The Solution: MEMCON, the Smart Librarian
Enter MEMCON (Memory as a Controlled Process). The authors didn't build a new type of notebook; instead, they built a smart, adaptive librarian that sits on top of any existing memory system.
Think of MEMCON as a tiny, super-fast decision-maker that asks itself three questions before the robot even opens its notebook:
- When should I look?
- What should I look for?
- How much should I grab?
Instead of using a hard-coded rule, MEMCON treats memory management like a game of strategy. It uses a mathematical approach called a Markov Decision Process (imagine a flowchart where every choice leads to a new state). The "player" in this game is the memory controller, and its "moves" include:
- Retrieving: Pulling out old notes.
- Injecting a Plan: Sliding a pre-written "cheat sheet" into the robot's mind.
- Re-retrieving: Trying a new search query because the first one failed.
- Consolidating: Merging messy notes into a clean summary.
- Forgetting: Throwing away old, useless junk to make space.
The magic is in how MEMCON learns. It doesn't need to be pre-trained on a mountain of data. Instead, it learns on the fly while the robot plays. Every time the robot finishes a task, MEMCON gets a score: "Success!" or "Fail." If the robot succeeded, the memory choices that led to that success get a "high five" (a reward). If it failed, those choices get a "thumbs down."
Over just a few dozen tasks, MEMCON figures out the perfect strategy. It learns that for "early stage" tasks, a shallow search is best. It learns that when the robot is "stuck," it needs to try a completely different search angle. It learns that for complex math problems, it's better to inject a general plan than to search for specific examples.
The Results: Smarter, Faster, and Cheaper
The team tested MEMCON on six different benchmarks, ranging from navigating virtual houses (ALFWorld) to solving science puzzles (ScienceWorld) and answering tricky trivia questions (GAIA). They tried it with three different robot frameworks and three different "brains" (the underlying AI models).
The results were impressive. MEMCON consistently beat the best existing memory systems.
- Better Scores: In some tests, MEMCON improved the robot's success rate by up to 15.2 points. For example, on the ALFWorld benchmark, it reached a 67.9% success rate, which was the highest score among all the memory systems tested.
- Less Waste: Usually, when you make a system smarter, it uses more computer power. But MEMCON did the opposite. By knowing exactly what to retrieve, it avoided pulling in useless information. This reduced the amount of data the robot had to process by 5% to 20%.
- No Extra Cost: Unlike some other systems that ask the AI to "think" about what to remember (which costs extra time and money), MEMCON makes its decisions in milliseconds using a simple lookup table. It adds zero extra calls to the AI model.
Why This Matters
The paper suggests that the future of smart robots isn't just about building bigger brains or bigger notebooks. It's about building better managers for those notebooks.
The authors show that memory shouldn't be a static pipeline where you just dump data in and hope it comes out right. Instead, memory should be a controlled process. By letting the agent learn how to access its own experiences, we can create robots that are not only smarter but also more efficient. They learn faster, make fewer mistakes, and don't get bogged down by their own history.
In short, MEMCON teaches the robot to be the boss of its own memory, ensuring that when it needs a clue, it finds the right one at the right time, without getting lost in a sea of irrelevant notes. It's a small change in how we manage memory, but it seems to make a huge difference in how well these digital agents can learn and grow.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.