Paper deep dive
$\varepsilon$-MemEvo: Adaptive Cross-Task Memory Transfer for LLM Program Evolution
Aofan Liu, Shiyuan Song, Yiyan Qi
Intelligence
Status: succeeded | Model: Gemma-4-26B-A4B | Prompt: intel-v1 | Confidence: 92%
Last extracted: 8/14/2026, 4:27:47 AM
Summary
The paper introduces ε-MemEvo, a framework for cross-task knowledge transfer in LLM-based program evolution. It utilizes a Tactic Memory Bank to store natural-language strategy summaries and an Adaptive Injection Gate based on contextual Thompson Sampling to safely inject these memories into new tasks, avoiding negative transfer. Evaluated on 8 benchmarks, it outperforms AdaEvolve with improved convergence and negligible overhead.
Entities (11)
Relation Signals (8)
ε-MemEvo ā uses ā Adaptive Injection Gate
confidence 95% · ε-MemEvo uses an adaptive injection gate that decides whether retrieved memories should be injected
ε-MemEvo ā uses ā Tactic Memory Bank
confidence 95% · ε-MemEvo stores prior experience as task-agnostic tactic memories
ε-MemEvo ā outperforms ā AdaEvolve
confidence 92% · ε-MemEvo improves AUCC over AdaEvolve on all 8 tasks
ε-MemEvo ā backedby ā Gemini-3-pro
confidence 90% Ā· using two LLM backbones (GPT-5 and Gemini-3-Pro)
ε-MemEvo ā backedby ā GPT-5
confidence 90% · On the primary GPT-5 backbone, ε-MemEvo improves AUCC
ε-MemEvo ā evaluatedon ā EPLB
confidence 90% Ā· systems optimization (4 from ADRS: EPLB...)
ε-MemEvo ā evaluatedon ā Circle Packing
confidence 90% · We evaluate ε-MemEvo on 8 diverse optimization benchmarks... circle packing
Adaptive Injection Gate ā implements ā Thompson Sampling
confidence 90% Ā· The injection gate is implemented as a contextual bandit with Beta-distributed arms updated by Thompson sampling
Cypher Suggestions (0)
No Cypher suggestions yet.
Abstract
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 $\varepsilon$-MemEvo, a framework for cross-task knowledge transfer in LLM program evolution. $\varepsilon$-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, $\varepsilon$-MemEvo uses an adaptive injection gate that decides whether retrieved memories should be injected, and at what intensity. We evaluate $\varepsilon$-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, $\varepsilon$-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.
Tags
Links
- Source: https://arxiv.org/abs/2608.12522v1
- Canonical: https://arxiv.org/abs/2608.12522v1
Trouble viewing inline? Open PDF directly ā
Full Text
37,890 characters extracted from source content.
Expand or collapse full text
ε -MemEvo: Adaptive Cross-Task Memory Transfer for LLM Program Evolution Aofan Liu Song Shiyuan Qi Yiyan 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 ε -MemEvo, a framework for cross-task knowledge transfer in LLM program evolution. ε -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, ε -MemEvo uses an adaptive injection gate that decides whether retrieved memories should be injected, and at what intensity. We evaluate ε -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, ε -MemEvo improves AUCC over AdaEvolve on all 8 tasks, with a mean relative gain of +8.7%+8.7\%, and improves early-stage convergence by +9.4%+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 <1%<\!1\% computational overhead. 1 Introduction Large language models (LLMs) have emerged as powerful engines for automated algorithm discovery. Systems like FunSearch (26) and AlphaEvolve (22) use LLMs to iteratively generate, evaluate, and refine programs, achieving breakthroughs in combinatorial optimization, matrix multiplication, and scientific computing. More recent work such as AdaEvolve (4) introduces adaptive island models and paradigm breakthroughs to further improve search diversity. Despite these advances, a fundamental limitation persists: every task starts from scratch. When an LLM evolution system finishes one optimization task and moves to a related task, it retains nothingāno memory of which strategies worked, no intuition about search structure, no reusable heuristics. This āamnesicā behavior leads to redundant exploration across related tasks, slow cold-start convergence, and wasted API budget. Figure 1: Motivating example. On circle packing after solving a related geometric task, ε -MemEvo retrieves a geometric arrangement heuristic from memory and reaches 90% of its final score in 3 iterations (vs. 9 for AdaEvolve). The Tactic Memory Bank stores strategy summaries (not code), enabling transfer across tasks with different APIs and metrics. Consider a concrete scenario: after optimizing a geometric packing problem, the system has learned that āstructured grid layouts with symmetric offsets minimize overlap.ā This geometric intuition can also benefit a related packing task, yet existing systems cannot leverage it. Human researchers naturally build on prior experienceāwhy shouldnāt LLM evolution systems? We propose ε -MemEvo (ε -Memory-augmented Evolution), a framework for cross-task knowledge transfer in LLM-based program evolution. ε -MemEvo makes two methodological moves tailored to evolutionary coding: ⢠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. ⢠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 behind ε -MemEvo 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 our 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 (Section 4.5). 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. Although the adaptive gate is not uniformly better than hand-tuned rules on benign tasks, it is the only variant in our study that remains safe across all five tasks without requiring per-task threshold tuning. To evaluate content-level cross-task transfer, we use a Leave-One-Out (LOO) protocol: when evaluating on task k, the memory bank excludes all experience from task k itself. We evaluate ε -MemEvo on 8 benchmarks spanning circle packing, signal processing, load balancing, SQL optimization, and more, on two LLM backbones (GPT-5 and Gemini-3-Pro). Our key findings: 1. Consistent convergence improvement. ε -MemEvo achieves higher AUCC on all 8 tasks (p=0.0078p=0.0078, Wilcoxon signed-rank) with +8.7%+8.7\% mean relative improvement on GPT-5 and +11.7%+11.7\% on Gemini-3-Pro. 2. Strongest early-stage acceleration. On GPT-5, AUC@20 improves by +9.4%+9.4\% on average, with circle packing +26.0%+26.0\% and transaction scheduling +27.2%+27.2\%, showing that the largest gains occur during cold-start convergence. 3. 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. 4. Negligible overhead. Cross-task transfer adds <1%<\!1\% per-iteration cost (ā¼ 0.77 s vs. 80ā140 s baseline); aggregate wall-clock time across the 8 main tasks is 0.69Ć0.69Ć that of AdaEvolve. 2 Related Work LLM-based program evolution. Building on genetic programming (14), recent work replaces hand-designed variation operators with LLMs. FunSearch (26), AlphaEvolve (22), and OpenEvolve (29) establish LLM-based evolutionary search on math and systems benchmarks; ShinkaEvolve (15), CodeEvolve (3), GEPA (1), and AdaEvolve (4) extend these via sample-efficient sampling, island models, and adaptive paradigm breakthroughs. Earlier work includes ELM (16), Language Model Crossover (21), EoH (18), OPRO (33), EvoPrompting (6), and EvoX (19). All operate per-task without explicit cross-task memory. ε -MemEvo addresses this gap by making cross-task transfer first-class at both the representation level (tactic memories) and the control level (adaptive intervention). Selection in LLM-based program evolution. Recent LLM-evolution frameworks select within-task programs for mutation through a variety of mechanisms. FunSearch (26) and OpenEvolve (29) use island models with score-weighted parent sampling and periodic island resets; AlphaEvolve (22) extends this with multi-model collaboration; ShinkaEvolve (15) adds rejection-sampled adaptive parent sampling for sample efficiency; AdaEvolve (4) couples adaptive island models with paradigm breakthroughs that periodically inject conceptually different strategies into the next mutation prompt. All operate within one task: selection uses programs discovered for the current problem, and memorisable artifacts reset between tasks. ε -MemEvo instead adds a cross-task layer: a contextual Thompson Sampling gate (31; 5; 12; 2) decides whether retrieved tactics should be withheld, suggested, or imposed. The closest precedent is within-run adaptive operator selection (7; 9); ε -MemEvo instead gates cross-task interventions. Related foundations include meta-learning (11; 10), retrieval-augmented code generation (17; 20; 25; 34), agentic memory (30; 32; 23; 24), and continual learning (13; 28; 8). 3 Method 3.1 Problem Formulation We consider a sequential setting where an LLM-based evolution system solves tasks =T1,ā¦,TNT=\T_1,ā¦,T_N\. Each task TiT_i has description did_i, evaluation function fi:āāf_i:P , and seed program pi0p_i^0; the system runs M iterations per task to maximize fif_i. ε -MemEvo augments the standard (per-task) setting with a persistent memory state ā³=(ā¬,Ļ)M=(B,Ļ) comprising a Tactic Memory Bank ā¬B and an Injection Policy Ļ. The policy is updated during each task, while the bank is appended once at successful task completion; both are carried forward to subsequent tasks. 3.2 Architecture Overview 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. ε -MemEvo wraps around the AdaEvolve (4) base framework, adding two cross-task transfer modules (Figure 2): a Tactic Memory Bank ā¬B that stores strategy summaries from prior tasks (retrieved by embedding similarity), and an Adaptive Injection Gate Ļ that decides whether to inject memories and at what intensity. At iteration t of task TiT_i, the controller (1) queries Ļ for an action atāskip,hint,guidea_tā\ skip, hint, guide\ given search state sts_t; (2) if atā skipa_tā skip, retrieves the top-3 strategies from ā¬āiB_-i; (3) constructs an augmented prompt at intensity ata_t; (4) generates and evaluates a candidate; (5) resolves delayed rewards and updates Ļ. 3.3 Tactic Memory Bank Strategy extraction. After a successful task run completes, we use GPT-4.1-mini to extract a task-agnostic strategy summary from its final best program: tactici=LLMextractā(di,pibest,fiā(pibest)).tactic_i=LLM_extract\! (d_i,\;p_i^best,\;f_i(p_i^best) ). (1) The extraction prompt asks for general algorithmic descriptions (e.g., ātwo-phase optimization with greedy initialization followed by gradient descentā) rather than task-specific code. Each completed successful task contributes one entry containing the tactic, approach-type label, task description, and embedding; the entry becomes available only to subsequent tasks. Semantic retrieval. Given a new task with description djd_j, we embed j=Embedā(dj)e_j=Embed(d_j) via text-embedding-3-small (1536-dim) and rank memory entries by a score-weighted similarity: rk=cosā”(j,k)ā (1+0.3ā logā”(1+maxā”(Īk,0.01))),r_k= (e_j,e_k)Ā· (1+0.3Ā· (1+ ( _k,0.01)) ), (2) where Īk _k is the score improvement of entry kās strategy over its baseline; we return the top-3. 3.4 Adaptive Injection Gate The injection gate is implemented as a contextual bandit with Beta-distributed arms updated by Thompson sampling. We design it primarily as a gate against negative transfer rather than a reward-maximizing controller: on tasks where retrieved strategies are mismatched, the posterior for guide collapses within a handful of unsuccessful injections and the policy reverts to predominantly skip actions. State space. Six discrete states from two features: search phase āimproving,plateau,stagnatingā\ improving, plateau, stagnating\ from global improvement rate Ļ=improvementsevaluationsĻ= improvementsevaluations (Ļ>0.1āimprovingĻ>0.1 improving; 0.02<Ļā¤0.1āplateau0.02<Ļ⤠0.1 plateau; Ļā¤0.02āstagnatingĻ⤠0.02 stagnating); and task stage āearly,lateā\ early, late\, where t/M<0.4t/M<0.4 is early and the remaining iterations are late. Action space. 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. Each (s,a)(s,a) pair is Betaā(αs,a,βs,a)Beta( _s,a, _s,a). We set Priorā(improving,skip)=Betaā(3,1)Prior( improving, skip)=Beta(3,1) and Priorā(stagnating,guide)=Betaā(3,1)Prior( stagnating, guide)=Beta(3,1), with Betaā(1,1)Beta(1,1) for other pairs. Decision and reward. At each iteration we sample Īøs,aā¼Betaā(αs,a,βs,a) _s,a ( _s,a, _s,a) and pick aā=argā”maxaā”Īøs,a^*= _a _s,a. Before applying the action, we record the current best score fpreāf^*_pre. The reward is delayed: after window w=5w=5 iterations, Rt=[ft+wā>fpreā+ϵ]R_t=1[f^*_t+w>f^*_pre+ε] with ϵ=10ā8ε=10^-8; on success, αst,at+=1 _s_t,a_t +=1, otherwise βst,at+=1 _s_t,a_t +=1. Concurrent pending decisions are resolved via a FIFO queue Q. At the task boundary, unresolved records are evaluated against the final best score before the queue is cleared. 3.5 Leave-One-Out Evaluation Protocol When evaluating ε -MemEvo on task TkT_k: (1) the memory bank ā¬ākB_-k excludes any entries from TkT_k; (2) the policy Ļ retains its full posterior, since it learns task-agnostic state-action mappings rather than task-specific content or task identity; (3) all methods share the same seed program and evaluator. Thus, the protocol leaves out target-task memory content while retaining the globally warm-started policy. Algorithm 1 ε -MemEvo: One Iteration of Cross-Task Augmented Evolution @lno @tlmRequire: Memory bank ā¬ākB_-k, policy Ļ with Beta counts (αs,a,βs,a)\( _s,a, _s,a)\ and pending queue Q, iteration t, task description dkd_k, current best score ftā1āf^*_t-1, reward window w, total iterations M @lno @tlmstāGetStateā(Ļt,t/M)s_tā GetState( _t,t/M) 6-state discretisation @lno @tlmSample Īøst,aā¼Betaā(αst,a,βst,a) _s_t,a ( _s_t,a, _s_t,a) for aāskip,hint,guideaā\ skip, hint, guide\ @lno @tlmatāargā”maxaā”Īøst,a_tā _a _s_t,a posterior sampling @lno @tlmfpreāāftā1āf^*_preā f^*_t-1; tacticsāā tacticsā @lno @tlmif atā skipa_tā skip then @lno @tlmtacticsāā¬āk.Retrieveā(dk,top_k=3)tactics _-k. Retrieve(d_k,top\_k=3) @lno @tlmend if @lno @tlmpromptāBuildPromptā(parent,context,tactics,at)promptā BuildPrompt(parent,context,tactics,a_t) @lno @tlmpnewāLLMā(prompt)p_new (prompt); scoreāfkā(pnew)scoreā f_k(p_new) @lno @tlmftāāUpdatePopulationā(pnew,score)f^*_tā UpdatePopulation(p_new,score) @lno @tlm.Appendā((,,,,,,,))Q. Append ((s_t,a_t,t,f^*_pre) ) @lno @tlmResolvePendingā(,t,w,ftā) ResolvePending(Q,t,w,f^*_t) Beta updates for records with tā„Ļ+wtā„Ļ+w 4 Experiments 4.1 Experimental Setup Benchmarks. We evaluate 8 tasks across two categories: mathematical optimization (4 from AlphaEvolve (22): circle packing, signal processing, two inequality problems) and systems optimization (4 from ADRS: EPLB, LLM-SQL, PRISM, transaction scheduling). All task objective scores are higher-is-better. Methods. We compare ε -MemEvo (ours), which augments AdaEvolve with LOO memory and a TS gate; AdaEvolve, the base adaptive evolution framework; and TopK, a simpler top-K mutation baseline. Protocol. GPT-5 via LiteLLM is the primary generator, with Gemini-3-Pro replication runs reported in the tables; text-embedding-3-small is used for retrieval. Exp. 1 (memory accumulation): 8 tasks Ć 50 iterations Ć 2 methods, sequential. Exp. 2 (main): 8 tasks Ć 80 iterations Ć 3 methods, using LOO memory from Exp. 1. Exp. 3 (ablation): 5 tasks Ć 50 iterations Ć 5 variants. Each score is the mean over 5 paired seeds 42,0,1,2,3\42,0,1,2,3\. Metrics are: Final Score at iteration 80; AUCC (normalized area under the convergence curve); AUC@20 (cold-start efficiency); and T90%T_90\% (iterations to 90% of a methodās own final score). 4.2 Main Results Backbone: GPT-5 Backbone: Gemini-3-Pro Task ε -MemEvo AdaEvolve TopK Ī % ε -MemEvo AdaEvolve TopK Ī % circle_packing 0.9756 0.9524 0.9645 +2.4% 0.9761 0.9534 0.9650 +2.4% signal_processing 0.7227 0.7057 0.5508 +2.4% 0.6685 0.5998 0.5095 +11.5% first_autocorr_ineq 0.9936 0.9913 0.9945 +0.2% 0.9191 0.8426 0.9199 +9.1% uncertainty_ineq 0.9024 0.8938 0.8975 +1.0% 0.8347 0.7597 0.8302 +9.9% eplb 0.2171 0.1487 0.1336 +46.0% 0.2260 0.1609 0.1391 +40.5% llm_sql 0.7247 0.7047 0.7367 +2.8% 0.7232 0.7019 0.7352 +3.0% prism 26.256 26.266 26.233 ā-0.04% 26.230 26.213 26.207 +0.06% txn_scheduling 4032.3 2777.8 2688.2 +45.2% 3987.9 2716.0 2658.6 +46.8% Table 1: Final scores (Exp. 2, 80 iter, mean over 5 seeds), on two LLM backbones. Bold: best of ε -MemEvo / AdaEvolve. On GPT-5, ε -MemEvo achieves higher final scores than AdaEvolve on 7/8 tasks, with large gains on EPLB (+46.0%+46.0\%) and txn_scheduling (+45.2%+45.2\%). The single loss on PRISM (ā0.04%-0.04\%) is negligible. 4.3 Convergence Efficiency AUCC (full 80) AUC@20 T90%T_90\% (iter) Task ε -MemEvo AdaEvolve Πε -MemEvo AdaEvolve Πε -MemEvo AdaEvolve Speedup Backbone: GPT-5 circle_pack .946 .885 +6.9% .861 .683 +26.0% 3 9 3.0Ć eplb .159 .135 +17.9% .124 .123 +1.0% 53 50 0.9Ć autocorr .980 .979 +0.1% .942 .942 +0.0% 1 1 1.0Ć llm_sql .708 .696 +1.8% .675 .669 +0.8% 1 1 1.0Ć prism 25.90 25.31 +2.3% 24.84 22.45 +10.6% 2 17 8.5Ć signal .668 .651 +2.5% .573 .525 +9.2% 15 23 1.5Ć txn_sched 3766 2743 +37.3% 3358 2639 +27.2% 15 1ā” ā uncert_ineq .890 .882 +0.9% .855 .848 +0.8% 1 1 1.0Ć Win/Total 8/8 7/8 3/8ā” Mean Ī +8.7% +9.4% Backbone: Gemini-3-Pro circle_pack .947 .886 +6.9% .861 .684 +25.9% 4 10 2.5Ć eplb .166 .146 +13.3% .129 .133 ā-3.0% 56 52 0.9Ć autocorr .907 .832 +8.9% .871 .801 +8.8% 2 2 1.0Ć llm_sql .707 .693 +1.9% .674 .666 +1.1% 1 2 2.0Ć prism 25.87 25.26 +2.4% 24.82 22.41 +10.8% 3 16 5.3Ć signal .618 .553 +11.7% .530 .446 +18.8% 14 22 1.6Ć txn_sched 3725 2683 +38.8% 3321 2581 +28.7% 16 1ā” ā uncert_ineq .823 .750 +9.8% .791 .721 +9.7% 2 2 1.0Ć Win/Total 8/8 7/8 4/8ā” Mean Ī +11.7% +12.6% ā”AdaEvolveās T90%=1T_90\%=1 when its final score is materially lower than ε -MemEvoāsāreaching 90% of a lower target is trivially faster. ā”Excluding ties. Table 2: Convergence efficiency (ε -MemEvo vs. AdaEvolve on 8 tasks, two backbones). Ī % = relative improvement. AUCC. ε -MemEvo wins on all 8 tasks (mean +8.7%+8.7\% on GPT-5, +11.7%+11.7\% on Gemini-3-Pro). Largest gains are on txn_scheduling (+37.3%+37.3\%/+38.8%+38.8\%) and EPLB (+17.9%+17.9\%/+13.3%+13.3\%). AUC@20. Cold-start improves on 7/8 tasks (mean +9.4%+9.4\%/+12.6%+12.6\%), exceeding the full-horizon AUCC gain and indicating that the largest improvements occur in the cold-start phase. The largest GPT-5 gains are circle_packing (+26.0%+26.0\%), txn_scheduling (+27.2%+27.2\%), and PRISM (+10.6%+10.6\%). T90%T_90\%. On GPT-5, ε -MemEvo reaches 90% faster on circle_packing (3 vs. 9, 3.0Ć3.0Ć), PRISM (2 vs. 17, 8.5Ć8.5Ć), and signal_processing (15 vs. 23, 1.5Ć1.5Ć). 4.4 Statistical Significance On AUCC, the paired Wilcoxon signed-rank gives p=0.0078p=0.0078 (the minimum two-sided p-value at n=8n=8 when all task-level differences share the same sign); the bootstrap 95% BCa CI on mean relative improvement is [+2.9%,+21.4%][+2.9\%,+21.4\%]; Cohenās dz=0.675d_z=0.675 (medium effect). 4.5 Ablation Study We compare five variants on 5 tasks (50 iter): ε -MemEvo (full) (LOO bank + TS), MemEvo-always (always guide), MemEvo-stagnation (rule-based: guide if stagnating, else skip), AdaEvolve (no memory), TopK (weak baseline). Task ε -MemEvo always stagnation AdaEvolve TopK circle_pack 0.928 (+9.9%) 0.942 (+11.5%) 0.957 (+13.4%) 0.845 0.781 eplb 0.129 (+1.3%) 0.000 0.000 0.127 0.122 signal 0.639 (+2.9%) 0.599 (ā-3.5%) 0.646 (+4.0%) 0.621 0.421 txn_sched 3647 (+34.0%) 4227 (+55.3%) 3548 (+30.3%) 2722 ā llm_sql 0.700 (+1.3%) 0.000 0.000 0.691 0.652 Avg. Ī % +9.9% ā-27.4% ā-30.4% 0% ā-12.3% Safe tasks 5/5 3/5 3/5 5/5 4/4 Table 3: Ablation: AUCC@50 and relative improvement over AdaEvolve. Red = catastrophic failure (AUCC=0=0). Avg. Ī % averages per-task relative improvements over AdaEvolve; AUCC=0=0 failures are scored as ā100%-100\%. Both naive always-inject and rule-based stagnation fail catastrophically on mismatched tasks. MemEvo-always and MemEvo-stagnation both achieve AUCC=0=0 on EPLB and LLM-SQLāno iteration in 50 produces a score-improving program on these tasks, while ε -MemEvo (full) and AdaEvolve both produce valid programs on the same tasks. MemEvo-always injects every iteration; MemEvo-stagnation injects whenever stagnation is detected. These failures are consistent with static policies repeatedly injecting inapplicable code patterns. TS limits this behavior because the guide posterior drops after unsuccessful injections, and the gate reverts to predominantly skip. Memory injection is highly valuable when appropriate. On circle_packing, signal, and txn_scheduling, all three memory variants outperform AdaEvolve by +2.9%+2.9\% to +55.3%+55.3\%, demonstrating genuine value when semantically aligned memories are available. The adaptive gate trades peak upside for robustness. On circle_packing (+13.4%+13.4\% vs. +9.9%+9.9\%) and signal (+4.0%+4.0\% vs. +2.9%+2.9\%), MemEvo-stagnation edges out ε -MemEvo by small margins; on txn_scheduling, MemEvo-always is best (+55.3%+55.3\%). These results show that memory content is valuable when aligned, while the adaptive gate keeps that upside without exposing the system to static-injection brittleness. ε -MemEvo is the only memory-augmented variant that improves over AdaEvolve on all 5 tasks without per-task threshold tuning. 4.6 Analysis Policy posterior and prior sensitivity. Figure 3 shows the warm-start policy posterior obtained from Exp. 1. The observed states recover 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 that the observed-state behavior is learned rather than inherited from initialization. The unobserved stagnating states retain the informative prior that favors stronger memory use when progress stalls. 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. Reward rate validation. Within the improving_early decisions in Exp. 2, 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. Negative transfer avoided in practice. On EPLB, the closest retrievable memory (from LLM-SQL, cosine 0.4810.481) prescribes SQL-style grouping; under MemEvo-always this produces code that scores 00 every iteration, whereas the adaptive gateās guide-arm posterior collapses after a handful of failures and the policy reverts to skip, allowing normal AdaEvolve search to proceed. Retrieval forms semantic clusters. Retrieval similarity reveals two natural clusters: geometric placement (similarities 0.4200.420ā0.6460.646) and numerical/systems (similarities 0.3750.375ā0.5550.555). The catastrophic-failure pair (EPLB ā LLM-SQL at 0.4810.481) is a post-hoc diagnostic, not an inference-time cutoff: ε -MemEvo always retrieves top-3 by weighted similarity and lets TS gate the decision. Computational overhead. ε -MemEvo adds ā¼ 0.77 s per iteration (<1%<\!1\% of the 80ā140 s baseline). Wall-clock time is faster on 5/8 main tasks, with an aggregate ratio of 0.69Ć0.69Ć relative to 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. 5 Discussion When does transfer help most? Our results suggest cross-task transfer is most beneficial when: (1) the memory bank contains strategies from semantically related tasks (e.g., circle_packing benefits from other geometric layout strategies at similarity ā„0.5ā„ 0.5); (2) the target task has a smooth fitness landscape where the base framework can make steady progress; (3) the search is in its early stages (AUC@20 gains exceed full-horizon AUCC gains on both backbones). Transfer is less direct when available memories are from distant task domains, which is where the adaptive gate is most important. Theoretical safety guarantee. Specialising the standard regret bound for Bernoulli Thompson sampling (27; 2) to our 3-arm gating problem shows that, when retrieved tactics are mismatched (so pskip>pguidep_ skip>p_ guide in a fixed search state), the expected number of guide pulls in the first T rounds satisfies ā”[Tguideā(T)]ā¤Cālogā”T/Īguide2+oā”(logā”T)E[T_ guide(T)]⤠C T/ _ guide^2+o( T), so the per-round probability of injecting a harmful tactic decays as Oā”(1/t)O(1/t). In a synthetic validation over T=500T=500 rounds, the rolling selection frequency of guide falls below 5% by tā100tā 100 in the mismatched setting. Why Thompson sampling? Our gate needs to support delayed binary rewards, informative Beta priors, and rapid suppression of harmful actions. Fixed ε -greedy continues to select every arm with nonzero probability even after repeated failures, while UCB1 has no natural mechanism for incorporating the state-specific priors used by ε -MemEvo. In matched and mismatched synthetic bandits, Thompson sampling is the only tested controller that combines near-lowest regret in both regimes with a vanishing harmful-arm selection rate. This choice does not imply that Thompson sampling is universally optimal: our LLM-in-the-loop experiments isolate adaptive gating against always-inject and stagnation-triggered controls, rather than replacing the gate with every bandit alternative. Limitations. We evaluate two LLM backbones (GPT-5, Gemini-3-Pro). The memory bank is built at the task level: each entry distills a complete optimization run, and LOO evaluation tests transfer from other tasks. We do not yet know how retrieval precision, gate calibration, or negative-transfer frequency change as the bank grows to hundreds of entries. Moreover, ε -MemEvo augments rather than replaces its base evolution framework, so memory transfer cannot compensate for fundamental exploration failures in the underlying search. A stronger rule-based control not evaluated here would combine stagnation-triggered injection with a k-strike auto-disable rule. Such a controller could recover much of the observed safety benefit without posterior sampling, but would introduce a task-dependent strike threshold; comparing it with ε -MemEvo is an important missing ablation. The within-paper AdaEvolve vs. ε -MemEvo comparison (Tables 1ā2) remains the primary controlled test. 6 Conclusion 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.0078p=0.0078, 8/8 AUCC wins, +8.7%+8.7\% average improvement). The key insight is that adaptive injection control is essential: while cross-task memories can provide substantial value (up to +55%+55\%), uncontrolled injection can actively harm the searchāin our ablation, two of five tasks fail to improve under naive always-inject. The adaptive gate resolves this tension with an interpretable posterior: data favor skip in improving and early-plateau states and hint in late-plateau states, while the unobserved stagnating states retain the prior-initialized guide action. This control incurs negligible overhead (<1%<\!1\%). The content-level LOO protocol excludes target-task entries from the memory bank, so the transferred tactics come from other tasks rather than target solutions. These results establish adaptive cross-task memory as a complementary layer for evolutionary coding agents. Next steps include larger, more diverse banks, hierarchical memory, and transfer across base search frameworks and weaker LLM backbones. Broader Impact Statement ε -MemEvo uses 0.69Ć0.69Ć the aggregate wall-clock time of AdaEvolve across the 8 main tasks but costs 2ā34 GPU-hours per task; scaling may raise energy use. Cross-task reuse lowers cost; gating reveals memory influence. References Agrawal et al. (2025) L. A. Agrawal, S. Tan, D. Soylu, N. Ziems, R. Khare, K. Opsahl-Ong, A. Singhvi, H. Shandilya, M. J. Ryan, M. Jiang, et al. GEPA: reflective prompt evolution can outperform reinforcement learning. arXiv preprint arXiv:2507.19457. Cited by: §2. Agrawal and Goyal (2013) S. Agrawal and N. Goyal Further optimal regret bounds for Thompson sampling. In International Conference on Artificial Intelligence and Statistics (AISTATS), Cited by: §2, §5. Assumpção et al. (2025) H. Assumpção, D. Ferreira, L. Campos, and F. Murai CodeEvolve: an open source evolutionary coding agent for algorithm discovery and optimization. arXiv preprint arXiv:2510.14150. Cited by: §2. Cemri et al. (2026) M. Cemri, S. Agrawal, A. Gupta, S. Liu, A. Cheng, Q. Mang, A. Naren, L. E. Erdogan, K. Sen, M. Zaharia, A. Dimakis, and I. Stoica AdaEvolve: adaptive LLM driven zeroth-order optimization. arXiv preprint arXiv:2602.20133. Cited by: §1, §2, §2, §3.2. Chapelle and Li (2011) O. Chapelle and L. Li An empirical evaluation of Thompson sampling. In Advances in Neural Information Processing Systems (NeurIPS), Cited by: §2. Chen et al. (2023) A. Chen, D. M. Dohan, and D. R. So EvoPrompting: language models for code-level neural architecture search. In Advances in Neural Information Processing Systems, Cited by: §2. Da Costa et al. (2008) L. Da Costa, Ć. Fialho, M. Schoenauer, and M. Sebag Adaptive operator selection with dynamic multi-armed bandits. In Genetic and Evolutionary Computation Conference (GECCO), Cited by: §2. De Lange et al. (2021) M. De Lange, R. Aljundi, M. Masana, S. Parisot, X. Jia, A. Leonardis, G. Slabaugh, and T. Tuytelaars A continual learning survey: defying forgetting in classification tasks. IEEE Transactions on Pattern Analysis and Machine Intelligence 44 (7), p. 3366ā3385. Cited by: §2. Fialho et al. (2010) Ć. Fialho, L. Da Costa, M. Schoenauer, and M. Sebag Analyzing bandit-based adaptive operator selection mechanisms. Annals of Mathematics and Artificial Intelligence 60 (1-2), p. 25ā64. Cited by: §2. Finn et al. (2017) C. Finn, P. Abbeel, and S. Levine Model-agnostic meta-learning for fast adaptation of deep networks. In International Conference on Machine Learning, Cited by: §2. Hospedales et al. (2022) T. Hospedales, A. Antoniou, P. Micaelli, and A. Storkey Meta-learning in neural networks: a survey. IEEE Transactions on Pattern Analysis and Machine Intelligence 44 (9), p. 5149ā5169. Cited by: §2. Kaufmann et al. (2012) E. Kaufmann, N. Korda, and R. Munos Thompson sampling: an asymptotically optimal finite-time analysis. In Algorithmic Learning Theory (ALT), Cited by: §2. Kirkpatrick et al. (2017) J. Kirkpatrick, R. Pascanu, N. Rabinowitz, J. Veness, G. Desjardins, A. A. Rusu, K. Milan, J. Quan, T. Ramalho, A. Grabska-Barwinska, D. Hassabis, C. Clopath, D. Kumaran, and R. Hadsell Overcoming catastrophic forgetting in neural networks. Proceedings of the National Academy of Sciences 114 (13), p. 3521ā3526. Cited by: §2. Koza (1992) J. R. Koza Genetic programming: on the programming of computers by means of natural selection. MIT Press. Cited by: §2. Lange et al. (2025) R. T. Lange, Y. Imajuku, and E. Cetin ShinkaEvolve: towards open-ended and sample-efficient program evolution. arXiv preprint arXiv:2509.19349. Cited by: §2, §2. Lehman et al. (2022) J. Lehman, J. Gordon, S. Jain, K. Ndousse, C. Yeh, and K. O. Stanley Evolution through large models. arXiv preprint arXiv:2206.08896. Cited by: §2. Lewis et al. (2020) P. Lewis, E. Perez, A. Piktus, F. Petroni, V. Karpukhin, N. Goyal, H. Küttler, M. Lewis, W. Yih, T. RocktƤschel, S. Riedel, and D. Kiela Retrieval-augmented generation for knowledge-intensive NLP tasks. In Advances in Neural Information Processing Systems, Cited by: §2. Liu et al. (2024) F. Liu, X. Tong, M. Yuan, X. Lin, F. Luo, Z. Wang, Z. Lu, and Q. Zhang Evolution of heuristics: towards efficient automatic algorithm design using large language model. In International Conference on Machine Learning, Cited by: §2. Liu et al. (2026) S. Liu, S. Agarwal, M. Maheswaran, M. Cemri, et al. EvoX: meta-evolution for automated discovery. arXiv preprint arXiv:2602.23413. Cited by: §2. Lu et al. (2022) S. Lu, N. Duan, H. Han, D. Guo, S. Hwang, and A. Svyatkovskiy ReACC: a retrieval-augmented code completion framework. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics, Cited by: §2. Meyerson et al. (2023) E. Meyerson, M. J. Nelson, H. Bradley, A. Gaier, A. Moradi, A. K. Hoover, and J. Lehman Language model crossover: variation through few-shot prompting. arXiv preprint arXiv:2302.12170. Cited by: §2. Novikov et al. (2025) A. Novikov, N. Vu, M. Eisenberger, E. Dupont, P. Huang, A. Z. Wagner, et al. AlphaEvolve: a coding agent for scientific and algorithmic discovery. arXiv preprint arXiv:2506.13131. Cited by: §1, §2, §2, §4.1. Packer et al. (2023) C. Packer, S. Wooders, K. Lin, V. Fang, S. G. Patil, I. Stoica, and J. E. Gonzalez MemGPT: towards LLMs as operating systems. arXiv preprint arXiv:2310.08560. Cited by: §2. Park et al. (2023) J. S. Park, J. C. OāBrien, C. J. Cai, M. R. Morris, P. Liang, and M. S. Bernstein Generative agents: interactive simulacra of human behavior. In Proceedings of the 36th Annual ACM Symposium on User Interface Software and Technology (UIST), Cited by: §2. Parvez et al. (2021) M. R. Parvez, W. U. Ahmad, S. Chakraborty, B. Ray, and K. Chang Retrieval augmented code generation and summarization. In Findings of the Association for Computational Linguistics: EMNLP 2021, Cited by: §2. Romera-Paredes et al. (2024) B. Romera-Paredes, M. Barekatain, A. Novikov, M. Balog, M. P. Kumar, E. Dupont, F. J. R. Ruiz, J. Ellenberg, P. Wang, O. Fawzi, P. Kohli, and A. Fawzi Mathematical discoveries from program search with large language models. Nature 625, p. 468ā475. External Links: Document Cited by: §1, §2, §2. Russo et al. (2018) D. Russo, B. Van Roy, A. Kazerouni, I. Osband, and Z. Wen A tutorial on Thompson sampling. Foundations and Trends in Machine Learning 11 (1), p. 1ā96. Cited by: §5. Rusu et al. (2016) A. A. Rusu, N. C. Rabinowitz, G. Desjardins, H. Soyer, J. Kirkpatrick, K. Kavukcuoglu, R. Pascanu, and R. Hadsell Progressive neural networks. arXiv preprint arXiv:1606.04671. Cited by: §2. Sharma (2025) A. Sharma OpenEvolve: an open-source evolutionary coding agent. Note: https://github.com/algorithmicsuperintelligence/openevolve Cited by: §2, §2. Shinn et al. (2023) N. Shinn, F. Cassano, A. Gopinath, K. Narasimhan, and S. Yao Reflexion: language agents with verbal reinforcement learning. In Advances in Neural Information Processing Systems, Cited by: §2. Slivkins (2019) A. Slivkins Introduction to multi-armed bandits. Foundations and Trends in Machine Learning 12 (1ā2), p. 1ā286. Cited by: §2. Wang et al. (2023) G. Wang, Y. Xie, Y. Jiang, A. Mandlekar, C. Xiao, Y. Zhu, L. Fan, and A. Anandkumar Voyager: an open-ended embodied agent with large language models. In Advances in Neural Information Processing Systems, Cited by: §2. Yang et al. (2024) C. Yang, X. Wang, Y. Lu, H. Liu, Q. V. Le, D. Zhou, and X. Chen Large language models as optimizers. In International Conference on Learning Representations, Cited by: §2. Zhou et al. (2023) S. Zhou, U. Alon, F. F. Xu, Z. Wang, Z. Jiang, and G. Neubig DocPrompting: generating code by retrieving the docs. In International Conference on Learning Representations, Cited by: §2.