Writing effective prompts for ChatGPT
Learn what a prompt is and the key components of writing an effective one.
2024-11-30
This tutorial is the sixth lesson of our free 'Learn how to use ChatGPT' course and we will cover:
- What is a prompt and why is it important?
- What makes a great prompt?
- Examples of well-written prompts for various tasks
- Troubleshooting common prompt-writing mistakes
Now that you’ve gotten familiar with ChatGPT and have experimented with its capabilities, it’s time to learn some techniques that will help you really level up your ChatGPT game — and it all starts with writing effective prompts.
What is a prompt, and why is it important?
A prompt is the question or instruction you give ChatGPT to initiate the interaction. With AI assistants like ChatGPT, it’s very much a case of “you get out what you put in”. The way you prompt an AI assistant can significantly influence the quality of the results you get.
Prompts are crucial for several reasons:
- Setting the stage: Your prompt is like the opening act of a play - it sets the tone for the entire interaction.
- Providing context: The more context and detail you include in your prompt, the better ChatGPT can understand your needs and provide relevant, accurate responses. Especially important when dealing with complex or niche topics.
- Guiding the output: Remember, you get out what you put in. If you want a concise answer, specify that in the prompt. If you need a step-by-step explanation, say so.
- Establishing roles: Experiment with telling ChatGPT what role you want it to play - expert teacher, writing assistant, coding guru… It can help shape the responses and style of reply.
What makes a great prompt?
Here are some tips:
- Be clear and specific
- Provide enough context and detail
- Use simple, concise language
- Break down complex tasks into step-by-step instructions*
- Specify the desired format or style of the output
- Provide examples
- Use delimiters to indicate distinct parts of the input
Let's take a closer look at some specific components that make prompts effective.
Being clear and specific
“Help me write a 500-word blog post about the benefits of yoga for stress relief” is a clear prompt, but it could be more specific.
Example prompt:
Help me write a 500-word blog post about the benefits of yoga for stress relief.
Providing enough context and detail
Providing relevant information, such as the target audience, specific requirements, or constraints, will make sure the response is tailored to your needs.
Example prompt:
“Help me write a 500-word blog post about the benefits of specific yoga practices, like Hatha Yoga and mindfulness meditation, for stress relief, targeted at busy professionals. Include evidence from recent studies to support this. Also, include some practical tips - as a bulleted list - on how these can be integrated into a hectic daily schedule.”
Example prompt:
Act as a certified yoga instructor with a background in psychology. You’re tasked with writing a 500-word blog post…[continue with the prompt from the previous step]
Desired format or style
If you have a specific format or style in mind for the output, mention it in the prompt. This could include the tone, language style, or any structural preferences.
Example prompt:
The 500-word blog post should be broken down into distinct sections, defined by headings. The post should be optimised for the keywords “Can yoga help with stress” and “yoga for busy people”.
Provide examples (and use delimiters)
ChatGPT thrives when you provide relevant examples for it to reference. It can create far more aligned generations based on the reference material you provide vs. long descriptions. As a bonus, when you’re providing examples, using delimiters to demarcate them is even more powerful.
Example prompt:
Here is a sample of yoga articles for reference when creating the 500-word blog post. Please structure and format the blog post to match these examples:
<article> insert first article here </article>
<article> insert second article here </article>
By including these key elements in your prompts, you'll be able to:
- Communicate your needs more effectively
- Tap into the AI's vast knowledge base
- And receive high-quality, relevant, and insightful responses that meet your specific goals and requirements
Let's see what all of those elements look like together using some examples.
Examples of well-written prompts for various tasks
Fitness routine:
Act as an expert personal trainer tasked with creating a personalised workout plan for me. I'm a 25-year-old man looking to lose 15 pounds and build lean muscle. Please provide:
1. A 4-week workout plan, including exercises for each major muscle group
2. Recommended number of sets and reps for each exercise
3. Tips for proper form and technique
4. Suggestions for progression and avoiding plateaus
Please ensure the plan is suitable for someone with a busy work schedule and limited access to gym equipment.
Trip planning:
Act as an experienced travel agent tasked with planning a 7-day couples' getaway to Italy. We're interested in visiting Rome, Florence, and Venice. Please suggest:
1. Accommodations that are romantic and centrally located in each city
2. A daily itinerary that includes major attractions, hidden gems, and leisure time
3. Recommended restaurants that showcase local cuisine
4. Transportation options between cities
Please keep the budget in mind and provide cost-saving suggestions where possible.
Business strategy:
Act as an expert business consultant tasked with creating a marketing strategy for the launch of a new e-commerce store. The store sells eco-friendly home goods, and the target audience is environmentally conscious millennials. Please provide:
1. A breakdown of the key marketing channels and tactics to focus on
2. Suggestions for content creation and social media engagement
3. Ideas for partnerships and influencer collaborations
4. A timeline for implementing the strategy leading up to the launch
Please use a professional tone and include relevant marketing terminology.
Essay writing:
Act as an experienced academic writer tasked with creating an outline for a 1500-word essay on the theme of power in Shakespeare's "Macbeth". Please provide:
1. An introduction that presents the main argument or thesis statement
2. Three main body paragraphs, each focusing on a specific aspect of power in the play
3. Textual evidence and quotes to support each point
4. A conclusion that summarises the main argument and offers a final insight
5. A list of potential secondary sources to consult for further research
Please use a clear, structured format and include transitions between sections.
Technical explanation:
Act as a knowledgeable IT professional tasked with explaining cloud computing to a non-technical audience. Please provide an 800-word blog post that covers:
1. A simple definition of cloud computing and its main characteristics
2. The three main service models: IaaS, PaaS, and SaaS
3. Real-world examples of cloud computing in action (e.g., Google Drive, Netflix)
4. The benefits of cloud computing for businesses and individuals
5. A brief discussion of potential challenges and security concerns
Please use a friendly, informative tone suitable for readers with no prior knowledge of the subject. Include a brief explanation of key terms and concepts.
HR policy:
Act as an experienced HR manager tasked with drafting a flexible work policy for our company. Please provide:
1. An overview of the different types of flexible work arrangements (e.g., remote work, flexible hours)
2. Guidelines for eligibility and approval processes
3. Expectations for communication, availability, and performance management
4. Considerations for maintaining team cohesion and company culture
5. A plan for implementing the policy and training managers on best practices
Please use a clear, concise, and empathetic tone that balances employee well-being with organisational goals.
These examples demonstrate how to create well-crafted prompts that provide clear objectives, necessary context, desired formats, and step-by-step instructions for ChatGPT to follow, enabling it to generate high-quality, relevant, and actionable responses.
Troubleshooting common prompt-writing mistakes
When writing prompts for AI assistants like ChatGPT, it's common to make mistakes that can lead to less effective or relevant responses. Here are some common slip-ups:
- The objective (the purpose of the prompt) is too vague.
- You don’t provide enough relevant background and/or constraints.
- The prompt isn’t written in clear steps. (not including working with GPT-o1)
- The format you want the response in isn’t defined - structure, style, length of the output, etc.
- You use an inconsistent tone throughout the prompt.
- You overload information and include too many unnecessary details.
- You don’t mention who the output is for (the intended audience).
- The prompt doesn’t establish a persona or expertise, e.g. "Act as an expert [profession]".
- You don’t include enough context or details.
- The prompt contains typos or missing info.
It’s a pretty long list we’ll admit, but you can experiment with different prompt crafting techniques to see how the quality of your input affects the quality of the output. Remember, the more effort you put into your prompts, the better the results you'll get!
In the next lesson, we’ll explore advanced techniques for how you can customise your ChatGPT experience to better support your personal and work tasks.