If you’re using OpenAI’s ChatGPT, Anthropic’s Claude, or Meta’s LLaMA, then you’ve already written a prompt, or in simpler terms, given an instruction to a generative artificial intelligence to get a result.
In this article, we’ll explore what the term “prompt engineering” means, the basic elements of a prompt, and three very interesting techniques to get better responses: zero-shot, few-shot, and chain-of-thought.
What is Prompt Engineering?
If you’ve ever been on a sales call, then you know that preparation is key: you need to know the client well—needs, pain points, and goals—before meeting.
Prompt engineering is very similar: you need to prepare before giving an instruction to an AI model to get the best possible response. Think of it as an input-output logic, where the input is your instruction, which the model will use to craft a response.
This concept arises from the idea of engineering the instructions given to generative AI models to obtain the best possible response (or output).
Basic Elements of a Prompt
A good prompt should consist of four elements:
- Instruction: The tasks or instructions that the model should follow when crafting the response.
- Context: External information or additional context that can help the model give better answers.
- Input Response: What we want the AI to respond to.
- Output Indicator: The type or format we want the output to have (if applicable).
Let’s go with an example (for all examples, I’ll be using the Claude Opus 3 model from Anthropic).
Prompt
INSTRUCTIONS
Create an ideal script for a 30-minute call with a potential client.
CONTEXT
Our company sells tires, and the potential client manufactures cars.
We want to sell our product for all their car lines.
RESPONSE FORMAT (where we define input data and output indicator)
I want your response to look like the following example:
• Minute 0 to 5: introductions
• Minute 5 to 15: thoroughly understand the client’s problem
• Minute 15 to 30: demonstration and answer questions
Also, add important potential topics to discuss in each section.
Response
Here’s an ideal script for a 30-minute call with the potential car manufacturer client:
Minute 0 to 5: Introductions
• Thank the client for their time and the opportunity to talk.
• Briefly introduce our company, highlighting our track record
and experience in the tire market.
• Mention some of our most important clients in the automotive
industry to build credibility.
Minute 5 to 15: Understand the client’s needs and challenges
• Ask open-ended questions to better understand their car
manufacturing process and the challenges they face regarding tires.
• Inquire about the car models they produce, volumes, target markets,
and specific tire requirements for each line.
• Ask about their current tire suppliers, their level of satisfaction,
and aspects they would like to improve.
• Listen carefully and take notes on key points.
Minute 15 to 30: Present a solution and answer questions
• Based on the information gathered, present our value
proposition and how we can meet their needs better than the competition.
• Highlight the quality, technology, durability, and warranty of our tires.
• Share success stories with other car manufacturers to demonstrate
our capabilities.
• Explain our service model, technical support, logistics, and commercial terms.
• Open the floor to answer all the client’s questions and clarify details.
• Propose concrete next steps and dates, for example, to test
samples of our tires.
• Thank them again for their time and interest, and express
enthusiasm for a potential collaboration.
The most important thing is to demonstrate that we understand their needs,
that we have a tailored solution, and to convey professionalism and confidence
throughout the call. The key is to listen first before presenting, so our
proposal is as relevant and convincing as possible.
Voilà! 🎩
Now, there are different ways to create prompts that serve different tasks. While there are many ways to write instructions, today we’ll review just three (the most commonly used): zero-shot, few-shot, and chain-of-thought prompting.
Zero-shot Prompting
One of the most used techniques, where you basically ask the model to do something without giving any example or specific way of thinking. That is, the model wouldn’t have anything to base its response on, so it will use its knowledge to provide the best possible output based on the instructions.
Continuing with the previous example, let’s say we want to ask for 10 short titles for Google Ads. It would look something like this:
Zero-shot Prompt
Give me 10 different titles of no more than 10 words to sell my tires.
Avoid grandiose adjectives; I want you to focus on price/quality ratio.
Zero-shot Response
1. Durable tires at affordable prices
2. Safety and savings in every mile
3. Quality tires, unbeatable prices
4. Ride safe, pay less
5. Better grip, better price
6. Miles of savings in every tire
7. Sturdy tires, smart investment
8. Reliable grip, reasonable price
9. Quality and economy in every wheel
10. Tires that last, prices that suit
As you can see, the model chose to give me a numbered list. However, if I was looking for a different type of output, with another format, it would be better to use the next technique.
Few-shot Prompting
Just as in zero-shot, no examples are used, in few-shot, they are. The idea behind this technique is to create the instructions for the response and then provide examples of what a valid or successful response would look like.
Few-shot Prompt
INSTRUCTIONS
You will play the role of a potential customer for our tire company.
Your role is to find flaws in our sales arguments and ask questions
that might put us in a bind.
EXAMPLES
Example 1
Sales argument: Our tires withstand temperatures of up to 100 degrees Celsius.
Potential customer: Under what conditions? What happens if it’s 100 degrees
and the tire is spinning against the asphalt?
Example 2
Sales argument: We are working with large companies in the sector,
providing tires for various models.
Potential customer: Which brands are you working with? What models?
Do you have any quality metrics?
QUESTION
Sales argument: The price/quality ratio of our tires is the best
in the Latin American market.
Potential customer:
Few-shot Response
What do you base your claim that your price/quality ratio is the
best in Latin America on? Have you conducted comparative studies
with other leading brands in the market? I would like to see concrete data.
Moreover, what parameters do you use to measure the quality of your tires?
Durability, grip, puncture resistance, wear, wet adhesion?
How do you compare in each of these aspects against the competition?
On the other hand, which price segment are you targeting? Because you might
have a good price/quality ratio for low-end tires, but not necessarily in
the mid and high ranges where the demands are higher.
I’m also wondering if that statement applies to all your models or only to
some in particular. Could you specify for which types of vehicles and uses
you recommend your tires over other market alternatives?
The few-shot technique is especially relevant when a high level of control is desired over the form of the output or response that the model will provide.
Chain-of-thought Prompting
This technique allows you to understand how the model thinks and, if necessary, provide examples so that the different steps that comprise complex thinking are executed in a specific way. If you’re looking for complex answers, this technique can help a lot.
Continuing with our example of tires, let’s assume that the Marketing manager of that company has to create a new campaign and faces brutal competition:
CoT Prompt
Our tire brand is facing brutal competition in the market. Develop a
brand positioning strategy that differentiates us from our competitors
and resonates with our target audience.
Show me your thought process step by step, tell me why you consider
it important, and share specific examples.
CoT Response
To develop an effective brand positioning strategy that differentiates
our tire brand from the competition and resonates with the target audience,
I would follow these steps:
1. Deeply analyze the competition:
• Identify the main competitors and their unique value propositions.
• Evaluate their pricing, distribution, communication, and
targeting strategies.
• This is key to finding differentiation opportunities and
avoiding occupied positions.
Example: If competitor A positions on price and B on safety, we could explore
attributes like performance, technology, or sustainability.
2. Know the target audience thoroughly:
• Define the target demographically and psychographically: age,
gender, SES, lifestyle, values, interests.
• Understand their needs, motivations, and tire purchasing criteria.
Are they looking for price-value, high-end, extended warranty?
• Crucial for developing relevant positioning and emotionally connecting.
Example: If the target is men aged 35-50, professionals, with children,
who value family safety, we should appeal to messages in that line.
3. Identify the strengths and differentiating attributes of our brand:
• List all the features, benefits, and values of our tires.
• Determine which are most distinctive vs. the competition and relevant
to the target.
• This allows us to build a unique and superior positioning in the
consumer’s mind.
Example: Suppose we use cutting-edge technology that optimizes grip and stability.
This could be a great differential to communicate.
4. Define the brand positioning:
• Articulate in one sentence the space we want to occupy in the
target’s mind.
• It must be unique, relevant, credible, and sustainable over time.
• The strategic direction that will guide all marketing actions.
Example: “Tires X: Cutting-edge technology for maximum safety to protect
what matters most.”
5. Translate the positioning into a value proposition:
• Define what we offer the target on a functional, emotional, and
self-expressive level.
• The brand promise that we will fulfill at every touchpoint.
Example: “With Tires X, you drive with the peace of mind that your family is
safe, thanks to advanced technology.”
6. Align with a brand personality:
• The set of human characteristics that we will give the brand.
• It must be consistent with the positioning and connect with the target.
Example: A protective, reliable, intelligent, and modern personality.
7. Execute the positioning integrally:
• Implement the strategy in every aspect of the marketing mix:
product, price, distribution, and communication.
• This involves everything from product design and packaging to advertising
campaigns and activations.
• Consistency across all touchpoints is key to building the positioning.
Example: Work on a technological aesthetic and safety messages in all materials,
from point-of-sale displays to social media pieces.
8. Measure and optimize:
• Define KPIs to evaluate the performance of the strategy.
• Continuously track to monitor awareness, consideration, sales, satisfaction,
and loyalty.
• This allows us to make adjustments and improvements to enhance results.
Example: If sales don’t grow as expected, analyze whether the positioning is
sufficiently distinctive and relevant.
In summary, developing strong brand positioning requires a deep understanding
of the target, the competition, and our own strengths, to find a unique and relevant
space that we can “own” in the consumer’s mind and consistently bring to life at
every touchpoint. A good positioning strategy not only differentiates the brand
but also makes it the preferred choice for the target, building long-term r
elationships and sustainable business results.
As you can see, the response not only includes what to do but also why the AI considers it important. Thanks to this technique, it is possible to understand why the model responds as it does.
Conclusion
There are various techniques to get better results when using generative artificial intelligence. Zero-shot, few-shot, and chain-of-thought are just a few. However, you should not limit yourself to just these techniques; instead, the best approach is to experiment until you find a prompt structure that makes sense for what you need to solve or get a response to.
One important thing to keep in mind is that these techniques work with the current state of technology. As Logan Kilpatrick from OpenAI said some time ago: prompt engineering is a bug, not a feature. That is, it is expected that these models will be better in the future at understanding what the user really wants, without needing to create something so complex.