GPT-4 Prompt Engineering: Why This Is a BIG Deal!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
the context window of GPT for just doubled from 4000 tokens in chat jpt to now 8 000 or even 32 000 tokens in the biggest version so I want to talk about why I think this is a big deal and how this opens up for more things we can do so I want to show you some ways we can take advantage of this Improvement so let's just get started so the first thing I want to start with is I see there's some kind of confusion sometimes about the context length or the context window so I just wanted to quickly address this and show you a bit what I mean so we can say that thousand tokens is about 750 words that's like ish plus minus and you can see here the changes from chat GPT we went from 4 000 tokens that's the window to 8 000 tokens on one version of gpt4 and we have a 32k version too and as you can see here that's about 3 000 words in chat GPT and 25 000 words uh that's the biggest one 32k right so how is actually the com context window or context lengths working so let's take a look at that if we head over here hopefully you can see this now let me zoom in a bit so here you can see we have chat TPT we have 4 000 tokens here we have the same 32 cables in here and we put in here right 4000 tokens and you can see here on the top here I put my YouTube channel is all about AI I do that on both places right and if I go down here now and I type in in let's say chat gbt or gpt4 uh what is my YouTube channel name your YouTube channel name is all about the eye so the model now can look in this window it still has access to every context here because it's under 4K or 4K tokens so it can still understand that my YouTube channel is all about AI so what happens if we move on to let's say we add yeah you can say this right it's good you can see we add 6 000 tokens here now so we have 6 000 tokens here and we have the same here right but now you can see this part now ends up outside the token window right so my YouTube channel is all about AI it's it ends out outside the token window because chat GPD only can handle four thousand tokens right so when we go to and ask what is my YouTube channel name it's just gonna reply something like I can't find any information about any YouTube channel right but if we have the 32k version that's no problem this is still way inside the context window so here we get the correct answer right and that is basically what I want to show you because I've seen there's been some confusion about this uh but also you got to remember that the input and the output is the window right so if you put in 10 000 tokens and you get 10 000 back as an answer then the context window then you have added 20 000 tokens right so I think this gave you some information about how the context window work so we're gonna take a closer look at some use cases now so the first thing I want to do is just take my latest YouTube video and turn it into a blog post or an article call it what you want just by using the big context window we got in gpt4 so I'm just gonna show you how I do this so the first step was to just take my YouTube video and turn it into an MP3 file so we only have the audio then I went over to this very simple python script I created here with open a eyes whisper that is basically just a transcribe API just put my file name here.mp3 and when I run this I will get every word I said in the video in text form right so basically I'm just gonna run this now and let this finish okay so that was done took about I don't know 45 seconds you can see here now we have a text file here with every single word I said in the video so that's perfect so we can use in gpt4 now let's move on to the second step and that is just gonna be head over to my website and copy every single word for a similar article I have written before so I get the format style right just copy all of that and just paste it into a Word document and then we can do our final step and that is gonna be heading over to Mid Journey's homepage I'm just gonna copy some information here about their newest model version 5 because I think we need some context for the article or blog post and that is basically all I need and now let's head over to gpt4 so I didn't want to waste your time so I just went ahead and prepared this so I just started with here's some info I want you to read then I pasted in the whole previous old article I have written so I get the format down right that was basically the whole article and it just just answer me with red if you have read article so we just get back that this helps us save tokens right if gpt4 is going to give us a big answer back from everything we put in then we're just gonna lose some tokens this is a way to save some tokens and here are some information about mid Journey 5 I just put in some info here about major Journey 5 we get a red back and here is some more information I want you to read and this was basically you remember my transcript so here you can see this is every word I said in the video so just fed That Into gpt4 You can see how long this is and it still can read it right then I go on to create my prompt so here I just go now with all the information you have read I want you to write an in-depth article named gpt4 plus mid Journey V5 the future of photo in the style of our ioscope when Tech writer include details from the information I gave you above okay so that's a good start I think and you can see here the title future of Photography so it changed that a bit got some subtitles we got a I think it was an okay introduction we got section one that was gpt4 and Midian was a match a match made in Tech heaven and it just talked a bit about gpt4 and mid joining V5 and showcasing the power and we got the impact of the photograph industry and we ended up with our conclusion and I read through this and it was quite good actually it only used from our context window above this is pretty much not using nothing from the foundation model and I think I can say that basically this content that the AI wrote for me or gbd4 wrote for me is pretty much my own content since I generated the video right but I wasn't too happy about section one so I just continued great can you elaborate more on section one include more about gpt4 priming so that's what I really wanted to going in the article because I wanted to talk more about gbd4 priming and then it did a really good job this this section was very very good it went deep into priming gpt4 for optimal prompt generation I'm Gonna Leave a link to this so you can read it if you want to and it was building constant contextual understanding that's important crafting detailed prompts iterative refinement and this was a very good section so I read through all of this and basically I didn't have to change anything because it took everything from my transcription from the video and just built on that and it turned out very good actually so I was pretty happy with that then I just wanted great can you elaborate more on the conclusion write it in a purse for first person view because I think the conclusion was a bit thin up here so I wanted a bit more and it gave me a four five paragraph conclusion that was very in-depth and I think I took out one paragraph and I started to keep the rest just did some small adjustment but I basically kept the whole thing that was basically it I went to Mid journey I created some images I added my video so let's take a look look at how this turned out so you can see here yeah I kept the intro I kept the section from priming building contextual understandment I added some images right I added some examples that I had to do myself of course but I was quite easy and we got this in-depth conclusion how long did I spend on this I will say I spent about 20-30 minutes to turn this up and I gotta say it was a really good article and it covered everything I wanted the big advantage of this is that you when you can put in all let me Zoom this out a bit so you can see when you can put in all these contacts here you can never do this in chat TPT it will never remember the first things up in here in chachibiti it would just lose context right so that is why I think this is so powerful because you can put in so much information about what you want to do so you can take advantage of the context window and use all that in information to basically you don't have to use anything from the foundation model just some small things and then you can say that the article is very much not it's a i generated but it's not the content is not from the Foundation model right so let's just run this for fun through the through the AI detection tool so I'm here just at the open ai's own text classifier and I pasted the whole article inside here so let's just check it the classifier considers the text to be very unlikely AI generated right so I think that's the best score you can get yeah very unlikely I know it was written by AI but all of that context that I added basically used nothing from the foundation model that is I think it's a great use case for this I wanted to show you one more because I want to don't want to drag the video on so long but I might be doing some more on my membership if you are interested so let's just take a look at one more use case I want to show you so I just wanted to take all the text from the research or the compressed research paper from gpt4 so I copied all of this text here even the exams and everything everything a single bit of text here and and I went over to gpt4 and I just went here are some info for you to read so I pasted in all of this text but as you can see I want to show you a trick here so I didn't paste in everything at once I split it in two that's not a token issue that's more of a window issue in chat repeat uh you can paste in all the Tonk tokens but the window needs some kind of space so I just split the text into and paste it into different sequences and I just just answer it read and I got to read and I pasted the second half right so now we have every single word on the gptt compressed technical report right now I want you to create a quiz test with fix 15 questions about the content above the test should be for students in machine learning so I expect gpt4 Now to create some difficult questions right so let's just run this so let's just take a quick look at some of the questions so remember this was for students in machine learning what are some of the biases and limitations that gpt4 may have in its outputs how has open AI work to improve the safety and alignment of gpt4 compared to previous models explain the two main parts of gt4's training process pre-training and reinforcement learning with human feedback okay so this seems a bit more advanced so let's see what happens if we change this we don't need 15 questions let's go five and let's do it for fourth graders let's see what we get then foreign this was just great this was so wholesome so let's have a look here so it goes creating a quiz test suitable for fourth grader based on the con content provided might be challenging as the information is quite Advanced however I'll do my best to simplify the questions while keeping them relevant to the text so what is the name of the AI language model we are talking about gpt2 345 so that's good what does gpd4 do help people cook drive cars play video games answer questions and give information is GPT perfect yes it never makes mistake no it can't make some errors no it only knows about sports so that was a good one what is one thing that gbt4 should not help with making friends doing homework creating weapons learning new words uh should it could it help you make friends that was a bit strange but I think C is the correct answers this was very wholesome but I think this kind of showed how we can take this large content window and turn it into something cool but this is just of course scratching the surface right this is just a tip of the iceberg so I'm gonna be exploring um more of this later uh I haven't really gotten around to I have a good idea but I'm not gonna spoil that yet so I think that's it for this one so I hope this video gave you some inspiration of how you can take advantage of the new context window length so if you want to dive deeper into this check out the link in the description to my membership where I will be doing some videos on this coming up and check out this video here if you enjoyed this one and as always have a great day and I'll see you in the next one
Info
Channel: All About AI
Views: 72,127
Rating: undefined out of 5
Keywords: gpt 4, gpt-4, gpt 4 prompt, gpt 4 prompt engineering, gpt-4 context, gpt 4 context window size, gpt 4 context length, openai gpt 4, prompt engineering
Id: WuRPFzx6Ti0
Channel Id: undefined
Length: 13min 41sec (821 seconds)
Published: Mon Mar 20 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.