← Latest papers
🤖 AI

Enhancing Software Engineering Through Closed-Loop Memory Optimization

This paper introduces \ours, a closed-loop framework that optimizes memory utility in software engineering agents by grounding it in validated downstream impact, thereby enabling task-agnostic evaluation and annotation-free optimization that significantly improves success rates, resolve efficiency, and computational cost.

Original authors: Xuehang Guo, Zora Zhiruo Wang, Qingyun Wang, Graham Neubig, Xingyao Wang

Published 2026-06-05
📖 4 min read☕ Coffee break read

Original authors: Xuehang Guo, Zora Zhiruo Wang, Qingyun Wang, Graham Neubig, Xingyao Wang

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

The Problem: The "Goldfish" Software Engineer

Imagine you hire a brilliant new software engineer to fix bugs in a massive, complex codebase (a giant library of digital instructions). This engineer is incredibly smart but suffers from a severe case of goldfish memory.

Every time they start a new task:

  1. They forget everything they learned yesterday.
  2. They have to re-read the entire library from scratch to find where things are.
  3. They make the exact same mistakes they made on the previous project.
  4. They reinvent the wheel every single time.

In the world of Artificial Intelligence, these "engineers" are Large Language Models (LLMs) acting as software agents. The paper argues that while these AI agents are powerful, they are fundamentally episodic. They live only in the "now." They don't learn from their past experiences, so they keep stumbling over the same hurdles, wasting time and computing power.

The Old Solution: The "Notebook" That Doesn't Work

Researchers tried giving these AI agents a "notebook" (memory) to write things down. But the old notebooks had a major flaw: Nobody knew what was actually useful to write down.

  • Some agents wrote down every single keystroke (too much noise).
  • Some wrote down vague summaries that didn't help (too vague).
  • There was no rule to say, "Hey, this specific note actually helped me solve the problem later, so keep it," or "This note was useless, throw it away."

Without a way to judge if a memory is actually good, the agents just filled their notebooks with junk, making them slower and more confused.

The New Solution: MemOp (The "Smart Mentor")

The authors introduce MemOp, a system that acts like a strict, data-driven mentor. Instead of just letting the AI write whatever it wants, MemOp uses a "closed-loop" process to ensure the AI only keeps memories that prove they work.

Think of MemOp as a fitness coach for the AI's brain:

  1. The Workout (The Task): The AI tries to fix a software bug.
  2. The Reflection (The Memory): After the task, a special "Memory Model" (a smaller AI) looks at what happened and tries to write a summary (a memory) of what was learned.
  3. The Test (The Crucial Step): This is the magic part. The system doesn't just guess if the memory is good. It tests it.
    • It asks: "If we give this memory to the AI to solve a new problem, does it help?"
    • If the memory helps the AI solve the new problem faster or better, the memory is accepted.
    • If the memory doesn't help (or makes things worse), it is rejected and thrown in the trash.

This creates a Closed Loop: The system only learns from memories that have been proven to improve performance. It's like a chef who only keeps recipes that actually taste good, discarding the ones that ruin the meal.

How It Works in Practice

The paper describes a two-step training process for this "Memory Mentor":

  • Step 1: Learning the Basics (Supervised Fine-Tuning): The mentor learns how to write a decent summary of what happened, just like a student learning to take notes.
  • Step 2: Learning from Results (Reinforcement Learning): The mentor gets a score based on whether its notes actually helped the AI in the next round. If the notes helped, the mentor gets a "reward." If they didn't, the mentor gets a "penalty." Over time, the mentor learns to write only the notes that matter.

The Results: Faster, Smarter, Cheaper

The paper tested this system on real-world software engineering tasks (fixing bugs in open-source projects). Here is what happened:

  • Success Rate: The AI agents with MemOp fixed significantly more bugs (up to 5.25% more) than agents without it.
  • Efficiency: They solved problems faster, using fewer steps (up to 4.63% more efficient).
  • Cost: Because they didn't have to re-read everything or make the same mistakes, they used at least 9.79% less computing power.

The Takeaway

MemOp changes the game by treating memory not as a static list of facts, but as a dynamic tool that is constantly optimized.

Instead of an AI that says, "I remember I tried this before, but I don't know if it worked," MemOp gives the AI a system that says, "I remember this specific lesson because I tested it, and I know it helps me win."

It turns the AI from a forgetful goldfish into a seasoned veteran who learns from every single experience, getting smarter and more efficient with every task it tackles.

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 →