Skip to main content
Prompt engineering bridges users and models. Good prompts are critical for reliable reasoning and generation. The examples below move from simple to complex and show how to tune prompts for summarization, reasoning, and transformation tasks.

Prompt design principles

Principle 1: Write clear, specific instructions

1. Be explicit

  • Vague instruction: ❌
    Too broad; the model may produce an unfocused overview.
  • Specific instruction: ✅
    Calls out the art movement and the expected outputs.

2. Add necessary detail

  • Sparse instruction: ❌
    Overly broad.
  • Detailed instruction: ✅
    Defines the concept and the required examples.

3. Use delimiters

  • No delimiter: ❌
    Unclear which part is content vs. instruction.
  • With delimiters: ✅
    Separates the content from the instruction.

4. Account for edge cases

  • No conditions: ❌
    Error type is unspecified.
  • With conditions: ✅
    Guides the model through the check-and-report flow.

5. Use few-shot examples

  • No example: ❌
    Tone and style are unspecified.
  • Provide an example: ✅
    Sets expectations for tone, style, and output.

Principle 2: Give the model time to think

LLMs need space to reason. If you rush them, answers may be shallow or wrong. Encourage step-by-step thinking—e.g., list different perspectives before concluding. This improves logical reasoning and accuracy.

1. Specify task steps

Below is a prompt that guides the model through a story analysis:
Model output:

2. Encourage self-reflection (Andrew Ng’s reflective workflow)

Invite the model to reason before judging. For example, when checking whether a math answer is correct, ask the model to solve the problem itself, then compare. Here is a three-step reflective prompt:
Model reasoning First pass (incorrect on purpose):
Second pass verification:
Third pass step-by-step solution:

Common prompt references

Text analysis

1. Sentiment analysis

2. Document analysis

3. Translation

Notes

LLMs can hallucinate—generate plausible but false information. Reduce this risk with better prompt design (e.g., cite sources, use reflective workflows) and with Tool Calls to fetch or compute authoritative data.