MemotivaPrompt Engineering Patterns: Structured Outputs, JSON Mode, Function Calling, Schema Validation

What is XML tagging in prompts and when is it useful?

Prompt Engineering Patterns: Structured Outputs, JSON Mode, Function Calling, Schema Validation

Audio flashcard · 0:19

Nortren·

What is XML tagging in prompts and when is it useful?

0:19

XML tagging is using tags like instructions, context, and examples to delimit different parts of a prompt. It helps the model distinguish instructions from data, system rules from user input, and different example types. Anthropic specifically recommends XML tags for Claude prompts because the model is trained to recognize them as semantic markers.
docs.anthropic.com