Generalizable Self-Evolving Memory for Automatic Prompt Optimization

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Liang, Guanbao, Bei, Yuanchen, Zhou, Sheng, Qin, Yuheng, Zhou, Huan, Jia, Bingxin, Li, Bin, Bu, Jiajun
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866912977942216704
author Liang, Guanbao
Bei, Yuanchen
Zhou, Sheng
Qin, Yuheng
Zhou, Huan
Jia, Bingxin
Li, Bin
Bu, Jiajun
author_facet Liang, Guanbao
Bei, Yuanchen
Zhou, Sheng
Qin, Yuheng
Zhou, Huan
Jia, Bingxin
Li, Bin
Bu, Jiajun
contents Automatic prompt optimization is a promising approach for adapting large language models (LLMs) to downstream tasks, yet existing methods typically search for a specific prompt specialized to a fixed task. This paradigm limits generalization across heterogeneous queries and prevents models from accumulating reusable prompting knowledge over time. In this paper, we propose MemAPO, a memory-driven framework that reconceptualizes prompt optimization as generalizable and self-evolving experience accumulation. MemAPO maintains a dual-memory mechanism that distills successful reasoning trajectories into reusable strategy templates while organizing incorrect generations into structured error patterns that capture recurrent failure modes. Given a new prompt, the framework retrieves both relevant strategies and failure patterns to compose prompts that promote effective reasoning while discouraging known mistakes. Through iterative self-reflection and memory editing, MemAPO continuously updates its memory, enabling prompt optimization to improve over time rather than restarting from scratch for each task. Experiments on diverse benchmarks show that MemAPO consistently outperforms representative prompt optimization baselines while substantially reducing optimization cost.
format Preprint
id arxiv_https___arxiv_org_abs_2603_21520
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Generalizable Self-Evolving Memory for Automatic Prompt Optimization
Liang, Guanbao
Bei, Yuanchen
Zhou, Sheng
Qin, Yuheng
Zhou, Huan
Jia, Bingxin
Li, Bin
Bu, Jiajun
Computation and Language
Automatic prompt optimization is a promising approach for adapting large language models (LLMs) to downstream tasks, yet existing methods typically search for a specific prompt specialized to a fixed task. This paradigm limits generalization across heterogeneous queries and prevents models from accumulating reusable prompting knowledge over time. In this paper, we propose MemAPO, a memory-driven framework that reconceptualizes prompt optimization as generalizable and self-evolving experience accumulation. MemAPO maintains a dual-memory mechanism that distills successful reasoning trajectories into reusable strategy templates while organizing incorrect generations into structured error patterns that capture recurrent failure modes. Given a new prompt, the framework retrieves both relevant strategies and failure patterns to compose prompts that promote effective reasoning while discouraging known mistakes. Through iterative self-reflection and memory editing, MemAPO continuously updates its memory, enabling prompt optimization to improve over time rather than restarting from scratch for each task. Experiments on diverse benchmarks show that MemAPO consistently outperforms representative prompt optimization baselines while substantially reducing optimization cost.
title Generalizable Self-Evolving Memory for Automatic Prompt Optimization
topic Computation and Language
url https://arxiv.org/abs/2603.21520