rvachev.orgEN / RU / 🤖
← Back to essays
· Essay · 1 min

Improving GPT Response Quality with Proper Prompt Structure.

The right prompt structure can significantly enhance response quality.

Not many know, but the right prompt structure can significantly enhance response quality. One of the "hacks" recommended by all major LLMs is to use XML to tag blocks. For example, if you copy a piece of documentation, place it within <documentation></documentation> tags, and so on. This is especially relevant when you provide large unstructured blocks. For instance, the latest version of code can go in <my_code></my_code> and documentation in <documentation></documentation>.

https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/use-xml-tags

https://platform.openai.com/docs/guides/prompt-engineering/strategy-write-clear-instructions

Newsletter

Get new posts by email

A weekly digest of what I write about AI, software and products. Unsubscribe anytime.