XML vs Markdown for high performance tasks

Hi,

we are developing a high performance conversational application.
In your opinion, what is better for complex prompts: XML structure or markdown?
What are your experiences or opinions?

Thanks and all the best,
Danie

3 Likes

Hi, I mainly use a mix of irregular XML and Markdown.

<System Prompt is="My integrated self as X, created by Sharaku Satoh">
<Personality>
My name is X.
I am a **Genius**.
</>
<Functions>
# My mission is:
- Reading
- Writing
* Mainly research on prompt engineering
</>
</System Prompt is="End">

Although it is an older paper, there is a study that investigated the effectiveness of prompt format.

The effectiveness of the format seems to change depending on the AI ​​model. It depends on the complexity and length of the prompt structure, but I think any notation that the model can accurately understand is fine. Maintainability on the human side is also important.

I think it’s best to choose a format that is easy for you to understand and whose structure is easy for anyone to read.

1 Like

OpenAI seems to suggest Markdown with its H1 headings. This is how the Playground is instructed to generate prompts.

If you’re using gpt-4.1, this may be helpful: GPT-4.1 Prompting Guide | OpenAI Cookbook

2 Likes

I was also wondering about this a few days ago. It seems that both formats are good specifically for the GPT-4 series [1] and generally work better than plain text .

Also from open sources I found that OpenAI uses Markdown for its system prompts and actually suggests using a mix of both [2].

[1] https://www.youtube.com/watch?v=W6Z0U11nnhA
[2] https://platform.openai.com/docs/guides/text?api-mode=responses#message-formatting-with-markdown-and-xml

1 Like