Cookie Consent by Free Privacy Policy Generator

The Best Of

Go to the Best Of the SEO Community.

David Schargel
David Schargel
Mar 23, 2025, 10:59 PM
Forwarded from another channel:
I am (always) working at getting better at prompting and have recently been taking my most important and repeatedly used prompts and making them better by 1) running them through the Anthropic Console (or the prompt I show below), 2) Adding 1-3 examples of output, and 3) Converting it all into XML.
I shared this with my brother and I figured y'all might gain from this.
Anthropic talks about using XML extensively in their documentation, so all of their tech is clearly using it. Google references XML in info about structuring complex prompts () and tucks it away in a few places, including an example in "Few-shot examples" (). Google has some examples of how to use it with data processing but, at this point, I'm personally only using it for text-based RAG prompt engineering.
It's obvious to me that the key reason that at least one output example in XML format is better (but not too many to avoid overfitting!) is that a SLM or LLM can see the tags in the XML and know about the desired result immediately instead of inferring it’s an example by the context.
Try it out for yourself...Use this example of a Markdown prompt and it's counterpart in XML in the same LLM and see what happens:
Original Markdown Version:
XML Version:
Bottom line: I can confidently say that I am getting better results with 3 of my most important prompts in XML prompts within my go-to LLMs. Was it worth the time? IMHO, yes.
Forwarded thread from another channel:
Kyle Faber
Kyle Faber
Mar 23, 2025, 11:11 PM
@david179 this is amazing; thank you so much for sharing!
Dorron
Dorron
Mar 24, 2025, 12:51 AM
The prompt for prompting is fantastic. I would try to apply the CARE Method to Your Prompt:
• *Context*: Clearly define the role or objective (who or what the AI is acting as).
• Action: Specify the key responsibilities and steps the AI should take.
• *Response*: Ensure the AI generates actionable, structured, and useful outputs.
• *Evaluation*: Guide the AI to refine its response with examples, best practices, and expert insights.
I would also add some structure to anything ambiguous and a cognitive verifier feedback loop:
Feedback Loop (Self-Evaluation)
Ensure AI assesses its own output for completeness, clarity, and alignment with user intent.
Example: “After generating the enhanced prompt, verify that it includes role context, key responsibilities, methodology, specific steps, and expert insights.”
Guardrails for Specificity vs. Flexibility
Avoid overly generic expansions by guiding AI to include industry-relevant best practices and real-world applications.
Example: If the input is broad (e.g., "Act as a financial advisor"), prompt AI to specialize (e.g., “Focus on personal finance, investment strategy, or corporate finance”).
Emina Demiri-Watson
Emina Demiri-Watson
Mar 24, 2025, 1:36 AM
Did you test against different use cases? I read somewhere that markdown is good for things where clarity matters but there is flexibility in structure ie. content writing. While XML works best on complex, multi-step, strict sections tasks ie. technical documents. I was thinking it might work better even for content if you are working off a brief. As expected they tend to stray off the brief at times so this might help.
David Schargel
David Schargel
Mar 24, 2025, 3:19 AM
I'm wrapping up for the evening now and can answer/clarify more tomorrow.
When I explored advanced prompting (which I posted about here a few months ago) I was all about the mega-prompt and now I'm doing human-in-the-middle prompt chaining using my own version of the RTF framework I learned 2+ years ago.
This example I gave is the 2nd in my 3 or 4 prompt chain. The last prompt is always a formatting/reformatting, but there may be document uploads, website scraping or something similar earlier on and my prompt for that is usually 1 sentence.
Unless I already have a good one, my first in the prompt chain is ALWAYS the buildout of a role with with a long(er) prompt to define , , , and . I encourage anyone to always use an exceptionally great role and the more specific you get, the better your end results will be. Don't be afraid to express multiple levels of expertise/fields. That role is fed into a newer version of that example prompt I posted in this thread to build something more comprehensive. (Something kinda amusing about the chaining is that I need to keep saying things where "I will give you simple/basic" even though it is at all basic.)
I still have not built out any XML versions of the formatting/reformatting portion of the prompting chain, but I know I will need to have a few depending on the target use. What I have now is very manual with a crapton of mix & match copy/pastes to reformat and tweak the final output and optionally humanize the output depending on how it's going to get used.
I have not tried out multiple use cases since my own targets (for this prompting) is American English copywriting, video scripts, and a course I am working on. I have a completely different series of prompts for Google Search Ads.
My tech stack looks like this: Originially (Bard into) Gemini and now it's a Flash 2 variant under Gemini Advanced & AI Studio (where I am using this prompt chaining), Gemini API in n8n, a private Milvus vector store using isolated Llama 3.1 8B in n8n, Sonnet 3.5 for coding (which I am still new with), Sonnet 3.7 for slow Superwhisper, and GPT-4o mini for fast Superwhisper. I am still using for blog-based SEO research and outlining although I will bail on that soon. I'm happy with that stack but I still drop things into LM Arena just to see what other LLMs come up with. :-)
OK...I hope this mostly made sense...it's past 2 AM...I'm out.
Dorron
Dorron
Mar 24, 2025, 3:41 AM
Get some rest it's well deserved

Our Values

What we believe in

Building friendships

Kindness

Giving

Elevating others

Creating Signal

Treating each other with respect

What has no home here

Diminishing others

Gatekeeping

Taking without giving back

Spamming others

Arguing

Selling links and guest posts


Sign up for our Newsletter

Join our mailing list for updates

By signing up, you agree to our Privacy Policy and Terms of Service. We may send you occasional newsletters and promotional emails about our products and services. You can opt-out at any time.

Apply now to join our amazing community.

Powered by MODXModx Logo
the blazing fast + secure open source CMS.