That first image, “Structure Prompts with XML”, just screams AI-written. The bullet lists don’t line up, the numbering starts at (2), random bolding. Why would anyone trust hallucinated documentation for prompting? At least with AI-generated software documentation, the context is the code itself, being regurgitated into bulleted english. But for instructions on using the LLM itself, it seems pretty lazy to not hand-t…
No, it’s two screenshots from Anthropic documentation, stitched together: https://platform.claude.com/docs/en/build-with-claude/prompt... The post even links to that page, although there’s a typo in the link.
Why XML tags are so fundamental to Claude
11–20 of 160 posts
Re: Why XML tags are so fundamental to Claude
#12That first image, “Structure Prompts with XML”, just screams AI-written. The bullet lists don’t line up, the numbering starts at (2), random bolding. Why would anyone trust hallucinated documentation for prompting? At least with AI-generated software documentation, the context is the code itself, being regurgitated into bulleted english. But for instructions on using the LLM itself, it seems pretty lazy to not hand-t…
No, it’s two screenshots from Anthropic documentation, stitched together: https://platform.claude.com/docs/en/build-with-claude/prompt... The post even links to that page, although there’s a typo in the link.
And yes, these are screenshots from Anthropic’s documentation.
Re: Why XML tags are so fundamental to Claude
#13Anthropic’s tool calling was exposed as XML tags at the beginning, before they introduced the JSON API. I expect they’re still templating those tool calls into XML before passing to the model’s context
Yeah like I remember prior to reasoning models, their guidance was to use tags to give models space for reasoning prior to an answer (incidentally, also the reason I didn't quite understand the fuss with reasoning models at first). It's always been XML with Anthropic.
Re: Why XML tags are so fundamental to Claude
#14Re: Why XML tags are so fundamental to Claude
#15E.g. instead of
....
.....
....
...
....
{actual input}
Just doing something like: ...instructions...
input: ....
output: {..json here}
...maybe further instructions...
input: {actual input}
Use case document processing/extraction (both with Haiku and OpenAI models), the latter example works much better than the XML.N of 1 anecdote anyway for one use case.
Re: Why XML tags are so fundamental to Claude
#16That first image, “Structure Prompts with XML”, just screams AI-written. The bullet lists don’t line up, the numbering starts at (2), random bolding. Why would anyone trust hallucinated documentation for prompting? At least with AI-generated software documentation, the context is the code itself, being regurgitated into bulleted english. But for instructions on using the LLM itself, it seems pretty lazy to not hand-t…
Re: Why XML tags are so fundamental to Claude
#17I thought the goal was minimal instruction to let Claude determine the best way to solve the problem. Not adding this to my workflow anytime soon.
Nobody expects the end user to prompt the AI using a structured language like xml
Re: Why XML tags are so fundamental to Claude
#18I think XML is good to know for prompting (similar to how was popular for outputs, you can do that for other sections). But I have had much better experience just writing JSON and using line breaks, colons, etc. to demarcate sections. E.g. instead of .... ..... .... ... .... {actual input} Just doing something like: ...instructions... input: .... output: {..json here} ...maybe further instructions... input: {actual i…
Re: Why XML tags are so fundamental to Claude
#19Re: Why XML tags are so fundamental to Claude
#20HTML also descended from SGML, and it’s hard to imagine a more deeply grooved structure in these models, given their training data.
So if you want to annotate text with semantics in a way models will understand…