Adaptive Universal Prompt Optimizer: A Multi- Stage Prompt Engineering Framework Using the Model Context Protocol

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.

Authors

Institutions

Publication Details

Journal
Research Square
Published
2026-11-17
DOI
https://doi.org/10.21203/rs.3.rs-11736368/v1
Primary Topic
Topic Modeling
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

Adaptive Universal Prompt Optimizer: A Multi- Stage Prompt Engineering Framework Using the Model Context Protocol

Hansaraj Shalikram Wankhede, Arya Tiwari, Arpit Kale, Dhanshri Kubade et al.
4 links
Research Square
Topic Modeling
preprint

Adaptive Universal Prompt Optimizer: A Multi- Stage Prompt Engineering Framework Using the Model Context Protocol

Hansaraj Shalikram Wankhede, Arya Tiwari, Arpit Kale, Dhanshri Kubade, Dhanistha Wadettiwar
preprint en

Abstract

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.

Research Square
Raisoni Group of Institutions (IN)
Topic Modeling
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon