liveBook · Manning

Step-back prompting

As explained in Essential GraphRAG

Step-back prompting is a prompting technique that reformulates a specific question into a more general question or perspective before retrieval or generation.

Step-back prompting rewrites a detailed user question into a broader, more foundational question before vector retrieval. The broader wording can better match information-rich documents, widen the search, and reduce missed facts caused by query-specific phrasing. section 3.0 section 3.1

Implement the technique as a query-rewriting stage:

  • Give an LLM a system instruction to paraphrase the input into a more generic, easier-to-answer question. section 3.1
  • Use zero-shot prompting for a direct instruction, or add two to five examples with few-shot prompting to make the transformation more consistent. section 3.1
  • Send the original question with the rewriting prompt, then use the generated step-back question for vector retrieval. section 3.1 section 3.0

Career-history retrieval

Rewrite “Which team did Thierry Audel play for from 2007 to 2008?” as “What is the career history of Thierry Audel?” The broader query searches across more comprehensive career information before the system generates the answer. section 3.1

Figure 3.1 Query rewriting by using the step-back technique to increase the vector retrieval accuracy
figure

Shows how a detailed question becomes a broader retrieval query, widening the search before answer generation. section 3.0

How Essential GraphRAG covers it

How deep it goes
Defines the rationale, contrasts zero-shot and few-shot prompting, and provides a prompt and generation function without detailing retrieval evaluation.
Examples
Uses Estella Leopold’s education, Thierry Audel’s career, and prompt examples involving The Police and Jan Sindel.
What it assumes
Assumes vector retrieval and LLM interaction, while teaching the query-rewriting prompt pattern from basic instructions and examples.
What you can do after
Apply it via an LLM prompt and generation function to produce broader questions for subsequent vector retrieval.
How it connects
Connects query rewriting with vector retrieval, zero-shot prompting, few-shot prompting, and hypothetical document retrieval.

Also explained in

Compare how 2 books explain step-back prompting →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Essential GraphRAG. The section links point to the parts of the book it draws on.