← Latest papers
💻 computer science

EvoMem: Memory-Augmented Evolution for Code Optimization

EvoMem is a persistent memory architecture for LLM-driven evolutionary code search that captures and reuses successful mutation strategies as structured, task-aware advice to reduce redundant exploration and improve optimization across diverse tasks.

Original authors: Viktor Volkov, Valentin Khrulkov, Andrey V. Galichin, Danil Sivtsov, Nikita Glazkov, Olga Volkova, Konstantin Pchelin, Iaroslav Bespalov, Dmitry V. Dylov, Petr Anokhin, Ivan Oseledets

Published 2026-08-12
📖 6 min read🧠 Deep dive

Original authors: Viktor Volkov, Valentin Khrulkov, Andrey V. Galichin, Danil Sivtsov, Nikita Glazkov, Olga Volkova, Konstantin Pchelin, Iaroslav Bespalov, Dmitry V. Dylov, Petr Anokhin, Ivan Oseledets

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 trying to teach a robot how to solve a maze. You don't just give it a map; you let it wander, try different paths, and if it hits a wall, it tries again. This is the basic idea behind evolutionary search, a method used by computers to solve hard problems by mimicking nature's way of finding the best solutions. The computer generates thousands of random "ideas" (like different code snippets), tests them, keeps the ones that work best, and mixes them together to create even better ideas for the next round.

Now, imagine if every time the robot started a new maze, it forgot everything it learned in the previous one. It would have to rediscover that "turn left at the red rock" trick every single time, even if the new maze looked very similar. This is the problem researchers face with current AI systems that write code: they are brilliant at finding solutions, but they often treat every new task as if it's the very first day of school, forgetting the clever tricks they discovered yesterday. The paper you are about to read tackles this specific headache: how can we give these AI code-writers a "memory" so they can remember their best tricks and use them to solve new puzzles faster?


The Paper: EvoMem – Giving AI a Brain for Its Best Ideas

Meet EvoMem (Evolutionary Memory). Think of it as a digital "reference sheet" or a "highlight reel" for an AI that is trying to write better computer programs.

Usually, when an AI runs an evolutionary search to optimize code, it works like a lonely explorer. It tries a mutation (a small change to the code), sees if it gets a better score, and if it does, it keeps that new version. But once that run is over, the AI throws away all the notes on why that change worked. If you ask it to solve a similar problem later, it has to stumble upon that same clever trick all over again, wasting time and energy.

EvoMem changes the game by acting like a wise librarian. It doesn't just store the final code; it stores the story of the success.

How It Works: The Two-Phase Dance

The system operates in two distinct phases, like a chef cooking a meal and then writing down the recipe for next time.

Phase 1: The After-Party Cleanup (Writing to Memory)
After the AI finishes a round of searching and finds some winning code, EvoMem steps in. It looks at the successful changes and asks, "What was the actual trick here?"

  • Did the AI realize that "caching" a result saved time?
  • Did it figure out that "simplifying the math" made it faster?
  • Did it discover a specific way to arrange data?

It takes these insights, strips away the specific details of that one task, and turns them into a structured "memory card." It's like taking a complex magic trick and writing down the secret move on a notecard. It also keeps track of where the idea came from (provenance) so the AI knows it's a proven winner, not just a lucky guess.

Phase 2: The Pre-Game Huddle (Reading from Memory)
Before the AI starts a new round of searching on a new task, EvoMem flips through its notecards. It doesn't just dump the whole library on the AI; that would be overwhelming. Instead, it picks a few cards that seem relevant to the current problem.

  • If the new task is about packing shapes, it might pull a card about "using repulsive forces to spread things out."
  • If the new task is about answering questions, it might pull a card about "checking facts step-by-step."

The AI then reads these cards as advice. It's not a command; the AI can still ignore them if they don't fit. But often, these hints help the AI skip the boring part of "trying everything" and jump straight to the good stuff.

What They Found: Faster and Smarter

The researchers tested EvoMem on a variety of challenges, from packing circles into a box and solving geometry puzzles to optimizing code for graphics cards (GPUs) and answering complex trivia questions.

The results were promising. In many cases, the AI with memory didn't just find better solutions; it found them much faster.

  • Speed: For some tasks, like packing circles or solving the "Kissing Number" problem (a complex geometry puzzle), the memory-enabled AI reached the same high score as the "forgetful" AI but used far fewer attempts. In one case, it was nearly 9 times faster (a speedup of 9.26).
  • Quality: For other tasks, like optimizing scientific code or answering "HotpotQA" questions, the AI with memory actually found better final answers. On average, the memory-enabled runs showed a 6.40% improvement in their target scores compared to runs without memory.

However, the paper is careful to note that this isn't a magic wand that works perfectly every time. The results varied. For some tasks, the memory helped a lot; for others, like the "Kissing Number" problem, it only helped with speed, not the final quality. The authors suggest that the memory works best when the new task is related to the old one, allowing the AI to transfer a "strategy" rather than just copying code.

Why This Matters

The most important takeaway is that EvoMem proves we can teach AI to learn from its past without getting stuck in it.

Before this, if you wanted an AI to get better at a new job, you often had to start from scratch. EvoMem suggests that we can build systems that accumulate "experience." It's the difference between a student who forgets their math notes after every test and one who keeps a notebook of "what worked last time" to ace the next exam.

The researchers found that by storing these "successful mutation strategies" as structured advice, they could reduce the amount of redundant exploration. The AI didn't have to waste time rediscovering that "turning left at the red rock" was a good idea; it just remembered it.

In short, EvoMem shows that giving evolutionary AI a persistent memory can make it a more efficient explorer, helping it navigate new territories by remembering the paths that worked in the past. It's a step toward AI that doesn't just solve problems, but actually gets smarter about how it solves them over time.

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 →