15/06/2023
From Lucas at AI builder. Super insightful.
“Whenever I use an AI product that offers a great user experience, I ask myself: "How the F #🤬 did they do it?"
And if the product is open source, I dive deep into the code, the logic, and of course, the almighty prompt.
Today, I was exploring Bamboo AI, a tool that analyzes data using natural language processing.
Being the curious geek that I am, I dove deep into the prompt to see how it was engineered and to see what types of techniques I could pick up to make my own prompts better.
And in this tweet, I will do my best to reverse engineer the prompt into its building blocks.
Feel free to bookmark this tweet for later reference. I've broken down the prompt into simple pieces for you to replicate if you want.
PS: A (slighlty reduced) snippet of the prompt is attached on the images for reference.
Here's what I found:
1. Role
The prompt starts by declaring a clearly defined role for the AI. Most prompts do this, as this has become a standard best practice.
2. Goal
A clearly defined goal on top of the role allows the AI to act in accordance to it. Nothing extraordinary with this prompt until now.
The problem is that most people stop crafting their prompts here, and then wonder why their outputs are useless and random more often than not.
3. Clearly defined input
The prompt clearly states what is the expected input the AI will receive.
This part of the prompt is often overlooked, but I've found it greatly reduces the randomness of the output.
4. Clearly Defined output
Similarly, clearly going over the expected output in minute detail will help steer the model in the exact direction that you want.
This will allow you to pinpoint exactly what it should do, and on top of that, will reduce the need for revisions.
Again, most people never even get to this point and then wonder why the AI never gets them right.
Of course it doesn't; it won't get you right if you haven't told it what to do.
5. Revisions
The prompt clearly states that revisions are to be expected and the output probably won't be the final one.
Once again, clearly stating what can happen during the actual use of this tool.
6. Input example
On top of clearly defining what input to expect, the prompt also shows an input example.
"Show, don't just tell" is a good principle to keep in mind when prompting.
This will greatly reduce the randomness of the model and make for more accurate outputs.
7. Output example
Stating the examples of the output is equally important.
This will allow the model to pick up on the input -> output pattern and make its answers way more relevant, contextual and useful.
See a pattern here?
Clearly state what the AI should do and what to expect.
Don't leave it to chance if you want your outputs to be reliable and useful.
And now we have reverse engineered how this prompt works.
“Whenever I use an AI product that offers a great user experience, I ask myself: "How the F #🤬 did they do it?" And if the product is open source, I dive deep into the code, the logic, and of course, the almighty prompt. Today, I was exploring Bamboo AI, a tool that analyzes…”