BasicsPatternsAdvancedExamplesPlaygroundResourcesIndexFAQ
Patterns Hero

Patterns

Your guide to mastering prompt patterns

Prompt Pattern Foundations

Prompt Pattern Basics

+

Purpose

Prompt patterns are reusable strategies for crafting effective prompts, ensuring consistent and high-quality AI responses.

Use Case

Use prompt patterns when you need predictable outputs, such as generating summaries, answering questions, or creating content in a specific style.

Example

Start with a simple 'Few-Shot' pattern: 'Here are two examples of summaries: [Summary 1], [Summary 2]. Summarize this text: [Text].'

Pro Tip

Begin with basic patterns and gradually add complexity as you understand how the AI responds to different structures.

Dive Deeper

Core Prompt Patterns

Core prompt patterns like 'Few-Shot', 'Chain-of-Thought', and 'Role-Play' form the foundation of effective prompt engineering. 'Few-Shot' uses examples to set expectations, 'Chain-of-Thought' encourages step-by-step reasoning, and 'Role-Play' sets a persona for context.

Few-Shot Pattern

+

Purpose

The 'Few-Shot' pattern provides examples to guide the AI, ensuring it follows a specific format or style.

Use Case

Ideal for tasks requiring a consistent output format, such as summarizing articles, generating lists, or writing in a specific tone.

Example

Give two summaries as examples: 'Summary 1: [Example]', 'Summary 2: [Example]'. Then ask: 'Summarize this text in the same style: [Text].'

Pro Tip

Use 2-3 examples for best results; too many can overwhelm the AI, while too few may not provide enough guidance.

Chain-of-Thought Pattern

+

Purpose

The 'Chain-of-Thought' pattern prompts the AI to explain its reasoning step-by-step, improving transparency and accuracy.

Use Case

Great for complex tasks like problem-solving, logical reasoning, or tasks requiring detailed explanations, such as math problems or decision-making.

Example

Prompt the AI: 'Solve this problem and explain each step: 2x + 3 = 7.' The AI will break down the solution: 'First, subtract 3 from both sides...'

Pro Tip

Encourage detailed steps by adding 'show all calculations' or 'explain your reasoning' to the prompt for clearer outputs.

Role-Play Pattern

+

Purpose

The 'Role-Play' pattern sets a persona for the AI, tailoring its responses to a specific audience or perspective.

Use Case

Useful for creating audience-specific content, such as explaining concepts to children, professionals, or beginners.

Example

Set the persona: 'You are a teacher explaining photosynthesis to a 5th grader.' The AI will simplify its language: 'Plants use sunlight to make food...'

Pro Tip

Be specific about the persona’s expertise and audience to get the most relevant and appropriately toned responses.

Advanced Prompt Patterns

Critique then Improve

+

Purpose

The 'Critique then Improve' pattern asks the AI to evaluate and enhance its own output, leading to better quality responses.

Use Case

Perfect for iterative refinement, such as improving a draft, refining creative writing, or enhancing a generated idea.

Example

Prompt the AI: 'Write a short story, then critique it and provide an improved version.' The AI will analyze its story and suggest improvements.

Pro Tip

Ask the AI to focus on specific aspects (e.g., 'critique the plot') to get more targeted improvements.

Zero-Shot Pattern

+

Purpose

The 'Zero-Shot' pattern asks the AI to perform a task without examples, relying on its pre-trained knowledge.

Use Case

Useful for straightforward tasks where examples aren’t needed, such as translations, simple definitions, or basic questions.

Example

Prompt the AI: 'Translate this text to French: [Text].' The AI will perform the task without needing prior examples.

Pro Tip

Ensure the task is simple and well-defined, as 'Zero-Shot' may not work well for complex or ambiguous requests.

Practical Applications

Prompt patterns can be applied to various tasks—creative writing, problem-solving, and more. Combine patterns for complex needs: use 'Few-Shot' with 'Chain-of-Thought' to guide the AI through a multi-step task with examples.

Creative Writing

+

Purpose

Use prompt patterns to guide the AI in generating creative content that matches your desired style and tone.

Use Case

Ideal for writing stories, poems, or scripts where consistency in tone, style, or structure is important.

Example

Use 'Few-Shot' for creative writing: 'Here are two story intros: [Intro 1], [Intro 2]. Write a story intro in the same style.' The AI will match the tone and style.

Pro Tip

Combine 'Few-Shot' with 'Role-Play' (e.g., 'You are a novelist') to further refine the AI’s creative output.

Problem-Solving

+

Purpose

Apply prompt patterns to solve complex problems by guiding the AI through logical, step-by-step reasoning.

Use Case

Useful for tasks like solving math problems, logic puzzles, or decision-making scenarios where detailed reasoning is needed.

Example

Use 'Chain-of-Thought': 'Solve this logic puzzle step-by-step: [Puzzle].' The AI will break down its reasoning: 'First, let’s identify the clues...'

Pro Tip

If the AI skips steps, add 'explain each step in detail' to the prompt to ensure a thorough breakdown.

Chatbot

...

Welcome to the Prompted Chatbot! How can I assist you today?