Artificial Intelligence

Beginner’s Guide to Prompt Engineering with ChatGPT

Summary

Intro

Prompt Engineering is one of the highest-leverage skills that you can learn in 2023.

Whether you’re developing applications, producing content, writing blog posts, or doing any other work activity, this skill can speed up your workflow and help you achieve your goals faster.

And you don’t need any coding experience to get started with prompt engineering.

So, let’s talk about what prompt engineering is, why it’s important, and how you can optimize your ChatGPT prompts for better results.

Prompt Engineering: What & Why?

Prompt engineering is all about writing good prompts and good prompts lead to good results.

Here’s an example of a bad prompt:

Write a story about traveling

We can, for example, ask ChatGPT to write a story about traveling. If we do that we will get such a story, but it will be pretty generic, and it won’t be interesting to read because we gave a very generic prompt without any additional information in it.

Although the story that we get is not too bad, it still lacks specificity and direction. To make it more engaging and compelling, we need to provide additional context or focus.

Here’s an example of how we can adjust our prompt to get a better result:

Act as a storyteller.

Write a captivating story about a solo traveler who embarks on a life-changing journey through the vibrant streets of Tokyo, discovering unexpected friendships, cultural wonders, and personal growth along the way.

The story should be up to 1000 words

So here, I’m providing more information and context, and as a result, I get a way more detailed and specific story that is more useful to me.

And context is the most important part when writing prompts. That’s why prompt engineering is about writing good prompts by adding just the right information and context to clarify our goal.

The Core Elements Of A Good Prompt

So how do we write good prompts?

Every good prompt consists of 2 main elements — the goal of your prompt and additional context. The context is basically a piece of additional information that will help the AI language model to produce a better result for you.

And this context can be broken up into 2 parts:

Role

It’s quite common for many prompts to add a role, where you assign a role to ChatGPT so that it’s not a generic AI assistant anymore but that it’s now something more specific.

For instance, I can ask ChatGPT to help me manage an organization’s Twitter profile. But we could also specify an extra role, typically before the goal, and in that extra role I can help ChatGPT how it should behave by assigning it to a role.

I want you to act as a social media manager.

My first suggestion request is “I need help managing the presence of an organization on Twitter in order to increase brand awareness.”

Now adding such a role to your prompt is totally optional and it’s not needed for all prompts, indeed there are many other kinds of prompts where adding such a role simply isn’t needed or doesn’t make sense.

But for some prompts like this one here, adding such a role can make a lot of sense.

Extra Information

Now besides adding such an optional role, you can also add extra information to your prompt and it makes almost all responses better.

For example here, I can also add extra information, that the target audience of this organization is small to medium companies in the healthcare industry, and I also mention that it should be responsible for executing campaigns across other platforms as well.

I want you to act as a social media manager.

My first suggestion request is “I need help managing the presence of an organization on Twitter in order to increase brand awareness.”

The target audience of this organization is small to medium companies in the healthcare industry. You will be responsible for developing and executing campaigns across all relevant platforms, creating engaging content regularly.

As a result, we get even more specific output from it, which makes more sense to me and clearly targets the healthcare industry.

Adjusting results

So by adding a Role and Extra Information, we make our prompt better, but no matter how good your prompt is, you will always need to adjust the result, because the first output is just a starting point and it won’t always return exactly what you want from it. You need to ask follow-up questions to adjust the outputs of ChatGPT.

But, you don’t need to specify a role or extra information again in the follow-up questions, because ChatGPT remembers the chat history, so you can start asking follow-up questions without repeating yourself.

Which context should you add?

Add any information that’s important for your goal. Try to keep your extra information as short and focused as possible.

Include important keywords but avoid adding unnecessary information.

In most cases when you create a blog post or a tweet with it you might need to define the target audience.

You can also control the tone, style, and length in this case.

And avoid mixing topics in a single chat session.

Summary

So, there we go, folks! This was just a primer, a beginner’s guide to stepping into the world of prompt engineering. There’s so much more depth, techniques, and tricks to learn that can help you master this skill. You can also take a look at some awesome prompts to get inspiration.

More content at PlainEnglish.io.

Sign up for our free weekly newsletter. Follow us on Twitter, LinkedIn, YouTube, and Discord.


Beginner’s Guide to Prompt Engineering with ChatGPT was originally published in Artificial Intelligence in Plain English on Medium, where people are continuing the conversation by highlighting and responding to this story.

https://ai.plainenglish.io/beginners-guide-to-prompt-engineering-with-chatgpt-ae0a1721f6c4?source=rss—-78d064101951—4
By: Hayk Simonyan
Title: Beginner’s Guide to Prompt Engineering with ChatGPT
Sourced From: ai.plainenglish.io/beginners-guide-to-prompt-engineering-with-chatgpt-ae0a1721f6c4?source=rss—-78d064101951—4
Published Date: Wed, 21 Jun 2023 06:16:46 GMT

Leave a Reply

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