Details
Last updated:
April 10, 2024
Category:
AI & Prompting
Do you want to get the best possible outputs from AI tools ChatGPT? The key is learning how to speak the ‘AI's language’ through prompt engineering.
In this guide, you'll learn the essentials of crafting prompts that AI can't help but give great responses to.
We'll cover what makes a prompt good or bad and show you proven formulas to get impressive output every time.
Prompt engineering is the practice of writing prompts that get the best possible results from AI tools like ChatGPT.
Prompt engineering is about learning how AI thinks differently from humans and using that to craft great prompts.
Although it sounds technical, it’s actually quite straightforward. You don't need to be technical to be a great prompt engineer.
A prompt is a set of instructions or a question given to an AI model to guide its response. It can be a single sentence or a longer passage with multiple components.
The goal is to provide enough context and direction for the AI to generate a relevant, coherent, and useful output.
This is a prompt:
But this is also a prompt:
Everything that you ask or instruct an AI is considered a prompt.
Well-crafted prompts set the model up for success, while poor ones lead to confusion and unhelpful responses. That’s why it’s important to engineer your prompts and think them through.
Instructing an AI isn't as simple as just asking it questions like you would ask a human.
AI models interpret language very differently from humans.
For example, if you request a ‘very good blog post’ or a ‘great email’ it’s hard for an AI to know what that means.
Asking an excellent writer from your team for a blog post would be enough. Also because the writer has the context of your company such as your target audience and the tone of voice.
These are all the things an AI is lacking and that’s what needs to be included in your prompt.
A good prompt is the one that provides you good output. This can be a short prompt or a more comprehensive one.
However, prompts that deliver good output often have a few things in common:
A good prompt should explicitly define the task you want the AI to perform and your intent behind it. Are you looking for an analysis, creative writing sample, tutorial, data summary? Spell it out directly.
For example:
The reason you want to be clear and straightforward is to leave no room for ambiguity.
Effective prompts provide enough context and background around the topic for the AI to fully understand the requirements. Offer relevant details about the subject, audience, use case, and other crucial background info.
For instance:
With this context, the AI knows to tailor its outputs for at-home, time-constrained, no-equipment workouts suited for office workers.
Guide the desired structure and format of the AI's response by stipulating things like:
For example:
The more specific you are about your formatting preferences, the better the AI can meet your requirements.
One of the most powerful ways to demonstrate expectations is to provide examples that illustrate the type of output you're looking for. This can be examples you create, or existing content to use as templates.
For instance, if you want the AI to mimic a particular writing style or document structure, you could say:
With clear guiding examples, the AI has a reference point to align its responses to your needs.
While there's no one-size-fits-all formula, following principles like these will help ensure your prompts are specific, comprehensive and easy for AI models to correctly interpret. The more thoughtful care you put into prompt creation, the better results you'll get out of the AI.
After covering what makes an effective prompt, it's time to look at specific prompting frameworks you can use to structure your inputs. Prompting frameworks provide reusable templates for clearly instructing your requirements to AI models.
Two popular options are the JTF framework and the RISEN framework.
The JTF framework categorizes prompts into defined roles, tasks, and output formats.
The JTF structure looks like this:
For example:
In this case, the role defines the persona and expertise level for the AI to adopt. The task specifies the content you want it to produce, while the format conveys your desired output structure.
The JTF framework is a great option for all kinds of uses. Its simplicity makes it an easy, versatile option for many applications.
RISEN is a great framework for complex and multi-step tasks. The acronym stands for:
RISEN helps break down complex, multi-step tasks. It covers the role for the AI, instructions, steps to follow, the desired goal, and any constraints.
For example:
Both frameworks provide preset templates to reduce ambiguity. The structure ensures you cover all crucial pieces like the AI's role, task details, requested format, and more.
The key is experimenting to find the right prompting approach for your use case. Over time, you'll develop frameworks tailored to the AI models and tasks you use most.
Getting AI to give you what you want can be tricky. Even if you write prompts carefully, the AI might misunderstand your meaning.
Let's look at solving the most common prompting issues.
If the AI's answer doesn't match what you wanted, don't get upset. You may need to try a few times.
This can happen because:
You can troubleshoot and solve this in a few ways:
Sometimes using vague wording or contradictions leads to bad results. Carefully review how you explained the task. Rewrite with specific details.
Sometimes it’s hard to phrase what the output should look like, an example will fix that. Provide an example of what you want the output to look like—this often solves the problem.
One effective technique is asking the AI directly why its response didn't meet your needs. You can pose a question like:
The AI's explanation often reveals misunderstandings. With this insight, you can rephrase for better results or ask the AI to rephrase the prompt for you.
If revising prompts doesn't work, start a new chat.
Previous context can negatively impact new prompts, especially if you never got the right results. A clean slate may improve results.
Another issue is inconsistent output. The first message was great, then it gets worse over time.
For example, if you instruct the AI to write a specific way initially, it can forget those instructions as the conversation continues.
Solutions:
Sometimes reminding the AI of original instructions helps. You can copy part of your initial prompt and say:
The longer chats go, the harder it is for the AI to stay consistent. Starting a new chat can lead to better, more consistent results.
In this guide we covered the crucial role prompt engineering plays in communicating effectively with AI models like ChatGPT.
Some key takeaways to keep in mind:
With these tips, you'll be able to get better results from AI that are more relevant and tailored to what you need. It takes some practice, but mastering this skill will help you unlock the full power of AI as a helpful tool.
No matter what kind of work you do - writing, analyzing data, coding, or anything else - learning how to prompt AI effectively will let you combine your own skills with artificial intelligence in creative and productive ways. So keep practicing and improving your prompts - the possibilities are endless!
Get a head-start by exploring our library of proven and expert-crafted prompts that you can directly copy and use in your work.
Details
Last updated:
April 10, 2024
Category:
AI & Prompting