Memory Transfer Learning: How Memories are Transferred Across Domains in Coding Agents
Paper: arXiv:2604.14004 Code: KangsanKim07/MemoryTransferLearning Code reference:
main@61c6e4e3(2026-04-16)
1. Motivation (研究动机)
现有 memory-based self-evolving coding agents 的核心假设通常是“同一 benchmark / 同一任务域内的经验最可靠”:agent 在某个环境中失败或成功后,把轨迹、workflow 或 insight 存起来,下一次在相似任务中检索并复用。这一范式能减少重复试错,但也把 memory 的适用边界限制在 homogeneous domain 内;当真实 coding agents 同时面对 function-level coding、repository-level bug fixing、terminal/bash task、科学代码复现和 ML 实验任务时,这种限制会浪费跨任务共享的基础设施知识。
本文要解决的问题是:coding agent 的 memory 是否可以跨 domain 转移,以及什么类型的 memory 才真正可转移。作者把问题定义为 Memory Transfer Learning (MTL):对目标 benchmark 做推理时,不从 自身历史中取 memory,而是从其他 heterogeneous coding benchmarks 产生的统一 memory pool 中检索相关经验,再注入当前 agent 的 system prompt。
这个问题值得研究的原因有三点:
- 现实 coding 环境共享底层结构:不同 benchmark 虽然任务表面不同,但常常共享 Linux shell、Python tooling、repository exploration、test/verify/submit 流程、API contract 检查、错误恢复等 procedural knowledge。
- 直接复用 domain-specific code 很危险:跨语言、跨仓库、跨评测协议时,低层命令或代码片段可能变成误导锚点;因此关键不是“把旧代码搬过来”,而是判断哪些经验可以抽象成 task-agnostic meta-knowledge。
- 如果跨域 memory 有效,agent 可以用更少 memory 覆盖更广任务:实验里 MTL 只用 431 条 memory 就超过 AgentKB 的 5,899 条 memory 平均表现,说明高质量、跨域可迁移 memory 比单纯堆大 memory bank 更重要。
2. Idea (核心思想)
核心洞察是:跨 domain 可迁移的主要不是具体算法或代码,而是指导 agent 如何行动的 meta-memory,例如先 inspect 再 edit、用小型验证脚本检查修改、不要盲目 overwrite、遵守 benchmark 的输出协议和 API contract。只要 memory 的抽象层级足够高,它就能从一个 coding domain 泛化到另一个 domain;反过来,越接近原始命令/trace 的 memory 越容易产生 negative transfer。
本文的关键创新不是提出复杂模型结构,而是系统性地构造并比较四种 memory representation:Trajectory、Workflow、Summary、Insight。它们从低层执行轨迹到高层行为原则形成一条 abstraction spectrum,作者用六个 coding benchmarks、三类模型和多组 ablation 证明:Insight 这类高抽象 memory 在跨域迁移中最稳定。
与 ReasoningBank / AgentKB 的根本区别在于评估问题和分析粒度不同:ReasoningBank 主要在相似任务中复用 insight,AgentKB 使用大规模 unified memory 但缺少对“什么知识可迁移”的机制分析;本文强制目标 benchmark 从其他 benchmarks 的 memory pool 检索,并进一步拆解 meta-knowledge、abstraction、pool size、source-domain count、cross-model transfer 和 negative transfer 的原因。
3. Method (方法)
3.1 Overall framework:两阶段 Memory Transfer Learning
MTL 的 pipeline 分成 offline memory generation 与 online memory retrieval 两步。第一步先让 coding agent 在多个 benchmarks 上运行,收集每个任务的 inference history;第二步在目标 benchmark 推理时,从非目标 benchmarks 组成的 memory pool 中取 top- memories,把它们 prepend 到 coding agent 的 prompt 里。
Figure 1 解读:图中 A 是无 memory 的 agent;B 是传统 self-evolving agent,只能在单一 domain 内复用 memory;C 是本文的 MTL,把 heterogeneous coding tasks 的 memory 合并成共享池;D 的 hatched bars 表示 MTL 在多个 memory format 上相对 self-evolving setting 更稳。这个图的重点是把“同域经验复用”改成“跨域经验转移”,但仍然通过 prompt 注入完成,不涉及参数更新。
设一个任务为 ,agent 的推理过程包含多步 reasoning、action 和 observation: 其中 是 agent 的中间思考或计划, 是实际执行的 shell / code-edit / command action, 是环境返回的观察。MTL 不直接把所有 都塞给新任务,而是先把 转成不同抽象层级的 memory representation。
3.2 四种 memory representation:从 trace 到 insight
Figure 2 解读:图中从 Trajectory 到 Insight 逐步减少 task-specific 细节。Trajectory 保存命令和 observation,最接近原始执行;Workflow 保留目标和关键动作;Summary 把任务、环境、动作和成败分析压缩成自然语言;Insight 进一步要求不提具体文件或字符串,而是写成可泛化原则。这个层级设计是全文实验的核心自变量。
Trajectory memory
Trajectory memory 直接拼接 agent 执行过的 commands / code actions 及其执行结果,但去掉 reasoning sentences。论文定义为: 它的优点是信息最完整:新任务可以参考旧任务里某个命令的预期输出、报错模式或环境结构。缺点也最明显:跨 domain 时文件名、语言、依赖、评测协议往往不同,旧 trajectory 中的具体命令容易诱导 agent 做 blind imitation。
Workflow memory
Workflow memory 用 LLM 从完整 trajectory 中抽取一个 reusable workflow,包含 goal 和若干 meaningful actions: 它比 Trajectory 更短,保留“为了达成目标应执行哪些关键步骤”的结构,减少无关 observation 干扰。它仍然偏 task-specific,因为 action 可能包含具体命令、文件路径或语言习惯;所以 Workflow 在跨 domain 时比 Trajectory 安全,但仍可能迁移错误的低层过程。
Summary memory
Summary memory 解决 raw command 无法解释“为什么成功/失败”的问题。LLM 从 trajectory 中生成 task summary 和 experience summary : 它显式包含成败分析,因此对失败轨迹也有价值:agent 可以知道某些策略为什么不应该重复。Summary 的抽象程度高于 Workflow,但仍保留任务和环境描述,因此仍可能带有源 domain 的语义痕迹。
Insight memory
Insight memory 是最高抽象格式,沿用 ReasoningBank 风格,包含 title、description、content: LLM 被要求解释任务成功或失败背后的通用原则,并避免提具体文件、query 或字符串内容。作者特别强调要生成可泛化到未来相似任务的 insights,因此它更接近“行为策略”而非“旧任务记录”。实验结果表明,Insight 在跨域 MTL 中平均效果最好。
3.3 Memory pool construction 与 retrieval
对目标 benchmark 和 memory type ,MTL 的 memory pool 排除目标 benchmark 本身,只收集其他 benchmarks 的 memories:
构建 pool 时,每条 memory 会用 text embedding model 编码并存储 embedding。论文实验使用 OpenAI text-embedding-3-small。推理时,对当前任务生成 query embedding,并计算 query 与 memory embedding 的 cosine similarity;最后取 similarity 最高的 top- memories。实验中 。
对 Trajectory,因为 memory 中保留 task 字段,query 直接用当前 task。对 Workflow、Summary、Insight,论文说明会先让模型根据当前 task 写 4–5 句 coding plan,再用该 plan 的 embedding 作为 query,以避免直接匹配表面任务文字。
3.4 为什么 abstraction 影响 transfer
作者在 appendix 给出一个 formal abstraction model,把 memory embedding 分解为 domain-invariant meta-knowledge 和 domain-specific component: memory 的 abstraction level 定义为 invariant component 在总能量中的占比: 对未见 target task ,retrieved memory 的 utility 被建模为 transferable guidance 减去 domain mismatch penalty: 直觉上, 越高,memory 中越多是“怎样安全探索仓库、怎样验证、怎样避免错误操作”这类 meta-knowledge; 越低,memory 越容易包含源任务的语言、文件结构、命令和评测细节。跨域时,前者可以成为稳定引导,后者则更像噪声或错误锚点。
3.5 Embedding-space evidence:abstraction 的可视化与指标
Figure 3 解读:t-SNE 图显示 task embeddings 会按 benchmark 聚类,Trajectory / Workflow 也更接近这种 domain cluster;到 Summary / Insight 后,不同 benchmark 的点更稀疏、更混合。这支持作者的解释:越高抽象的 memory 越不绑定源 domain,因此更适合跨域检索。
Figure 4 解读:DBI 上升表示 benchmark-level cluster separation 变弱,LISI 上升表示局部邻域中 benchmark 混合更强。两者都从定量角度说明 Trajectory / Workflow 更 task-specific,而 Summary / Insight 更 generalized。它们与表 1 中 Insight 平均最好、Summary 次之的趋势一致。
3.6 Pseudocode:基于 released code 的可执行逻辑抽象
Code reference:
main@61c6e4e3(2026-04-16) — pseudocode and mapping based on this commit
Released repo 的 README 仍写着 “Code Coming Soon”,但仓库中已经包含 Harbor / Mini-SWE-Agent 相关 memory utilities。下面伪代码按当前 release 中 harbor/experiments/utils/memory_extract.py 与 mini-swe-agent/src/minisweagent/agents/utils.py 的实际逻辑抽象;它反映的是 available implementation evidence,而不是完整的一键复现实验包。
Component A:memory extraction
import pickle
from filelock import FileLock
def extract_trajectory_memory(task, commands, task_name, benchmark, judge, log_dir, embed):
item = {
"task_name": task_name,
"task": task,
"commands": commands,
"benchmark": benchmark,
"judgement": judge,
"type": "trajectory",
}
item["embedding"] = embed(item["task"])
append_pickle_with_lock(log_dir.parent / "trajectory_memory.pkl", item)
return item
def extract_llm_memory(kind, trajectory, task, task_name, benchmark, judge, log_dir, llm, embed):
prompt = select_success_or_failure_prompt(kind=kind, judge=judge)
raw = llm(model="gpt-5-mini", system=prompt, user=f"Trajectory:\n{trajectory}")
parsed = parse_json(raw)
if kind == "workflow":
key_text = parsed["goal"]
item = {"type": "workflow", "workflow": parsed, "llm_judge": judge}
out_path = log_dir.parent / "workflow_memory.pkl"
elif kind == "summary":
key_text = parsed["task_summary"]
item = {"type": "summary", **parsed, "judgement": judge}
out_path = log_dir.parent / f"summary_memory_{benchmark}.pkl"
elif kind == "insight":
key_text = parsed["title"]
item = {"type": "insight", "insight": parsed, "llm_judge": judge}
out_path = log_dir.parents[1] / "insight_memory.pkl"
else:
raise ValueError(kind)
item.update({"benchmark": benchmark, "task_name": task_name, "task": task})
item["key_embedding"] = embed(key_text)
append_pickle_with_lock(out_path, item)
return itemComponent B:top- retrieval
import numpy as np
def cosine(a, b):
a = np.asarray(a)
b = np.asarray(b)
return float(np.dot(a, b) / (np.linalg.norm(a) * np.linalg.norm(b)))
def retrieve_topk(memory_items, query_text, embed, k=3):
query = embed(query_text)
scored = []
for item in memory_items:
key = item.get("key_embedding") or item.get("embedding")
scored.append((cosine(query, key), item))
return sorted(scored, key=lambda pair: -pair[0])[:k]Component C:format-specific query construction
def build_query_for_memory(memory_type, task, llm):
if memory_type == "trajectory":
return task
if memory_type == "summary":
return llm(
model="gpt-5-mini",
system="Summarize the task goal and required actions in 2-3 sentences.",
user=f"Task: {task}",
)
if memory_type in {"workflow", "insight"}:
return llm(
model="gpt-5-mini",
system="Write a clear 3-4 sentence high-level plan; do not solve the task.",
user=f"Task: {task}",
)
raise ValueError(memory_type)Component D:prompt injection into the coding agent
def format_memory_prompt(memory_type, retrieved):
prompt = "\n\nBelow are memory items from past interactions that may help solve the task."
prompt += "\nAt each step, explicitly state which memory item you want to use."
if memory_type in {"trajectory", "workflow"}:
prompt += " Since LLM judgments may be wrong, verify memories and do NOT blindly follow failed attempts."
for i, (score, item) in enumerate(retrieved, start=1):
result = "PASS" if item.get("llm_judge") or item.get("judgement") else "FAIL"
prompt += f"\n\n# Memory Item {i}\n"
if memory_type == "trajectory":
prompt += f"## Task: {item['task']}\n## Trajectory: {truncate_observations(item['trajectory'])}\n## LLM Judgment: {result}"
elif memory_type == "workflow":
prompt += f"## Goal: {item['workflow']['goal']}\n## Workflow: {item['workflow']['workflow']}\n## LLM Judge: {result}"
elif memory_type == "summary":
prompt += f"## Task: {item['summary']['task_summary']}\n## Summary: {item['summary']['experience_summary']}\n## Result: {result}"
elif memory_type == "insight":
ins = item["insight"]
prompt += f"## Title: {ins['title']}\n## Description: {ins['description']}\n## Content: {ins['content']}"
return prompt3.7 Code-to-paper mapping
Code reference:
main@61c6e4e3(2026-04-16) — pseudocode and mapping based on this commit
| Paper Concept | Source File | Key Class/Function |
|---|---|---|
| 四种 memory generation:Trajectory / Workflow / Summary / Insight | harbor/experiments/utils/memory_extract.py | extract_rawtraj_memory, extract_workflow_memory, extract_summary_memory, extract_insight_memory |
| Memory generation prompts:成功/失败轨迹分别生成 workflow / summary / insight | harbor/experiments/prompts/memory.py | WORKFLOW_CORRECT_EXTRACT_PROMPT, WORKFLOW_WRONG_EXTRACT_PROMPT, SUMMARY_*, INSIGHT_* prompts |
| Embedding 与 cosine retrieval | mini-swe-agent/src/minisweagent/agents/utils.py | get_embeddings, cosine_similarity |
| Trajectory / Workflow / Summary / Insight retrieval and prompt formatting | mini-swe-agent/src/minisweagent/agents/utils.py | get_traj_memory, get_workflow_memory, get_summary_memory, get_insight_memory |
| Reranking / adaptive rewriting ablation | mini-swe-agent/src/minisweagent/agents/utils.py | get_workflow_insight_memory_rerank, get_wi_memory |
| Benchmark runner and inference config | harbor/experiments/run_*.py | run_livecodebench.py, run_aider-polyglot.py, run_swebench.py, run_terminalbench2.py, run_replicationbench.py, run_mlgym-bench.py |
| Benchmark task inventory / sample counts | harbor/registry.json | registry entries for livecodebench, aider-polyglot, swebench-verified, terminal-bench, replicationbench, mlgym-bench |
论文公式与 released code 实现差异:当前 release 不是一个完整清理过的 MTL reproduction package。README 明确写 “Code Coming Soon”,但仓库包含部分 Harbor / Mini-SWE-Agent memory utilities。可见差异包括:1) 论文把 Trajectory 定义为 ,而 extract_rawtraj_memory 当前只保存 task 与 commands,没有在该函数中显式保存完整 observation list;2) 论文说 Workflow/Summary/Insight query 使用 4–5 句 plan,但代码中 get_summary_memory 生成 2–3 句 task goal summary,get_workflow_memory 与 get_insight_memory 生成 3–4 句 plan,get_wi_memory 才使用 4–5 句 plan;3) extract_summary_memory 写出 summary_memory_{benchmark}.pkl,而 get_summary_memory 读取 /current/{benchmark_name}/summary_memory.pkl,说明 release 中仍有路径命名不一致;4) 论文中的 cross-domain exclusion pool 在 released retrieval utilities 中体现为读取 /current/{benchmark_name}/*.pkl,但跨域 pool 的离线 merge 脚本未在当前 README 中明确公开。
4. Experimental Setup (实验设置)
4.1 Benchmarks and scale
论文在 6 个 coding benchmarks 上评估不同 memory utilization methods。根据论文正文和 released harbor/registry.json / runner scripts,可整理为:
| Benchmark | Task type | Evaluated scale in this repo/paper setting |
|---|---|---|
| LiveCodeBenchv6 | function-level / competitive coding | 100 sampled tasks (registry.json already lists 100) |
| Aider-Polyglot | polyglot code editing | 100 sampled from 225 tasks (run_aider-polyglot.py samples 100) |
| SWE-Bench Verified | repository-level software engineering | 100 sampled from 500 tasks (run_swebench.py samples 100) |
TerminalBench2 / terminal-bench | terminal/bash environment tasks | 89 tasks in registry |
| ReplicationBench | scientific knowledge grounding / computational experiment replication | 90 tasks in registry |
| MLGym-Bench | ML research / model development tasks | 12 tasks in registry |
论文正文的通用规则是:如果某 benchmark 总样本数超过 100,就随机采样 100;否则使用现有任务集。评价指标使用每个 benchmark 自身的 success protocol,并报告 Pass@3;appendix 还报告 Pass@1。
4.2 Baselines and compared methods
主要比较对象包括:
- Zero-shot:不注入 memory 的 mini-swe-agent coding agent。
- MTL (T/W/S/I):分别使用 Trajectory、Workflow、Summary、Insight memory 的 cross-domain memory transfer。
- Self-evolving baselines:ReasoningBank 与 AgentKB;比较表只覆盖 LCB、SWEB、ReplicationBench 三个 benchmark。
- Retrieval ablations:No Memory、LLM Reranking、Adaptive Rewriting、Embedding Similarity。
- Cross-model transfer:源 memory 与目标 agent 模型可不同,包括 GPT-5-mini、DeepSeek V3.2、Qwen3-Coder-480B-A35B-Instruct。
4.3 Metrics
- Pass@3:每个任务最多运行三次,至少一次成功即计为通过;主结果表使用该指标。
- Pass@1:单次运行成功率;appendix 用于验证趋势是否仍成立。
- DBI (Davies–Bouldin Index):用于衡量 embedding clusters 的 benchmark-level 分离程度;值更高表示 cluster separation 更弱。
- LISI (Local Inverse Simpson’s Index):用于衡量局部邻域内 benchmark 混合程度;值更高表示局部混合更强。
4.4 Model and run config
论文和代码都显示主要实验采用 GPT-5-mini:memory generation、coding agent base model、LLM judge 均使用 GPT-5-mini;附加模型为 DeepSeek V3.2 与 Qwen3-Coder-480B-A35B-Instruct。coding agent 使用 mini-swe-agent,评测平台使用 Harbor,embedding model 使用 text-embedding-3-small,每个 query 检索 条 memory。
训练硬件不是本文重点:该方法不训练新模型参数,而是 evaluation-time / inference-time memory retrieval + prompt augmentation。论文未详细说明 GPU 型号、GPU 数量或训练步数;released runner scripts 中可见的是 agent inference config,例如 run_livecodebench.py、run_aider-polyglot.py、run_swebench.py 和 run_terminalbench2.py 都使用 openai/gpt-5-mini 与 step_limit=50,而 memory extraction utilities 使用 gpt-5-mini 和 text-embedding-3-small。
5. Experimental Results (实验结果)
5.1 Main Pass@3 results
GPT-5-mini 上,Insight memory 是平均最强的 cross-domain memory format:
| Method | LiveCodeBenchv6 | Aider-Polyglot | SWEBench-Verified | TerminalBench2 | ReplicationBench | MLGym-Bench | Avg. |
|---|---|---|---|---|---|---|---|
| Zero-shot | 0.910 | 0.470 | 0.730 | 0.315 | 0.111 | 0.667 | 0.523 |
| MTL (Trajectory) | 0.940 | 0.490 | 0.770 | 0.270 | 0.122 | 0.583 | 0.534 |
| MTL (Workflow) | 0.920 | 0.470 | 0.770 | 0.348 | 0.111 | 0.583 | 0.538 |
| MTL (Summary) | 0.930 | 0.460 | 0.760 | 0.371 | 0.133 | 0.667 | 0.546 |
| MTL (Insight) | 0.930 | 0.470 | 0.770 | 0.360 | 0.189 | 0.750 | 0.560 |
| vs Zero-shot | +2.0% | 0.0% | +4.0% | +4.5% | +7.8% | +8.3% | +3.7% |
这说明 MTL 的平均收益不是由单个 benchmark 拉动:SWEBench-Verified、TerminalBench2、ReplicationBench、MLGym-Bench 都有 4.0% 以上提升,其中 ReplicationBench 和 MLGym-Bench 最大。Aider-Polyglot 对 Insight 没有增益,但 Trajectory 有 +2.0%;TerminalBench2 上 Trajectory 反而下降到 0.270,体现低抽象 memory 的 negative transfer 风险。
跨模型主表也成立:DeepSeek V3.2 的 Insight MTL 平均从 0.542 到 0.568(+2.6%);Qwen3-Coder-480B-A35B-Instruct 从 0.483 到 0.501(+1.8%)。这支持作者关于 meta-knowledge 非模型专属的假设。
5.2 Comparison with self-evolving baselines
| Method | # Memories | LCB | SWEB | RepliB | Avg. |
|---|---|---|---|---|---|
| Zero-shot | — | 0.910 | 0.730 | 0.111 | 0.584 |
| ReasoningBank | 97 | 0.920 | 0.750 | 0.133 | 0.601 |
| AgentKB | 5,899 | 0.920 | 0.720 | 0.200 | 0.613 |
| MTL (Ours) | 431 | 0.930 | 0.770 | 0.189 | 0.630 |
MTL 比 ReasoningBank 高 +2.9%,比 AgentKB 高 +1.7%。关键不是 memory 数量:AgentKB 有约 5.8k memories,MTL 只有 431 条,但平均更高。作者据此得出 Core Finding 1:跨域 memory transfer 在效果和效率上都优于代表性 self-evolving baselines。
5.3 Meta-memory is the main transferable knowledge
Figure 5 解读:作者检查 zero-shot 失败但 Insight MTL 成功的案例,用 GPT-5 和人工分析归类 memory 带来的帮助。最大类别不是具体算法,而是 meta-knowledge:结构化行动流程、外部约束遵守、test-driven verification、环境适配、anti-pattern avoidance、接口合规、文件/语法管理、repository exploration tactics 等。Algorithmic Strategy Transfer 只占 5.5%,说明“跨域记忆”的主要价值不是搬运旧代码或公式。
一个代表性案例是 LiveCodeBench 产生的 Insight 被用于 SWE-Bench Verified:memory 提醒 agent 用 inline Python here-doc 做快速验证,目标任务中 agent 因此不再简单 raise error,而是检查 query/annotation 逻辑并构造小型测试。这类 transfer 是 procedural,而不是 domain-specific。
5.4 Abstraction drives transfer effectiveness
Insight > Summary > Workflow > Trajectory 的平均趋势说明 abstraction 比 raw detail 更重要。作者进一步在同一 Insight format 内控制变量:让 LLM 仅根据 Insight 反推原始任务,反推越像原任务表示越 task-specific;取 top 30% task-specific 与 bottom 30% task-agnostic 对比。结果是 task-agnostic insights 全面更好:
| Insight group | LCB | SWEB | RepliB | Avg. |
|---|---|---|---|---|
| Task-specific Insights | 0.887 | 0.617 | 0.067 | 0.523 |
| Task-agnostic Insights | 0.893 | 0.627 | 0.082 | 0.534 |
| +0.6% | +1.0% | +1.5% | +1.1% |
定性案例也一致:从 MLGym-Bench 转移来的 Trajectory 可能包含 OneHotEncoder(..., sparse=False) 这类旧 API 或具体命令,agent 盲目照搬会失败;而 Insight 只提醒“先检查 evaluation requirements、合并 train+validation、适配 library API changes”,新任务中的 agent 可以自行决定具体实现。
5.5 Negative transfer and retrieval limits
论文承认 MTL 会在某些 benchmark / memory type 上降低性能,主要原因有三类:
- Domain-mismatched anchoring:表面相似但结构无关的 memory 诱导 agent 采用错误假设。
- False validation confidence:旧 memory 中的 verification pattern 让 agent 过早相信 superficial checks,而忽略正式评测标准。
- Misapplied best-practice transfer:成功模式被不加区分地迁移,覆盖当前任务语义,例如把 R 任务中的 heredoc overwrite 模式误用到 C++ 文件结构,或把“预先检查数据/权重”扭曲成“只做 smoke test 就结束”。
Retrieval ablation 进一步显示,复杂检索不一定更好:
| Retrieval method | LCB | SWEB | RepliB | Avg. |
|---|---|---|---|---|
| No Memory | 0.910 | 0.730 | 0.111 | 0.584 |
| LLM Reranking | 0.920 | 0.730 | 0.144 | 0.598 |
| Adaptive Rewriting | 0.920 | 0.760 | 0.144 | 0.608 |
| Embedding Similarity | 0.930 | 0.770 | 0.189 | 0.630 |
作者解释:agentic coding task 是动态多步过程,真正需要的知识很难在静态 query 时完全预测;因此 LLM reranking 或 rewriting 未必能准确选择最有帮助的 memory。这也是 Finding 7:cross-domain agentic memory retrieval 仍然是开放问题,未来可能需要 domain routing 或 step-wise retrieval。
5.6 Scaling with memory pool size and source domains
Figure 6 解读:左侧实验随机采样完整 cross-domain pool 的 、、,平均 performance 随 pool size 增长而提升;右侧实验改变 source domains 数量,整体趋势也是 source domains 越多越好,9 个 domains 达到最佳。直觉是:更大的 pool 和更多 domain diversity 提高了检索到有用 meta-knowledge 的概率。
5.7 Cross-model memory transfer
| Source memory model | Target model | LCB | SWEB | RepliB | Avg. |
|---|---|---|---|---|---|
| Zero-shot | GPT-5-mini | 0.863 | 0.623 | 0.059 | 0.515 |
| DeepSeek V3.2 | GPT-5-mini | 0.890 | 0.617 | 0.048 | 0.518 |
| Qwen3-Coder | GPT-5-mini | 0.883 | 0.607 | 0.093 | 0.528 |
| GPT-5-mini | GPT-5-mini | 0.877 | 0.633 | 0.119 | 0.543 |
| Zero-shot | DeepSeek V3.2 | 0.890 | 0.423 | 0.144 | 0.486 |
| GPT-5-mini | DeepSeek V3.2 | 0.890 | 0.450 | 0.163 | 0.501 |
| DeepSeek V3.2 | DeepSeek V3.2 | 0.893 | 0.463 | 0.178 | 0.511 |
| Zero-shot | Qwen3-Coder | 0.733 | 0.347 | 0.126 | 0.402 |
| GPT-5-mini | Qwen3-Coder | 0.780 | 0.347 | 0.111 | 0.413 |
| Qwen3-Coder | Qwen3-Coder | 0.740 | 0.370 | 0.130 | 0.413 |
跨模型 transfer 一般优于 zero-shot,但低于 self-generated memory。这说明 memory 中确实有 model-agnostic meta-knowledge,同时也存在 model-specific bias:不同模型的错误习惯、tool-use 风格和验证偏好不完全相同。
5.8 Limitations and takeaways
本文的主要限制是:1) retrieval 仍然是静态 top-,不能随 agent 中间状态 step-wise 调整;2) negative transfer 说明 memory adaptation 还不可靠;3) 当前实验主要覆盖 coding agents,结论能否推广到 web/robotics/general agents 需要进一步验证;4) released repo 当前仍是 partial code release,README 标注 “Code Coming Soon”,复现实验需要额外整理离线 memory pool 构建与路径约定。
总体结论:Memory Transfer Learning 证明了 coding agents 的历史经验可以跨 domain 使用,但最值得转移的是抽象后的 procedural / behavioral meta-memory。高层 Insight 能显著降低 brittle anchoring,embedding-space 分析、controlled abstraction ablation、cross-model transfer 和 pool-size scaling 都支持这一解释。