Source-linked AI summary
Memory Transfer Learning: How Memories are Transferred Across Domains in Coding Agents
Kangsan Kim, Minki Kang, Taeil Kim, Yanlai Yang, Mengye Ren, Sung Ju Hwang
TL;DR
Existing coding-agent memory systems largely restrict retrieval to homogeneous domains, leaving shared infrastructure across diverse coding tasks underused. This paper investigates Memory Transfer Learning with heterogeneous memory pools and four memory representations, finding that performance improves when transferable meta-knowledge is reused, especially in abstract forms.
Problem
Existing coding-agent approaches mostly restrict memory generation and retrieval to the same domain, despite diverse coding tasks sharing runtimes, languages, and dependency stacks.
Method
The paper evaluates Memory Transfer Learning across 6 coding benchmarks using heterogeneous memory pools and four representations ranging from Trajectory to Insight.
Results
3.7% average-score improvement across 6 coding benchmarks shows that heterogeneous-domain memory can improve coding-agent performance.
Takeaways & Limitations
Transferable value lies mainly in meta-knowledge, and higher-level abstractions such as Insights generalize better than task-specific traces.
Takeaways & Limitations
Cross-domain retrieval remains challenging because static retrieval methods fail to generalize in heterogeneous agentic settings.
Abstract
from arXiv · showhide
Memory-based self-evolution has emerged as a promising paradigm for coding agents. However, existing approaches typically restrict memory utilization to homogeneous task domains, failing to leverage the shared infrastructural foundations, such as runtime environments and programming languages, that exist across diverse real-world coding problems. To address this limitation, we investigate \textbf{Memory Transfer Learning} (MTL) by harnessing a unified memory pool from heterogeneous domains. We evaluate performance across 6 coding benchmarks using four memory representations, ranging from concrete traces to abstract insights. Our experiments demonstrate that cross-domain memory improves average performance by 3.7\%, primarily by transferring meta-knowledge, such as validation routines, rather than task-specific code. Importantly, we find that abstraction dictates transferability; high-level insights generalize well, whereas low-level traces often induce negative transfer due to excessive specificity. Furthermore, we show that transfer effectiveness scales with the size of the memory pool, and memory can be transferred even between different models. Our work establishes empirical design principles for expanding memory utilization beyond single-domain silos. Project page: https://memorytransfer.github.io/
1. Introduction
Memory Transfer Learning addresses the limitation of single-domain memory use by testing whether heterogeneous coding-task memories transfer across shared infrastructure. The study evaluates this approach across six coding benchmarks and identifies meta-knowledge and abstraction as central to transfer.
- Existing coding agents generally generate and retrieve memories within one domain, despite coding tasks sharing runtimes, languages, and dependency stacks.
- The paper asks whether heterogeneous-domain memories improve coding-agent performance, why transfer helps, and which factors determine transfer effectiveness.
- 3.7% average-score improvement across 6 coding benchmarks demonstrates that Memory Transfer Learning provides transferable knowledge.
- Cross-domain benefits primarily come from meta-knowledge such as failure prevention, structural and interface inspection, and strict validation routines rather than task-specific code.
- Higher abstraction improves transferability: Insights generalize across tasks, whereas detailed Trajectories can distract agents through excessive specificity.
- The study presents a holistic investigation showing room to expand memory use beyond homogeneous domains through heterogeneous memory pools.
2. Related Work
Related work situates Memory Transfer Learning within coding agents, self-evolving memory systems, and broader transfer-learning approaches. These strands span task scales, memory mechanisms, and parametric or non-parametric knowledge reuse.
- Coding Agents: Coding agents have progressed from function-level generation to repository-level modification and domain-specific code-generation tasks.
- Memory Transfer Learning: Figure 2 organizes memory into Trajectory, Workflow, Summary, and Insight formats to study how abstraction affects cross-task transferability.
- Memory-based Self-evolving Agents: Self-evolving agents reuse successful patterns and avoid erroneous actions, with prior systems emphasizing memory generation and retrieval during environment interaction.
- Transfer Learning: Transfer learning traditionally reuses source-domain knowledge through model updates, while newer methods transfer knowledge non-parametrically through inference-time context.
3. Memory Transfer Learning
The paper implements Memory Transfer Learning with offline memory generation, heterogeneous memory pools, and query-time retrieval across coding benchmarks. It compares four representations whose abstraction levels determine how broadly memories transfer.
- Memory Transfer Learning uses memories generated from heterogeneous tasks and applies them to target coding tasks in shared environments.
- The coding agent separates offline memory generation from query-time memory retrieval during inference.
- Four representations are constructed from inference histories: detailed Trajectories, reusable Workflows, explanatory Summaries, and generalized Insights.
- Workflow memories extract meaningful actions toward a goal, making them shorter than Trajectories and less prone to distraction from unrelated information.
- A heterogeneous memory pool combines memories from all non-testing benchmarks, indexes them with embeddings, and retrieves relevant items for each target task.
- The evaluation covers six coding benchmarks, using gpt-5-mini throughout memory generation, agent execution, and judging.
- MTL improves over zero-shot performance across models and memory types, with Insight achieving the highest average performance.
4. Experimental Results and Analysis
Across six coding benchmarks, Memory Transfer Learning improves performance, with the strongest benefits arising from abstract meta-knowledge rather than task-specific code. Transferability increases with abstraction and memory-pool size, but incorrect retrieval or rigid reuse can cause negative transfer.
- Main results: More than 4.0% and up to 8.3% gains occurred on four benchmarks when Insight memories were transferred.All MTL variants outperformed the zero-shot baseline.
- Main results: 2.6% and 1.8% average improvements were observed on DeepSeek V3.2 and Qwen3-Coder-480B-A35B-Instruct, respectively.These results validate cross-model transfer, including on open-sourced models.
- Comparison with self-evolving approaches: MTL outperformed ReasoningBank by +2.9% and AgentKB by +1.7% while using 431 memories versus AgentKB’s approximately 5.8k.The comparison used Pass@3 scores across three benchmarks and three runs per model.
- Transfer mechanisms: Transferred memory primarily contributes meta-knowledge, including minimal patches, self-generated verification, and safeguards against tool-chain or infrastructure failures.Algorithmic Strategy Transfer accounted for only 5.5% of total gains.
- Abstraction and transferability: Insight and Summary memories transfer more effectively than Workflow and Trajectory memories because higher abstraction avoids brittle implementation anchoring.Task and workflow embeddings cluster by benchmark, whereas Insight embeddings are sparse and intermingled.
- Scaling and failure modes: Larger memory pools consistently improve average performance because they increase the likelihood of retrieving relevant memories for the target task.However, negative transfer arises from misleading anchors, false validation confidence, misapplied procedural reuse, and failed adaptation.
5. Conclusion
Memory Transfer Learning shows that heterogeneous memory pools can improve coding-agent performance beyond homogeneous task domains. Its design principles emphasize meta-knowledge, abstraction, and larger, more diverse memory pools.
- 3.7% performance improvement was achieved across 6 diverse coding benchmarks using heterogeneous memory.
- Transferred memory primarily provides meta-knowledge rather than task-specific workflows.
- Abstraction determines transferability: high-level Insights generalize effectively, whereas low-level Trajectories can induce negative transfer.
- Transfer effectiveness increases with the size and diversity of the memory pool, improving the likelihood of retrieving useful meta-knowledge.
Impact Statement
The work introduces Memory Transfer Learning for self-evolving coding agents by leveraging knowledge across heterogeneous domains. It aims to improve generalizability and data efficiency through transferable high-level meta-knowledge.
- Memory Transfer Learning leverages knowledge across heterogeneous domains for self-evolving coding agents.
- Transferring high-level meta-knowledge is intended to make agentic systems more generalizable and data-efficient.
- The approach may reduce the need for extensive domain-specific fine-tuning.
A. Average Pass@1 Results
The supplied table caption identifies evaluation results for Memory Transfer Learning but does not report average Pass@1 values or comparisons.
- Table 8 presents evaluation results of Memory Transfer Learning.
B. Case Study on Negative Transfer
The negative-transfer case study documents failures caused by misapplying or distorting retrieved knowledge. Examples include cross-language pattern transfer and turning high-level guidance into shortcuts.
- Negative transfer can result from misapplying retrieved knowledge across programming languages, such as transferring R patterns to C++.
- Negative transfer can also result when agents distort high-level guidance into justifications for suboptimal shortcuts.
C. Formal Modeling of Abstraction
The paper models memory as a combination of domain-invariant meta-knowledge and domain-specific information, then defines abstraction as the invariant share. Under bounded-capacity and mismatch assumptions, higher abstraction yields greater expected transfer gains.
- Memory embeddings decompose into domain-invariant and domain-specific components: e(m) = zinv(m) + zsp(m).
- Abstraction level A is defined as the proportion of a memory embedding attributable to its domain-invariant component.
- Higher A indicates that memory emphasizes transferable meta-knowledge over domain-specific details.
- For an unseen task, memory utility balances transferable guidance against a penalty from brittle domain mismatch.
- Under bounded embedding capacity and misaligned domain-specific components, increasing A reduces expected mismatch penalties and lets invariant knowledge dominate utility.
- Expected empirical transfer gain strictly increases with abstraction level A under the model’s assumptions.
D. Memory Benefit Category
Table 10 presents categories of memory benefits generated by the LLM for analysis.
- The table presents categories of memory contributions generated by the LLM for analysis.
- The supplied passages identify the table’s organizational purpose but do not specify its individual benefit categories.
- Table 10 is titled “Categories of Memory Benefits.”
E. Memory Generation Prompts
The paper uses prompts to convert successful and failed command trajectories into reusable workflows or structured summaries, and to extract transferable insights. These prompts emphasize strategies, anti-patterns, context, and reasons for success or failure.
- Successful trajectories are converted into reusable base workflows capturing the core strategy behind successful file discovery, editing, and verification.
- Failed trajectories are converted into reusable workflows that capture misleading strategies and anti-patterns to avoid.
- Successful trajectories receive structured summaries explaining the task context, approach, and factors behind success.
- The materials include prompts for generating summaries and insights from both successful and failed trajectories.