mlsanityData to 7 Oct 2026

Influence of Prompt Engineering on Small Language Models for Guarded Query Routing

arXiv 2607.24801 ↗First posted 6 Jul 2026cs.IR cs.CLcited by 0

Not on the map. Why?

Abstract (arXiv)

We study the problem of guarded query routing, where we assume that a user query first meets a router that either determines the ideal endpoint for in-distribution queries or rejects out-of-distribution queries that are potentially unsafe or out of the system's scope. We investigate whether compact open-weight Small Language Models (SLMs) can jointly handle both tasks under latency constraints. We evaluate 22 models on GQR-Bench and score them with the harmonic mean of in-distribution and out-of-distribution accuracy. We find that mid-scale SLMs come close to frontier model routing quality at much lower latency. Still, many compact models fail because they do not reliably follow the required output format. However, our results show that prompt optimization techniques enable SLMs to handle such cases gracefully, without changing the models' weights. Moreover, few-shot prompt optimization raises Mistral 7B from 81.79 to 90.87 GQR-Score and lifts Qwen3.5 9B to 95.74, the best optimized score in our study and within 0.3 points of the strongest unoptimized larger model: Gemma 3 27B at 96.01. The bare DSPy signature, without in-context exemplars, is the most effective strategy for Granite 4 Tiny, raising its score from 54.29 to 83.05. These results show that prompt optimization is a useful first step for guarded query routing, while weaker models may still need weight-level adaptation or schema-aware training

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 29 of its 42 references that are in the map. First posted on arXiv 6 Jul 2026.

Builds on

29 of 42 references.

References · 29

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2024The Llama 3 Herd of Modelscited by 14,192
  3. 2021The Power of Scale for Parameter-Efficient Prompt Tuningcited by 3,769
  4. 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,317
  5. 2016A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networkscited by 2,362
  6. 2016Enriching Word Vectors with Subword Informationcited by 1,578
  7. 2017Enhancing The Reliability of Out-of-distribution Image Detection in Neural Networkscited by 1,325
  8. 2020Energy-based Out-of-distribution Detectioncited by 1,296
  9. 2025gpt-oss-120b & gpt-oss-20b Model Cardcited by 1,258
  10. 2023Instruction-Following Evaluation for Large Language Modelscited by 1,143
  11. 2023Llama Guard: LLM-based Input-Output Safeguard for Human-AI Conversationscited by 1,124
  12. 2020Exploiting Cloze Questions for Few Shot Text Classification and Natural Language Inferencecited by 934
17 more
  1. 2016Bag of Tricks for Efficient Text Classificationcited by 869
  2. 2023FrugalGPT: How to Use Large Language Models While Reducing Cost and Improving Performancecited by 791
  3. 2024RouteLLM: Learning to Route LLMs with Preference Datacited by 633
  4. 2025GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learningcited by 449
  5. 2019Nuanced Metrics for Measuring Unintended Bias with Real Data for Text Classificationcited by 396
  6. 2023NeMo Guardrails: A Toolkit for Controllable and Safe LLM Applications with Programmable Railscited by 347
  7. 2024Optimizing Instructions and Demonstrations for Multi-Stage Language Model Programscited by 270
  8. 2019Predicting the Type and Target of Offensive Posts in Social Mediacited by 268
  9. 2023Efficient Guided Generation for Large Language Modelscited by 192
  10. 2023Large Language Model Routing with Benchmark Datasetscited by 166
  11. 2024A Comprehensive Survey of Small Language Models in the Era of Large Language Models: Techniques, Enhancements, Applications, Collaboration with LLMs, and Trustworthinesscited by 125
  12. 2024A Unified Approach to Routing and Cascading for LLMscited by 71
  13. 2019Offensive Language and Hate Speech Detection for Danishcited by 48
  14. 2024Large Language Models for Anomaly and Out-of-Distribution Detection: A Surveycited by 24
  15. 2021Bag-of-Words vs. Graph vs. Sequence in Text Classification: Questioning the Necessity of Text-Graphs and the Surprising Strength of a Wide MLPcited by 17
  16. 2025xRouter: Training Cost-Aware LLMs Orchestration System via Reinforcement Learningcited by 16
  17. 2025Guarded Query Routing for Large Language Modelscited by 2

Built on by

Not cited yet.