This lesson equips prompt engineers with techniques for directing LLMs to produce outputs structured with markdown headers. The goal is to enhance response readability and organization through precise prompt crafting. Additionally, using markdown headers in your output can make parsing output much easier.
The success in generating markdown header-formatted outputs lies in the explicit instruction within your prompts as well as in providing examples:
Let's dive directly into examples demonstrating how to incorporate markdown header formatting instructions into your prompts.
Let's say you are writing a biology report and want to collaborate with an LLM in doing so, but you want your report to be nicely structured in markdown. Your initial prompt might be as follows:
This prompt will yield a narrative or list, lacking structured hierarchy.
By including a clear formatting request and a structural example, the prompt is more likely to elicit a response that is well-organized and easy to navigate.
What if you only want to use a specific header like an h2
type header (in markdown that's ##
) instead of the variety that is produced by the prompt above?
