Dual-Grained Agent Memory and Shapley Context Attribution for Multimodal Agentic Learner
This paper introduces DG-Mem, a non-parametric, dual-grained agentic memory framework inspired by Complementary Learning Systems that enhances frozen multimodal large language models' scientific and mathematical reasoning through an online concept categorizer and Shapley-based context attribution, achieving consistent improvements across diverse benchmarks without requiring gradient updates.
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
Modern artificial intelligence has reached a point where it can look at a photograph and describe it, or read a chart and summarize its trends. These systems, known as multimodal large language models, are remarkably good at perception. However, when asked to solve a complex scientific problem or a tricky math puzzle, they often stumble. They can see the pieces of the puzzle, but they struggle to assemble them into a coherent solution. The standard way to fix this is to retrain the model, feeding it thousands of examples so it learns the right patterns. But this approach has a major flaw: it requires access to the model's internal code, which is often locked away in proprietary systems or simply too large to run on personal devices. Furthermore, if a model solves a problem today, a standard retraining process does not guarantee it will remember that lesson tomorrow; each new question is treated as if it were the first time the model has ever seen it.
To bridge this gap, researchers are exploring a different strategy: giving the AI an external memory. Instead of changing the model's brain, they attach a notebook that the model can read from. The challenge lies in what to write in that notebook. If the notebook is just a list of past problems and their answers, the model might get confused by too much specific detail. If the notebook is just a list of general rules, it might lack the concrete examples needed to understand a new, unfamiliar situation. The most effective human memory systems seem to balance these two needs, storing both specific experiences and the general principles derived from them. A new framework called DG-Mem attempts to replicate this balance for artificial agents, allowing them to learn from past problems without needing to be retrained from scratch.
The researchers behind this work, based at UC Merced and Shanghai Jiao Tong University, built a system that works with a frozen model—one that cannot be changed or updated. They created a memory bank that is constructed once using a set of training problems and then consulted whenever the model faces a new challenge. This memory is split into two distinct parts, much like how a human might keep both a diary of specific events and a handbook of general advice. The first part is an "exemplar memory," which stores specific, solved examples. These are not just raw copies of old questions; they are distilled records that capture the step-by-step strategy used to solve a particular type of problem and the specific errors to avoid. The second part is a "schema memory," which contains general rules, written as simple "if-then" statements. These rules describe the underlying logic of a category of problems, such as how to count objects in a specific visual arrangement or how to interpret a data chart, without getting bogged down in the details of any single instance.
A crucial design choice in this system is how these two types of memory are created. The researchers ensured that the general rules are never written by looking directly at the specific examples. Instead, the system first generates a temporary, abstract reflection of a solved problem. It is only from this abstract reflection that the general rules are synthesized. This prevents the system from accidentally memorizing specific numbers or names from a single problem and mistakenly applying them as a universal law. For instance, if a problem involves counting yellow blocks, the system learns the rule "count all objects of a specific color" rather than "count yellow blocks." This separation allows the model to apply a general principle to a new situation involving red blocks, even if it has never seen red blocks before.
To make this system work effectively, the researchers also had to solve the problem of how to organize the memory. In the past, systems often relied on a fixed list of categories, like "geometry" or "algebra," which could be too broad or too narrow. The new system uses an online categorizer that builds its own list of categories as it goes. As the system processes new problems, it groups them into emerging categories based on their underlying concepts, allowing the memory to grow and adapt to the specific types of problems it encounters without needing a pre-defined map.
The most innovative aspect of this work is how the system decides which pieces of memory are actually useful. When the model retrieves a set of rules to help solve a problem, it often gets several that seem relevant. The researchers developed a method to figure out exactly which rule contributed to the correct answer. They treat the rules like players in a team game, testing different combinations of rules to see which ones lead to success. By analyzing how much each rule improves the outcome when added to a group, the system assigns a "utility score" to every rule. This score is not based on how similar the rule looks to the current question, but on how often it has historically helped the model get the right answer. When the model faces a new problem, it uses this score to prioritize the most helpful rules, effectively learning which advice to trust.
The team tested this framework on four different AI models, ranging from open-source systems to powerful proprietary models, and evaluated them on three challenging benchmarks involving math and science reasoning. The results showed a consistent improvement. The models equipped with this dual-grained memory solved significantly more problems correctly than the same models without any memory. They also outperformed other memory systems that relied on only one type of storage or that did not have a way to rank the usefulness of their rules. In some cases, the improvement was substantial, with the system solving over twelve percent more problems on certain difficult tests.
The study also revealed that the two types of memory serve different purposes. When the researchers removed the specific examples, the system struggled with problems that required visual details, such as distinguishing between a full circle and a slice of a circle. When they removed the general rules, the system failed on problems that required applying a broad strategy to a new visual setup. The combination of both was essential, proving that the system needed both the concrete grounding of specific examples and the abstract flexibility of general rules to succeed.
This approach offers a practical path forward for improving artificial intelligence without the massive cost of retraining. Because the system does not require any changes to the model's internal weights, it can be deployed on closed systems or even on personal devices where privacy and efficiency are paramount. The researchers acknowledge that the system has limitations, particularly in how it handles the randomness of computer calculations when assigning scores to rules, but the results demonstrate that a structured, dual-layered memory can significantly enhance an AI's ability to reason. By separating specific experiences from general principles and using a method to weigh the value of each piece of advice, this framework provides a robust way for artificial agents to learn, evolve, and solve complex problems more effectively.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.