Prompt Patterns

Prompt Patterns

Bilgin Ibryam
This is a sample of the book's content.Buy on Leanpub

Table of Contents

Preface›

    Introduction›

    • Prompts
      • Terminology
      • Prompts and prompting
      • Prompt and context engineering
      • Prompt technique
    • Patterns
      • What makes a prompt pattern
      • Pattern structure
      • Pattern language
      • Patterns vs. techniques
    • Design Principles
      • Software Design Principles
      • Core Prompting Principles
      • Objective Framing Principle (OFP)
      • Information Supply Principle (ISP)
      • Method Prescription Principle (MPP)
      • Quality Validation Principle (QVP)
      • Output Representation Principle (ORP)
      • Iterative Alignment Principle (IAP)
      • Why Principles Are Not Enough
    • Pattern Categories
      • Prompt Pattern Categories
      • Objective Framing
      • Information Supply
      • Method Prescription
      • Quality Validation
      • Output Representation
      • Iterative Alignment
      • Finding the Right Pattern

    Objective Framing›

    • Task Directive
      • Definition
      • Problem
      • Solution
      • Mechanism
      • Techniques
      • Action Command
      • Problem Statement
      • Demonstration
      • Discussion
      • Resources
    • Perspective Framing
      • Definition
      • Problem
      • Solution
      • Mechanism
      • Techniques
      • Speaker Role
      • Audience Role
      • Situational Cue
      • Worldview Lens
      • Sycophancy Guard
      • Discussion
      • Resources
    • Constraint Scoping
      • Definition
      • Problem
      • Solution
      • Mechanism
      • Techniques
      • Inclusion Scoping
      • Exclusion Scoping
      • Discussion
      • Resources
    • Summary

    Information Supply›

    • Context Injection
      • Definition
      • Problem
      • Solution
      • Mechanism
      • Techniques
      • Context Stuffing
      • Context Retrieval
      • Discussion
      • Resources
    • Context Selection
      • Definition
      • Problem
      • Solution
      • Mechanism
      • Techniques
      • Context Scoping
      • Inclusion and Exclusion
      • Blanket Noise Warning
      • Context Reset
      • Context Reconstruction
      • Step 1: Reconstruct
      • Step 2: Answer
      • Bias and Opinion Stripping
      • Discussion
      • Resources
    • Example-Driven Specification
      • Definition
      • Problem
      • Solution
      • Mechanism
      • Techniques
      • Demonstration Examples
      • Contrastive Examples
      • Convention Mirroring
      • Discussion
      • Resources
    • Structural Segmentation
      • Definition
      • Problem
      • Solution
      • Mechanism
      • Techniques
      • Region Labeling
      • Data Isolation
      • Discussion
      • Resources
    • Summary

    Method Prescription›

    • Alternative Enumeration
      • Definition
      • Problem
      • Solution
      • Mechanism
      • Techniques
      • Breadth Enumeration
      • Dimensional Enumeration
      • Discussion
      • Resources
    • Hierarchical Decomposition
      • Definition
      • Problem
      • Solution
      • Mechanism
      • Techniques
      • Component Decomposition
      • Recursive Decomposition
      • Discussion
      • Resources
    • Dependency Decomposition
      • Definition
      • Problem
      • Solution
      • Mechanism
      • Techniques
      • Sequential Dependency
      • Self-Directed Dependency
      • Discussion
      • Resources
    • Stepwise Decomposition
      • Definition
      • Problem
      • Solution
      • Mechanism
      • Techniques
      • Step-by-Step Instruction
      • Demonstrated Reasoning
      • Incremental Stepping
      • Discussion
      • Resources
    • Multi-Path Reasoning
      • Definition
      • Problem
      • Solution
      • Mechanism
      • Techniques
      • Majority Voting
      • Model-Based Selection
      • Discussion
      • Resources
    • Semantic Lifting
      • Definition
      • Problem
      • Solution
      • Mechanism
      • Techniques
      • Step-Back Questioning
      • Principle Realization
      • Discussion
      • Resources
    • Summary

    Quality Validation›

    • Knowledge Externalization
      • Definition
      • Problem
      • Solution
      • Mechanism
      • Techniques
      • Premise Generation
      • Staged Externalization
      • Discussion
      • Resources
    • Deferred Commitment
      • Definition
      • Problem
      • Solution
      • Mechanism
      • Techniques
      • Inline Deferred Commitment
      • Staged Deferred Commitment
      • Discussion
      • Resources
    • Reflective Evaluation
      • Definition
      • Problem
      • Solution
      • Mechanism
      • Techniques
      • Self-Critique
      • Claim Verification
      • Confidence Gating
      • Discussion
      • Resources
    • Claim Enumeration
      • Definition
      • Problem
      • Solution
      • Mechanism
      • Techniques
      • Claim Extraction
      • Assumption Extraction
      • Discussion
      • Resources
    • Summary

    Output Representation›

    • Semantic Compression
      • Definition
      • Problem
      • Solution
      • Mechanism
      • Techniques
      • Semantic Condensation
      • Selective Reduction
      • Progressive Compression
      • Discussion
      • Resources
    • Response Tail
      • Definition
      • Problem
      • Solution
      • Mechanism
      • Techniques
      • Disclosure Tail
      • Continuation Tail
      • Discussion
      • Resources
    • Answer Extractor
      • Definition
      • Problem
      • Solution
      • Mechanism
      • Techniques
      • Open Extraction
      • Constrained Extraction
      • Discussion
      • Resources
    • Output Template
      • Definition
      • Problem
      • Solution
      • Mechanism
      • Techniques
      • Section Template
      • Field Template
      • Slot Filling
      • Discussion
      • Resources
    • Formal Representation
      • Definition
      • Problem
      • Solution
      • Mechanism
      • Techniques
      • Schema Constraining
      • Notation Encoding
      • Discussion
      • Resources
    • Summary

    Iterative Alignment›

    • Interaction Reversal
      • Definition
      • Problem
      • Solution
      • Mechanism
      • Techniques
      • Progressive Discovery
      • Structured Elicitation
      • Discussion
      • Resources
    • Interaction Language
      • Definition
      • Problem
      • Solution
      • Mechanism
      • Techniques
      • Term Definition
      • Operator Definition
      • Notation Definition
      • Discussion
      • Resources
    • Meta Prompting
      • Definition
      • Problem
      • Solution
      • Mechanism
      • Techniques
      • Prompt Refinement
      • Prompt Generation
      • Prompt Selection
      • Prompt Templating
      • Discussion
      • Resources
    • Summary

    Afterword›

    • Patterns List
    • Recommended Resources
      • Books
      • Courses
      • Videos
      • Papers
      • Websites
      • Articles
      • Repositories
      • Services and Tools
      • Communities
    • About the Author
    • Markua Snippets Collection
      • Headings and Paragraphs
    • Chapter One
    • Chapter Two
      • Text Formatting
      • Lists
      • Definition Lists
      • Scene Break
      • Blockquotes
      • Asides
      • Blurbs
      • Images
      • Inline SVG Image
      • Code Spans
      • Code Blocks
      • External Code Resource
      • Console Code
      • Math Inline
      • Math Block
      • Tables
      • Links
      • Custom Span
      • Footnotes
      • Endnotes
      • IDs
    • Chapter One
      • Quizzes
      • Exercises
      • Choose Answers
      • Question Alternates
      • Directives
      • Page Break
      • Attributes
      • Conditional Inclusion
    • Chapter One
    • Buy the Book
    • Advanced Markua Examples: Code and Images
      • Inline Code Variations
      • Basic Code Blocks
      • Indented Code Block
      • Tilde Code Block
      • Console Output
      • Code With Caption
      • External Code File Reference
      • Basic Images
      • Image With Alt Text
      • Image With Caption
      • Image With Caption and Alt
      • Image Size and Class
      • Multiple Images
      • Inline SVG Image
      • SVG Without Caption
      • Figure With Code and Image Together
      • Callout With Code
      • Warning With Code
      • Collapsed Example Using Blurb
      • Math Inside Code
      • Escaping Backticks
      • Mixed Content Example
      • Page Break For Code Section
      • Conditional Code Example
    • Formatting Prompt and Response Examples for a ChatGPT Book
      • Pattern 1: Simple Prompt and Response (Recommended Default)
      • Prompt
      • Response
      • Pattern 2: Prompt and Response Using Asides
      • Pattern 3: Prompt and Response Using Code Blocks (LLM-Style)
      • Prompt
      • Response
      • Pattern 4: Chat Transcript Style
      • Pattern 5: Callout Prompt With Plain Response
      • Response
      • Pattern 6: Warning Prompt With Critical Response
      • Response
      • Pattern 7: Side-by-Side Prompt and Response Using Headings
      • Prompt
      • Response
      • Pattern 8: Multi-Turn Conversation Example
      • Prompt
      • Response
      • Follow-up Prompt
      • Follow-up Response
      • Pattern 9: Prompt With Constraints
      • Prompt
      • Response
      • Pattern 10: Minimalist Book-Style Format
      • Pattern 11: Prompt, Response, and Commentary
      • Prompt
      • Response
      • Commentary
      • Page Break
      • Pattern 12: Conditional Rendering for Samples
      • Prompt
      • Response
      • Prompt
      • Response
      • Final Notes
    • Prompt and Response Formatting Patterns (Alignment-Safe)
      • Example 1: Same Block Type Using Asides Only
      • Example 2: Same Block Type Using Blurbs Only
      • Example 3: Explicit Aside Blocks Using {aside}
      • Example 3A: Explicit Aside Blocks Using {aside}
      • Example 3B: Explicit Aside Blocks Using {aside}
      • Example 4: Headings + Blurbs (Recommended for Books)
      • An Example
      • Prompt
      • Discuss
      • More Information
      • Response
      • Notes
    • ChatGPT Prompt and Response Layout Experiments
      • Example 1: Faux Chat Alignment Using Labels (Recommended)
      • Example 2: Same Aside, Visual Separation
      • Example 3: Same Blurb, Compact Chat Style
      • Example 4: Simulated Chat Bubbles Using Headings
      • User
      • ChatGPT
      • Example 5: Code-Block Chat Transcript (LLM-Native Look)
      • Example 6: Single Blockquote Conversation
      • What You Cannot Do in Markua
      • Recommendation for a ChatGPT Book
      • What you can realistically do in Leanpub
      • What works reliably
      • What does NOT work
      • The best pattern for highlighting prompt structure
      • Full Markdown file with concrete patterns
    • Highlighting Prompt Structure in a Prompting Patterns Book
      • Pattern 1: Structured Prompt Inside a Single Aside (Recommended)
      • Pattern 2: Inline Emphasis Using Labels and Inline Code
      • Pattern 3: Hybrid, Explained Prompt
      • Pattern 4: Full Prompt as Code, With Semantic Breakdown Above
      • Pattern 5: Before and After Prompt Refinement
      • Pattern 6: Multi-Part Prompt With Visual Separation
      • Guidance for This Book
      • Rule You Can Follow Blindly
    Prompt Patterns/Output Representation/Formal Representation

    Formal Representation

    https://leanpub.com/prompt-patterns

    Definition

    https://leanpub.com/prompt-patterns

    Problem

    https://leanpub.com/prompt-patterns

    Solution

    https://leanpub.com/prompt-patterns

    Mechanism

    https://leanpub.com/prompt-patterns

    Techniques

    https://leanpub.com/prompt-patterns

    Schema Constraining

    https://leanpub.com/prompt-patterns

    Notation Encoding

    https://leanpub.com/prompt-patterns

    Discussion

    https://leanpub.com/prompt-patterns

    Resources

    https://leanpub.com/prompt-patterns

    Previous

    Output Template

    Up next

    Summary

    In this chapter

    • Formal Representation
    • Definition
    • Problem
    • Solution
    • Mechanism
    • Techniques
    • Schema Constraining
    • Notation Encoding
    • Discussion
    • Resources