- Published on
Tips on how to get the most of your prompts
You can't escape AI. And while it might not be coming for you job, its a great aggregation of multiple knowledge experts trained in huge amounts of data. Instead of thinking of AI like a big black box, you have to think of it as an advanced knowledge base that you're querying. And just like our ol postgres pal, the better your query the better your results.
In this post I will give you a few tips on how to improve your queries.
Zero shot prompting
This is the most basic way to do a prompt. You give the model no further info, no examples. So it has to stretch it's neurons (pun intended) to be able to determine what to do.
you: Chat, are we cooked?
chat: yooo lmfaooooo idk roomie
One-shot prompting
With this prompt style, you basically give the model an example of how you want your answer. Let's say we have French homework and we need chat to help us translate some phrases. You would prompt it like:
Translate a sentence from English to French:
English: "How is the weather today"
French: "Comment est le temps aujourd'hui?"
Now translate the following sentence from English to French:
English: "Where is the nearest supermarket?"
Few-shot prompting
As the name suggest, with few shot prompting you give the AI more examples. They could cover things like edge cases on your query. For an example:
Here are few statements classified by emotions:
Statement: "I loved the product. It was way better than I expected."
Emotion: Joy
Statement: "The product arrived broken. Worst quality possible."
Emotion: Frustration
Statement: "I still haven't received my purchase. I hop you can solve this soon."
Emotion: Anger
Now classify the following statement:
Statement: "The product arrived on time and as described."
Chain of thought (CoT)
Yet another three letter acronym. This tactic of prompting helps you gide the model into reasoning complex tasks. Let's say you have one of those logic problems like:
There are two ducks in front of a duck, two ducks behind a duck and a duck in the middle. How many ducks are there?
You just have to ask the model to breakdown it's reasoning steps. This helps you to see the steps it took and you can gide it.
There are two ducks in front of a duck, two ducks behind a duck and a duck in the middle. How many ducks are there?
Break down each step of your reasoning
The answer chat gpt gave me:
ChatGPT said:
Let's break this riddle down carefully, step by step:
Problem:
There are two ducks in front of a duck, two ducks behind a duck, and a duck in the middle.
So we have three conditions to satisfy:
Two ducks are in front of a duck.
Two ducks are behind a duck.
There is a duck in the middle.
Step 1: Visualize a lineup of ducks
Let's imagine the ducks standing in a line, from front to back.
Let’s label them as Duck A, Duck B, Duck C (hypothetically, let's assume 3 ducks for now and test it).
Position:
Duck A → front
Duck B → middle
Duck C → back
Step 2: Check the first condition: "Two ducks in front of a duck"
From Duck C's point of view:
There are Duck A and Duck B in front of it. ✅
So this condition holds.
Step 3: Check the second condition: "Two ducks behind a duck"
From Duck A's point of view:
There are Duck B and Duck C behind it. ✅
So this condition also holds.
Step 4: Check the third condition: "A duck in the middle"
Duck B is clearly in the middle of A and C. ✅
Step 5: Conclusion ✅
All three conditions hold with just 3 ducks in total.
💡 Main takeaway
If you really want to take advantage of AI to its fullest, you have to try and optimize your prompts. This won't only help you yielding better results but will also help you when it deviates from the topic like someone in mushrooms. I hope you give these techniques a try on your next interaction with this tooling.
Have a great prompting!