An architect is designing a system prompt for a data extraction task where Claude must extract specific fields from unstructured text and return only field values. The team observes that Claude includes explanatory prose when only field values are needed. Which prompt engineering technique most directly addresses this?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Here's the deal — two techniques work synergistically here. First, using XML tags (e.g., <fields>, <name>, <date>) in the output format specification gives Claude an unambiguous structural template to follow.
Full explanation below image
Full Explanation
Two techniques work synergistically here. First, using XML tags (e.g., <fields>, <name>, <date>) in the output format specification gives Claude an unambiguous structural template to follow. Second, prefilling the assistant turn (providing the opening of Claude's response as an assistant role message in the messages array) forces Claude to continue from where the prefill ends, effectively eliminating any preamble or explanation before the structured data. Together these provide structural control over output format. Option A (temperature 0) affects randomness, not verbosity — Claude will still add prose, just deterministically. Option B ('Be concise') is a soft instruction that can be overridden by Claude's helpful tendencies; it's less reliable than structural controls. Option D is incorrect — model tier doesn't reliably control output verbosity in the way described.