Prompt Engineering – Chapter 3: Best Practices

Chapter 3: Best Practices for Prompt Engineering

By now, you know what prompts are and how to write them in different styles. In this chapter, let’s cover some best practices to make your prompts consistently deliver great results.

Be Clear and Specific

Avoid vague instructions. A well-structured prompt gives the model a clear path to follow.

Bad Prompt: Explain AI.

Better Prompt: Explain artificial intelligence in 3 sentences as if you are teaching a high school student.

Use Context

Provide the model with enough background information to guide its output.

Example:

You are an expert data scientist. Summarize the benefits of using cosine similarity for recommendation systems.

Iterate and Refine

Prompt engineering is iterative. Experiment with phrasing, formatting, and structure to get better results.

Set Output Constraints

If you want a list, code block, or table, explicitly request it.

Example: Provide 5 bullet points summarizing the benefits of clean energy.


πŸ’‘ Tip

Use prompt templates to save time. For example, create a standard template for generating blog post outlines, so you only need to change the topic each time.

🧩 Quick Quiz

1. Which of the following is NOT a good best practice?

  • A. Provide context
  • B. Be vague and generic
  • C. Iterate and refine
  • D. Set output format
Show Answer

B. Be vague and generic β€” this leads to unpredictable results.

2. Fill in the Blank: Providing background information in your prompt is called adding __________.

Show Answer

Context.

3. Reflection: Write a prompt template you could reuse for generating social media posts about new product launches.


Navigation

β¬… Back to Chapter 2: About Types of Prompts

➑ Go to Chapter 4: About Advanced Techniques

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top