Prompt Research

Generate Questions That Verify an Answer

Has the model write follow-up questions that test the key assumptions and facts of a response, as a step in the Chain of Verification method.

  • 🤖 Any chat LLM
  • 🗂️ Research

Last verified: write-up checked

Prompt by Jason Liu and contributors (567-labs/instructor) · Original source (opens in a new tab)

Generate Questions That Verify an Answer — prompt preview

The prompt

prompt
You are an expert AI system that excels at
generating follow up questions to validate a response.
These questions should validate key assumptions, facts
and other important portions of the generated response

What it is

Has the model write follow-up questions that test the key assumptions and facts of a response, as a step in the Chain of Verification method. The docs cite the Chain of Verification paper. Their code also shows the other prompts in the method. The prompt text comes from the Instructor documentation (MIT licence, Copyright (c) 2023 Jason Liu). Python string quotes and code indentation were removed. Placeholders keep the source syntax. Original author: Jason Liu and contributors (567-labs/instructor).

Who it's for

  • Editors
  • Researchers
  • Developers checking LLM output

يجعل النموذج يكتب أسئلة متابعة تختبر الافتراضات والحقائق الأساسية في الإجابة، كخطوة في أسلوب سلسلة التحقق.

Examples

Example from the docs

python
python
if __name__ == "__main__":
    query = "What was the primary cause of the Mexican-American war and how long did it last?"
    initial_response = asyncio.run(generate_initial_response(query))
    print(initial_response.model_dump_json())
    """
    {"correct_answer":"The primary cause of the Mexican-American War was
    the annexation of Texas by the United States and the dispute over
    whether Texas ended at the Nueces River (as the Mexicans claimed) or
    the Rio Grande (as the U.S. claimed). The war lasted from April 25,
    1846, to February 2, 1848, totaling nearly two years."}
    """

    verification_questions = asyncio.run(
        generate_verification_questions(initial_response.correct_answer)
    )
    print(verification_questions.model_dump_json())
    """
    {"question":["Is it accurate that the primary cause of the
    Mexican-American War was the annexation of Texas by the United
    States?","Was there a dispute over whether Texas ended at the Nueces
    River or the Rio Grande?","Did the Mexican-American War last from
    April 25, 1846, to February 2, 1848?","Is it correct to state that
    the disagreement over the Texas border was between the Nueces River
    and the Rio Grande?","Was the Mexican claim that Texas ended at the
    Nueces River while the U.S. claimed it was at the Rio Grande?"]}
    """

    responses = asyncio.run(
        generate_verification_response(verification_questions.question)
    )

    final_answer = asyncio.run(
        generate_final_response(responses, initial_response, query)
    )
    print(final_answer.model_dump_json())
    """
    {"correct_answer":"The primary cause of the Mexican-American War was
    the annexation of Texas by the United States and the dispute over
    whether Texas ended at the Nueces River (as the Mexicans claimed) or
    the Rio Grande (as the U.S. claimed). The war lasted from April 25,
    1846, to February 2, 1848, totaling nearly two years."}
    """

What it does: The usage code and printed output from the Instructor docs. Output as printed in the docs, not re-run by us.

Tips

  • The docs list four steps: generate a response, generate follow-up questions, answer those questions independently, then verify the response in a final call.
  • The docs pass a Pydantic response model with this prompt, so the printed output follows that schema.