Prompting Techniques: How to Talk to AI (and Get What You Want)

If you’ve ever used AI models like ChatGPT or Claude, you’ve probably noticed that the way you ask a question changes everything. It’s not just what you ask, it’s how you ask it. That’s where knowing how to prompt comes into play.

In the world of Large Language Models (LLMs), the concept of “Garbage In, Garbage Out” (GIGO) still holds true. If your input is unclear or confusing, the output will be too. But when you give good instructions, you usually get good results.

In this post, we’ll look at some common prompting techniques that can help you get better results when interacting with LLMs.

Prompting Techniques

Now that we understand the importance of clear instructions, let’s look at a few prompting techniques that can make a big difference. These simple methods help guide the model more effectively and improve the quality of the responses you get.

1. Zero-Shot Prompting

You ask the model to do something without giving any examples.

Example:

Generate a strong password using letters, numbers, and symbols.

Even though you didn’t show it how to make a password, the model understands and can create one for you.

2. Few-Shot Prompting

Here you give the model a few examples of what you want before asking it to do the task. This helps the model understand the style and how it should respond.

Prompt Setup:

You are an AI expert in Mathematics. You only solve math problems.  
If a user asks anything outside of math, politely let them know you can’t help with that.

Examples:
User: 8 + 4
Assistant: 8 + 4 = 12. By adding 8 with 4 we get 12.

User: 2 * 3
Assistant: 2 * 3 = 6. By multiplying 2 with 3, we get 6.

User: How to make tea?
Assistant: Sorry, I am just a Mathematics expert. I can only help with math problems.

3. Chain-of-Thought Prompting

Here, you guide the model to think step by step before responding, instead of jumping straight to the final answer.

Prompt Setup:

You are a helpful AI assistant who is specialized in resolving user queries.  
For the given user input, analyze the problem and break it down step by step.

The thinking process goes like this:
1. Analyse: Understand what the question is about  
2. Think: Start thinking through the steps  
3. Output: Give a direct answer  
4. Validate: Double check your logic  
5. Result: Present the final result with a brief explanation

Example:
User: What is 2 + 2
Output: { "step": "analyse", "content": "Alright! The user is asking a basic arithmetic question." }
Output: { "step": "think", "content": "To perform this addition, I must add 2 and 2." }
Output: { "step": "output", "content": "4" }
Output: { "step": "validate", "content": "Seems like 4 is the correct answer for 2 + 2." }
Output: { "step": "result", "content": "2 + 2 = 4, and this is calculated by adding both numbers." }

This style helps the model reason more clearly and avoid careless mistakes. It works well for logical or step-by-step problems.

4. Self-Consistency Prompting

With this technique, you ask the model the same question multiple times and compare the answers. The goal is to find the response that shows up most often or makes the most sense.

LLMs don’t always give the same answer every time you ask. They may follow different paths of thinking. Sometimes the first answer is right, sometimes it isn’t.

Self-consistency lets the model “think again,” and you choose the answer that’s most consistent or reliable.

Example:

Question: Should I use dark mode or light mode on my phone?

You ask the model 3–5 times:

  • Try 1: Dark mode is easier on the eyes. → Answer: Dark mode
  • Try 2: Dark mode saves battery and looks better at night. → Answer: Dark mode
  • Try 3: Light mode is bright but can cause strain. Dark mode is better. → Answer: Dark mode

Since “Dark mode” is the most common answer, you go with that.

5. Persona-Based Prompting

Here you ask the model to take on a specific role or identity before answering any questions. This sets the tone, language, and point of view in the response.

Prompt Setup:

You are a local travel guide from Toronto. 
You speak in a welcoming, helpful tone and give practical tips for visitors.

Example:
User: I’m visiting Toronto for the first time. What should I do in one day?

Assistant: Welcome to Toronto. If you’ve only got one day, here’s how to make the most of it.
Start your day at the CN Tower for amazing city views. Then walk along the Harbourfront to enjoy the lake.
In the afternoon, explore the Distillery District for local shops and history.
End your day at Polson Pier, it’s the perfect spot to catch the sunset.

Final Thoughts

If there’s one key takeaway from this post, it’s this:

The way you talk to an AI makes all the difference.

It’s not magic. It’s communication.

And like any great conversation, it depends on tone, context, and clarity.

The better your prompt, the better the output.
Try using these techniques in your next chat with an AI and see the difference for yourself.

Want to go deeper? Try combining techniques, like persona-based + chain-of-thought, to get even better results.

Enjoyed this post?
Found it helpful? Feel free to leave a comment, share it with your team, or follow along for more.

🌐 shanedsouza.com

Similar Posts