Skip to main content

The Fundamentals of Prompt Engineering

Lesson 3 from: Getting Started with AI Prompt Engineering

Mark Hinkle

The Fundamentals of Prompt Engineering

Lesson 3 from: Getting Started with AI Prompt Engineering

Mark Hinkle

buy this class

$00

$00
Sale Ends Soon!

starting under

$13/month*

Unlock this classplus 2200+ more >

Lesson Info

3. The Fundamentals of Prompt Engineering

Delve into the art and science of crafting precise instructions or questions for AI systems, ensuring desired outputs. Through this lesson, learners will understand the essence of AI prompts as vital inputs to models like ChatGPT, enabling the generation of human-like text based on given directives.

Lesson Info

The Fundamentals of Prompt Engineering

1 Prompt engineering is simply the act of creating prompts 2 for AI that allow you to get the result you want. 3 The better your input is, typically, 4 the better your output is. 5 And they can be as simple as a short question like, 6 "What is the capital of France?" 7 And since the capital of France happened 8 before September 2021, we would know what that is. 9 We could tell it to write a short story about a dog 10 and it would follow those instructions, 11 so there's a question and then there's a task. 12 And when you write a prompt, you wanna be specific, 13 you wanna give it context. 14 If you can, you wanna include examples, 15 you wanna break it down into steps when applicable. 16 You wanna constrain it, so how long is it, 17 how much information you need. 18 And let's look at a simple prompt and a complex prompt. 19 So here, we have two different prompts. 20 They basically are asking for you to write a LinkedIn post, 21 one is simple and it's one sentence, write a LinkedIn po...

st 22 about the importance of artificial intelligence. 23 The other one is very complex, it has lots of details. 24 It says that you're an AI expert, 25 that you want to share insights with your LinkedIn network. 26 It's comprehensive, so just to give an idea 27 of the difference, I'm gonna go back to ChatGPT, 28 I'm gonna use GPT-4 because I want it to be able to use web 29 and search the web, and I'm gonna say, "Write a post 30 about the importance of artificial intelligence." 31 Now, since I didn't give it a lot of direction, 32 it can be very, very creative. 33 And it's thinking on it, and thinking, I'm using air quotes, 34 'cause what it's actually doing 35 is calculating the probability of what the best answer is. 36 Notice it says, "At Peripety Labs," 37 my company is called Peripety Labs. 38 I told it in the instructions 39 that I have a company called Peripety Labs, 40 so it references that, and because I wanna share it 41 with my network, it did that. 42 So there's the result from that prompt. 43 Now let's cut and paste in the more complex prompt 44 and see what we get. 45 All right, this is the longer prompt. 46 And once again, it's calculating. 47 And it's a little bit different, 48 the last one seemed to have some bullets, 49 it has a different title, and it even goes as far as saying 50 that advancements don't even stop 51 with artificial intelligence, that quantum computing 52 is gonna have a role in that. 53 And it included some hashtags. 54 Let's compare that to what we got in the last time. 55 This one complete, also included hashtags, 56 but they're different. 57 So the difference here is really the amount 58 of creativity in the post. 59 And there's a little bit more creativity around this. 60 This one, the advanced one, has some actual references to, 61 you know, quantum computing, how it will be used, 62 and it's a function of the prompt. 63 Let's talk about system prompts. 64 And system prompts are just the initial prompt that you use 65 when you start a conversation with ChatGPT. 66 And in this sense, I'm using a role, 67 act as an artificial intelligence expert. 68 Then I ask it to write in English suitable 69 for a business person, so I'm putting a language requirement 70 in there. 71 Then I say, "Don't use any technical jargon," 72 because I'm putting a limitation in there, 73 I don't want it to use highly technical terms. 74 And then I put a length limitation in there, 300 words. 75 So this is really directing the output of your prompt. 76 There are lots of ways to restrict or box in your responses, 77 and as we saw before, you can make it very, very simple 78 and let creativity take its toll, 79 or you can provide this level of definition in your prompt, 80 and it'll focus your prompt to give you an answer 81 that you would expect. 82 It doesn't always work this way because part of the way 83 that ChatGPT works is it's based on probabilities, 84 it's not deterministic, so there is a little bit of variance 85 in the way that it does the output, 86 which is why it's so human-like to us, 87 because there's a lot of variance 88 in the way that we speak to each other. 89 So this is the overall understanding of how prompts work. 90 What I try and do is get to the point 91 where my prompts are ready for prime time. 92 And when they're ready for prime time, 93 I call them super prompts. 94 They've been tested and verified, 95 I'm getting consistent results. 96 And at that point, I save them into a notebook of sorts, 97 I use something called Notion. 98 You could use Google Docs, 99 you could use an Excel spreadsheet, 100 you could use whatever you use to organize information, 101 but this is how I organize my thoughts around prompts. 102 I've created a database with all the prompts that I use. 103 When they have a certain level of competence, 104 I could call them a super prompt. 105 Sometimes, I'll add notes in there 106 that says it requires ChatGPT 4 with web browsing 107 or web pilot plugins so that it can go out 108 and get information that's not contained 109 within the GPT model. 110 Even though it's formatted here, when you cut 111 and paste it in, it's gonna just be clear text. 112 But the thing that I like about it is that I'm formatting it 113 for me so I can keep my thoughts better organized. 114 And then once it's done, I just copy and paste it 115 and put it into ChatGPT.

Class Materials

CLASS MATERIALS

Super Prompts

Ratings and Reviews

Mayoon Boonyarat
 

It's a really good starting point and gives you an overview. The CreativeLive team is really fantastic to bring Mark here. You'll know that the most important skill is the prompt skill. Talk with AI.

Student Work

RELATED ARTICLES

RELATED ARTICLES