Skip to content
Preprint

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

Aug 2026 · 0 citations · 28 references
Computer Science

TL;DR

The $\varepsilon$-MemEvo framework for cross-task knowledge transfer in LLM program evolution 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.

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.

View source

Similar papers

Preprint Aug 2026

EvoMem: Memory-Augmented Evolution for Code Optimization

EvoMem is introduced, a persistent memory architecture for LLM-based evolutionary program search that captures and reuses candidate mutation knowledge and provides evidence that persistent memory can reduce some redundant exploration and improve the reuse and adaptation of successful strategies in LLM-driven evolutionary search.

Viktor Volkov, V. Khrulkov, Andrey V. Galichin et al. · 0 citations
Preprint Jul 2026

MEMENTO: Memory-Guided Memetic Code-as-Policy Evolution

MEMENTO is introduced, a memory-guided single-elite memetic framework for code-as-policy evolution that outperforms Eureka and REvolve, adapted as code-as-policy evolutionary baselines, in task success and generalization to held- out Robosuite object configurations and unseen AI2-THOR scenes.

Alkis Sygkounas, Victor Aregbede, Amy Loutfi et al. · 0 citations
Preprint Aug 2026

MemTrapBench: Benchmarking Cognitive Traps in LLM Memory Use

Memory has become a key component of large language models, enabling them to retain information and learn from long-term interactions. However, existing memory benchmarks mainly evaluate whether information is correctly extracted, stored, and retrieved, while largely overlooking how retrieved memories reshape model reasoning and affect performance on the current task. We identify memory-induced cognitive traps: even faithfully recorded and semantically relevant memories can distort model reasoning or beliefs and degrade current task performance. To systematically evaluate these failure modes, we introduce MemTrapBench, which covers two forms of cognitive traps: Reasoning Fixation and Belief Distortion. Experiments across two model families and five representative memory frameworks show that MemTrapBench is challenging: all evaluated memory strategies underperform the no-memory setting, with even the strongest methods suffering drops of more than 10%. To mitigate these cognitive traps, we propose AdaptiveMem, a simple yet effective inference-time method that instructs LLMs to avoid memory traps. AdaptiveMem mitigates cognitive traps on MemTrapBench while preserving or improving performance on standard memory benchmarks across diverse memory frameworks.

Mengru Wang, Haozhe Luo, Zhenqiang Xu et al. · 0 citations
Preprint Aug 2026

DistillCache: KL-Guided Adaptive KV-Cache Eviction for Memory-Efficient LLM Inference

Transformer-based large language models (LLMs) achieve strong performance across many tasks, but their Key-Value (KV) cache grows linearly with sequence length, creating a severe memory bottleneck for long-context inference. Existing heuristic eviction methods (e.g., H$_2$O and SnapKV) rely on static attention or positional signals that often fail to capture a token's future predictive influence. We propose DistillCache, a reinforcement learning framework that formulates KV-cache eviction as a sequential decision problem. DistillCache learns a lightweight policy network using rich internal model signals (attention statistics, value norms, entropy, and position) and trains it with REINFORCE via a per-step KL-divergence reward to preserve the full-cache output distribution. On a 7B-parameter instruction-tuned Transformer (Mistral-7B-Instruct-v0.3), DistillCache retains 94.2% of full-cache accuracy on LongBench at a 25% cache budget, outperforming both strong heuristic baselines (H$_2$O, SnapKV) by up to 2.7 absolute points and, under our re-implementations, concurrent RL-based methods (ForesightKV, RLKV) by up to 1.4 points on long-context tasks. On reasoning benchmarks, DistillCache is competitive with the best concurrent method and surpasses it under aggressive compression. It also delivers up to 2.1x full-cache throughput while maintaining competitive practical efficiency. These results highlight the effectiveness of learned, distribution-aware policies for memory-efficient long-context LLM inference.

Asaad Althoubi · 0 citations
Conference Jul 2026

Toward Reliable LLM Code Generation: Adaptive Routing Framework for Ambiguous Requirements

Natural-language requirements for program synthesis are often incomplete or ambiguous, yet large language models are commonly expected to generate code in a single pass. Prior clarification-based methods address this issue by asking follow-up questions when sampled candidate programs disagree, but fixed clarify-on-disagreement policies can overuse clarification and can also overtrust weak behavioral agreement. We present an adaptive routing framework for LLM-based program synthesis that treats clarification as an inference-time control decision. The framework augments a ClarifyGPT-style pipeline with execution-driven confidence estimation, semanticdifference analysis, and bounded candidate expansion, allowing the system to choose among direct generation, additional evidence gathering, and clarification. We evaluate the framework on MBPP, HumanEval, and extended-test variants using GPT-4.1 mini, Claude Haiku 4.5, and GPT-5.4 mini. Adaptive routing improves pass@1 accuracy by up to 7.60 percentage points over single-pass baselines. Compared with fixed-policy clarification, it preserves accuracy while reducing token usage by up to 57.2% for GPT-4.1 mini, and reallocates computation toward harder cases for Claude Haiku 4.5. These results suggest that clarification is most useful when triggered selectively based on execution evidence and semantic disagreement, even when ambiguity is observed indirectly through candidate behavior rather than through explicitly annotated ambiguous requirements.

Muhammad Ahmed, Edwar Tiu, Niyati Nikunj Kapadia et al. · 0 citations