
#openai #gpt4 #chatgpt #programming #python #javascript
--- type: transcript date: 2023-05-04 youtube_id: t94s5apFres --- # Transcript: System Prompts in GPT-4 all right in this video I wanted to talk to you about system prompts and some of the neat things that you can do with them so I'm going to show you a few examples um sort of live examples here within the openai playground and then I'll also show you presumably how it's already being incorporated into some products that are live out there so the system prompt if you're interested in trying this out you can go to platform.openai.com sign up for an account if you haven't already and then just go to their Playground now depending on what you have access to I've requested access over a month ago for gpd4 and I do have access for gpt4 through this other users please let me know your experience like do you have gpt4 within the playground if you haven't uh directly signed up for it just sort of curious to see the landscape of who has it or who doesn't when they try and do this so now the thing with the system message is it's a message that you can instruct the llm and the system message is weighted a lot higher in gpd4 than it is in other models like 3 and 3.5 and the thing with the system message is so you might have seen examples where someone might say you are this type of assistant so you're an accounting assistant or you're a developer assistant or whatever the field might be you know you're a dietitian you know like you'll provide meal plans when people are asked so I've seen a lot of instances like that but the thing with system messages that is pretty cool is you can have it do things where you can ask for output back to get more consistent responses so an example of this is asking for responses in Json so right now they come back as text as everyone's seen with Chad GPT and whatnot but if I just say okay you are you are an API so let's just do a little bit of a thought experiment so let's say what if we didn't have back ends um sort of a bit of a crazy example but what if all of a sudden everything that goes into setting up a back end we could just get through an llm so what if I said okay you're an API you will always respond in Json and the schema of the response will have just one key named response so I could go a lot more into depth maybe there's like specific um uh like a specific schema that I want or maybe go a bit further and make it specific like you'll respond Json with this response key and it will be about this subject and return it in this format so now if I go ahead and ask a message and I'll just say something I won't eat I won't you know reference anything that I just said um but um just imagine this was in something like chat GPT where say you just select it you know you want to interact with the Json endpoint so if I say what are the lyrics to the most popular David Bowie song let's say hypothetically we have an app where you can just ask it questions and see what potentially could come back from it so I'm just going to make sure I have the right model selected and now this is still in beta so let's hope that this works so right here so we do have the response based on the system message and then we do see the lyrics coming back now I'm not going to validate these but it does have sort of a response that's similar to what you would expect from something like John gbt but right off the bat it's it's nice because you can say okay now I know I have I can expect it in a particular format so it doesn't finish because I don't have the length cranked up on here but you can imagine if it did it would just sort of close it out here so just to sort of get you thinking about this on how you could potentially use this so Forefront is a a company that I came across that has a pretty interesting use of these system messages and now I don't know the back end of their code or how they're setting this up but I just sort of assume this is what they're doing so if you get a really good and detailed system message and not even just a good one let's just say like an approximation of one that's you know within the realm of acceptability let's say so if you just say okay you are a senior software developer you have many years of experience you know you'll you'll respond with code Snippets and whatever it might be right so in these examples what this company has done has basically taken some of these mythical characters like from Harry Potter or famous athletes or just sort of General professions like you saw at the Top If you're trying to do something within productivity and one that's sort of neat I I think is about history you could talk with philosophers of the past or celebrities and sort of get a sense so the cool thing with how this works and this interface is you can be like hey um Ray Charles you know why did you write this song you know could you give me a little bit of backstory or hey Oprah like what was it like to you know have thousands of shows and you know what was your favorite interviewer stuff like that um so it's pretty neat um you can at them within here but you can also just select it here and you can see it sort of has a chat gbt like experience here you can also go down here and you can change the model so and the cool thing with this is this is a free version right now so I'm showing you what is a completely for free you can go and look at it yourself but I sort of wanted to tie this into the system message so I'll give you an example on how you could do it to you know play around and maybe push the limits and see you know what uh things you could use it for like you know maybe you want to use it for a Json response or you want to have it be a code generator like only generate HTML files that have inline styling and JavaScript or whatever like there's so many possibilities with what you can do and you can sort of have that behind the scenes so the thing with system messages is if you think about this system message in the context of this this is sort of their proprietary information so how they set up this system message for the senior software developer you could do something similar and you could say if you have a really good prompt you know and you're like I crushed it this is going to be you know like the the best way if you want responses from someone that is just like a senior developer um you can you can throw it in and sort of do what they did and sort of make a a neat neat product out of it so if I just say like give me react boilerplate so this video is not really meant to be a example holy on Forefront it's a really cool product as you see here great that there's a free option right now that you can play around with but I thought when I first saw it I was like damn this is a a cool implementation of the system message probably one of the coolest ones that I've seen yet so if I just exit out of here again you can see like this is something that can just really scale you know you can start to add you know maybe instead of four CEOs you can add you know all the CEOs in the S P 500 and you know maybe in future iterations of this have uh CEOs have conversations with one another or maybe have a round table you know have a discussion with multiple um uh you know CEOs interpretations of CEOs I should say so anyway I'm gonna leave it at that system messages highly recommend that you take a look at this it's a really cool thing there's some examples out there but I'd love to see more people sort of pushing the boundaries on how they're implementing this and I'd love to see what you're building uh or what what use cases you might think of having something like this behind the scenes and how it could improve how you're using GPT 3.5 gpd4 so let me know in the comments what you're doing if you're doing anything interesting or or cool with us but otherwise if you like this video please like comment share and subscribe and until the next one
Technical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.
Weekly deep dives on AI agents, coding tools, and building with LLMs - delivered to your inbox.
Free forever. No spam.
Subscribe FreeNew tutorials, open-source projects, and deep dives on coding agents - delivered weekly.