Get startedGet started for free

Writing effective prompts

1. Writing effective prompts

Welcome back!

2. Garbage in, garbage out

Have you heard the phrase garbage in, garbage out? This has never been more appropriate than with using ChatGPT - if the prompt we provide doesn't contain sufficient context or isn't written in an easily-interpretable way, chances are it will lower the quality of the response.

3. How does ChatGPT interpret a prompt?

To begin forming a set of guiding principles for writing effective prompts, let's discuss how ChatGPT interprets prompts using an example. Here, we're asking ChatGPT to write a job description for a data scientist based in New York.

4. How does ChatGPT interpret a prompt?

First, ChatGPT identifies the broad topic of the prompt. In this case, the phrases job description, data scientist, and New York help the model identify that the prompt is about a job description for a specific role and location.

5. How does ChatGPT interpret a prompt?

Next, ChatGPT attempts to understand what the prompt is requesting. In this case, the verb, write, and job description indicate the task being given to ChatGPT. Data scientist and New York provide additional context to help populate the response with relevant information.

6. How does ChatGPT interpret a prompt?

Finally, the response is generated. This isn't bad for a first draft with little specific context. More context could be added to the prompt for greater personalization, such as key role-specific skills and company culture information. Let's use this understanding to begin thinking about best practices for writing prompts.

7. Prompt engineering

Prompt engineering is the process of writing prompts to maximize the quality and relevance of the response. Prompt engineering is a whole topic in itself, so in this video, we'll present the foundational best practices to get the most out of our ChatGPT prompts.

8. Writing tips for prompt engineering

The first guideline is to be clear and specific. This sounds like common sense, but we need to ensure that the prompt contains all of the necessary context to create the desired response. One common ChatGPT use case is asking it to summarize a passage of text. In the prompt, we should specify roughly how long we want the resulting summary to be: one page, one paragraph, or even one sentence. Second, keep prompts concise. This means removing any unnecessary information or linguistic frills that don't provide extra context for the task at hand - these extras will only dilute the important information and keywords. Finally, use correct grammar and spelling in prompts. ChatGPT uses grammar to interpret the task, so make sure to include it in all the right places.

9. Provide examples if necessary...

Another way to superpower our prompts is to provide examples. In many cases, this is a much quicker way of providing extra context than writing a comprehensive explanation of the desired results. For example, let's use ChatGPT to create a list of example customer names, ages, and occupations that we can use to test our internal systems. We want the results in a very specific format: the full name and age separated by a comma, followed by the occupation in brackets. We should provide an example in the prompt so ChatGPT understands exactly what we're asking for.

10. Provide examples if necessary...

In our prompt, we specify the instruction and also provide the example, John Smith, 34, and Builder in brackets.

11. Provide examples if necessary...

Because of the example in the prompt, ChatGPT outputs exactly what we want and in the format that we wanted it.

12. Let's practice!

Now you have the tools to begin writing effective prompts. Time to practice!