---
title: Personalized Prompt Optimization
url: https://www.emergentmind.com/topics/personalized-prompt-optimization-ppopt
type: topic
---

# Personalized Prompt Optimization

Personalized Prompt Optimization (PPOpt) denotes a family of methods that optimize prompts as adaptive interfaces between data, users, tasks, and fixed or lightly tuned foundation models. Across recent work, the optimized object may be a discrete natural-language instruction, a user-conditioned soft prompt, a profile-generation template, a memory-augmented prompt, or a system prompt for an optimizing agent itself. The unifying idea is that prompt quality is not treated as static: it is conditioned on user profiles, interaction histories, task instances, model idiosyncrasies, feedback signals, or accumulated experience, and is improved by search, learning, reinforcement, or self-evolution rather than by one-shot manual engineering [2205.09666] [2408.00960] [2603.21520].

## 1. Conceptual scope and units of personalization

The literature does not use one single canonical formalism for PPOpt. Instead, it instantiates personalization at several granularities. In sequential recommendation, personalization is explicit and user-conditioned: a prompt generator maps user profiles \(A_u\) or concatenated profile embeddings \(\mathbf{x}_u\) to personalized soft prefix prompts \(\mathbf{P}^u\), which are prepended to the behavioral sequence before a Transformer-based recommender encodes it [2205.09666]. In explainable recommendation, personalization appears as user- and item-specific prompt tokens, either as discrete feature prompts or continuous prompt vectors \(\mathbf{u}\) and \(\mathbf{i}\) prepended to a GPT-2 input for explanation generation [2202.07371].

In personalized language prompting, the optimized object is a user-specific soft prompt \(P_u\) computed from a long interaction history \(H_u\), yielding the conditional model \(P_{\theta_{LM}}(Y_u \mid [P_u; T; X])\). Here personalization is function-based rather than tied to explicit per-user prompt parameters stored independently of the user history [2408.00960]. In prompt rewriting for personalized text generation, the personalized component is not the entire prompt but the user-context summary and synthesis sections \(\mathbf{Su}(x,\mathcal{E})\) and \(\mathbf{Sy}(x,\mathcal{E})\), which are rewritten to better steer a frozen API-only LLM [2310.00152].

In code generation, personalization is instance-level rather than user-level. Prompt optimization is modeled as a sequential decision-making process over a natural-language prompt \(p_{i,t}\), with a PPO agent choosing among direct generation, lexical mutation, and semantic rewriting based on test-derived rewards for the current programming task [2605.19102]. In memory-driven prompt optimization, the prompt becomes query-dependent via \(p = [p_{\mathrm{Inst}}, p_{\mathrm{Mem}(q)}]\), where \(p_{\mathrm{Mem}(q)}\) is assembled from retrieved strategy templates and error patterns [2603.21520]. In interactive systems, personalization can be implicit in a human assessment functional \(H(I(p_i))\), where the preferred prompt is whichever best matches a specific user’s preferences over prompt text, sample predictions, explanations, and \(F_1\) [2412.12644].

| Formulation | Optimized prompt object | Personalization unit |
|---|---|---|
| PPR | Personalized soft prefix \(\mathbf{P}^u\) | User profile and cold-start behavior [2205.09666] |
| PEPLER / PERSOMA | Continuous prompt tokens or adapters | User ID, item ID, or interaction history [2202.07371] [2408.00960] |
| PPO code prompting | Rewritten natural-language task prompt | Task instance and backbone model [2605.19102] |
| MemAPO / DelvePO / SePO | Memory- or evolution-composed prompts | Query, task, or optimization history [2603.21520] [2510.18257] [2606.04465] |

A plausible implication is that PPOpt is best understood not as one algorithmic family but as a design space whose central variable is the conditioning signal used to specialize prompts.

## 2. Prompt representations and architectural patterns

One major axis in PPOpt is the representation of the prompt itself. Continuous prompt methods treat prompts as learned vectors in model embedding space. PPR constructs \(n\) personalized soft prefix tokens \(\mathbf{P}^u = \{\mathbf{p}_1^u,\dots,\mathbf{p}_n^u\}\) through a prompt generator \(\mathrm{PPG}(\mathbf{x}_u \mid \vartheta)\), then prepends them to the item sequence so that the pre-trained sequential encoder processes a prompt-enhanced sequence \(\hat{s}_u\) [2205.09666]. PEPLER similarly prepends continuous user and item vectors to a GPT-2 explanation sequence, while PERSOMA compresses free-form user interactions into soft prompt embeddings via an MLP, Transformer, or Perceiver-based adapter before concatenating them with task soft prompts and input text [2202.07371] [2408.00960].

A second pattern uses discrete textual prompts. In automatic reranking, AGP optimizes a global profile-generation prompt \(p_{\mathrm{gen}}\) that instructs an LLM how to infer a user profile \(p(u)\) from textual history \(H(u)\); that inferred profile is then used in a second prompt for reranking [2504.03965]. MePO optimizes natural-language prompts through merit-guided rewriting and trains a lightweight prompt optimizer to output a new prompt \(P_{\text{golden}}\) from a lower-quality \(P_{\text{silver}}\) [2505.09930]. SPO likewise searches over discrete prompts, but uses only output-vs-output comparisons rather than ground truth during optimization [2502.06855].

A third pattern uses structured or compositional prompts. DelvePO decomposes prompts into tagged components such as `Role`, `Task description`, `Output format`, `Workflow`, and `Examples`, then evolves them at the component level rather than rewriting monolithic prompt strings [2510.18257]. MemAPO composes prompts from an invariant instruction plus memory-derived rules and templates, while SePO treats system prompts themselves as evolutionary objects in an archive-based search over human-readable instructions [2603.21520] [2606.04465]. AutoFed extends the prompt notion outside language-only settings by learning a prompt matrix \(p_g \in \mathbb{R}^{n \times h}\) from local traffic sequences and injecting it as the first input token to a personalized decoder in federated learning [2512.24625].

This suggests that “prompt” in PPOpt is a broader computational object than natural-language instructions alone. It can be a token sequence, a prompt matrix, a retrieved rule set, or a structured collection of components.

## 3. Optimization objectives and algorithmic families

The optimization mechanisms used in PPOpt are correspondingly diverse. In recommendation, PPR follows a pre-train \(\rightarrow\) prompt-tune paradigm. A pre-trained sequential recommender \(f_{seq}\) is adapted to cold users by optimizing a pairwise ranking loss \(L_p\) plus a prompt-oriented contrastive loss \(L_{CL}\), yielding \(L_{all} = L_p + \lambda L_{CL}\). Two regimes are defined: PPR(light), where only the prompt generator and profile MLP are trained, and PPR(full), where backbone parameters are also updated [2205.09666].

In explainable recommendation, PEPLER addresses the mismatch between randomly initialized prompt parameters and a pre-trained PLM by sequential tuning: first fixed-LM prompt tuning, then prompt+LM fine-tuning. It further introduces recommendation-as-regularization through a joint objective \(\mathcal{L}_C + \lambda \mathcal{L}_R\), forcing prompt embeddings to support both explanation generation and rating prediction [2202.07371]. In personalized text generation, prompt rewriting uses a supervised-learning stage based on best sampled prompt variants, followed by PPO fine-tuning with BLEU reward from a frozen generator; RL from scratch performs poorly, whereas SL\(\rightarrow\)RL yields the strongest results [2310.00152].

Several systems formulate PPOpt directly as reinforcement learning or sequential control. Prompt optimization for code generation models prompt refinement as an MDP with state \(s_{i,t} = \mathrm{Embed}(p_{i,t}) \in \mathbb{R}^{384}\), action space \(\{\text{direct}, \text{mutation}, \text{rewrite}\}\), and a shaped reward defined by pass ratio and execution status. The PPO agent updates prompts iteratively to maximize episode return over tasks [2605.19102]. P\(^2\)O couples policy optimization with prompt optimization in RLVR: hard samples are identified by low average reward, GEPA evolves prompt templates for those samples, and the gains are distilled back into model parameters through context distillation rather than left as inference-time prompt hacks [2603.21877].

Other methods rely on preference learning, bandits, or self-supervision. MePO uses DPO on a prompt preference dataset of \((P_{\text{silver}}, P_{\text{golden}})\) pairs, learning a lightweight optimizer that internalizes interpretable merits such as clarity, precision, concise CoT, and preserving original information [2505.09930]. OPTS casts strategy selection as a Bernoulli multi-armed bandit over prompt design strategies plus an inaction arm, with Thompson sampling outperforming uniform selection and APET-style implicit selection [2503.01163]. SPO uses no labels or human references; it iteratively proposes a prompt \(P'\), executes it on a few questions, and accepts it if an LLM evaluator prefers its outputs over those of the current best prompt [2502.06855].

A final family is explicitly self-evolving. DelvePO combines roulette-wheel sampling, component-wise mutation and crossover, and memory-guided direction selection [2510.18257]. MemAPO maintains a Correct-Template Memory and an Error-Pattern Memory, retrieving both at inference and editing both after each interaction [2603.21520]. SePO extends this logic one level upward by optimizing the prompt agent’s own system prompt through open-ended evolutionary search with an archive of candidate prompts as stepping stones [2606.04465].

## 4. Feedback signals, memory, and the personalization substrate

The personalization signal in PPOpt may come from explicit user attributes, observed behavior, model outputs, or human assessment. In cold-start recommendation, user profiles such as age, gender, consumption level, occupation, or location are embedded and concatenated into \(\mathbf{x}_u\), which conditions both the prompt generator and an attribute-level preference pathway. Prompt-oriented augmentations include masking profile features and masking items in the behavior sequence, with contrastive learning encouraging invariance under sparse or noisy observations [2205.09666].

In explainable recommendation and personalized language prompting, the signal is richer and often mixed. PEPLER uses user IDs, item IDs, item features, and ratings; PERSOMA uses title, description, and rating from many historical interactions, then studies sampling strategies such as recency, random, long tail, top-K popularity, and genre sample [2202.07371] [2408.00960]. AutoFed uses local client traffic sequences and graph structure to produce a client-aligned prompt matrix, while keeping personalized predictor parameters local and aggregating only shared representor parameters across clients [2512.24625].

Test-driven frameworks derive personalization from execution feedback. In code generation, the reward distinguishes full success, partial success, total failure, and execution failure, with shaped rewards outperforming sparse binary rewards [2605.19102]. AGP uses position-aware ranking feedback \(\mathcal{F}(u)\) comparing actual and target positions of ground-truth items, then aggregates this over batches with weights \(w(u)=1/\text{avgPos}(u)\) to update the global profile-generation prompt [2504.03965]. P\(^2\)O identifies hard samples through low empirical success rates, then optimizes prompt templates specifically for that subset [2603.21877].

Human-in-the-loop and memory-driven systems turn preferences and error histories into prompt signals. iPrOp formalizes interactive prompt optimization as
\[
p^* = \arg\max_{p \in P \cup M(P)} H(I(p_i)),
\]
where \(I(p_i)\) includes the prompt text, informative instances, model explanations, and \(F_1\) on a held-out subset; the human’s assessment function \(H\) supplies the effective personalization [2412.12644]. MemAPO stores successful strategies as templates \(T=\{I,S,C\}\) and failed reasoning as error patterns \(R\), then composes prompts for new queries using both [2603.21520]. DelvePO similarly uses prompt memory and component memory as working memory so that future prompt edits are conditioned on historical successes and failures rather than on one-shot stochastic rewriting [2510.18257].

A plausible implication is that PPOpt systems differ less by whether they personalize and more by what substrate they treat as the source of personalization: profiles, histories, rankings, tests, interaction logs, or explicit judgments.

## 5. Empirical evidence across domains

In sequential recommendation, PPR reports statistically significant improvements over plain SASRec, BERT4Rec, CL4SRec, MeLU, and fine-tuning baselines on three large-scale datasets. In few-shot recommendation, examples include CIKM HIT@10 improving from 0.6836 for Fine-tuning to 0.6889 for PPR(full), QQBrowser NDCG@10 from 0.6944 to 0.6960, and AliEC HIT@10 from 0.7189 to 0.7275 for PPR(light). In zero-shot recommendation, CIKM NDCG@10 improves from 0.2463 to 0.2507, QQBrowser from 0.4016 to 0.4074, and AliEC HIT@5 from 0.3905 to 0.4014. PPR(light) updates only about 0.25–0.6% of full parameters across datasets, yet often surpasses full fine-tuning [2205.09666].

In explainable recommendation, continuous prompt learning in PEPLER consistently outperforms discrete prompt learning and several non-prompt baselines on TripAdvisor, Amazon, and Yelp, while sequential tuning is more robust than joint prompt+LM fine-tuning from random initialization [2202.07371]. In personalized language prompting, PERSOMA scales to long histories with far shorter prompt lengths than text-based personalization; for history length 50 under recency sampling, PERSOMA MLP with a frozen LM reaches \(F1=0.541\), PERSOMA end-to-end reaches \(F1=0.569\), while UEM Base is 0.396 and zero-shot Gemini 1.5 Pro is 0.261 [2408.00960].

For test-driven optimization, PPO-based code prompt refinement substantially outperforms EPiC, Reflexion, and Random-Hybrid. On MBPP+ strict Pass@1, PPO reaches 57.58% with CodeT5+, 64.80% with CodeLLaMA, and 85.50% with DeepSeek-Coder; Soft-Pass@1 reaches 67.90%, 73.10%, and 88.20%, respectively [2605.19102]. In RLVR, P\(^2\)O improves average accuracy from 60.5% under GRPO to 65.2% under P\(^2\)O-Teacher-Ref on DeepScaler-5K, and removing context distillation drops performance to 55.6%, below the RL baseline [2603.21877].

For reranking and prompt rewriting, AGP reports 5.61–20.68% improvements in NDCG@10 over baseline recommenders, with particularly strong gains for LightGCN, while training on only 100 users already delivers most of the benefit [2504.03965]. In personalized text generation, the SL\(\rightarrow\)RL rewriter outperforms the original FtPersLlm prompts and both SL-only and RL-only variants. On Avocado, BLEU rises from 9.59 to 13.18; on Amazon reviews, from 5.00 to 13.07; on Reddit, from 13.13 to 20.59 [2310.00152].

For lightweight or self-supervised optimizers, MePO achieves the best average performance across Qwen2-7B, Tulu2-7B-DPO, LLaMA2-7B-chat, and LLaMA3-8B-instruct, for example improving LLaMA3-8B-instruct average accuracy from 48.77 to 57.07 and Tulu2-7B-DPO from 41.05 to 48.37 [2505.09930]. SPO reaches average performance 66.9 at an average cost of \$0.15 per dataset, compared with 66.6 at \$4.51 for OPRO and 63.9 at \$13.14 for TextGrad [2502.06855]. SePO-Generalist improves average accuracy by 4.49 points over Manual-CoT across AIME’25, ARC-AGI-1, GPQA, MBPP, and Sudoku, reaching 76.38 versus 71.89 [2606.04465]. DelvePO reports average performance 70.48 on DeepSeek-R1-Distill-Llama-8B, 90.56 on GPT-4o-mini, and 75.25 on Qwen2.5-7B-Instruct, outperforming APE, EvoPrompt, and PromptBreeder under matched settings [2510.18257].

Taken together, these results indicate that PPOpt is not restricted to a single modality or task family. It has been validated in recommendation, explanation generation, long-history personalization, code generation, reranking, federated prediction, system-prompt optimization, and self-supervised discrete prompt search.

## 6. Limitations, tensions, and future directions

Several recurrent limitations appear across the literature. Scalability remains a central issue. PPR notes the need to verify personalized prompting on “industrial extremely large-scale recommendation datasets and pre-trained models,” especially when user bases or item vocabularies are very large [2205.09666]. AutoFed reduces communication through prompt-related sharing, but still assumes relatively heavy local models and graph-structured data, which may be challenging for resource-constrained clients [2512.24625]. AGP and PPO-based prompt refinement both require repeated LLM calls plus repeated evaluation, making them appropriate primarily where correctness or personalization gain justifies added compute [2504.03965] [2605.19102].

Another tension is the scope of context available to the optimizer. PPO-based code prompt refinement uses a prompt-only state and explicitly excludes generated code, previous actions, rewards, and unit-test tracebacks from the state representation, which limits debug-aware adaptation [2605.19102]. Personalized text generation rewrites only selected prompt components, not the full prompt structure, and optimizes against BLEU reward, which may encourage conservative rewrites [2310.00152]. PERSOMA handles long histories well but does not address true cold start, since no \(H_u\) implies no user soft prompt \(P_u\) [2408.00960].

Interpretability and preference modeling remain uneven. Continuous prompt systems such as PPR, PEPLER, PERSOMA, and AutoFed learn prompt vectors or matrices without explicit semantics, even though those prompts clearly influence downstream behavior [2205.09666] [2202.07371] [2408.00960] [2512.24625]. iPrOp exposes prompt text, predictions, explanations, and metrics to users, but does not yet learn a persistent model of user preferences across sessions [2412.12644]. MemAPO and DelvePO move toward interpretable prompting knowledge through explicit memories of templates, rules, and components, but both still face memory-management, interference, and scaling questions as domains or users proliferate [2603.21520] [2510.18257].

Future directions identified in the cited work converge on a few themes. One is richer conditioning: dynamic user profiles, streaming updates, multimodal inputs, code tracebacks, and explicit user descriptors rather than only static features or prompt text [2205.09666] [2605.19102]. A second is stronger personalization infrastructure: per-user memory banks, contextual bandits, profile-conditioned DPO, and human-in-the-loop prompt selection with explicit preference elicitation [2503.01163] [2505.09930] [2412.12644]. A third is broader optimization scope: SePO proposes extending self-evolving optimization from system prompts to tools and workflows, while MemAPO suggests multimodal and agentic extensions of strategy and error memory [2606.04465] [2603.21520].

These trajectories suggest that PPOpt is evolving from isolated prompt rewriting into a general methodology for adaptive interface design between foundation models and heterogeneous users, tasks, and environments.

Source: https://www.emergentmind.com/topics/personalized-prompt-optimization-ppopt