Adaptive Universal Prompt Optimizer: A Multi- Stage Prompt Engineering Framework Using the Model Context Protocol
Year: 2026
Type: preprint
Abstract: Large language models provide more accurate responses when given well-structured and clear prompts. However, most users’ prompts are brief and ambiguous. Writing effective prompts can be time-consuming and requires skill. This paper describes the Adaptive Universal Prompt Optimizer, a lightweight python program that takes a user input prompt and produces an optimized system prompt and well-structured user prompt. It identifies the task type using an ordered keyword classifier before assigning the model an appropriate expert role. The prompt is then created using techniques from the literature. This includes APET for strategic improvements, PICCO for structure, MetaSPO for the system prompt and OPRO for iterative improvements. A rule-based scoring system (APEX) tests each prompt on four aspects: Assessment, Performance, Execution and Excellence. The system asks up to three brief questions to determine the desired level of detail, content and audience. The system operates either as a command line application or as a Model Context Protocol server. The system was tested with 60 prompts across 6 different task types. The ordered keyword classifier correctly identified the task type for 93.3% of prompts. The average APEX score improved from 36.4 to 70.9. When the user added details regarding the desired level of detail and audience, the score improved further to 74.5. Optimization occurs in under 0.1ms. No prompts scored above the pass mark (85) and after one iteration of improvements the improvements were no longer beneficial. Overall, this shows the system is quick and has potential but further tuning is required to improve the scoring system and the rules applied to improve.
Source: Research Square
Institution: Raisoni Group of Institutions
Language: English
Topic: Topic Modeling
Subfield: Artificial Intelligence
Field: Computer Science
Domain: Physical Sciences
Open Access status: green
OpenAlex ID: W7234895706
