Use XML tags to structure my prompts

Is it ok to use XML structured prompts to organize it?
I work with a big context window and I have a lot of dynamically inserted information in my prompts. I know that for example antropic advises to structure information using XML tags. I wonder if this approach will help the GPT-4o model understand my large context better?

Please if anyone has used a similar approach, let me know if it helped you.

1 Like

Using structured prompts like XML tags can be a helpful approach, especially when dealing with a large context window and dynamically inserted information. While it doesn’t strictly matter which format you use—whether it’s valid <xml_tags>, or [data] like this [/data], or any other format—the key is ensuring that your final prompt is clear and unambiguous.

Personally, I use XML tags in my prompt templates, and they work well. However, as long as the information is organized and easy for the model to interpret, the specific format shouldn’t make a significant difference.

1 Like