Querywise Prompt Routing for Large Language Models
TL;DR Highlight
Choosing a prompt per query improved zero-shot arithmetic reasoning accuracy.
Who Should Read
Backend developers using LLM APIs who see inconsistent accuracy on math-style questions with a single fixed prompt.
Core Mechanics
- Pick the prompt per query
- Instead of one prompt for every query, choose the best instruction for each one.
- The paper frames this as a per-query decision problem.
- An offline reward model does the scoring
- A proxy reward model is trained in advance to score query-prompt pairs.
- At inference it needs no extra model calls and no gold answers.
- Preference model trained on past logs
- Prior prompt-response logs serve as demonstrations.
- A prompt preference model is trained on them.
- Best-of-N selection per query
- For each query, the highest-scoring candidate instruction is chosen.
- The target is arithmetic reasoning under strict zero-shot conditions.
- Plain natural-language prompts, easy to deploy
- The prompt space stays in natural language, so it is model-agnostic.
- It deploys directly on chat LLMs with no gradient updates.
- Consistently beats baselines
- It beats query-agnostic distribution-level prompting and confidence-based selectors.
- Gains held across multiple LLM scales.
Evidence
- Consistent gains on standard reasoning benchmarks
- Reported as better than distribution-level (query-agnostic) prompting.
- Also reported as better than confidence-based selectors.
- Gains hold across LLM scales
- Improvements persisted when model size changed.
- Ablations confirm generalization
- The learned reward worked on unseen prompts and queries.
- No concrete numbers in the provided text
- The abstract gives no accuracy gains or benchmark names.
How to Apply
- Compare an oracle over 5 candidate prompts today
- Run 5 instructions on 50 arithmetic questions and tabulate per-query accuracy.
- Check whether the best prompt differs by query.
- Build prompt preference data from past logs
- Attach correctness labels to stored prompt-response logs.
- Form pairs of prompts that succeeded and failed on the same query.
- Put a lightweight router before the model call
- Train a model that scores a query with each candidate prompt.
- Call the LLM once with the top-scoring prompt.
- A/B test against your single prompt
- Compare accuracy of the fixed prompt and routing on the same question set.
- Measure separately per model size.
Try It
# Simplified version of the paper's method: paste into Claude or ChatGPT (an LLM picks the prompt instead of a learned reward model)
Before solving the question below, pick the single most suitable instruction from the candidates.
Question: {{question}}
Candidate instructions:
1. Think step by step.
2. Write the equation first, then compute.
3. Break the problem into smaller sub-problems.
4. Give an answer, then verify it.
5. Be concise and show only the key calculations.
Step 1: Write the chosen instruction number and a one-line reason.
Step 2: Solve the question following the chosen instruction.
Step 3: Write only the final answer on the last line.Terminology
Related Papers
Why Do LLMs Help with Scientific Misconduct Requests and What to Do About It?: Increasing the Trustworthiness of AI for Science
Adding an intention-analysis system prompt raised refusal of misconduct requests from 58% to 87%.
How Specification Explicitness Shapes Failure in LLM-Generated Code
Spelling out invariants, edge cases and constraints cut hidden-test failures in LLM code by 47.2%.
Same Task, Different Statement: When and How Reformulation Helps LLM Problem Solving
Rewriting problem statements to fit their type raises LLM accuracy, but blind rewriting hurts.
Show HN: STE80 Humanizer – de-AI text by writing 80% of the way to ASD-STE100
A skill strips 26 AI tells and rewrites text in short ASD-STE100-style sentences
Character-Name Concentration in LLM Fiction: Measuring Displacement and Mitigating Repetition
Drafting name candidates and filtering by frequency cut LLM character-name repetition by 95%
LLM Voice
Martin Fowler: LLM-drafted prose keeps an uncanny tone even after human editing.
The Instruction Tax on Factual Recall: Base Models Can Beat Their Instruction-Tuned Counterparts
Few-shot completion with repeated sampling on a base model beat chat: F1 0.684 vs 0.568
AI is a tool and using it well takes skill
A rebuttal to Hickey: LLMs are tools, and skill in directing and checking them decides the outcome
Original Abstract (Expand)
This paper treats prompt choice as a per-query decision problem for large language models, learning an of-fline proxy reward that can score query-prompt pairs without additional model calls or access to gold answers at inference time. Using prior prompt-response logs as demonstrations, the method trains a preference model over prompts and then selects a best-of-N instruction per query to boost arithmetic reasoning accuracy under strict zero-shot conditions. The pipeline reduces interaction cost by shifting evaluation and optimization offline, while preserving the natural-language prompt space so the approach remains model-agnostic and immediately deployable across chat-oriented LLMs. Experiments on standard reasoning benchmarks show consistent gains over distribution-level, query-agnostic prompting and over confidence-based selectors, with improvements holding across multiple LLM scales. Ablations confirm that the learned reward generalizes to unseen prompts and queries, enabling robust prompt routing at inference without additional gradient updates or tool-specific supervision.