ExpWeaver: LLM Agents Learn from Experience via Latent RAG
ExpWeaver is an end-to-end optimized framework that enables LLM agents to learn from experience via latent retrieval-augmented generation, achieving state-of-the-art performance across diverse tasks while significantly reducing token overhead and improving cross-domain generalization compared to traditional text-based retrieval methods.
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 have a brilliant but forgetful assistant who is trying to solve a puzzle. Every time they get stuck, they ask you for help.
The Old Way (Current Methods):
In the past, to help this assistant, you would pull out a giant physical notebook filled with notes from every time they solved a similar puzzle before. You'd flip through the pages, find the most relevant note, and then read the entire note out loud to the assistant before they tried again.
This approach has two big problems:
- It's slow and expensive: Reading a whole page of text takes time and uses up a lot of "attention tokens" (like a limited budget of mental energy). If the notebook is huge, the assistant gets overwhelmed.
- It's rigid: The assistant just hears the words. They don't really feel the connection between the old note and the new problem until they process the text themselves. It's like being told a story rather than having the solution intuitively click.
The New Way (ExpWeaver):
The paper introduces ExpWeaver, a smarter way to help the assistant learn from experience. Instead of a physical notebook, imagine the assistant has a secret, invisible library inside their own brain.
Here is how ExpWeaver works, using simple analogies:
1. The Invisible Library (Latent Space)
Instead of writing experiences down as long paragraphs of text, ExpWeaver compresses every past success or failure into a tiny, dense "mental fingerprint" (a mathematical vector).
- Analogy: Think of it like a Spotify "Shuffle" button. Instead of playing the whole song (the text) to remind you of the vibe, it just plays a 3-second hum that instantly triggers the memory of the song. The assistant doesn't need to read the whole story; it just needs that "hum" to remember the lesson.
2. The Instant Connection (Latent Retrieval)
When the assistant faces a new problem, it doesn't search a library. Instead, it instantly checks its own current thoughts against its library of "mental fingerprints."
- Analogy: It's like having a super-smart librarian who doesn't need you to describe the book you want. You just think about the problem, and the librarian instantly hands you the exact "mental fingerprint" that matches your current mood. This happens in a split second, inside the assistant's brain, without any reading aloud.
3. The Smart Mixer (Gated Integration)
Once the assistant finds the right "mental fingerprint," it doesn't just paste it into its thoughts. It uses a special mixing valve (a gated mechanism).
- Analogy: Imagine you are cooking a stew. You have your current ingredients (the new problem). You have a secret spice blend (the old experience). A bad cook dumps the whole jar of spice in, ruining the dish. ExpWeaver is a master chef who tastes the stew and adds just the right amount of the spice blend. Sometimes it adds a little; sometimes it adds a lot, depending on what the dish needs right now. This ensures the old experience helps without overpowering the new logic.
4. The Result: Faster and Smarter
The paper tested this new method on 13 different types of tasks, from solving math problems and writing code to predicting chemical reactions and recommending movies.
- The Score: ExpWeaver beat the best existing methods in 12 out of 13 tasks.
- The Efficiency: Because it doesn't have to "read" long text notes, it uses 30% to 50% less computing power (tokens) than the old methods. It's like getting the same answer but using a much smaller battery.
- The Adaptability: When the assistant was thrown a completely new type of problem (like moving from general math to chemistry), ExpWeaver figured it out much faster than the others. It learned that the pattern of solving the problem was similar, even if the words were different.
In Summary:
ExpWeaver is a system that teaches AI agents to learn from their past mistakes and successes not by reading a diary, but by feeling the memory. It compresses experiences into tiny, efficient signals and mixes them directly into the thinking process, making the AI smarter, faster, and more adaptable without wasting energy on reading long texts.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.