epsilon-MemEvo: Adaptive Cross-Task Memory Transfer for LLM Program Evolution
Aofan Liu, Shiyuan Song, Yiyan Qi
cs.AI
Submitted: 2026-08-12
Updated: 2026-08-14
Code: https://github.com/algorithmicsuperintelligence/openevolve
License: http://creativecommons.org/licenses/by-nc-nd/4.0/
Importance score: 100/100
The gist: ε-MemEvo is a framework for cross-task knowledge transfer in LLM-based program evolution.
Terminology
Summary
ε-MemEvo is a framework for cross-task knowledge transfer in LLM-based program evolution. It addresses the limitation that existing LLM-based program evolution systems such as FunSearch and AlphaEvolve typically optimize each task in isolation, discarding search experience after completion.
ε-MemEvo makes two methodological moves: Content-level transfer via a Tactic Memory Bank that stores LLM-extracted natural-language strategy summaries (not raw code) from completed tasks, enabling transfer across heterogeneous APIs and evaluators,
and "Strategy-level gating via an Adaptive Injection Gate that treats memory usage as an adaptive gating problem whose primary role is to avoid negative transfer: it learns when retrieved memories should be withheld, softly suggested, or strongly imposed based on search state."
The key insight is that cross-task transfer in evolutionary coding is a safety problem, not a retrieval problem alone.
Naïvely injecting cross-task strategies every iteration can cause catastrophic negative transfer—in the ablation, two of five tasks see the search fail to produce any score-improving program under always-inject, and the same two fail under a rule-based stagnation policy.
The adaptive gate addresses this by posterior-sampling over Beta arms, so the guide arm is down-weighted after a few unsuccessful injections, recovering skip-like behavior on mismatched tasks while retaining injection benefits elsewhere.
The Tactic Memory Bank stores one entry per completed successful task, containing a task-agnostic strategy summary
extracted by GPT-4.1-mini from the final best program, along with approach-type label, task description, and embedding.
Retrieval uses text-embedding-3-small (1536-dim) and ranks entries by a score-weighted similarity: rk = cos(ej, ek) · (1 + 0.3 · log(1 + max(Δk, 0.01))), returning the top-3.
The Adaptive Injection Gate is implemented as a contextual bandit with Beta-distributed arms updated by Thompson sampling.
It has a six-state discrete state space from two features: search phase ∈ improving, plateau, stagnating and task stage ∈ early, late. The action space has three injection intensities: skip (no injection, base prompt), hint (retrieved strategies as optional references), and guide (top strategy as recommended approach plus injection into paradigm breakthrough generation).
Informative priors are set: Prior(improving, skip) = Beta(3, 1) and Prior(stagnating, guide) = Beta(3, 1), with Beta(1, 1) for other pairs. Rewards are delayed over a window of w=5 iterations, with Rt = 1[ft+w > fpre + ε] where ε = 10−8.
Evaluation uses a Leave-One-Out protocol: when evaluating on task k, the memory bank excludes all experience from task k itself.
The policy retains its full posterior since it learns task-agnostic state-action mappings rather than task-specific content or task identity.
The paper evaluates on 8 benchmarks spanning circle packing, signal processing, load balancing, SQL optimization, and more,
on two LLM backbones (GPT-5 and Gemini-3-Pro).
Key findings:
-
Consistent convergence improvement. ε-MemEvo achieves higher AUCC on all 8 tasks (p = 0.0078, Wilcoxon signed-rank) with +8.7% mean relative improvement on GPT-5 and +11.7% on Gemini-3-Pro.
-
Strongest early-stage acceleration. On GPT-5, AUC@20 improves by +9.4% on average, with circle packing +26.0% and transaction scheduling +27.2%, showing that the largest gains occur during cold-start convergence.
-
"TS prevents catastrophic negative transfer. Full ε-MemEvo improves over AdaEvolve on all 5 ablation tasks; both naïve always-inject and rule-based stagnation variants fail to produce any score-improving program on 2/5 tasks."
-
"Negligible overhead. Cross-task transfer adds < 1% per-iteration cost (∼0.77 s vs. 80–140 s baseline); aggregate wall-clock time across the 8 main tasks is 0.69× that of AdaEvolve."
On final scores with GPT-5, ε-MemEvo achieves higher final scores than AdaEvolve on 7/8 tasks, with large gains on EPLB (+46.0%) and txn scheduling (+45.2%). The single loss on PRISM (−0.04%) is negligible. On T90%, ε-MemEvo reaches 90% faster on circle packing (3 vs. 9, 3.0×), PRISM (2 vs. 17, 8.5×), and signal processing (15 vs. 23, 1.5×).
The ablation study compares five variants on 5 tasks (50 iter): ε-MemEvo (full), MemEvo-always (always guide), MemEvo-stagnation (rule-based: guide if stagnating, else skip), AdaEvolve (no memory), and TopK. "Both naive always-inject and rule-based stagnation fail catastrophically on mismatched tasks. MemEvo-always and MemEvo-stagnation both achieve AUCC = 0 on EPLB and LLM-SQL—no iteration in 50 produces a score-improving program on these tasks. Memory injection is highly valuable when appropriate:
On circle packing, signal, and txn scheduling, all three memory variants outperform AdaEvolve by +2.9% to +55.3%. The adaptive gate trades peak upside for robustness:
ε-MemEvo is the only memory-augmented variant that improves over AdaEvolve on all 5 tasks without per-task threshold tuning."
Analysis of the policy posterior shows an interpretable hierarchy: improving → skip, plateau early → skip, and plateau late → hint.
These greedy actions are unchanged when the informative prior is replaced by uniform Beta(1,1), confirming the observed-state behavior is learned rather than inherited from initialization.
Reward rate validation shows that within improving early decisions, "skip attains a 39.6% positive reward rate (99/250), compared with 34.0% for hint (17/50) and 19.7% for guide (15/76). Over-injection during productive search actively harms performance: guide's reward rate is half that of skip."
On negative transfer avoidance, on EPLB "the closest retrievable memory (from LLM-SQL, cosine 0.481) prescribes SQL-style grouping; under MemEvo-always this produces code that scores 0 every iteration, whereas the adaptive gate's guide-arm posterior collapses after a handful of failures and the policy reverts to skip."
The paper also provides a theoretical safety guarantee: "Specialising the standard regret bound for Bernoulli Thompson sampling to our 3-arm gating problem shows that, when retrieved tactics are mismatched (so pskip > pguide in a fixed search state), the expected number of guide pulls in the first T rounds satisfies E[Tguide(T)] ≤ C log T / Δ2guide + o(log T), so the per-round probability of injecting a harmful tactic decays as O(1/t)."
Limitations noted include: evaluation on only two LLM backbones, the memory bank being built at the task level, uncertainty about how retrieval precision and gate calibration change as the bank grows, and that ε-MemEvo augments rather than replaces its base evolution framework, so memory transfer cannot compensate for fundamental exploration failures in the underlying search.
The paper also acknowledges a missing ablation: A stronger rule-based control not evaluated here would combine stagnation-triggered injection with a k-strike auto-disable rule.
The conclusion states: "We presented ε-MemEvo, a framework that formalizes cross-task knowledge transfer as an adaptive intervention problem in LLM-based program evolution. Through a Tactic Memory Bank for content-level transfer and an Adaptive Injection Gate for strategy-level transfer, ε-MemEvo achieves statistically significant convergence improvements across 8 diverse optimization benchmarks on GPT-5 (p = 0.0078, 8/8 AUCC wins, +8.7% average improvement)."
Improvements for AI systems
Improvements to AI systems:
-
Adaptive knowledge-injection gating – Add a Thompson-sampling-based contextual bandit that decides when to inject prior task knowledge (skip/hint/guide) based on search state (improving/plateau/stagnating × early/late). This prevents catastrophic negative transfer from mismatched prior knowledge, which naive always-inject or rule-based policies cause.
-
Cross-task tactic memory with safety-aware retrieval – Store natural-language strategy summaries (not raw code) from completed tasks, retrieved via embedding similarity with score-weighted ranking. The system learns task-agnostic tactics that transfer across heterogeneous APIs/evaluators, while the gate prevents harmful retrieval from dominating.
-
Delayed-reward policy learning – Use a reward window (w=5 iterations) with a threshold on score improvement to update the gate’s Beta posteriors. This enables the system to learn state-action mappings that are task-agnostic, so the policy transfers across tasks without retraining.
-
Informative priors for safe exploration – Initialize the gate with priors favoring skip during improving phases and guide during stagnation (Beta(3,1) vs. Beta(1,1) elsewhere). This encodes a safe default that avoids over-injection during productive search, while still allowing exploration.
-
Catastrophic-failure recovery – When a retrieved tactic repeatedly fails (guide-arm posterior collapses), the system automatically reverts to skip, recovering baseline behavior. This provides a safety guarantee: the per-round probability of injecting a harmful tactic decays as O(1/t).
What the improved AI system can do:
-
Solve new optimization tasks faster – Achieve +8.7% to +11.7% mean improvement in area-under-convergence-curve across diverse benchmarks (circle packing, signal processing, load balancing, SQL optimization) compared to no-transfer baselines, with up to 3–8.5× faster time-to-90%-performance on cold-start tasks.
-
Transfer knowledge across heterogeneous problem domains – Reuse high-level strategy summaries (e.g.,
group by constraint type,
use divide-and-conquer
) from unrelated tasks (e.g., LLM-SQL → EPLB) without copying code, enabling generalization across different APIs and evaluators. -
Avoid negative transfer automatically – Detect when retrieved memories are mismatched (e.g., SQL-style grouping injected into a load-balancing task) and suppress them after a few failures, maintaining baseline performance where naive injection would cause total failure (0 score-improving iterations).
-
Operate with negligible overhead – Add <1% per-iteration cost (0.77s vs 80–140s baseline) and reduce total wall-clock time to 0.69× of the no-transfer baseline, making it practical for real-time evolutionary search.
-
Provide interpretable control policy – Learn an explicit state-action hierarchy (improving→skip, plateau early→skip, plateau late→hint) that is robust to prior initialization, enabling human inspection and tuning of when and how strongly to inject prior knowledge.
Abstract
LLM-based program evolution systems such as FunSearch and AlphaEvolve have shown strong ability to discover novel algorithms, but typically optimize each task in isolation, discarding search experience after completion. We introduce epsilon-MemEvo, a framework for cross-task knowledge transfer in LLM program evolution. epsilon-MemEvo stores prior experience as task-agnostic tactic memories: compact natural-language summaries of successful algorithmic strategies rather than raw code, enabling transfer across tasks with different APIs and evaluators. To avoid negative transfer from semantically mismatched memories, epsilon-MemEvo uses an adaptive injection gate that decides whether retrieved memories should be injected, and at what intensity. We evaluate epsilon-MemEvo on 8 diverse optimization benchmarks spanning mathematical optimization and systems engineering, using a content-level Leave-One-Out protocol that excludes target-task memory entries. On the primary GPT-5 backbone, epsilon-MemEvo improves AUCC over AdaEvolve on all 8 tasks, with a mean relative gain of +8.7%, and improves early-stage convergence by +9.4% on average. Ablations show that naive memory injection can fail catastrophically, while adaptive gating remains safe across all five ablation tasks. The data-updated posterior is interpretable in observed states: it favors skip during improving search and shifts from skip to hint across early and late plateaus. These gains incur less than 1% computational overhead.
Sources
- GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning
- CodeEvolve: an open source evolutionary coding agent for algorithmic discovery and optimization
- AdaEvolve: Adaptive LLM Driven Zeroth-Order Optimization
- ShinkaEvolve: Towards Open-Ended And Sample-Efficient Program Evolution
- Evolution through Large Models
- EvoX: Meta-Evolution for Automated Discovery
- Language Model Crossover: Variation through Few-Shot Prompting
- AlphaEvolve: A coding agent for scientific and algorithmic discovery
- MemGPT: Towards LLMs as Operating Systems
- Progressive Neural Networks
Related papers
- MAVEN-T: Reinforced Heterogeneous Distillation for Real-Time Multi-Agent Trajectory Prediction
- Model Discovery Agent: LLM-assisted Bayesian experiment design for data-efficient discovery of mechanistic world models
- The Clinician's Veto: Navigating Trust, Liability, and Uncertainty in Autonomous AI Prescribing
- MindHelper: Closed-Loop Embodied Mental-State Reasoning for Precision Intervention
- Incumbent Advantage: Brand Bias and Cognitive Manipulation Dynamics in LLM Recommendation Systems
- VSAL: A Vision Solver with Adaptive Layouts for Graph Property Detection