NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

$\varepsilon$-MemEvo: Adaptive Cross-Task Memory Transfer for LLM Program Evolution

Aofan Liu, Shiyuan Song, Yiyan QiarXiv 2026

TL;DR

$\varepsilon$-MemEvo introduces cross-task knowledge transfer to Large Language Model (LLM) program evolution systems. By storing successful algorithmic strategies as high-level, natural-language "tactics" rather than raw code, it allows LLMs to reuse insights across completely different tasks. To prevent irrelevant memories from derailing the search, an adaptive Thompson Sampling gate dynamically manages when and how strongly to inject these memories, boosting convergence speeds with less than 1% computational overhead.

What Problem Does This Paper Address?

LLM-based program evolution systems (like FunSearch and AlphaEvolve) are highly effective at discovering novel algorithms by iteratively generating, evaluating, and refining code. However, these systems suffer from a fundamental flaw: amnesia. Every time they start a new optimization task, they begin entirely from scratch.

If a system spends hours discovering that a "structured grid layout" works best for a specific geometric packing problem, it completely forgets this intuition when moving to a slightly different packing problem. This leads to redundant exploration, slow "cold-start" convergence, and wasted API budgets.

The challenge in fixing this is two-fold:

  1. API Mismatch: Different tasks use different code structures, APIs, and evaluation metrics, making direct code reuse impossible.
  2. Negative Transfer: Injecting an irrelevant or mismatched strategy can completely break the evolutionary search, causing catastrophic failures.

Methods

$\varepsilon$-MemEvo wraps around existing evolutionary frameworks (specifically AdaEvolve) and introduces two core components to enable safe, cross-task memory transfer:

Figure 2: ε-MemEvo architecture. Prior-task best programs are distilled into task-agnostic tactics under LOO. At each iteration, a state-conditioned Thompson Sampling gate selects skip, hint, or guide; retrieved tactics and the selected intensity augment the base prompt. AdaEvolve evaluates each candidate and returns a delayed reward that updates the gate. After a successful task run completes, its final best program contributes one tactic to memory for subsequent tasks.

1. Tactic Memory Bank

Instead of saving raw code, $\varepsilon$-MemEvo uses an LLM to distill successful programs into task-agnostic natural language summaries (e.g., "two-phase optimization with greedy initialization"). When a new task is initialized, the system uses embedding similarity (weighted by how much the strategy originally improved performance) to retrieve the top three most relevant tactics.

2. Adaptive Injection Gate

To combat negative transfer, the authors treat memory injection as a multi-armed bandit problem solved via Thompson Sampling. At each evolutionary iteration, the system evaluates its current state (e.g., whether it is steadily improving or stuck in a plateau) and samples an action from three intensity levels:

  • skip: Do not use memory; proceed with the base prompt.
  • hint: Provide retrieved tactics as optional references.
  • guide: Strongly impose the top tactic within the prompt.

If a retrieved tactic fails to yield improvements, the mathematical posterior for the guide action quickly collapses, and the gate safely reverts to skip behavior, protecting the search from corruption.

Datasets

The framework was evaluated using a Leave-One-Out (LOO) protocol across 8 diverse optimization benchmarks split into two categories:

  • Mathematical Optimization: circle_packing, signal_processing, and two inequality problems (first_autocorr_ineq, uncertainty_ineq).
  • Systems Engineering: eplb (Easy Parameter Load Balancing), llm_sql (SQL optimization), prism, and txn_scheduling (transaction scheduling).

Key Insights and Ideas

  • Transfer is a Safety Problem, Not a Retrieval Problem: The authors demonstrate that naive, continuous injection of past memories (always-inject) causes catastrophic failures on mismatched tasks, often resulting in a score of zero. Gating is essential.
  • Natural Language as a Universal Bridge: Code is brittle and API-specific, but algorithmic concepts described in natural language bypass syntax mismatches, allowing a strategy learned in a geometric task to seamlessly guide a systems engineering task.
  • Intelligent Timing: The Thompson Sampling gate naturally learns an intuitive, human-like strategy. As shown in the policy posterior heatmap, it prefers to skip memory when the search is already actively improving, but shifts to providing hints during late-stage plateaus to break out of local optima.
Figure 3: Policy posterior as a posterior-mean heatmap over 6 states × 3 actions after Exp. 1. Bold-bordered cells mark the greedy arm per state. Observed states yield the data-driven hierarchy improving →skip, plateau_early →skip, and plateau_late →hint; the unobserved stagnating states retain the prior-initialized guide action.

Key Results

The authors evaluated $\varepsilon$-MemEvo against AdaEvolve and a simple Top-K baseline using GPT-5 and Gemini-3-Pro backbones.

  • Consistent Performance Gains: $\varepsilon$-MemEvo achieved higher Area Under the Convergence Curve (AUCC) across all 8 tasks, with a mean relative improvement of +8.7% on GPT-5 and +11.7% on Gemini-3-Pro.
  • Rapid Cold-Starts: The biggest advantages were seen in early-stage convergence (AUC@20 improved by +9.4% on average). For instance, on the circle_packing task, $\varepsilon$-MemEvo reached 90% of its final score in just 3 iterations, compared to 9 iterations for AdaEvolve.
Figure 4: Convergence curves on four representative tasks. ε-MemEvo (blue) converges faster than AdaEvolve (orange) in early iterations; the gap is most pronounced on circle_packing and txn_scheduling. Shaded region: AUC@20 zone.
  • Negligible Overhead: The cross-task transfer mechanism adds only ~0.77 seconds per iteration (<1% overhead), yet because it accelerates convergence, the aggregate wall-clock time across the main tasks was actually 0.69× faster than the baseline.

Limitations and Future Work

  • Framework Dependency: $\varepsilon$-MemEvo acts as an augmentation layer; it cannot compensate if the underlying base evolutionary framework suffers a fundamental exploration failure.
  • Memory Scale Dynamics: The evaluation was limited to a small task-level memory bank. It remains unknown how retrieval precision and gate calibration will scale when the bank grows to hundreds or thousands of entries.
  • Ablation Gaps: The authors note they did not test against a rule-based controller equipped with a strict "k-strike auto-disable" rule, which could potentially mimic the safety benefits of Thompson Sampling without posterior sampling.

Summary updated

BibTeX
@misc{liu2026varepsilon,
  author = {Aofan Liu and Shiyuan Song and Yiyan Qi},
  title = {{$\textbackslash\{\}varepsilon$-MemEvo: Adaptive Cross-Task Memory Transfer for LLM Program Evolution}},
  year = {2026},
  eprint = {2608.12522},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2608.12522},
}
Figure