Prompt engineering: 13 tips to get better responses
Generative AI is impressive, but it needs the right tools to truly shine. That’s where
prompt engineering steps in. Here are 13 tips to improve the responses you get.
Artificial intelligence tools are advancing rapidly, getting closer to communicating like humans. However, if you’ve worked with AI enough, you’ve likely experienced the challenge of phrasing your queries just right to get the desired output. This becomes especially important when integrating AI into commercial applications, where outputs need to follow specific guidelines. That’s where prompt engineering comes in – crafting precise queries to optimize AI responses. But how does it work? And how can you make the most of it? Explore 13 practical tips (with examples) to improve your AI results
What is prompt engineering?
Simply put, prompt engineering is the practice of crafting inputs – known as prompts –to guide AI models, like GPT, into delivering the desired output.
To better understand this, think of AI as a highly skilled but somewhat literal-minded assistant. The way you ask it to do something determines the quality of the result you get. The same way you’d provide detailed, clear instructions to someone unfamiliar with a task, AI needs well-structured, specific input to perform well. If you’re vague or imprecise, you might get an answer that feels off-track or incomplete.
So, prompt engineering is about asking the right questions in the right way. The more you understand how to structure these inputs, the more powerful the AI’s responses become.
Why your business needs prompt engineering?
In a world where AI is becoming the go-to solution for everything from customer service to content creation, prompt engineering could be one of the secrets for taking your business to the next level. Here’s why you should care about it.
Improves accuracy and relevance
When you use well-crafted prompts, you help AI deliver outputs that make sense for what you need. This means better decisions and more effective use of AI.
Use case: A marketing agency tunes its prompts for a content generator. By specifying details about their target audience, they consistently get high-quality articles that hit the mark, cutting down on editing time.
Enhances customer experience
With effective prompt engineering, you can create AI solutions that feel personal to your customers. Tailoring responses based on user input can ramp up customer satisfaction.
Use case: An e-commerce site rolls out a chatbot that uses prompt engineering to assist shoppers. By refining how it responds, the chatbot offers personalized product suggestions and resolves questions quickly, leading to happy customers and more sales.
Increases efficiency and saves time
Smart prompts can save you time by reducing the need for back-and-forth revisions. This means your team can focus on what really matters instead of getting bogged down in edits.
Use case: A financial firm automates its report generation using AI and prompt engineering. By defining exactly what analyses they need, the AI cranks out accurate financial summaries way faster than before, freeing analysts to work on strategy.
Facilitates complex problem-solving
When tasks get complicated, prompt engineering helps break them down into manageable pieces. This is handy in industries where details matter.
Use case: In healthcare, a diagnostic tool leverages prompt engineering to interpret patient data. By guiding the AI to focus on specific symptoms and histories, it assists doctors in making accurate diagnoses.
Drives innovation
With prompt engineering, you can unlock exciting new capabilities for your AI. This can lead to fresh ideas and unique offerings that set you apart in the market.
Use case: A tech startup creates a language translation tool that gets better with user feedback, thanks to prompt engineering. By refining prompts based on what users say, the tool becomes more accurate and gives the startup a leg up on the competition.
Enables scalability
As your business grows, prompt engineering helps your AI solutions scale smoothly. This flexibility is key if you want to expand without losing quality.
Use case: A global company uses prompt engineering to develop a customer support system that can handle multiple languages. By fine-tuning prompts for different languages, they effectively manage support inquiries worldwide.
How does prompt engineering work?
Generative AI models, like GPT, are trained on massive datasets and rely on complex neural networks to process and respond to prompts. At the heart of how they function is a blend of natural language processing (NLP) and machine learning techniques.
When a prompt is given, the model breaks down the input through a process known as tokenization. This involves converting the text into smaller units (tokens), which the AI can analyse. These tokens help the model recognize patterns, meaning, and context within the input, allowing it to predict and generate coherent responses.
A range of techniques can influence how the model generates output. For instance, model parameter tuning adjusts the internal settings of the AI to control factors like creativity or precision. Another method, top-k sampling, limits the number of possible next-word predictions, helping to create more focused and relevant responses. These techniques work together to refine the outputs based on the input, ensuring the AI delivers more precise, creative, or contextually appropriate results.
Generative models like DALL-E, which create images from text prompts, add another layer of complexity. These models use a technique called stable diffusion, which works alongside the language model to transform text into visual outputs. Here too, prompt engineering is vital for directing the model toward producing high-quality images that match the description.
What are the benefits of prompt engineering?
The main advantage of prompt engineering is that it helps AI models generate high-quality responses with minimal need for editing or adjustments afterward. AI outputs can vary in quality, and without a well-crafted prompt, you might end up spending more time fixing the output than benefiting from it. By using precise and targeted prompts, prompt engineers can guide the AI to produce responses that align closely with the desired outcome, reducing the amount of post-processing required.
Another huge benefit is how prompt engineering can make interactions with AI more efficient over time. As AI systems adapt and evolve, having a well-engineered prompt from the start can streamline long-term workflows. Whether you’re using AI to generate reports, answer customer inquiries, or even create stories, prompt engineering ensures that each interaction becomes more productive and satisfying.
The more complex and capable these systems become, the more important it is to guide them effectively to get the best results.
13 tips to generate better results (with examples)
With these 13 tips, you can dramatically improve the quality and relevance of AI-generated content.
Be clear and specific
One of the simplest but most powerful strategies in prompt engineering is clarity. AI models thrive on clear, direct instructions. The more specific you are with what you want, the better the AI can deliver relevant and useful results. Of course, writing clear instructions takes time and knowledge but overly vague prompts often result in broad or imprecise outputs, which may require further refinement or editing.
❌ Worse
Write about health benefits. Ouput: There are many health benefits, like better heart health and more energy. |
✅ Better
List five health benefits of a Mediterranean diet, focusing on heart health and longevity. Output: The Mediterranean diet offers several benefits, including: 1) Lower risk of heart disease, 2) Improved cholesterol levels, 3) Reduced inflammation, 4) Enhanced brain function, 5) Increased life expectancy. |
Provide context
Context is crucial for generating meaningful responses. AI models can generate better, more coherent results when they have enough context to understand what you’re asking. Context can include background information, specific instructions, or even a scenario that frames the prompt.
For example, if you’re using AI to write an email, providing context about who the recipient is, what the email is about, and the tone you want (e.g., formal or friendly) can lead to a much more tailored response.
❌ Worse
Write an email about a new product launch. Ouput: We have a new product coming out. Stay tuned! |
✅ Better
Write an email to our existing customers announcing the launch of our new eco-friendly water bottle. The tone should be friendly and excited, and mention a special 10% discount for early buyers. Output: Hi [Customer]! We’re thrilled to announce the launch of our newest product – an eco-friendly water bottle made from sustainable materials! As a valued customer, we’re offering you an exclusive 10% discount for early purchases. Grab yours now and help reduce plastic waste!. |
Embrace AI personas
One powerful strategy in prompt engineering is to have the AI adopt a specific persona or role. By guiding the AI to respond from a defined perspective, you can obtain insights and opinions that reflect the expertise or viewpoint of that persona. This approach allows for richer, more nuanced responses, especially when you’re seeking specialized knowledge or a particular take on an issue.
When crafting your prompt, simply instruct the AI to “act as” a certain expert or character.
❌ General prompt
What are the benefits of renewable energy? Ouput: Renewable energy sources are beneficial because they reduce carbon emissions and reliance on fossil fuels. |
✅ Prompt with persona
Act as a renewable energy expert and explain the benefits of renewable energy. Output: As a renewable energy expert, I can tell you that the benefits are substantial. Not only do renewable energy sources, like solar and wind, significantly lower greenhouse gas emissions, but they also promote energy independence and create jobs in emerging technologies. Furthermore, they help stabilize energy prices in the long run. |
Refine your questions
Sometimes, you might find yourself unsure about how to articulate your query effectively. In such cases, a helpful strategy is to ask the AI for assistance in refining your question. This approach can clarify your thoughts and lead to more targeted and insightful responses.
When using this strategy, you can prompt the AI to suggest a better version of your initial question or to help you frame it in a more effective way.
❌ Initial prompt
Tell me about renewable energy. Ouput: Renewable energy includes sources like solar, wind, and hydroelectric power. |
✅ Prompt for refinement
How do I ask you about the benefits of renewable energy in a better way? Output: You might ask: ‘What are the key advantages of using renewable energy sources compared to fossil fuels?” This will lead to a more detailed and focused response. |
Let the AI take the lead
Another effective strategy in prompt engineering is to allow the AI to guide the conversation towards achieving a specific goal or task. By inviting the AI to ask you questions, you can create a more interactive dialogue that helps clarify your needs and enables the AI to deliver more relevant and effective results.
This approach leverages the AI’s ability to think critically and utilize its knowledge base to identify the key information required for the task at hand. Instead of providing all the details upfront, you can prompt the AI to inquire further, ensuring that it fully understands your objectives.
❌ Initial prompt
Help me create a marketing plan. Ouput: Sure! Could you provide details about your target audience? |
✅ Prompt for AI-led conversation
Ask me questions until you have all the information you need to create a marketing plan. Output: Great! First, what is your main goal for this marketing plan – are you looking to increase brand awareness, drive sales, or something else? Also, what budget do you have in mind? |
Request supporting facts
When diving into a topic you’re not familiar with, it’s always a good idea to ask the AI for the facts behind its responses. By requesting a list of supporting information alongside the output, you can verify the accuracy of what you’re being told and ensure that the AI isn’t basing its conclusions on incorrect assumptions.
This strategy is especially helpful when you have limited knowledge about a subject but still want to make informed decisions or gain insights.
❌ Initial prompt
What are the benefits of meditation? Ouput: Meditation can reduce stress, improve concentration, and promote emotional health. |
✅ Prompt for AI-led conversation What are the benefits of meditation? Whenever you give me an answer, include a list of facts that support it. Output: Sure! Here are some supporting facts: 1) Studies show that meditation can lower levels of the stress hormone cortisol, 2) Research indicates that regular meditation practice can enhance focus and attention span, and 3) A review of multiple studies found that meditation contributes to greater emotional well-being by reducing anxiety and depression. |
Explore the AI’s reasoning
When you receive an answer from the AI, it can be really insightful to ask how it reached that conclusion. By prompting the AI to explain its reasoning, you can gain a better understanding of the thought process behind its responses.
❌ Initial prompt
What are the benefits of exercise? Ouput: Exercise can boost your mood, improve your physical health, and enhance cognitive function. |
✅ Prompt for reasoning
What are the benefits of exercise? Whenever you give me an answer, explain how you reached that conclusion. Output: Sure! To come up with that answer, I considered various studies that show the effects of exercise on mental health, such as how physical activity increases endorphins, which can lead to a better mood. I also referenced research linking regular exercise to reduced risks of chronic diseases and improvements in brain health, particularly regarding memory and focus. |
Experiment with temperature and top-k sampling
Generative AI models like GPT often have parameters that allow you to control the creativity and randomness of the output. Two common settings are temperature and top-k sampling.
Temperature controls how “creative” or varied the AI’s responses are. A low temperature (close to 0) makes the AI more conservative and focused, while a higher temperature (closer to 1) increases creativity but can also introduce more randomness.
Top-k sampling limits the number of potential next-word predictions the AI can choose from. By reducing this number, you can make the AI’s output more predictable and relevant to your prompt.
❌ Worse
Low temperature (0.2): Describe a cozy winter evening. Ouput: A cozy winter evening is spent inside, with a warm blanket, a crackling fire, and a hot cup of cocoa. |
✅ Better
Low temperature (0.9): Describe a cozy winter evening. Output: A cozy winter evening might include twinkling lights, the faint smell of cinnamon, laughter echoing through a cabin, and snow falling gently outside. |
Break down complex tasks
When dealing with complex queries, breaking the task down into smaller, more manageable pieces can improve the quality of the output. Large, multi-part prompts can overwhelm the AI, leading to generic or inaccurate responses. Instead of asking one large question, divide it into simpler, step-by-step instructions.
For example, instead of asking the AI to summarize a full report in one go, start by asking it to summarize individual sections. Then, you can ask it to combine the smaller summaries into a concise overall description.
❌ Complex prompt
Summarize the entire research paper on climate change mitigation strategies. Ouput: The paper discusses various strategies for mitigating climate change, including renewable energy, carbon capture, and sustainable practices. |
✅ Broken-down prompt
1) Summarize the introduction of the paper on climate change mitigation strategies. The introduction outlines the urgent need for climate change mitigation, emphasizing the global rise in greenhouse gases and the role of renewable energy in reducing emissions. 2) Summarize the conclusion of the paper on climate change mitigation strategies. The conclusion highlights the importance of international cooperation and long-term sustainability practices to achieve significant reductions in global carbon emissions.
|
By breaking down the task, you get a more detailed and structured response, which can later be combined for a comprehensive overview.
Experiment with tone and style
Generative AI models can adjust their tone and style based on how you phrase the prompt, which is particularly useful when writing for different audiences. Experimenting with tone allows you to customize outputs for specific contexts – whether you need something formal, casual, humorous, or technical.
❌ Neutral tone
Explain how solar panels work. Ouput: Solar panels convert sunlight into electricity through a process called the photovoltaic effect. Photons from the sun knock electrons loose in solar cells, creating an electric current. |
✅ Personalized tone
1) Casual tone Hey, how do solar panels actually work? So, solar panels are these cool devices that turn sunlight into electricity. Basically, when sunlight hits them, it shakes up electrons in the cells, and boom, you’ve got power. 2) Formal tone Provide a detailed explanation of how solar panels generate electricity. Solar panels function by harnessing sunlight through the photovoltaic effect, wherein photons from the sun’s rays dislodge electrons within semiconductor materials, resulting in the generation of an electric current that can be utilized for power. |
In addition, instead of adjusting the wording of your prompt to imply a tone, you can simply specify the tone or style directly, such as “explain how solar panels work in a casual tone” or “explain how solar panels work in a formal tone”.
Iterate and refine
AI is powerful, but it’s not perfect. Often, you won’t get the exact result you’re looking for on the first try. This is where iteration comes into play. By slightly tweaking your prompts and refining them, you can guide the AI closer to your desired output. You might start with a general question, see what the AI produces, and then refine your prompt based on what worked or didn’t.
❌ First prompt
Describe a beautiful sunset. Ouput: The sky turned orange as the sun set over the horizon. |
✅ Refined prompt
Describe a breathtaking sunset over the ocean, focusing on the colours in the sky and the reflection on the water. Output: The sun dipped below the ocean, casting brilliant shades of pink, purple, and gold across the sky, while the calm water mirrored the vibrant colours in a breathtaking display. |
Use examples
Sometimes the best way to get what you want from an AI is by giving it a direct example of the type of response you’re looking for. This is especially useful for complex or nuanced tasks where the AI may struggle to interpret your needs. By providing examples of both “good” and “bad” outputs, you give the AI a reference point for the kind of results you expect.
❌ Prompt without an example
Write a product description for a luxury watch. Ouput: This watch is elegant and stylish. |
✅ Prompt with examples
Write a product description for a luxury watch. Example: “Crafted with precision, this watch features a sapphire crystal face and a gold-plated case, exuding timeless elegance.” Output: This luxury watch combines exquisite craftsmanship with modern design. Featuring a sleek sapphire crystal face and a hand-polished gold case, it’s a statement piece for those who appreciate the finer things in life. |
Guide with constraints
Adding constraints to your prompt is a great way to focus the AI’s output and avoid results that are too long, short, or vague. You can specify word counts, formatting requirements, or even the tone of the response. This allows you to tailor the AI’s output to fit your needs, whether you’re writing an article, generating product descriptions, or even creating dialogue for a chatbot.
❌ Prompt without constraints
Write a summary of the benefits of exercise. Ouput: Exercise has many benefits. It can improve your health, make you feel better, and help you stay in shape. |
✅ Prompt with constraints
Write a 100-word summary of the physical and mental benefits of daily exercise, using a formal tone. Output: Daily exercise offers numerous physical benefits, including improved cardiovascular health, muscle strength, and weight management. It also enhances mental well-being by reducing stress, improving mood, and boosting cognitive function. Regular physical activity is key to maintaining both physical and mental health. |
Near Partner, your partner for prompt engineering
At Near Partner, we can help you develop clear and specific prompts that ensure your AI provides accurate responses tailored to your project needs. This way, you spend less time troubleshooting and more time moving your projects forward.
We also offer training for your team on best practices in prompt engineering, empowering everyone to maximize the AI’s capabilities. If you need quick adjustments for ongoing projects, we can help you create dynamic prompts that adapt to changing requirements. Let’s team up to make your AI smarter!