DEV Community

Devanshu Biswas
Devanshu Biswas

Posted on

Self-Ask Prompting: Let the Model Interview Itself

Ask an LLM a multi-hop question ("who was president when the composer of Rhapsody in Blue was born?") and it often skips a hop and guesses. Self-Ask fixes that by making the model interview itself — out loud.

Watch it ask its own follow-ups: https://dev48v.infy.uk/prompt/day19-self-ask.html

The format

Self-Ask gives the model a strict scaffold:

Are follow-up questions needed here? Yes.
Follow-up: Who composed Rhapsody in Blue?
Intermediate answer: George Gershwin.
Follow-up: When was George Gershwin born?
Intermediate answer: 1898.
Follow-up: Who was U.S. president in 1898?
Intermediate answer: William McKinley.
So the final answer is: William McKinley.
Enter fullscreen mode Exit fullscreen mode

The demo races a direct answer (skips a hop, wrong) against the self-ask chain (surfaces each intermediate fact, right).

Why it works

It forces the model to decompose a multi-hop question into single-hop questions it can actually answer, then compose them. Each hop is easy; the leap was the hard part.

The superpower: + search

Because each follow-up is a clean, atomic question, you can answer it with a search tool instead of the model's memory — that's the famous "Self-Ask + Search" combo for up-to-date, grounded multi-hop answers.

🔨 Full pattern (few-shot self-ask prompt → loop follow-ups → compose final) on the page: https://dev48v.infy.uk/prompt/day19-self-ask.html

Part of PromptFromZero. 🌐 https://dev48v.infy.uk

Top comments (0)