Course contentsShow
← Machine Learning and Deep Learning
Lesson 2017 of 3,53843. Retrieval-Augmented Generation: Advanced TechniquesFree lesson

Step-Back Prompting for Broader Context

Generating higher-level questions that establish broader context before retrieving specific details.

Step-Back Prompting for Broader Context

What you'll learn: How to generate higher-level, abstracted questions that help retrieve more generalizable context before diving into specific details.

The Core Problem

When users ask very specific questions in RAG systems, retrieving only documents matching those exact details can be limiting. Sometimes the best answer requires understanding broader principles or context first.

Step-back prompting solves this by having the LLM generate a more abstract, "stepped-back" version of the original query before retrieval.

How It Works

Instead of immediately retrieving for "What temperature should I bake a chocolate soufflé at?", you first prompt the LLM to create a step-back question like:

  • Original: "What temperature should I bake a chocolate soufflé at?"
  • Step-back: "What are the general principles of baking delicate egg-based desserts?"

You then retrieve documents for both questions. The step-back query pulls in foundational knowledge (heat sensitivity, structure formation), while the original gets specific recipes. Together, they provide richer context for generation.

The Analogy

Think of a student asking a professor: "What's the derivative of x³ at x=2?" A good professor might first explain "Let me remind you how derivatives work generally..." before solving the specific problem. The foundational refresher makes the specific answer more understandable.

Implementation Pattern

  1. Take the user's original query
  2. Prompt the LLM: "Generate a broader, more general question that captures the underlying principles of: [original query]"
  3. Retrieve documents for both the step-back question and the original
  4. Combine retrieved contexts and generate the final answer

This builds on Query Reformulation techniques you've learned, but specifically targets abstraction rather than expansion or decomposition.

Key Takeaway: Step-back prompting generates higher-level questions that retrieve foundational context, helping RAG systems answer specific queries with better grounding in general principles.