Introduction
Prompt engineering has traditionally focused on task-specific optimization—finding the best way to ask a model to summarize, classify, or reason. However, as Large Language Models (LLMs) proliferate, it has become evident that a "one-size-fits-all" prompt is sub-optimal. Different models, such as LLaMA, BLOOM, or GPT-J, possess unique internal biases and linguistic "personalities." A prompt that yields high performance on one model may fail on another. This paper introduces Model-Adaptive Prompt Optimization (MAPO), a framework designed to automatically tailor prompts to the specific preferences of individual LLMs.
The MAPO Framework
The core of MAPO is a multi-stage pipeline that transitions from general task understanding to model-specific alignment.
The framework operates in three primary phases:
- Warm-up Dataset Establishment: An "oracle" model (GPT-3.5) generates a diverse set of prompt rewrites. These candidates are evaluated on the target LLM to create a preference dataset based on the quality of the resulting outputs.
- Supervised Fine-Tuning (SFT): A prompt optimizer is trained on the top-performing prompt-response pairs to learn the basic linguistic structure preferred by the target model.
- Reinforcement Learning (RL) with RRMF: The system employs Proximal Policy Optimization (PPO) and a novel technique called Ranking Responses from Model Feedback (RRMF). This aligns the probability of generating a specific prompt with the reward score assigned to that prompt by the target LLM's performance.
To ensure the optimizer remains versatile, the authors incorporate Generalization Maintenance, mixing general NLP data into the training process to prevent catastrophic forgetting.
Understanding Model-Specific Preferences
The necessity of MAPO stems from the observation that different models respond differently to the same task instructions.
Case studies revealed distinct "dialects" among models. For instance, BLOOM showed a preference for passive voice in QA tasks, while LLaMA responded more accurately to specific terms like "commonly used term" rather than more generic phrasing. MAPO captures these subtle, often non-intuitive preferences that human engineers might overlook. Ablation studies confirmed that the RL stage (RRMF) is the "secret sauce" that captures these nuances, providing nearly double the performance gain of SFT alone.
Experimental Results
The researchers evaluated MAPO across nine datasets from the P3 benchmark, covering Question Answering, Classification, and Generation. The results demonstrated significant performance gains over standard prompts and SFT-only baselines:
- BLOOM: Achieved a 20.5% increase in CloseQA and a 30.9% boost in explanation tasks.
- LLaMA: Saw a 22.8% improvement in news classification.
- Zero-Shot Transfer: Prompts optimized for one task showed robust performance when transferred to new domains (e.g., GLUE, SuperGLUE), suggesting that MAPO learns fundamental model preferences rather than just task-specific shortcuts.
Conclusion
MAPO shifts the paradigm of prompt engineering from task-centric to model-centric. By leveraging Reinforcement Learning to align prompts with the internal "logic" of specific LLMs, MAPO unlocks significant latent performance. While the computational cost of training model-specific optimizers remains a challenge, the substantial gains in accuracy and reliability highlight the importance of model-adaptive strategies in the evolving LLM landscape.
Summary updated