Coding agents get smarter every month. But they share a weird blind spot: every time they switch from debugging a Python web app to fixing a C++ compiler error, they start from scratch. No memory. No carryover. Just blank slate.

A new paper from KAIST, NYU, and DeepAuto.ai asks a simple question. What if agents could remember what they learned in one domain and apply it somewhere completely different?

The answer turns out to be yes. But only if you remember the right kind of thing.

The Memory Problem

Most coding agents that use memory keep it siloed. An agent solving SWE-bench problems only pulls from memories of other SWE-bench problems. An agent writing competitive code only references its own past competitive solutions. The assumption is that cross-domain transfer is too noisy to help.

This makes some intuitive sense. A memory about fixing a Django ORM bug sounds useless when you're optimizing a machine learning pipeline.

But the researchers behind Memory Transfer Learning (MTL) noticed something. Coding tasks across different domains share infrastructure. They use the same languages, the same build tools, the same runtime environments. There's real structure underneath the surface differences.

So they built a unified memory pool. Instead of restricting an agent to domain-specific memories, they gave it access to everything. All domains. All task types. Six benchmarks, from live coding interviews to software engineering repairs to terminal challenges.

The result: a 3.7% average improvement across all six benchmarks. Not earth-shattering on its own. But the story behind that number is where things get interesting.

Not All Memories Are Equal

The team tested four ways to represent memories, arranged from concrete to abstract:

  • Trajectory — the raw log of every command the agent typed and every result it got back. Messy. Verbose. Includes all the failures.
  • Workflow — a cleaned-up version that extracts the reusable action sequence and a goal statement.
  • Summary — a natural-language recap of what worked, what didn't, and why.
  • Insight — generalizable principles stripped of task-specific details. Written to be domain-agnostic.

Here's the key finding. The abstract memories transfer beautifully. The concrete memories actually make things worse.

Insight memories delivered the best results: up to 8.3% improvement on individual benchmarks. Trajectory memories, the raw command logs, sometimes hurt performance. The agent would blindly follow stale commands from a different task and crash.

This makes sense when you think about it. A raw trajectory includes something like cat <<'PY' > train_predict.py ... OneHotEncoder(..., sparse=False) ... PY. That specific line caused a TypeError when reused in a different environment where the library API changed. But an insight memory says "inspect evaluation requirements and adapt to library API changes." That principle applies everywhere.

The researchers proved this with embedding analysis. When they plotted trajectory memories in 2D space, they clustered tightly by benchmark. The memories from one domain stayed far from memories of another. Insight memories scattered evenly. No clusters. Clean mixing. They generalized because they were designed to.

And a direct test confirmed it. Within the insight category, task-agnostic insights beat task-specific ones by 1.1% on average. Abstraction itself drives the benefit, not format.

What Actually Transfers

The team collected every case where a zero-shot agent failed but MTL with insights succeeded. They categorized why the transferred memory helped.

The dominant category was meta-knowledge. Not code. Not algorithms. Procedural knowledge about how to approach problems.

Things like:

  • Write inline tests to validate your fixes before submitting
  • Inspect evaluation scripts first so you know the exact output format
  • Combine training and validation data before your final model
  • Adapt to library API changes rather than assuming old signatures work

These are general principles about how to work. They're not specific to any benchmark or language. They're the kind of thing an experienced developer picks up over years and applies everywhere.

Only 5.5% of successful transfers involved algorithmic strategy. The rest was meta-knowledge about process, validation, and safe practices.

When Transfer Goes Wrong

MTL isn't all upside. Sometimes cross-domain memories hurt. The researchers identified three failure modes.

Domain-mismatched anchoring. A memory from one domain looks structurally similar to your current task but is actually irrelevant. The agent follows the misleading pattern and gets worse results than it would with no memory at all.

False validation confidence. A memory about verification procedures creates a false sense of certainty. The agent thinks it has validated its solution. It hasn't. It's in a self-confirming loop that misses the actual success criteria.

Misapplied best practices. A pattern that genuinely works in one domain gets transferred somewhere it doesn't belong. The agent over-engineers a simple task because a memory says "always do X."

These are real problems. But they're manageable. The researchers found that simple embedding-based retrieval outperformed fancier methods like LLM reranking and adaptive memory rewriting. In cross-domain settings, the sophisticated retrieval approaches didn't generalize. Sometimes simple is better.

Scale and Diversity Both Matter

The benefits of MTL aren't fixed. They scale.

Larger memory pools performed better. More source domains performed better. The researchers tested from 1 domain up to 9. Performance climbed steadily. More domains meant more diverse meta-knowledge. More meta-knowledge meant a higher chance that something relevant would surface for any given task.

This has a practical implication. If you're building a coding agent with memory, you should cast a wide net. Don't just accumulate memories in one narrow domain. Build a broad pool.

Cross-Model Transfer Works Too

Here's a finding that surprised me. Memories generated by one model help a different model.

The researchers tested memories from GPT-5-mini applied to DeepSeek V3.2, and vice versa. Also Qwen3-Coder. Cross-model transfer consistently beat the zero-shot baseline. Self-generated memories (where the source and target model are the same) performed best. But cross-model transfer still helped.

This matters because it means memory pools don't need to be model-specific. You can build a shared memory infrastructure that benefits any model. That's a big deal for teams running multiple agents or switching models over time.

Why This Matters

The current paradigm in coding agents treats each task domain as an island. SWE-bench memories for SWE-bench tasks. Competitive programming memories for competitive programming tasks. This paper shows that's leaving performance on the table.

The practical takeaways are clear:

  • Build unified memory pools, not domain-specific ones
  • Store insights, not raw trajectories
  • Prioritize abstraction and task-agnostic knowledge
  • More diverse domains means better transfer
  • Memory transfer works across different models

The 3.7% average improvement is modest but consistent. And the insight representation achieves up to 8.3% on harder benchmarks like ReplicationBench, where meta-knowledge about validation and exploration strategies matters most.

There's also a deeper lesson here. The researchers found that MTL outperforms existing self-evolving methods like ReasoningBank and AgentKB while using far fewer memories. MTL uses 431 memories. AgentKB uses 5,899. Quality of memory representation matters more than quantity.

The paper doesn't solve everything. Cross-domain retrieval remains challenging. Negative transfer is real. But the direction is promising. Instead of building smarter agents in isolation, we should think about how agents share and transfer what they learn across boundaries.

That's how humans work. A senior developer carries lessons from one project to the next. Not the specific code. The principles. The process. The meta-knowledge about how to debug, validate, and adapt.

Now coding agents can do the same.


Citations:

Suggested title: Your AI Coding Agent Has Amnesia. Here's the Fix.

Word count: 1,085

Fact-check notes:

  • The 3.7% average improvement figure comes directly from the paper's Table 1 and abstract. Confirmed across multiple sources.
  • The four memory representations (Trajectory, Workflow, Summary, Insight) are described in the paper's Method section and Figure 2.
  • The 5.5% algorithmic strategy transfer figure comes from Figure 4 analysis.
  • The 8.3% figure appears in Table 1 for ReplicationBench with Insight memories on GPT-5-mini (0.111 → 0.189 = +7.8%) and MLGym-Bench (0.667 → 0.750 = +8.3%). The paper's text says "up to 8.3%."
  • The 431 vs 5,899 memory count comes from Table 2. Confirmed.
  • Cross-model transfer results come from Table 4 (Pass@1). Confirmed.
  • The retrieval comparison (embedding similarity vs LLM reranking vs adaptive rewriting) comes from Table 5. Confirmed.
  • I described the paper as "from KAIST, NYU, and DeepAuto.ai" based on the author affiliations listed on the project page. Should verify this is accurate if it matters for publication.
  • The case studies (Django ORM, OneHotEncoder) are from the paper's Analysis section. I simplified them for readability but preserved the key details.