transcript

All About AI - ChatGPT: 5 Prompt Engineering Secrets For Beginners

Thumbnail of the video “All About AI - ChatGPT: 5 Prompt Engineering Secrets For Beginners”
Download Markdown
Community upload. AI output has not been independently verified.

ChatGPT Secret Prompt Hack Intro

Today I want to share five very good tips when you are starting out with prompt engineering in ChatGPT or other language models, and we're going to go through how I create my prompts, including all of these tips. So let's just get started.

Prompt Engineering

Okay, so the first important thing we need to look at when considering prompt engineering is context. Context, context, context. This is super important. Contextual relevance is crucial for generating coherent and accurate responses from ChatGPT. If we provide enough context, that will help guide ChatGPT and it will really improve the quality of the generated content. If we don't have enough context, ChatGPT might try to generate a response that is off topic, or it could be relevant but inconsistent with the goal of our prompt. Therefore, it's crucial to consider contextual relevance when we are designing our prompts.

Let's head over to ChatGPT and look at this. Here we have the prompt: generate a list of interview questions for a software engineer job in a tech startup with a fast-paced culture for an entry-level position. Break down the prompt and identify the contextual relevance. The three contextual relevance elements created in this prompt were the software engineer job, the tech startup with a fast-paced culture, and the entry-level position. Those are very important contexts when we are designing this prompt. So I would say the more contextual relevance you can add to the prompt, the better the prompt will be.

Okay, so now let's run the prompt and see what this comes back with. As you can see, we now have 10 different questions that could be interview questions. Let's have a look at a few of them. Can you explain a technical concept you learned recently? How do you keep up with the latest technology advancements in software engineering? Can you describe your experience with version control systems such as Git? Yeah, that looks good.

ChatGPT Prompt Engineering Tip 1

Now let's check out our next tip. Next up, we have setting a task for ChatGPT. The task definition sets a specific goal or objective for ChatGPT to achieve. This requires a clear understanding that the task is crucial for designing an effective prompt, and the task definition should be specific and avoid ambiguity or vagueness. The task definition should always align with the model's or ChatGPT's capabilities. So let's say we had a large language model, different from ChatGPT, that only could produce code. Then there's no point giving it a task to write an essay. You get the point, right? A clear task definition helps ChatGPT understand what it's supposed to do, and it will improve the quality of the generated content. Therefore, task definition is a crucial factor when we are designing our prompt.

Let's head over to ChatGPT again and look at this. Let's say we have the prompt: write a romantic comedy screenplay. The main characters must be in their 20s. The story must take place in a small town. The main plot should revolve around the two main characters overcoming obstacles in their relationship, while humorous situations complicate the story. The screenplay should include at least two songs. So let's break down the prompt into task definitions. As you can see, our prompt includes five different tasks: create two main characters, set the story in a small town, write a plot that revolves around the main characters, include humor, and integrate at least two original songs in the screenplay. These five tasks give us a very specific prompt. Let's run it and see what kind of output this generates.

Okay, this looks quite good. We have Joe, a handsome 25-year-old, that's one task, and we have Jessica, so we have both our main characters. There is some dialogue here. I guess it's supposed to be funny. Here we have song number one, "Small Town Love." Yes, that was part of our tasks. I'm not going to read this here. Here we have song number two, "Small Town Dreams." Yes, I think this filled up all our tasks. Let's have a quick look: yeah, we have the two main characters, it was set in a small town, and it included two songs. Perfect. Now let's look at our next tip.

ChatGPT Prompt Engineering Tip 2

The third tip we have is specificity. This is important and refers to the level of detail and precision we have in a prompt. The more specific the prompt, the more likely it is that ChatGPT will generate a targeted and very accurate response. To achieve this specificity, important details such as the type of journey or question, the starting or ending points, characters involved, or any relevant background information should be specified. If we have vague or general prompts, they can often lead to off-topic, irrelevant, or inconsistent responses from ChatGPT. Therefore, specificity is crucial when we are designing our prompts, because it improves the quality and the relevance of the generated content.

So again, head over to ChatGPT and take a look at this. The prompt here is: write a story about a character who embarks on a quest to find a lost magical artifact. Describe the journey they take, the obstacles they face, and how they eventually find the relic. Be sure to include elements of adventure, suspense, and danger, as well as details about the characters and the mystical creatures they may encounter along the way. Break down the prompt to analyze its specificity.

Okay, so here we have our story. Let's take a quick look at some of what we wanted. We have a main character, Arya, I think, yeah, Arya. We have some obstacles they faced along the way, and I saw that: they faced an army of dark creatures, dark caves, ancient ruins, and scorching rivers. Every step of the way they were met with new challenges and obstacles, so that was good. It seems like there's danger and suspense included in the story too, so I can see they've included everything we asked for. That was very good. Now let's take a look at our last tip.

ChatGPT Prompt Engineering Tip 3

The fourth tip we have is iterations. Iteration is a crucial part of the prompt design process, because prompt design is always an iterative process that may take multiple attempts when we are trying to create an effective prompt. These iterations involve refining and improving the prompt through cycles of design, testing, and evaluation, and each iteration should be guided by the results from the previous trials. Let's say we revisit the prompt to provide more specific instructions or additional context after we discover it was too vague, or ChatGPT generated an off-topic response. Embracing an iterative approach allows for continuous improvement and optimization of the generated content. I would say iteration is important to consider when you are designing your prompts. It's very easy to just say "write an essay about X" and stop there, but you always need to iterate so you can go back and change what you want to do.

We're going to take a look at that in the next step, which is how to design a prompt with these four factors we have looked at now in mind. Let's look at a prompt that has taken these four factors into account. This is what it could look like. We're going to break it down, but let's just start by looking at it: generate a 300-word article for a personal development website that provides a comprehensive guide to increasing productivity. The article should cover various strategies and techniques and be written in a clear and concise style accessible to its general audience. To support your advice, utilize research and expert opinions from credible sources like academic journals and productivity experts. You should also incorporate relevant statistics, examples, and case studies to illustrate your points and bring the advice to life. Consider the potential challenges and obstacles in increasing productivity and offer strategies to overcome them.

This prompt took all the previous factors into account. What is the context? The prompt is for a personal development website providing advice on how to increase productivity. The task definition is to generate a 300-word article that provides a comprehensive guide to increasing productivity. The article should cover a range of strategies and techniques and be written in a clear, concise style accessible to a general audience. The specificity is to use research and expert opinions from credible sources, incorporate relevant statistics, examples, and case studies, and consider the potential challenges and obstacles to increasing productivity and provide strategies for overcoming them. Finally, we have the iteration guidance, which is what we're going to look at now. In the first iteration, focus on the importance of setting clear goals and prioritizing tasks, and discuss the benefits of goal setting. We have a second iteration, a third one, and a final one. What I'm going to do now is run this prompt and then go through these four iterations to see how much they improve our output.

Okay, let's run the prompt and see what we get back. Here we have it: our 300-word article about productivity. Let me copy all of this before we continue with the iterations. Head over to our Word document and paste it in, leaving some space for the paragraphs. Here is basically the article. Now let's incorporate the iterations. The first iteration is to focus on the importance of setting clear goals and prioritizing tasks, discuss the benefits of goal setting, and provide practical tips for setting and achieving goals. Let's copy that, head back to ChatGPT, and run the prompt. That looks good. Now we'll write an H2 headline for the passage. We have "The Power of Goal Setting." Let's copy that, find our section about goal setting, and make it our H2. Then go back to ChatGPT and copy all of this. That looks good. We've expanded from one paragraph to four just by iterating our first prompt, which looks very good. Now let's go on to the next one.

ChatGPT Prompt Engineering Tip 4 - 5

In the second iteration, analyze the benefits of time management techniques such as the Pomodoro method and calendar blocking, provide practical tips for implementing these techniques, and discuss how they can increase productivity. Over to ChatGPT, and paste that in. That was our second iteration done. Now we have a much more in-depth look at calendar blocking and the Pomodoro method and how they can help you improve your productivity. Go back, copy the part about the Pomodoro method, and we don't need a conclusion yet. That looks great. Now we have a much more in-depth discussion of time management.

Now let's incorporate our third iteration. In the third iteration we want to discuss the role of technology in increasing productivity. Consider both the benefits and drawbacks of using technology, and provide advice on how to use technology effectively to boost productivity. Let's copy that, go back to ChatGPT, and paste it in. Here we have our iteration about technology and productivity. Remove the part about what we just iterated, paste the headline, and paste in our paragraphs.

Now let's head over to the final iteration. In the final iteration, we're going to summarize the key takeaways from the article and provide a comprehensive guide to increasing productivity. Make sure to provide a clear conclusion and actionable tips for readers based on your findings. Paste that into ChatGPT and hit go. Here we have a very solid conclusion for our article, with key takeaways on setting clear goals, time management, and technology. This looks very good, so let's get that into our post and we are finished. Let's paste that in, and now we have our conclusion.

Now you can see we have a roughly 1,245-word post about how to boost your productivity. This shows how important it is to include and iterate your prompts after you've done the initial draft. We went from a 300-word article up to about 1,200 words, so I think this turned out very well. I hope this showed that spending a bit more time on your prompts can really pay off. Following up with iterations is crucial if your initial prompt isn't quite good enough and you didn't get the result you wanted. If you have good questions or iterations to follow up with, you can really get a good result, as we saw going from that 300-word article up to 1,200 words.

How to get better at prompt engineering

Hopefully this video gave you some inspiration. Be sure to check out my membership and my newsletter in the link below, and as always, check out this video if you enjoyed it. Thank you for watching, have a great day, and I'll see you in the next one.