ChatGPT: Master Reverse Prompt Engineering

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so in today's video we are gonna take a look at a concept I have created that I have called reverse prompt engineering so basically what this is is that you take a text or a code or something else that you really like and try to turn it into a prompt that you can use for a more general purpose so we are going to take advantage of chat GPT when we try to accomplish this so I think let's just get started so as you can see here I have created this step-by-step template that we can use when we want to do some reverse prompt Engineering in chat GPT so let's just start off by step number one here so we are going to Prime the model now that's why we are going to use this step can we talk about reverse prompt engineering by reverse prompt engineering I mean creating a prompt from a given text so let's copy that and head over to chatgpt and in my new chat GPT plus let's just paste that and hit submit okay that was step number one Don let's take step two so that is just gonna be great can you give me a simple example of reverse prompt engineering again let's just paste that and submit so now you can see the model is starting to understand what we mean so you can see here like given the text I went to the store and bought some milk the reverse of that is gonna be write a sentence about going to the store and buying something right so let's just prime it a bit more so now we want to grab this good write a short explanation on how dog training works and reverse prompt engineer the explanation so let's paste that okay that's good let's move on to the next step and that is just gonna be great can you create a very technical reverse prompt engineering template paste that okay so that is it now where our model is prime so now it's ready to take some real text that we want to convert into our prompt so now let's take a look at the first thing we want to reverse engineer so that is going to be reverse prompt engineer the following text so here we have text in curly brackets right and you can see here we have text equals and we're gonna capture the tone and the writing style of the text to include in the prompt so here I have text equals and I just found some Obama speech online let's just grab all of this and take this over to chatgpt so again we're just gonna paste this and hopefully now we can get a prompt that we can use to regenerate this kind of text as you can see here it just says given a text so here basically repeats all of the the input text and here we have our reverse prompt right so write a speech reflecting on the challenges facing the country acknowledge the sacrifices of past generations and calling for a renewal of ideas and spirit of the nation the tone that's good should be humble grateful and mindful of the responsibilities of leadership in times of Crisis and the writing style should be formal and elevated perfect now we are of course gonna test this prompt so I'm just gonna copy this now open a new chat jpt window and see what kind of result we can get by using this prompt now let's paste this prompt into a new chat jbt window okay so that was our speech complete I kind of think it filled out all our parameters that we wanted so it has this good formal style and it has this humble and grateful tone I think I'm not gonna read all of this but it starts like ladies and gentlemen As We Gather here today let us take a moment to reflect and we have this conclusion let us be grateful for the sacrifices of those who came before us and worked towards a better future for all so I think you kind of nailed that so that's very good now I want to do some different examples to see how this works there so the next example I want to run is can you reverse engineer the following product description in curly brackets capture the writing style and the length of the text so here we just have product description equals so let's head over to Amazon and grab our product description so here we just have some iPods let's say I like this product description so let's just copy that go back here and just paste it here now let's copy all of this prompt and go back to to chat jbt and now it's important that you go back to the window where we have already primed the model right so let's paste The Prompt here and click submit [Music] so here you can see we get the given text so here is our product description so here we get the reverse prompt that's going to be describe the feature and benefits of a product including details but this is very specific right we have the length and we have the writing style but now we want to rewrite this into a more General product from so let me just gonna go rewrite the reverse prompt into a prompt that can be used for any product description with a user input feature that uses curly brackets so let's try that and then you can see we end up with this prompt describe the features and benefits of our product name product including the details of the fit controlled charging options yeah you get the point so now I want to try to run that prompt over in a new window now the prompt is just going to be describe the features and benefits and in the curly brackets product name we have product name equals let's say iPhone 12 and hit submit and there you have it what I would say is a pretty good description of the iPhone 12 so we have other features you can see here we have our benefits our fit controls charging options battery life yeah kind of everything you need for that so I think that turned out pretty good now let's go for another example of reverse prompt engineering so let's just try something simple let's try this can you reverse engineer this Excel formula so let's take that and of course go back to our Prime window just the edit button and click submit so here you can see the reverse prompt of this is write a formula in Microsoft Excel that calculates the average of values in cells C2 C3 and C4 okay so that's so good and now we can just go rewrite the prompt into a more General prompt for any formula in Excel with a user input in curly brackets and here you can see we get the prompt write a formula in Microsoft Excel that calculates the desired outcome using the values in cells anywhere the cell range and the references so let's just copy that head over to our new window and then we can go let's say write a formula in Excel at calculate so we add the desired outcome that is going to be a median number using the values in cells so we have cell b 2 3 and 4. so let's click submit and there we have it so now we have the formula to calculate the median number by using the cell values is equals median b 2 and 4. I think that worked out pretty good so you can always change your desired outcome here and you can change the cell number and you probably will get a different answer here so the next example I have is can you reverse engineer the following job posting capture the writing style details and the length of the text and include it in the prompt so we have job posting equals so let's just go grab a job posting somewhere so I found a job posting example I really like that I like the format I like the structure so let's just copy that head back here and paste it in here now let's grab all of this and take it over to chatgpt and again we go back to our Prime window right paste The Prompt click submit so here you can see it should just write a job description for a teller position at a community bank include details on the company culture A Day in the Life as a teller and the qualifications required to be a teller use a conventional informative tone and aim for length of approximately 150 to 200 words that is good but now we need the prompt to be more General then we can just go rewrite the prompt into a prompt that we can use for any job posting so now we get back basically the same prompt the only thing is that we have a job title leading curly brackets and we have a position at company name so let's just grab this now and head over to our new window and in the new window let's just type all of this and then we go component name equals Apple job title CEO good luck with that and there you have it here you have a job posting that you can use for any type of jobs you are hiring for you can just change out the job title and even a company name so I'm not going to read through all this if you want to read this just hit pause so let's have a look at one final example and that is gonna be reverse engineer the following HTML code in Brackets into a prompt HTML code and here you can just paste any HTML code you really like so let's grab all of this go back to our Prime window and just hit submit and here you can see we get the reverse prompt of this HTML code is going to be create an HTML code for a header section of a website that includes a logo and links to the home contact and about Pages now I want to do a final test and that is try to reverse engineer a very complex type of code so here I just changed up the curly brackets to code to code this is a JavaScript code so the program is to shuffle a deck of cards and you can see here it's a bit more complex than our last example so let's try that so here we get the suggestion write a program in JavaScript that shuffles a deck of cards and displays the first five cards after shuffling so let's copy that and head over to our window and see if that is correct paste that here and run it okay so here we have our code to test this I just want to rewrite it into HTML okay so that was done let's copy that and head over and test it so let's paste it in here and click run yeah first five cards after shuffling nine of clubs King of Clubs seven of Spades so let's run it again yeah we get something different yeah perfect I think that turned out pretty good so yeah very nice so hopefully this video gave you some inspiration if you want to know more about prompt engineering and generative AI you should check out the links in the description below to my newsletter and to my YouTube membership where I have over 30 members only videos now also check out the video 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: 57,295
Rating: undefined out of 5
Keywords: chatgpt, chat gpt, chatgpt examples, chatgpt explained, generative ai, openai, chatbot tutorial, productivity, prompt engineering
Id: _6lv6yeltW0
Channel Id: undefined
Length: 10min 39sec (639 seconds)
Published: Sun Feb 12 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.