← Latest papers
💬 NLP

No One Size Fits All: QueryBandits for Hallucination Mitigation

The paper introduces QueryBandits, a model-agnostic contextual bandit framework that adaptively selects optimal query-rewrite strategies to mitigate hallucinations in closed-source Large Language Models, demonstrating that dynamic online policies significantly outperform static rewriting approaches and a no-rewrite baseline without requiring model retraining.

Original authors: Nicole Cho, William Watson, Alec Koppel, Sumitra Ganesh, Manuela Veloso

Published 2026-02-25
📖 5 min read🧠 Deep dive

Original authors: Nicole Cho, William Watson, Alec Koppel, Sumitra Ganesh, Manuela Veloso

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you have a brilliant but occasionally daydreaming assistant (the Large Language Model, or LLM). This assistant is incredibly smart and can answer almost anything, but sometimes, when asked a tricky question, it starts "hallucinating"—making up facts or giving confident but wrong answers.

For a long time, researchers tried to fix this by trying to "retrain" the assistant's brain or peek inside its internal code. But most of the assistants companies actually use (like the ones behind paywalls) are "black boxes." You can't see inside them, and you can't retrain them. You can only talk to them.

This paper introduces QueryBandits, a clever new way to talk to these black-box assistants to stop them from daydreaming, without ever needing to touch their internal code.

Here is the breakdown using simple analogies:

1. The Problem: The "One-Size-Fits-All" Trap

Imagine you are trying to get a specific answer from a very literal but confused librarian.

  • If you ask, "How many integers are between 6 and 14.8?" the librarian might get confused by the "6" and say "8" (forgetting to count 6 itself).
  • If you ask, "What is the capital of France?" and the librarian is tired, they might guess "London."

Previous solutions tried to use one single trick for every question. For example, they might say, "Always rephrase the question to be simpler!" or "Always add more details!"

  • The Flaw: Sometimes simplifying a question helps. Sometimes, adding details helps. Sometimes, just asking the question exactly as it is works best. Using the same trick for every question is like wearing the same pair of shoes for running a marathon, climbing a mountain, and swimming in a pool. It just doesn't work well for everything.

2. The Solution: The "Smart Shopper" (QueryBandits)

The authors created a system called QueryBandits. Think of it as a super-smart personal shopper standing between you and the librarian.

Here is how the shopper works:

  1. The Fingerprint: Before you ask the librarian a question, the shopper looks at your question and takes a "linguistic fingerprint." They check 17 different things: Is the question too long? Does it use fancy words? Is it ambiguous? Does it require specific knowledge?
  2. The Menu of Tricks: The shopper has a menu of 5 different ways to rewrite your question:
    • Paraphrase: Say it differently.
    • Simplify: Make it easier to understand.
    • Disambiguate: Clarify vague words.
    • Expand: Add missing details.
    • Clarify Terms: Define jargon.
  3. The Gamble (The "Bandit" Part): The shopper doesn't know for sure which trick will work best for this specific question. So, they use a strategy called Contextual Bandits.
    • Imagine a slot machine with 5 arms (the 5 tricks).
    • The shopper looks at your question's "fingerprint" and says, "Based on the fact that this question is about math and has a confusing lower bound, I'm going to bet on the Expand arm."
    • They rewrite the question using that trick and ask the librarian.
  4. Learning on the Fly:
    • If the librarian gives the right answer, the shopper gets a "reward" and remembers: "Hey, expanding questions like this works!"
    • If the librarian gets it wrong, the shopper gets a "penalty" and learns: "Okay, don't expand this type of question next time."
    • Over time, the shopper gets incredibly good at matching the right rewriting trick to the right type of question.

3. The Results: Why It Matters

The researchers tested this on GPT-4o (a top-tier, closed-source model) across 16 different types of questions (from math to trivia to legal facts).

  • The "No-Rewrite" Baseline: Just asking the question as is.
  • The "Static" Approach: Always using the same rewrite (e.g., always simplifying).
  • The QueryBandit Approach: The smart shopper picking the best rewrite every time.

The Outcome:

  • The QueryBandit was the clear winner. It beat the "No-Rewrite" approach 87.5% of the time.
  • It beat the "Always Simplify" approach by a huge margin (42% better).
  • Crucially, they found that sometimes, rewriting makes things worse. If you force a "Simplify" rewrite on a complex legal question, the assistant might get more confused. The Bandit learned to know when not to rewrite, or which specific rewrite to use.

4. The Big Takeaway: "No One Size Fits All"

The title of the paper is the most important lesson: "No One Size Fits All."

There is no single magic sentence you can add to a prompt to fix hallucinations. The best way to ask a question depends entirely on the shape of the question itself.

  • If the question is vague, Expand it.
  • If the question is too complex, Simplify it.
  • If the question is already clear, Leave it alone.

Why This is a Big Deal

Most current AI safety tools require you to have access to the AI's "brain" (its code and weights) to fix it. But the most powerful AIs used by banks, hospitals, and governments are "black boxes" (you can't see inside).

QueryBandits works purely on the input. It's like a "plug-and-play" filter. You don't need to hire the AI company to retrain their model. You just put this "Smart Shopper" in front of the AI, and it learns on the fly how to ask the questions in a way that gets the right answers.

In short: Instead of trying to fix the AI's brain, we fixed the way we talk to it, using a smart system that learns which conversation style works best for every single question.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →