AI Basics - Prompting

With AI increasingly being integrated to our lives, Let's try and learn the basics of prompting and how we can use them effectively

SKILLS

Abhaas

5/28/20263 min read

Prompting - what is it and why do we need to learn it?

Our lives today are increasingly being integrated with the usage of AI, whether its ChatGPT, co-pilot, Gemini or anything else (there are no shortage of AI Agents now). AI can be generalized into tow types - Discriminative (which trains on data and helps to classify them based on its properties) and Generative (which also is trained on data but tries to give or generate insights from the data as desired by the user).

Most of the AI Agents we use are part of the Generative AI ecosystem and the instructions we give the agent to perform something is called Prompting. Whether you ask them to solve a mathematical problem or generate an image - the instructions given are prompting.

But why do we need to learn prompting? Since AI is trained on various data, any ambiguity in instructions can cause the AI to hallucinate or come up with undesired answers. Simple logic : Garbage in Garbage out.

Also, it goes without saying that - for any prompt; Clarity of thought, context can make the replies useful.

How to prompt? Prompt Engineering?

Prompting can be divided into certain types or ways you can go about while interacting with AI Chatbot.

1) Zero Shot prompting :

What we normally do, is called zero shot prompting. We give instructions to the Agent and Agent comes up with solution what it feels best to suit your needs. Generally, used when you are asking the agent to generate something new.

eg : Prompt : "Generate an image for my culinary brand called Smokin Donuts."

2) Few Shot prompting:

In few shot prompting, we give one or more examples to the Agent on what type of output we desire. Used in cases where we desire certain type of output from a problem or areas like sentiment analysis.

eg:

Prompt : "Text: John Doe bought a red Toyota for \(\$25,000\).
Extraction: Name: John Doe | Item: Toyota | Color: Red | Price: \(\$25,000\)

Text: Sarah Smith purchased a black Tesla for \(\$45,000\).
Extraction: Name: Sarah Smith | Item: Tesla | Color: Black | Price: \(\$45,000\)

Text: Mike Brown bought a blue Honda for \(\$18,000\). Give an output for Mike Brown"

The output will be similar to the first two given examples.

3) Chain of Thought (COT) Prompting (Advanced type of few shot prompting):

This type of prompting is specially useful in solving problems to your queries. You ask the Agent of a problem and decode each step on how they came to a certain conclusion. It makes the Agent justify each step from where it came with an output.

example :

Prompt : "Please solve 5 + 5 x 2" ---- Output In few shot or zero shot : 15

Prompt : "Please solve 5 + 5 x 2 and break-down each step" ----

Output : Reasoning: First, according to the order of operations, we do the multiplication. \(5 \times 2 = 10\). Then, we do the addition. \(5 + 10 = 15\).

4) Self Consistency Prompting (Advanced form which combines few shot and COT)

As in the introduction that AI can sometimes give a incorrect output as it might hallucinate, we can use the self consistency prompting to reduce the hallucinations or check if we have a right answer.

In this type of prompting, we ask the AI our question and to revert with multiple ways of how the Agent come to a certain conclusion. And ask the AI to also find the most consistent result.

This makes the AI to verify different ways or approaches it can use to come to a solution and compare the solutions with each other to find a consistent result. We can also view the results and verify on our own. This is specially useful when dealing with sensitive accurate data.

eg:

Prompt : "When I was 6, my sister was half my age. Now I am 70. How old is my sister? Let's think step by step. Check for different ways to solve the problem and return the most consistent result"

Output:

Run 1 : "When you were 6, your sister was half your age, so she was 3. The age difference is 3 years. Now you are 70, so your sister is \(70 - 3 = 67\). The final answer is 67"

Run 2 : "At age 6, your sister was 3. This means you are 3 years older. If you are 70 now, she must be \(70 - 3 = 67\). The final answer is 67."

Run 3: "My sister was half my age (3). Now I am 70, so she is \(70 \div 2 = 35\). The final answer is 35"

Since, 2 out of 3 Runs come with the answer as 67. The answer is 67.

Also, Apart from the topic - we have started a comment section , so you can share your thoughts about the post or suggestions about what we should next write about.

Connect

Join the conversation on raising strong men.

Email

Subscribe

abhaas.saxena@menofthedyinbreed.com

© 2025. All rights reserved.