According to Anthropic's prompt engineering documentation, what is the stated benefit of wrapping different parts of a prompt (instructions, context, examples, input) in distinct XML tags such as `<instructions>` and `<context>`?
- It helps Claude parse complex prompts unambiguously by clearly separating different types of content, reducing the chance the model misinterprets what is instruction versus example versus input
- It is required syntax without which the Messages API will reject the request with a formatting error
- It compresses the prompt so that it consumes fewer tokens than the equivalent plain-text prompt
- It automatically translates the tagged sections into a different language before the model processes them
Correct answer: A. It helps Claude parse complex prompts unambiguously by clearly separating different types of content, reducing the chance the model misinterprets what is instruction versus example versus input
Anthropic's documentation states that XML tags help Claude parse complex prompts unambiguously, especially when a prompt mixes instructions, context, examples, and variable input, and it recommends wrapping each type of content in its own consistently named tag, nesting tags when the content has a natural hierarchy. The second option is wrong because XML tags are a stylistic and structural convention recommended for clarity, not syntax enforced or required by the Messages API; plain-text prompts without tags remain valid requests. The third option is wrong because adding tags adds characters and therefore tokens rather than reducing them; the documented benefit is parsing clarity, not compression. The fourth option is wrong because tagging content has no translation function of any kind; the model still processes the tagged text in whatever language it was originally written in.
Source: Anthropic, "Prompting best practices" -- "Structure prompts with XML tags," platform.claude.com prompt engineering documentation