Why XML tags are so fundamental to Claude
Anthropic’s claim that XML-style tags are fundamental to getting good results from its Claude models has prompted debate over whether this is genuine model design or just overfitted documentation. Commenters agree that clear delimiters and structured prompts can help LLMs separate instructions, context, and output, but many question whether XML is meaningfully better than JSON, Markdown, or simple separators, and criticize the lack of hard evidence from Anthropic. The conversation broadens into XML’s wider reputation as “old enterprise tech,” its ongoing uses, and concerns about cargo‑cult prompt engineering versus principled, empirically tested practices.
Documentation & screenshots
- The odd-looking “Structure Prompts with XML” image is from Anthropic’s own docs, not user fakery; some criticize Anthropic for seemingly AI-written, sloppy guidance on how to use their own model.
- Several note that Anthropic has long exposed XML-ish structures (e.g., early tool-calling formats,
<think>tags), so the article’s examples fit that history.
Why XML / tags might help Claude
- Many argue tags serve mainly as clear delimiters and structure markers, not because XML itself is magical.
- Claude reportedly uses XML-like
antml:tool-invocation tags internally, so the model likely has strong reinforcement around angle-bracketed structure. - Named closing tags (
</section>) and namespaces are seen as helpful “error-correcting” redundancy and isolation.
XML vs JSON / Markdown / ad‑hoc delimiters
- Some prefer JSON or simple text conventions (
input:, separators like---) and report equal or better extraction performance than with XML. - XML is praised for freeform text markup (e.g., tagging embedded prompts or “no-op” blocks) where JSON is awkward.
- Others say Markdown headers and code fences already provide enough structure; many developers just talk to Claude in Markdown.
Practical prompting experiences
- Users report success tagging content/instructions separately (e.g., wrapping draft prompts in tags to prevent the model from “obeying” them).
- Others see no measurable benefit from following Anthropic’s XML recommendations and suspect old guidance was never cleaned up.
- Consensus: delimiters and consistent structure help; whether it’s “real” XML is less important.
Skepticism about the article and Anthropic’s claims
- Several call the article conceptually overreaching, especially around claims that XML tags occupy a special place in training beyond ordinary text.
- Distinction is drawn between true tokenizer-level special tokens (e.g., begin/end markers) and plain XML text learned via training.
- Some view the broader XML hype as bordering on cargo cult: a good model should follow instructions without elaborate markup.
XML’s status and side topics
- Long debate on XML being “spooky old enterprise tech” vs still-solid for documents, standards, finance, and configs.
- Discussion touches on transformer limits with nested structures, potential security issues with full XML, and the idea that structured prompts mainly force clearer user thinking.