# Prompt Patterns > A Pattern Language for Knowledge Engineering with Large Language Models. By Bilgin Ibryam. This website is the companion catalog to the Prompt Patterns book. It captures reusable prompt design moves that are explicit, grounded, and composable — not magic phrases or model-specific tricks. ## Prompting Principles Six core design principles behind effective prompting: 1. **Objective Framing Principle (OFP)**: Specify the objective and remove degrees of freedom so the model does not resolve ambiguity or underspecification by default. 2. **Information Supply Principle (ISP)**: Supply the information that materially shapes the outcome and avoid information that mainly adds noise. 3. **Method Prescription Principle (MPP)**: Prescribe how the model should proceed — steps, checkpoints, comparisons, intermediate artifacts — so the path to the result is shaped deliberately. 4. **Quality Validation Principle (QVP)**: Make uncertainty visible, expose assumptions, and validate output against correctness and constraints before relying on it. 5. **Output Representation Principle (ORP)**: Make the intended use of the response explicit so the output is an artifact with stable structure and predictable fields, not free-form prose. 6. **Interaction Design Principle (IDP)**: Design the interaction itself — who leads the conversation, what vocabulary governs it, and how prompts are created and refined across turns. --- ## Objective Framing Patterns Patterns that set the model's worldview before any work begins. ### Task Directive Defines the exact unit of work the model must perform, independently of how it must be performed. **Problem:** The model is not goal-seeking by default; if the task is not explicitly named, it guesses the response type from weak cues and often solves the wrong problem. **Solution:** Name the exact unit of work directly (summarize, rewrite, evaluate, extract). This high-salience task cue shifts generation toward task-shaped continuations instead of generic topic continuation. ### Perspective Framing Sets the communicative perspective (role, audience, or situation) the model should adopt for interpreting, prioritizing, and expressing information. **Problem:** Without a perspective cue, outputs default to generic framing, weak prioritization, and sometimes unexamined agreement with user bias. **Solution:** Declare role, audience, situation, or evaluative lens so the model applies the right learned conventions for emphasis, structure, and judgment. This reduces framing ambiguity without requiring long instruction lists. ### Judgment Criteria Declares the criteria the model should use to evaluate evidence, weigh trade-offs, and handle uncertainty while generating. **Problem:** Without explicit criteria, the model defaults to generic, socially agreeable, or stereotype-driven evaluation; user preferences leak in as implicit evidence. **Solution:** Declare the evaluation policy — evidence standards, trade-offs, uncertainty handling, preference treatment — before generation. Explicit criteria shift what the model optimizes for while selecting among plausible continuations. ### Constraint Scoping Defines the boundaries within which a language model is allowed to operate. **Problem:** Even with a clear task, the model fills gaps with high-probability but risky completions (speculation, over-commitment, policy promises, verbosity). **Solution:** Add explicit boundaries for what is in-bounds and out-of-bounds while keeping the task unchanged. Clear "only use" and "do not" constraints suppress unsafe continuation paths and keep output within operational limits. ### Example-Driven Specification Specifies desired model behavior through concrete examples rather than abstract rules. **Problem:** Abstract instructions often underspecify format, granularity, and edge-case behavior, causing inconsistent outputs despite correct intent. **Solution:** Provide examples as the primary specification so the model infers the contract from input-output patterns, boundaries, and conventions. In-context pattern induction stabilizes behavior more reliably than long abstract rules. --- ## Information Supply Patterns Patterns that address what information to provide and how to control what the model treats as relevant. ### Context Loading Supplies external information, state, constraints, and references the model lacks but must rely on to complete the task correctly. **Problem:** The model cannot access private state, current facts, or internal policy unless provided at runtime, so it defaults to generic advice or hallucinated specifics. **Solution:** Load required facts, constraints, and authoritative excerpts into context before asking for output (manually or via retrieval). This replaces guesswork with grounded evidence the model can condition on directly. ### Context Curation Specifies which provided information counts as relevant evidence and which should be ignored, without adding, removing, or rewriting context. **Problem:** Once text is present, irrelevant or biased details can still influence generation and pull reasoning toward plausible distractors. **Solution:** Explicitly define what counts as evidence and what must be ignored, or reconstruct a reduced context before answering. This reweights or removes distractors so reasoning tracks task-relevant signals. ### Structural Segmentation Separates the prompt into distinct regions so instructions, provided information, and user input are interpreted by their designated purpose. **Problem:** Mixed instructions, data, and examples in one stream make role boundaries ambiguous, causing instruction/input bleed and unstable behavior. **Solution:** Split prompts into explicit labeled regions (instructions, input, constraints, examples) and isolate untrusted text as data. Role-boundary clarity removes interpretive guesswork and improves containment against prompt-like content in inputs. --- ## Method Prescription Patterns Patterns that prescribe how the model should process the task. ### Alternative Enumeration Requires the model to surface multiple viable approaches before committing to one, preventing premature convergence. **Problem:** The model quickly converges on the first plausible answer, hiding other viable approaches and locking framing too early. **Solution:** Require multiple alternatives before any selection. Structural obligation forces distribution across distinct solution regions instead of single-path collapse. ### Hierarchical Decomposition Breaks a concept into its immediate constituent parts, increasing resolution through containment rather than variation. **Problem:** Complex topics are often returned as flat lists or linear prose, obscuring part-whole structure and boundaries. **Solution:** Ask for decomposition into components (and optionally subcomponents) as a hierarchy. Containment-based structuring increases resolution and makes system organization explicit. ### Dependency Decomposition Solves complex problems by progressively establishing prerequisite answers so that later steps become solvable. **Problem:** Complex answers fail when prerequisites are not established first; the model guesses missing enablers and produces brittle conclusions. **Solution:** Sequence subproblems by prerequisite dependency so each step enables the next. Earlier outputs become explicit working context, making later reasoning tractable and grounded. ### Stepwise Decomposition Breaks down a problem into ordered intermediate steps that can be solved before the final answer, to expose reasoning and prevent premature conclusions. **Problem:** One-shot answers hide intermediate reasoning, making errors hard to detect and encouraging premature conclusions. **Solution:** Require ordered intermediate steps before final commitment. Externalized steps function as visible working memory and local checkpoints, improving inspectability and robustness. ### Multi-Path Reasoning Evaluates multiple independent reasoning paths and delays commitment until they can be compared and the best one identified. **Problem:** A single reasoning trajectory is brittle: subtle path errors can produce wrong answers with no signal of uncertainty. **Solution:** Generate multiple independent reasoning paths and aggregate/choose after comparison (vote or evaluator selection). Convergence across paths amplifies robust answers and suppresses idiosyncratic errors. ### Governing Abstraction Derives a governing principle or broader frame before solving the specific instance, so reasoning proceeds from a stable abstraction rather than surface details. **Problem:** Solving detail-heavy instances directly encourages surface-level manipulation and fragile reasoning that misses governing principles. **Solution:** Force an abstraction step first (general question or explicit principle), then reason downward to the instance. Starting from higher-level representations constrains and stabilizes downstream inference. --- ## Quality Validation Patterns Patterns that are interventions between output produced and output trusted. ### Knowledge Externalization Requires the model to expose the background knowledge it will rely on before performing the task. **Problem:** Models often answer from unstated premises, producing fluent but weakly grounded judgments. **Solution:** Require the model to externalize relevant principles/facts first, then bind reasoning to them. Explicit premises in context make the reasoning basis inspectable and more coherent. ### Deferred Commitment States an explicit decision early, then defers final commitment until it is evaluated and confirmed or revised. **Problem:** Analysis often stays hedged and non-committal, making it unclear what decision is being made or revised. **Solution:** Force an initial explicit decision, then evaluate and confirm or revise before final commitment. Separating decision from evaluation creates an auditable, revision-aware decision trail. ### Reflective Evaluation Requires the model to evaluate its own output before revising or committing to a final answer. **Problem:** Default generation optimizes plausible output, not post-hoc checking, so constraint misses and factual errors pass through unchecked. **Solution:** Insert an explicit self-evaluation phase (critique, verification, or confidence gate) before finalizing. Reapplying criteria in a second pass catches errors that generation mode often misses. ### Claim Enumeration Requires the model to list the claims its output asserts as true, making them visible for verification. **Problem:** Assertions are buried in narrative prose, making verification difficult and encouraging uncritical acceptance of fluent text. **Solution:** Require a separate list of claims (and optionally assumptions) after the answer. This externalizes what is asserted as true so each item can be reviewed and checked systematically. --- ## Output Representation Patterns Patterns that shape the model's output into a form that can be consumed, compared, parsed, or acted on. ### Semantic Compression Compresses context by preserving meaning and constraints while discarding surface wording to fit within token limits. **Problem:** Human-readable summaries often drop constraints and edge details needed for downstream reasoning under token limits. **Solution:** Compress for semantic preservation, not prose readability, retaining decisions, constraints, and dependencies in dense form. This carries functional meaning forward with lower token cost and less silent loss. ### Response Tail Reserves a consistent slot in every response for secondary content (for example disclaimers, state, next steps). **Problem:** Secondary-but-required content (disclaimers, next steps, state notes) appears inconsistently or disappears across turns when not structurally reserved. **Solution:** Define a persistent tail slot in every response for that complementary content. Structural separation keeps primary answer and recurring support information consistently present and parseable. ### Answer Boundary Forces the model to commit to a final, discrete answer after reasoning, so the result is explicit and separable. **Problem:** Reasoning and conclusion blend together, leaving no clean final decision for action, comparison, or automation. **Solution:** Add an explicit commitment boundary and require a discrete final answer token/line/label. This does not improve correctness directly; it guarantees a separable commitment after reasoning. ### Output Template Declares the response structure in advance to produce predictable, reusable outputs. **Problem:** Free-form answers vary in section order and granularity, making cross-run comparison and downstream use difficult. **Solution:** Predeclare sections/fields/slots and have the model fill them. Converting open generation into structured completion yields predictable, reusable artifacts. ### Formal Representation Constrains output to a rule-governed symbolic form (for example JSON, SQL, DOT) so meaning is carried by structure rather than prose. **Problem:** Prose descriptions of rules, states, and dependencies are readable but ambiguous and hard to validate programmatically. **Solution:** Constrain output to a rule-governed symbolic form (JSON, SQL, DOT, Mermaid, etc.). Syntax carries explicit relationships, enabling validation, parsing, rendering, and execution. --- ## Interaction Design Patterns Patterns that shift the design lever from what the prompt says to how the interaction between the user and the model is structured. ### Control Reversal Transfers control of the conversation to the model, so it leads before committing to a response. **Problem:** When requests are underspecified, the model answers anyway by filling unknowns with assumptions, often steering decisions off-target. **Solution:** Transfer control to the model so it leads the conversation — asking questions, gathering context, guiding the user — before committing to a response. The model drives, the user responds. ### Interpretation Grammar Defines explicit rules for how terms, operators, and notation are interpreted, replacing the model's inference with declared definitions. **Problem:** The model infers what terms mean, what commands do, and how notation is parsed — producing plausible but inconsistent interpretations that drift across turns. **Solution:** Declare explicit definitions for terms, operators, and notation that bind the model's interpretation. Replace inference with definition: precision where there was ambiguity, stability where meaning would drift, compression where verbose prose can be replaced by defined operators. ### Meta Prompting Uses one prompt to generate or refine another prompt, using the LLM to craft how to interact with it. **Problem:** Prompt quality is a bottleneck; writing effective prompts directly is difficult and sensitive to wording details. **Solution:** Use one prompt to generate, refine, select, or template another prompt. Separating intent specification from wording implementation makes prompt design faster, more consistent, and iteratively improvable. ### Specification Extraction Extracts the implicit specification from a finished artifact, working backward from output to the rules that produced it. **Problem:** Effective writing follows conventions that are subtle and implicit. Extracting these conventions manually is time-consuming and unreliable. When asked to describe what makes their work effective, authors tend to offer high-level generalities that miss the structural and tonal conventions that actually drive quality. **Solution:** Provide the model with an exemplar of excellent work and ask it to extract the specification. The model extracts multiple convention dimensions from a single exemplar. The specification can then be reviewed, refined, embedded in a system prompt, or shared as a style guide.