Skip to content
Service status

Type to search

Advanced Course: Advanced Prompting · 1 min read

Structure for precision – Markdown, XML, and hierarchy

Headings, tags, and emphasis as control mechanisms – and finding the right level of detail.

Section 3: Structure for precision – Markdown, XML, and hierarchy

Section titled “Section 3: Structure for precision – Markdown, XML, and hierarchy”

Learning objectives

  • Use Markdown for readable structure in longer system prompts
  • Understand XML-style tags as delimiters
  • Use hierarchy and emphasis without creating a wall of rules the model ignores anyway
Markdown in system prompts

Models have seen massive amounts of Markdown in training. Structure with #, ##, lists, and bold makes sections easier to follow.

Without structure: one long run of sentences about HR policy.
With structure: headings for Role / Behavior / Constraints where the last point is bold if it’s critical.

XML-style tags

You choose your own tag names that describe the content, e.g. <role>, <background>, <instruction>, <example>, <document>.

They create a clearer “contract” about where sections begin and end – especially when multiple sources are mixed.

Example:

<role>
You are a legal assistant specializing in data protection law.
</role>
<background>
The client runs an e-commerce site with 50,000 registered customers.
</background>
<question>
Which GDPR aspects are most critical for purchase history?
</question>

Markdown and XML-style tags can be combined if you wish.

Hierarchy, uppercase, and the right level of detail

Hierarchy: overarching principles first, then details that follow from them.
Uppercase: e.g. CRITICAL: for a single rule – use sparingly.

Too vague: “Help with HR questions.”
Too granular: long if-then matrices for every conceivable edge case – the model still misses edge cases.

Just right: clear principles + how uncertainty and escalation are handled + format.

Take an existing prompt and restructure it with Markdown or tags. Compare responses to the same three test questions.

  • Structure helps the model navigate long instructions.
  • Tags can isolate context, task, and format.
  • Balance beats both vagueness and micro-management.

Test your knowledge

Question 1 of 2

Question 1 of 2

You want to create an XML-style tag for background information. Which syntax is correct?

You want to create an XML-style tag for background information. Which syntax is correct?