Structured Output & Format Control
JSON, XML, structured generation, and output formatting.
Classification and Labeling Output
Classification and labeling output techniques use prompt design, label space engineering, and output constraints to reliably sort LLM inputs into predefined categories with calibrated confidence. Prerequisites: None.
Constrained Decoding from the Prompt Perspective
Constrained decoding uses grammar-based filtering, regex constraints, and schema enforcement at the token level to guarantee structural output validity, complementing prompt-based format control. Prerequisites: json-mode-and-schema-enforcement.md.
Extraction and Parsing Prompts
Extraction and parsing prompts instruct LLMs to locate, identify, and structure specific information from unstructured text into defined fields, bridging the gap between raw documents and structured databases. Prerequisites: json-mode-and-schema-enforcement.md.
JSON Mode and Schema Enforcement
JSON mode and schema enforcement ensure LLM outputs conform to machine-parseable JSON structures through API-level constraints, prompt design, and external validation. Prerequisites: None.
Markdown and Rich Text Output
Markdown output prompting controls how LLMs format responses with headers, tables, lists, and code blocks, enabling consistent, readable, and structured human-facing content. Prerequisites: None.
Multi-Step Output Pipelines
Multi-step output pipelines chain multiple LLM calls where each step’s structured output feeds as input to downstream code or prompts, enabling complex tasks through decomposition. Prerequisites: json-mode-and-schema-enforcement.md, extraction-and-parsing-prompts.md.
Output Length Control
Output length control uses prompt instructions, parameter settings, and structural techniques to manage the trade-off between brevity and completeness in LLM responses. Prerequisites: None.
XML and Tag-Based Output
XML and tag-based output uses labeled opening and closing tags to structure LLM responses, excelling at nested mixed content, human readability, and seamless integration with Anthropic’s Claude models. Prerequisites: None.