Prompt Engineering Tutorial 0/120 lessons ~6 min read Lesson 40

    Verification Prompts

    A verification prompt double-checks an output against the source data or a rule set.

    Course progress0%
    Focus
    6 guided sections
    Practice signal
    Examples included
    Career prep
    Foundation builder

    Introduction

    A verification prompt double-checks an output against the source data or a rule set. It's the cheap way to catch hallucinations before they reach users.

    Beginner analogy: Like a second pair of eyes on a tax return. One pass writes, the other checks.

    Understanding the topic

    Core concepts to understand:

    • After main answer, run: 'Does each claim in the answer appear in the source?'
    • Output: pass / fail + list of unsupported claims.
    • Use a cheaper model for verification when possible.
    • Failed verification triggers retry or fallback.

    Syntax reference

    Visual workflow / architecture:

    bash
    Generate answer
    Verify each claim against source
    PASS → return answer
    FAIL → retry / mark uncertain

    Real-world use

    Perplexity uses verification-style prompts to ensure cited claims appear in cited sources.

    Best practices

    • Verify claim-by-claim, not paragraph-by-paragraph.
    • Use a smaller, cheaper model for verification.
    • Log verification failures for prompt improvement.

    Hands-on exercise

    Interview preparation — practice these questions:

    • Q1. Why verify after generating?
    • Q2. How catch hallucinations programmatically?
    • Q3. Cost of verification?
    • Q4. What does the fallback look like?
    Ready to mark this lesson complete?Track your journey across the entire course.