Prompt Engineering Guide
😃 Basics
💼 Applications
🧙‍♂️ Intermediate
🧠 Advanced
Special Topics
🌱 New Techniques
🤖 Agents
⚖️ Reliability
🖼️ Image Prompting
🔓 Prompt Hacking
🔨 Tooling
💪 Prompt Tuning
🗂️ RAG
🎲 Miscellaneous
Models
📝 Language Models
Resources
📙 Vocabulary Resource
📚 Bibliography
📦 Prompted Products
🛸 Additional Resources
🔥 Hot Topics
✨ Credits

🟢 How to Create Effective Prompts: Essential Tips and Best Practices

🟢 This article is rated easy
Reading Time: 8 minutes

Last updated on October 24, 2024

Last updated on October 24, 2024 by Valeriia Kuka

Introduction

In the previous document, we introduced the concept of Prompt Engineering and provided you with some examples how it works. Now, you're probably wondering: why do these examples work, and how can you start improving your AI outputs?

This guide covers easy, actionable tips that will quickly boost the quality of your AI's responses—whether you're using it for writing, coding, or image generation:

  1. Start with clear and specific prompts
  2. Experiment with prompt variations
  3. Add context for better results
  4. Iteration and refinement
  5. Leverage prompting techniques
  6. Conclusion: practice, refine, and iterate
  7. FAQ
Tip

If you want to dive deeper into creating high-quality prompts, learn how to effectively communicate with AI.

1. Start with Clear and Specific Prompts

Effective prompts start with being clear and specific. Generative AI only responds to the instructions you provide, so the clearer you are, the better the result.

Be Direct

Vague prompts lead to vague answers. Make sure your prompt directly addresses what you need.

Astronaut

Vague Prompt


Write something about climate change.

The response may be too general or not specific to your needs.

Astronaut

Clear Prompt


Write a 100-word summary of the impact of climate change on coastal cities, focusing on rising sea levels.

This is focused and guides the AI to a specific answer.

Best Practices:

  • Use plain, concise language: Avoid unnecessary jargon or complex sentence structures unless needed.
  • Avoid ambiguity: Make your request clear by stating exactly what you want.

2. Experiment with Prompt Variations

How you phrase your prompt can change the outcome. Experimenting with different variations helps you find the best approach.

Test Different Formats

The format of your prompt matters. You can present it as a question, a command, or an open-ended statement. Each will guide the model differently.

  • Example of a completion prompt:
Astronaut

Completion Prompt


The sky is

Robot

AI Output


blue.

  • Example of an instruction prompt:
Astronaut

Instruction Prompt


Complete the sentence: The sky is

Robot

AI Output


blue during the day and dark at night.

  • Example of a question prompt:
Astronaut

Question Prompt


What color is the sky during the day?

Robot

AI Output


The sky is blue during the day.

Refinement through Iteration

One of the core techniques in prompt engineering is iteration. Start with a simple prompt and refine it based on the results. Add clarity or context with each iteration.

  • Example of an iterative refinement:
Astronaut

Initial Prompt


Summarize this article.

Astronaut

Refined Prompt


Summarize this article in 3 sentences, focusing on the key challenges discussed.

Tip

Always review the AI’s response and tweak your prompt if the output isn’t quite what you want. Don’t hesitate to keep refining.

3. Add Context for Better Results

AI models perform better when they have more information about the task. By adding context, you can help the model understand what you want, making its responses more accurate and relevant.

Why Context is Key

Without sufficient context, the AI may make incorrect assumptions or provide incomplete responses. Adding background details, instructions, or guidelines allows the AI to generate a more tailored response.

  • Example without context:
Astronaut

Prompt without Context


Write a product description.

Robot

AI Output


This is a product.

  • Example with context:
Astronaut

Prompt with Context


Write a 50-word product description for wireless earbuds, focusing on sound quality and comfort for athletes.

Robot

AI Output


Experience superior sound with our wireless earbuds, designed for athletes. Enjoy powerful bass and a secure, comfortable fit during your toughest workouts.

Use Instruction + Context Format

One effective way to improve results is to combine specific instructions with context. This is especially useful in tasks like summarization or when asking the AI to perform complex tasks.

Astronaut

Prompt with Context


Summarize this email in one sentence.

Dear team, thank you for organizing the community event. It was a great success thanks to your hard work.

Robot

AI Output


The email thanks the team for their effort in organizing a successful community event.

Note

Giving instructions to generative AI model is among the first basic techniques you'll learn about in this basics guide. Read the next several docs to find it.

4. Iteration and Refinement

Prompt engineering is an iterative process. After receiving a response, you might need to adjust your prompt to get closer to the result you’re looking for.

The Iterative Process

Refining prompts is key to getting high-quality outputs. With each iteration, add or remove details to improve the response.

Astronaut

Initial Prompt


Summarize this book.

Astronaut

Refined Prompt


Summarize the book’s key themes in 2-3 sentences, focusing on the author’s viewpoint on personal growth.

Layering Instructions

You can achieve better outputs by adding layers of instructions that guide the AI’s behavior. The more specific your layers, the more tailored the result will be.

Astronaut

Prompt


Generate a product description for wireless earbuds. Use a formal tone. List 3 features and include a call-to-action.

5. Leverage Prompting Techniques

In the following docs, you'll learn about the important elements of a prompt and your first prompting techniques like:

As you become more comfortable with basic prompts, you can start experimenting with advanced prompting techniques to achieve even better results.

You will also learn about combining prompting techniques when dealing with more complex tasks.

6. Conclusion: Practice, Refine, and Iterate

Key Takeaways:

  • Start with clear and specific prompts.
  • Experiment with prompt variations and refine as needed.
  • Use advanced techniques like few-shot prompting and chain-of-thought for more complex tasks.
  • Add context for better results and iterate based on the AI’s output.

The more you practice and refine your prompts, the better your results will become. Start experimenting with the tips and techniques discussed in this guide, and see how your AI-generated outputs improve! Use our free video course, ChatGPT for Everyone, to learn more about tactics to write effective prompts and ChatGPT use cases.

7. FAQ

Why should I provide context in prompts?

Context helps the AI understand the task better, leading to more accurate and relevant outputs.

How can I improve my prompt engineering skills?

Experimentation is key. Try different prompt formats, add context, and refine your inputs based on feedback. The more you practice, the more effective your prompts will become.

Valeriia Kuka

Valeriia Kuka, Head of Content at Learn Prompting, is passionate about making AI and ML accessible. Valeriia previously grew a 60K+ follower AI-focused social media account, earning reposts from Stanford NLP, Amazon Research, Hugging Face, and AI researchers. She has also worked with AI/ML newsletters and global communities with 100K+ members and authored clear and concise explainers and historical articles.

Edit this page
Word count: 0

Get AI Certified by Learn Prompting


Copyright © 2024 Learn Prompting.