Iterative Prompt Construction with LLMs
Introduction
Welcome to the subsequent step in mastering prompt engineering with Large Language Models (LLMs): Iterative Prompt Construction. Through iterative refinement, we can transform our initial, high-level questions into more precise prompts that yield exactly the outputs we need. Let's delve into how we can utilize this technique.
Understanding Iterative Prompt Construction
The idea behind iterative prompt construction is to start with a simple prompt and use LLM output to enhance your prompt instead of writing the whole prompt from scratch.
In most cases, complex prompts require formatting guidelines, comprehensive examples, detailed requirements, and much more. Doing it all from scratch could be a daunting task. This is where starting simple and using your initial outputs to iteratively enhance and improve your prompt becomes handy.
The Starting Point
Let’s assume we want to build a comprehensive prompt for returning JSON documents from bulleted lists. Creating the full prompt from scratch might take some time, but in collaboration with an LLM to build it iteratively, we can do it much faster.
Sample Output:
In this output, we have an example we could use to improve our initial prompt.
Refinement Through Iteration
Let's go to the next step of our iteration and ask for the conversion while giving the example:
Sample Output:
