POaaS: Minimal-Edit Prompt Optimization as a Service to Lift Accuracy and Cut Hallucinations on On-Device sLLMs
Organizations: Electronics and Telecommunications Research Institute, Republic of Korea
Abstract
Small language models (sLLMs) are increasingly deployed on-device, where imperfect user prompts--typos, unclear intent, or missing context--can trigger factual errors and hallucinations. Existing automatic prompt optimization (APO) methods were designed for large cloud LLMs and rely on search that often produces long, structured instructions; when executed under an on-device constraint where the same small model must act as optimizer and solver, these pipelines can waste context and even hurt accuracy. We propose POaaS, a minimal-edit prompt optimization layer that routes each query to lightweight specialists (Cleaner, Paraphraser, Fact-Adder) and merges their outputs under strict drift and length constraints, with a conservative skip policy for well-formed prompts. Under a strict fixed-model setting with Llama-3.2-3B-Instruct and Llama-3.1-8B-Instruct, POaaS improves both task accuracy and factuality while representative APO baselines degrade them, and POaaS recovers up to +7.4% under token deletion and mixup. Overall, per-query conservative optimization is a practical alternative to search-heavy APO for on-device sLLMs.
Figures & tables
| Task Accuracy | Factuality | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Model | Method | BBH | GSM8K | CSQA | Avg. | HaluEval | HalluLens | FActScore | Avg. |
| Llama-3.2-3B | No Optimization | 42.2 | 77.2 | 71.6 | 63.7 | 68.2 | 48.8 | 16.6 | 44.5 |
| EvoPrompt | 35.8 (-6.4) | 75.4 (-1.8) | 68.2 (-3.4) | 59.8 | 67.6 (-0.6) | 46.8 (-2.0) | 16.4 (-0.2) | 43.6 | |
| OPRO | 32.4 (-9.8) | 74.2 (-3.0) | 65.8 (-5.8) | 57.5 | 66.8 (-1.4) | 45.6 (-3.2) | 15.8 (-0.8) | 42.7 | |
| PromptWizard | 10.4 (-31.8) | 72.4 (-4.8) | 63.6 (-8.0) | 48.8 | 65.2 (-3.0) | 43.8 (-5.0) | 14.8 (-1.8) | 41.3 | |
| POaaS (Ours) | 46.0 (+3.8) | 79.0 (+1.8) | 73.0 (+1.4) | 66.0 | 70.2 (+2.0) | 52.0 (+3.2) | 22.0 (+5.4) | 48.1 | |
| Token Deletion | Token Mixup | |||||||
|---|---|---|---|---|---|---|---|---|
| Model | Method | Clean | 5% | 10% | 15% | 5% | 10% | 15% |
| Llama-3.2-3B | No Optimization | 63.7 | 52.4 | 45.8 | 40.2 | 59.2 | 54.6 | 48.8 |
| EvoPrompt | 59.8 (-3.9) | 46.8 (-5.6) | 39.2 (-6.6) | 32.4 (-7.8) | 54.6 (-4.6) | 48.2 (-6.4) | 41.6 (-7.2) | |
| OPRO | 57.5 (-6.2) | 44.2 (-8.2) | 36.4 (-9.4) | 29.2 (-11.0) | 52.0 (-7.2) | 45.2 (-9.4) | 38.4 (-10.4) | |
| PromptWizard | 48.8 (-14.9) | 35.6 (-16.8) | 27.2 (-18.6) | 20.4 (-19.8) | 42.8 (-16.4) | 34.6 (-20.0) | 28.2 (-20.6) | |
| POaaS | 66.0 (+2.3) | 58.4 (+6.0) | 52.8 (+7.0) | 47.6 (+7.4) | 63.2 (+4.0) | 59.4 (+4.8) | 54.6 (+5.8) | |
| Method | Opt. Time (s) | Added Tokens | LLM Calls |
|---|---|---|---|
| No Optimization | 0 | 0 | 0 |
| OPRO | 455 | 2,840 | 130 |
| PromptWizard | 336 | 3,520 | 96 |
| EvoPrompt | 602 | 4,180 | 172 |
| POaaS (Ours) | 0.95 | 48 | 1.4 |
| Model | Configuration | Clean | Del-10% | Mix-10% |
|---|---|---|---|---|
| Llama-3.2-3B | No Optimization | 63.7 | 45.8 | 54.6 |
| Full POaaS | 66.0 (+2.3) | 52.8 (+7.0) | 59.4 (+4.8) | |
| w/o Cleaner | 65.6 (+1.9) | 46.4 (+0.6) | 55.2 (+0.6) | |
| w/o Paraphraser | 64.8 (+1.1) | 51.4 (+5.6) | 57.8 (+3.2) | |
| w/o Fact-Adder | 64.2 (+0.5) | 52.2 (+6.4) | 58.8 (+4.2) | |
| Cleaner only | 63.9 (+0.2) | 51.6 (+5.8) | 58.4 (+3.8) |
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
| Component | Default |
|---|---|
| Routing thresholds | |
| Skip gate | and |
| Length cap | (character ratio) |
| Specialist gen cap | 512 output tokens / call |
| Fact-Adder cap | bullets, tokens total |
Automatic Prompt Optimization
Automatic prompt optimization uses model or task feedback to revise instructions for stronger, more reliable language-model performance.
See all 103 papers