Prompt Engineering 2025 Full course | Prompt engineering course | ChatGPT Prompts

361.81k views8837 WordsCopy TextShare
Great Learning
📚 Learn the basics of prompt engineering, including components of a good prompt and defining a good...
Video Transcript:
hello there are you ready to supercharge your interactions with AI today we are diving into the magic of prompt engineering the key to making AI tools like Char GPT do exactly what you want and all you need to do is Master the art of prompting effectively in this beginner friendly Hands-On video we will start from the basics what prompts are why they matter and how to craft prompts effectively to achieve accurate and contextually relevant AI responsive we will dive deep into numerous real world examples demonstrating the Practical applications of these techniques and we will also
tackle common challenges that newcomers often face providing you with practical tips and solutions to enhance your prompting skills whether you are looking to automate tasks generate content or develop Innovative AI tools the skills you require today are very crucial by the end of this video you will not only understand prompt engineering but also make AI work smarter for you so let's dive in and start creating some AI [Music] [Music] magic now let's understand what is prompt engineering prompt engineering is as much an art as it is a science a very creative line we'll come back
to this once we understand what is actually prompt engineering prompt engineering is made up of two words prompt and Engineering prompt is nothing but a detailed set of guidelines or instructions given to the llm or generative model to do a task engineering is developing iteratively a task specific prompt to enable the generative models or llms to Output a perfect or near perfect outcome that you have focused for so if you see prompt engineering is an iterative process how first is the idea that comes to you that you want this then you have prompt you design
a prompt then there are results you give that to your model your chart GPT okay and then you have to test you have a feedback right so basically it's it's a process a iterative process now once you have the prompt and you have the results you might be not very much satisfied with the result this is where you develop or you have a conversation with your chat GPT with your model and enforce or reinforce the model to give you a good result a good out output which is what you want for example if you have
a task on code Generation Now a specific problem statement can be solved through various methods for example you want to uh output palindrome palindrome can be done by Brute Force palindrome can also be done by recursive method recursion for example when you give chat GPT a prompt it'll first give you a brute force method you have to keep on instructing and providing an attempt or providing a prompt to chat GPT so that it gives you an optimized version for your code this is an example for code generation similarly suppose you have content creation you want
to create a content and your content that you want to create is directed towards a specific target audience now when you give chat gbt a prompt the results it will show you that might not be satisfying enough you have to tell your chat GP or your generative model iteratively what you want give them a feedack back for example you have not received a good output what you will tell your chat GPT for example this is not I want please generate the output based on my target audience or based on my feedback provided right that's where
your feedback or test comes into picture you have to have a conversation with your generative model or for in this case if you say chat GPT give them a feedback constant feedback it is good it is bad it is what specific part you want it to be changed right all these things are an iterative process that's why we say prompt engineering is an iterative process based on the guidelines or the detailed set of instructions that you provide for a specific task now let's go back a bit we said when we started about prompt engineering that
it is an art as it is a science how it is an art it is an art because when you conceive an idea and when you write a prompt it is your creativity which comes into picture however the science part comes in when you provide your generative model or llm or in this case chat GPT The Prompt and it gives you the result because in the back end there is something called generative models there is something called different Transformers or architectures that are going into picture where billions of parameters are playing a role to give
you this result that becomes your science part of it that's why prompt engineering is combination of both an art and science now that you have understood what is prompt engineering let's go and see the vital the main element of prompt engineering that is prompts without which generative model chat GPT will not work prompts are cons stituted or it contains two parts majorly that is parameters and structure what will be the structure and what will be the parameters of your prompts that when you design it you have to think so that you have an optimized result
now structure is one thing that we'll talk more about and parameters here let me explain I have only Selected Few parameters you can search more there are more parameters on which uh prompts work majorly here we are highlighting only three parameters that is temperature top p and max length temperature is the randomness that comes into picture when you provide that parameter to your prompt it ranges from 0 to 1 and if you want your model to be creative and generate creative answers or generate creative outcomes your range or you set your temperature to 0.7 to
0.8 however in tasks such as code generation you don't need creativity so you can set your temperature to zero also where you do not want creativity now top p is actually kind of same as temperature it also has creativity top p is top probability that it selects from so you have a generative model it generates results based on your prompt now there can be n number of results how does that model decide what to put as a output for you here top P comes into picture more the top P more you have different creative answers
right so low for factual high for diverse last is max length again it is written manage your response length this parameter is to control the cost of your generative model as well so now you have understood what is prompt engineering what is a prompt and what are the two main components of your prompt that is parameter and structure now let's see components of a good prompt what we mean by good prompt is that your chat GPT your generative model gives you a good output your good outcome and you have less feedbacks for your chat GPT
or generative model now let's see the first or I would say the first two are context and instruction these are interchangeable how you want to design your prompt if you want to keep instruction first and then context in your prompt you can do the same if you want to keep the context first and then instruction you can do the same context is an additional information that you want to provide to your model instruction is a specific task that you want your model to perform for example if you want to summarize some text that is your
instruction summarize your text summarize this text context is why you want to summarize what is the outcome you want to achieve for example going back to Tesla there you are providing an instruction to summarize but the context is that you want a business report from a business report you want what is the profit from 2020 to 2023 right so that is the context that you need to set why do you want this why it is needed next is the input data okay what is your input data for the example Tesla example example the input data
is your business report or business article that you will provide to char GPT and output indicator is what how what and how you want as an output for example you want in a CSV format your output suppose you want in a tabular format or you want in a graphical format so you have to tell what kind of output or what format of output you want so these are the four components of a good prompt if your prompt consists of these four things you are enabling your generative model your chat GPT to give you better and
good results now let's see an example here we will see um sentiment analysis we are setting up a context it is written act as a analyst you're acting as you are asking your chart GPT to act like an analyst working for an OT platform you are saying your chat gbt that you will have to perform sentiment analysis based on the feedback provided by the consumers you are working for an OD platform your consumers are the users that are seeing your movies your web series now the feedback that they provide on that you have to do
sentiment analysis this is the context that you are giving to your chat GPT now giving this your Char knows that they need to think from an analyst perspective they need to do sentiment analysis now second is instruction you are saying to chat GPT to classify the feedback into neutral negative positive where you are instructing or telling your chat GPT that what is positive positive means your consumer is your promoter negative means they are demo neutral means they are neither promoter or demo they are neutral towards your content this is the instruction that you give what
the chat GP or what generative model needs to do this is what it is doing classifying next is your input data and your output indicator before that let's see an example a good prompt while you're giving a good prompt if you give examples for your generative model here in this case we are using chat GPT if you give them an example they will learn from this example and train your input data to give the output here we have given two examples feedback first feedback is I think the series was okay second feedback is the acting
of each character in the series was awesome so I think the series was okay it took this is okay as neutral so this is a sentiment neutral here awesome it took as positive so your sentiment becomes positive now your input data is the story line for the series was repetitive and abysmal and your output indicator here is sentiment what is the sentiment for this you're asking your chat GPT what will be the sentiment of this entire prompt that is your context that you have given which tells chib to act as an analyst and do sentiment
analysis it gives an instruction to classify the feedback provided that is your input data and classify that feedback into positive negative and neutral here you and here you are giving examples for the same so that your chat GPT can understand learn and then act accordingly now the output for this particular feedback is negative so if you copy paste this into your chat GPT it gives you a output as negative for this sentence so this is how you should write your prompt which is good these are the components good components of for your prompt so that
the output that chat gbd generates for you is exact for you to work upon so this is what we understood about components of a good prompt now that you have seen what are the different components of a good prompt let's have a look at a good checklist that you can keep in mind while designing a effective prompt for better results so the first one is defining the goal telling chat gbt what exactly you want to do that is called defining the goal next is detail out the format format is output format that you want chat
GPT to provide you for example as I told you previously it can be table paragraph list csvs anything that you want and you can give it in a priority order also ask chat to give you in a priority order if you are working on such uh content next is creating a role if you remember the previous prompt that we discussed while learning about components of a good prompt we told as a context act like a analyst that is creating a role so that chat GPT assigns or processes based on your request based on that role
that you are have asked next is Clarity who the audience is or clarify the who the audience is basically you are telling chart GPT please generate the output based on the demography of my audience whom I am catering to it can be beginner level intermediate Advanced if you are creating any content if you are creating code it can be foundational functional expert based on the audience it can also if you a teacher and you are using chart GPT you can specify I want to teach fractions from a sixth class learner perspective or if you want
to create a Content or if you are working on something and you want to make someone understand that particular concept for example I want a 10-year-old to understand what is prompt how would I make that particular learner understand that kind of clarity that kind of clarifications when you put in your prompt what is your target audience it will generate tailored feedbacks tailored outputs for your prompt next is giving context basically you are giving every possible additional information for chat GPT in your prompt so that the purpose of your request is clarified to chat GPT and
the response that it generates is what you want next is giving examples we saw in the previous components while we were understanding components that giving example trains your chat GPT or makes it understand that what you want and it learns from it to produce accurate results next is specifying the style it can be communication style if you're working with a brand it can be how your brand Works communication style such as informal formal what do you want to do so it's suitable for your response next is defining the scope when you outline the scope with
specifications besides giving context and examples chat GPT operates within those parameters for example temperature when you are telling okay I want to be creative my temperature is this I want my uh top P to be this right you are defining the scope for your chart GPT applying restrictions restrictions becomes your what is supposing length that you want the output length the token length that you want a there is a restriction but what is that you want when you apply those restrictions that constraints will create right boundaries for chart GPT to produce relevant responses so all
these are checklists that you can keep in mind again these all uh pointers in your checklist revolves around all the components of a good prompt that we have already seen But as a checklist you can keep in mind that okay these are my pointers which I can follow when I'm designing my prompt so this is how you can write a good prompt so now let's understand what are the different prompt patterns one is your persona patterns act as X do the task as y as a yoga instructor create a beginner friendly routine for joint Mobility
for example this is your persona pattern next is your audience Persona pattern for example in the previous bit I told explain this concept supposing prompt explain prompt to me assume that I am a 10year old child or another example that is there explain the importance of eating greens assume I am a skeptical child so you are trying to tell Chad GPT that what is your audience Persona and you are writing your prompt or designing your prompt having the correct bits explained to me assume I'm this or previously Persona pattern act like this next is visualization
generator pattern now I have a tool I want to generate a data for example and provide that data to my tool so it can be generate X that can be provided to Tool y for visualization for data analysis for anything it can generate data in table table format it can generate csvs that can be provided that you can download and provide it to your tool for visualization data analysis task modeling uh machine learning tasks anything so these are the first three prompt patterns Persona pattern audience Persona pattern visualization generator pattern now let's see the next
pattern that is recipe pattern pattern for example you want to do X task but to perform this x task there are steps or subtasks a B and C so I want chat GPT to have a complete itenary generated for me if I'm traveling from Bangalore to daring and from there I can take a train or a cap to dodging now based on this I am telling charj to complete my itinary this is a recipe pattern where you know you want to do X task and you know that a b c are the sub uh tasks
or the steps that are necessary for you to do that X task so this is the recipe pattern next is your template pattern where you provide or as a user I provide the chat GPD or generative model with placeholder with a template and a placeholder so that my output chat GPT fits my outputs in those placeholders for example I want a day wise travel itinary if I'm visiting to Paris I'm telling chat GPT to generate day wise travel itinary for visiting Paris now my placeholders are day for the day uh of the travel supposing Monday
location in Paris what location I'm traveling to activity what in that location I plan to do time what is the best time or best part of the day to travel or to go there this is my entire template and how I want the uh output it's indicated for for day visit location at time for activity so if CH GPD generates it will give you for Monday visit location X at time noon for activity visiting museum for example so this becomes your entire output and you're giving the template you're giving giving placeholders that place my information
in these and generate output in the form of this line for day visit location at time for activity containing everything so these are your five prompt patterns that you can embibe while designing your prompts so that you have better responses from chart GPT and also you understand what you want to do you have a Clarity what you want to do and work accordingly if you want a pattern where you want Chad jibi to act as a person where or you want to give a idea to Chad giib what audience you are catering to or you're
doing visualization or you're doing data analysis what is your pattern if you are doing a task which contains subtasks or sub steps what is the pattern you follow and if you have a template in mind how you want your output to be generated then you have template pattern so all these five patterns you can keep in mind along with your checklist while designing your prompts let's now see common prompting errors so wake or ambiguous prompts when you just write what is joints what is prompt engineering that is your vague and ambiguous prompts where you do
not have any context instruction what to do just vague prompts then there are biased prompts where you are designing the prompts supposing you have two categories and the data or the instructions that you are providing the examples you are providing is leaning towards one and now the second category is left alone that is your biased prompts third is lack of contextual information you have just said okay generate the content uh for fractions but what is the target audience that you have uh acting are you a teacher that you are teaching is there any template is
there any FL that you want to follow are you looking at creating a course are you looking as at teaching uh fractions as a uh slide you want or as paragraph you want anything any contextual information is missing then you have insufficient examples you do not have examples for example you just saying generate synthetic data for doing sentiment analysis but what on you need to provide some content some information that okay this is my data now based on this you generate synthetic data in a CSV format for me to do sentiment analysis that is lacking
your training data or examples insufficient examples then there is complex or confusing prompts if you write F lengthy prompts but it is very complex it has several different informations such as you have Target information also you are acting as a uh target audience information you are acting as a uh analyst and you have target audience you have branding also you have campaigning also in that it is very confusing for chat GPT to pick one Persona and act or for example you are designing a campaign but you have given a lot of information you know check
out uh Coca-Cola uh campaign that happened at this year or check out this campaign and design my campaign it is confusing when you give different reference points you need to be very clear you need to be less complex your prompt needs to be very simplified so that chat GP can understand last is not testing prompts thoroughly you have given a very good prompt you have designed a very good prompt and given to chart GPT it generates something but you are not reading it you are blindly following what it generates you're not giving it a feedback
you are not asking what it has understood from your uh designed prompt that is not testing prompt thoroughly and you will have less accurate uh responses and in some cases wrong responses now let's see what are the applications different applications of prompt engineering one is content generation you want copywriting advertising creative writing educational content you can do anything and everything under content generation based on your target audience based on who you are catering to next is customer support and engagement there are various chatbots and virtual assistance that can use generative models and instructional guides as
well so that your customer is engaged you do not need human as resources to reply to your customers there are generative models that can help you with act as a human and reply to your customers at all times 24/7 then there is data analysis and science data cleaning data preparation visualization as we talked about whatever you want to do you can give an input as your data there would be a size limit you give and you tell to clean you generate the code you can ask what to do when you are doing statistical analysis on
this kind of data what tests uh hypothesis testing to do so all these come under data analysis and data science then application comes under code generation and software development that is automating your code wrting debugging document generation documentation so all these using chat GT or generative models you can they can make your life easy they can generate a code for you whatever you are looking at but you have to be very specific you have to be very clear what you want so that your output your response from chat GPT your generative models are customized based
on your prompts next is research and information retrieval like for example Tech summarization question answering anything and everything you can give links as a context and tell that okay these are the specific researches done in this field based on this give me your hypothesis what next can be done for example next is machine translation information Shar sharing internal communication anything related to machine translation then sentiment analysis consumer feedback analysis brand management marketing all these things using sentiment analysis can be done and prompt engineering is used to create tools for this other domains include Healthcare where
you can do diagnosis you can create a system using generative model to diagnosis for a disease and you can prompt design prompts that okay my patient is this it has a history of this now these are the symptoms what is your diagnosis Manufacturing in manufacturing if you want to supply your manufacturing and your suppliers you create an llm you create generative model where your users your employees can ask if manufacturing this if I have to transport here what to do what not to do everything the mesh the network that you have in manufacturing industry it
can intake and give you output results based on your prompts then comes security security there are attacks they can be a lot of AI tools that can be used to prevent those attacks to prevent your systems you know without failing last is retail and shopping that is e-commerce in your OT platforms or shopping e-commerce mintra different websites Amazon they can use generative models to intake all these things and you prompt that okay I want this and it helps you with retail and shopping so these are the various applications for prompt engineering now let's write a
few prompts so that you can understand what are prompts how to write them so we are on a prompt engineering course where you understanding the outcome of this course is for you to understand what is prompt engineering how to write a good prompt right so let's give chat GPT a simple prompt that is what is prompt engineering and let's let's see what it tells us it starts generating and it tells you what prompt engineering refers to what is crafting and refinement of prompts and generates responses from AI language model such as GPT then it's saying
that prompt engineering involves considering various factors such as language used in prompt structure of prompt context effective prompt engineering can significantly improve performance and usefulness of a AI models in various domains such as including natural language understanding text generation dialogue systems Etc if you see this is a query that you have put which you can also put on Google and get different links not a text not a paragraph but different links where you can open the links and read it here on chat GPT when you enter what is prompt engineering you get this a definition
a elaborated explanation of what the generative model that is chat GPT that uses GPT as a generative model understands about prompt engineering and it tells you their perspective of it based on the different parameters that it is trained on now let's see another example suppose I want to travel 5 days in India please make me itinary I give this a promt according to chat gbt understanding it'll give me this arrival in Delhi I have not said that where I'm arriving from it assumed arrival in Delhi day two Delhi to Agra day three Agra to japur
day four japur sightseeing day five jaur to Delhi and it tells me when you are in that day you arrive in Delhi for example it is capital of India visit historic landmarks like red Fort explore bustling streets of old Delhi experience optional visit is humay Tomb or Kum Minar okay again day two it's giving different or day three it is giving different options I have not said here what I like I have not said whether I am a beach person or a mountain person or a normal uh I want to travel uh which kind of
places hot cold nothing it has not asked also this is my random prompt that I have given chat GP now let's see a different kind of example I have a passage of three four sentences I want to summarize in one sentence right I am giving an example that my example text next is scientists have discovered a new species of orchid in rainforests of South America and the output that I'm giving is a new species the entire sentence okay now my sentence or my passage is on prompt engineering it involves crafting precise contest Specific Instructions and
queries and these prompts provide guidance we can can enhance model performance achieve better control over generated output and address limitations associated with open-ended language generation and I want to summarize this into one or two sentences right this is my prompt I give this and this is what it gives me however this is isn't it feeling as same now if I say please shorten this further for example I don't want this much I want short and crisp it still gives me this again I say B please be concise now it gives me prompt engineering uses precise
prompts to guide language models improving performance control and overcoming limitations in generating responses however the first one when I asked please shorten this further it said crafting precise instructions called prompts to guide language models and shape their output it enhances model performance offers better control over generated uh responses and addresses limitations of open-ended language generation if you compare this output with this output some information is lost some information is retained while making it concise so you have to see what responses you are getting based on your prompts and give them a feedback what you want
to do so these are some examples of prompts this is the first uh time you're looking at prompts in this course so we try to cover from basic content generation basic query based uh prompts to traveling itary without any information to text summarization where you are given an example and asking to summarize and giving chat GPT a feedback on it right so this is your first prompt now let's see different components and further analyze what is a good prompt now let's look at few examples so that we can analyze what are good prompts and the
checklist that we have seen the pattern Persona patterns we have seen the components that we have seen how to integrate that while designing your prompts now let's see how we have designed this prompt and what all components we have included in content generation where where we have written provide a comprehensive overview of tech summarization which is our main topic or concept that we want to understand empowering Learners to grasp its significance and potential applications across diverse domains so basically with this l we are telling that we want our Learners to grasp what is text memorization
for different domains it can be for manufacturing domain it can be Healthcare but what is Tech summarization we want our Learners to understand that now we have given some guidelines also here you need to follow below guidelines while answering we are telling chart GPT provide an insight into Tech some mization a tool for condensing lengthy text into shorter and more manageable versions second we say explore various techniques like extraction abstraction used to achieve this and provide Clarity on how it works third we are saying provide relevant examples of different domains and use cases where this
text summarization can be SL fourth is explain te teex summarization how it is evolving and innovating with advancement in Ai and machine learning offering customized solutions for diverse needs we are also giving extra instructions also that while providing insights the Learners are from different domains and have just the preliminary knowledge of tech summarization cover the basics so for that you cover the basics of text summarization techniques highlight key Concepts without diving into overly technical details what not to do we have also specified this approach will cater to our audience's level with familiarity of the topic
we can tell the level also here but let's see how it responds give explanation in clear straight forward American English we are telling the scope also we are telling the communication style also ensuring the accessibility and understanding maintain a clear and straightforward tone ensuring accessibility and ease of understanding for all Learners now let's give this prompt to chart gbt and see how it response so it gives text summarization is a powerful tool used to condense lengthy text into shorter more manageable versions it's basically taken what we have provided and given as a definition making it
easier for leaders to grasp main points without going through entire document now this is now breaking a key con uh aspects into better understanding insights into Tech summarizing ation where it tells that it can be thought of a process similar to what humans naturally do when they summarize an article a book or a conversation the goal is to extract the most important information and present in the concise form that's okay that is the Insight that it is giving now we also highlighted that please ensure that you are using extraction and abstraction also to explain Tech
summarization and along with that use examples and use cases also where it is highlighting what are the applications in various domains in news aggregation academic research legal documents that is your law in branding social media in custom feedback analysis which different companies uses then it is giving the evolution and advancements with time what it has done customized summaries multimodel summarization realtime summarization evaluation Matrix various things that has evolved in Tex summarization now if you want more insights on text summarization where you want different techniques for it to explain different techniques you need to tell please
explain further more or elaborate further more on techniques used on extraction or abstraction or give me more examples not application examples so if you see here it has given use cases the applications across it has not given examples so you can say this is my feedback to you that the explanation that you have generated is missing example I'm not able to correlate what is given here what you have generated here right so you can tell the examples are missing you can also tell that Evolution and advancements does not tell me when it started does not
tell me a history Evolution means history it is not telling me that so all these are your feedbacks so that you can have a output you can have a response a fin fin response that gives you what is Tech summarization what is the significance of tech summarization what are different techniques of teex summarization what are the different examples of TCH summarization what are the applications how it evolved when it started what are the different things what are the different advancements in using AI now so you can definitely work further more now this was chat GPT
3.5 let's now see in chart GPT 4 we create a new chat and give the same prompt to chat gbt 4 also and see how it response what is the difference between four and three we have given the same prompt not changed a single line here so it has generated an output where it generates a content on text summarization if and if you note the first line it has not taken the same thing that we have given as prompt it has written and explained in its different words or different explanation what is text summarization which
is a powerful tool in the field of natural language processing designed to condense long pieces of text into shorter concise summaries now it tells you the techniques of text summarization which is abstraction and extraction with tools and various examples of it various applications of it now it tells you applications across various domains as well which is closely the same as 3.5 again this is also missing your examples it has not given you any example in evolution if you see it has given how it has evolved you can also give a feedback to chat GPT 4
that I want a timeline Evolution for Tech summarization and it has briefly explained some advancement again as compared to 3.5 that is missing which you can give as a feedback and it can improve upon so this is what cot content generation example was in both chat GPT 3.5 and chat GPT 4 now let's see a different example that is text summarization we learned about Tex summarization now you have fairly a good idea what is Tech summarization you give what you want to understand and it summarizes and gives you output summaries basically of what you provide
now let's provide chart GPT an article and ask it to summarize it so we have the tech summarization example here where we are given an article on Indian Express based on Tesla policy and we have asked that use pinto pyramid principle and we have given the link also to that to structure your communication from top down ensuring Swift and clear message delivery start with the conclusion follow with key arguments and then support with detailed information give only relevant information that is appropriate to understand business outcomes only use clear and straightforward language for better understanding so
we have given a context an instruction we have not given an example here but we have given clear instruction and we have given restrictions also we have given a style also that be straightforward right you can further give that okay uh make your word limit to this much only okay so let's first see what it generates so in pinto pyramid principle we write a conclusion first then we write key argument why we have concluded so basically if you are having a conversation and you want to conclude that conversation you will write that conclusion first then
you'll write your key arguments okay this is why I'm telling and then you write the detailed information that is related so basically we want because we are asking for business right business needs conclusion first so we have concluded this first that India's decision to lower import taxes on EV could potentially pave the way for Tesla LED by Elon Musk to enter Indian market now key arguments are lowering import uh taxes Tesla entry into Indian market boost for India's EV industry then we have detailed inputs from that report only that are mentioned here right so this
is a text summarization in a structured way text summarization can also be if you go back in the first prompt that you have written where we had four five lines and it summarized for us that is also text summarization this is a structured text summarization where you do not need to go through this whole article of Indian Express and it gave you a conclusion it gave you key arguments what it presented in the article right so this is an example for Tex summarization now let's do an example on code generation which mostly from people from
Tech domain or data domain will use charity for right so the prompt has a python recursion uh code for calculating factorial where we are defining a method to calculate factorial if n is equal to 1 equal equal to 1 return n else return n into calculate factorial we are doing recursively right now the same calculating factorial we have done with non-tail recursive function right we are giving an example on that as well now what we want us to write a program with recursive function to check if a string is pal androme in python or not
right where we have given two examples of recursion on factorial and now we are asking chat GPT to generate code for palandro now this has given that okay with comment that this is the base case if the length of the string is zero or one it's a palr compare the first and last characters of the string false okay return false if it is not equal recursive call check if the substring excluding the first and last characters right so this becomes your output now this function works by recursively checking if the first and last characters of
the strings are same okay you can also uh in your prompt say uh please uh explain line by line as well if you want further elaborated explanation as well though it has uh given comments right you can further ask give me further more explanation for this now let's see the same thing in chat jib 4 in chat gbt 4 it actually has explained what is this function what it does where Len is equals to Zer A Single Character what it will do both cases will be true it runs returns true okay what is the cursive
case first checks if the first and last characters of the string are same calls is pal androme it is telling each and everything that the function is doing this is equivalent however this is a little bit optimized version of 3.5 now you can see a difference between how or what 3.5 generates code for a specific problem statement and how four gener R so basically four is more optimized for uh code generation rather than 3.5 in 3.5 you can iteratively ask please optimize please optimize this please optimize this right in four you can do once or
twice and then actually it will give you an optimized version for the same and you can write furthermore to uh refine your prompt you can write please give me the complexity time complexity storage complexity for the same space complexity for the same right so these are the examples for a good prompt where you are giving a context where you giving an instruction where you are giving uh restrictions we are doing where you are following items from your checklist where you are following a pattern uh to provide a pattern to your uh chat GPT as well
so these are some of the examples that you can refine more you can experiment more with Advanced prompt strategies these are different prompts or different types of prompts that exists we are taking only three types zero short few short chain of thought process that's it there are several different more strategies that exists like self-consistency tree of thought respond rephrase Etc you can go and look dive deeper into the same let's not see what is zero short zero short is directly instructing your model that is chat GPT to perform a task without any additional examples for
example I just say classify my feedback into neutral positive and negative and I give a line that is the input and it outputs the sentiment that's it this is my zero short few short is teaching with examples that we saw previously where we gave two examples and third is our input where we are indicating how we want the output and it gives the output for the same so that is few short zero short is without any example any prompt without any example where you are only telling the instruction that's it no context F short is
giving examples for chat GPT to learn and produce your response now Chain of Thought Chain of Thought is designed for logical tasks anything logical it is the best prompt strategy to follow you give in Chain of Thought an example how to do a process for example you are adding you are given an example 2 + 2 is = 4 then you say 15 + 4 = 19 then you give an input okay I want 3, 150 + 10,500 what will be my answer you're telling how to do the process and then you asking in your
input what will be the output this is very basic there are complex problems for example blood relations X is related to Y so what will be the relation for Zed with X so all these logical questions all these logical uh and complex bits is for Chain of Thought now let's see examples of these three prompt strategies on chart GPT so that you understand it better how to work with these on actual playground let's now see few examples on these Advanced prompt strategies zero short few short and Chain of Thought now zero shot is giving no
examples just giving the the instruction just giving what it needs to do so we'll take a simple example very generalized example where we are generating a passage in the style of William Shakespeare okay we are giving this prompt based on what chart gbd would have been trained on it has given a passage from of William Shake spare but from where it is from you can ask from where this passage is from the passage I provided is an original composition written in the style of William Shakespeare while it captures the language imagary and themes often found
in Shakespearean work it is not directly derived from any specific text by the B do did you want the same right you need to give the feedback now I did not want in this manner I wanted a extract uh from his own plays or his own uh poetry and given as an example right or is it following what you you want right you can give that as a feedback as well now this is zero short if you want to make this as a f shot we need to give an example we have given an example
generate a passage in the style of William Shakespeare example is original text to be or not to be that is the question Shakespeare in style rewrite is WEA this's nobler in the mind to suffer the slings and arrows of Outrageous Fortune similarly in example two we have given all the worlds is a stage and all the men and women merely players right so now we say this is few short it has given an example out out brief candle lives but a walking Shadow a poor player that struts and frits his R upon the stage and
then is heard no more right and Shakespeare and style for this so this is an example of zero shot and this is an example of few shot right let's take another example where we say charity to translate it's a lot of William Shakespeare William Shakespeare right let's take a simple more simpler example where I say translate this English sentence to Spanish I am a Spanish reader I this is the English sentence I want to translate into Spanish I say this and it says it gives the translation for this now if I want to make this
few short I'll add examples I'll add um more examples for the same I'll add uh say that okay this is my article I can give an article also and say please translate this these are my examples now take this article and Translate in Spanish for me I can do that as well so that becomes few short for the same in Char 4 there is an option that we want to highlight is that you can click on this attachment add any attachment it can be data set it can be images and train your chat GPT that
okay for example you want to train these are the picture of roses where you provide different pictures of roses and in input as an input data you give Lily and you ask what is it is it a rose and it tells you based on what images you have input is it a rose or not just a random example the same can be used for data science or data analysis different activities visualizations as well where you can give the data and ask chat GPT to analyze visualize the data and give you outputs for the same now
let's see Chain of Thought Chain of Thought is said to be logical it works on logical bits right here in this prompt example we have designed few question and answer that is on blood relation where the first question is if Michael says Patrick's mother is the only daughter of my mother how is Michael related to Patrick we are giving the answer is Michael is saying that Patrick's mother is Michael's own Mother's only daughter this means Patrick's mother is Michael's sister making Michael Patrick's Uncle okay second example we are giving Emma is John's sister Mark is
John's father Linda is Mark's sister and Thomas is Linda's son what is the relation between Emma and Thomas Emma is John's son making her Mark's daughter Linda being Mark's sister is Emma's aunt which makes Thomas who is Linda's son Emma's cousin right now our input question is Alex introduces Brad to his friend as the son of the only brother of his mother how is Brad related to Alex output is Brad is the son of the only brother of Alex's mother which means Brad is Alex cousin right logically it correlates the Chain of Thought correlates based
upon your examples Chain of Thought can be of different types as well where you can give different examples uh complex examples as well and it works it is zero short also it is few short also so basically this comes under few short Chain of Thought prompt okay zero short is separate where you give directly what you want without more explanation in your prompt designs right and then there is automatic Chain of Thought as well so there are various Chain of Thought prompts as well you can explore more and deep dive there as well apart from
Chain of Thought we have different prompting strategies as highlighted earlier we have self-consistency we have prompt chaining we have respond rephrase We have tree of thought we have many Advanced prompt strategies which you can deep dive and apply based on your requirement your prompt design what you want to do with your generative models with chart GPT hope you have understood these three different Advanced prompt strategies zero shot with where you do not provide any examples few shot where you provide where you teach AI with few examples and Chain of Thought where it has three versions
and is for logical thinking is used for logical thinking and logical problems then we understood what are the components of a good prompt what are the different checklist that you can follow to create a good prompt to design a good prompt then we saw what are the different Persona patterns that you can think of while designing your prompt following the checklist then we understood different Advanced strategies prompt strategies which is zero uh short prompting few short prompting Chain of Thought with examples we saw what are the common prompting errors that can happen if you miss
something and at last we saw applications of prompt engineering what are the different fields in which prompt engineering can be used so the key to becoming a proficient prompt engineer is to practice experiment with different prompts again and again give feedback to your generative models be it chat GPT be it Gemini be it any generative model analyze your outcomes what the outcome what response you are receiving and telling giving them the feedback refine your techniques refine your prompts based on the checklist that is provided based on the different strategies apply read about different strategies and
apply them that is refining your techniques keep practicing stay curious explore various AI platforms to enhance your skills this is how you can become a proficient prompt engineer I hope you enjoyed this course thank you
Related Videos
How to use ChatGPT 4o for FREE! | ChatGPT Tutorial | ChatGPT 4o tips and tricks
9:19
How to use ChatGPT 4o for FREE! | ChatGPT ...
Great Learning
58,444 views
Learn Prompt Engineering: Full Beginner Crash Course (5 HOURS!)
4:57:00
Learn Prompt Engineering: Full Beginner Cr...
Zero To Mastery
60,685 views
Generative AI Full course 2024 | All in One Gen AI Tutorial
7:39:53
Generative AI Full course 2024 | All in On...
Great Learning
171,957 views
The ULTIMATE 2025 Guide to Prompt Engineering - Master the Perfect Prompt Formula!
26:10
The ULTIMATE 2025 Guide to Prompt Engineer...
AI Master
98,308 views
How To Learn Any Skill So Fast It Feels Illegal
13:48
How To Learn Any Skill So Fast It Feels Il...
Justin Sung
1,660,154 views
Master Prompt Engineering full course in one video with ChatGPT!
27:52
Master Prompt Engineering full course in o...
PRO DEVELOPING CHAMPS
4,725 views
140+ ChatGPT Tips and Tricks with Demo in 2024 | ChatGPT Applications
5:44:17
140+ ChatGPT Tips and Tricks with Demo in ...
Great Learning
21,020 views
Google's 9 Hour AI Prompt Engineering Course In 20 Minutes
20:17
Google's 9 Hour AI Prompt Engineering Cour...
Tina Huang
416,655 views
How to use ChatGPT in 2025 | ChatGPT Tutorial | ChatGPT Full Course
11:40:06
How to use ChatGPT in 2025 | ChatGPT Tutor...
Great Learning
907,286 views
Deep Dive into LLMs like ChatGPT
3:31:24
Deep Dive into LLMs like ChatGPT
Andrej Karpathy
1,601,717 views
How to Get Rich with AI Agents in 2025 | Complete Beginner's Guide (OpenAI Custom GPTs)
1:21:23
How to Get Rich with AI Agents in 2025 | C...
Liam Ottley
973,028 views
Discover Prompt Engineering | Google AI Essentials
30:30
Discover Prompt Engineering | Google AI Es...
Google Career Certificates
145,703 views
Learn DeepSeek-R1 in 30 Minutes: Watch BEFORE It's TOO LATE!
32:28
Learn DeepSeek-R1 in 30 Minutes: Watch BEF...
Ishan Sharma
312,368 views
How to Start Coding | Programming for Beginners | Learn Coding | Intellipaat
33:08
How to Start Coding | Programming for Begi...
Intellipaat
10,002,764 views
Complete Excel Tutorial in 7 hours in 2024 | Learn Microsoft Excel
6:49:15
Complete Excel Tutorial in 7 hours in 2024...
Great Learning
327,865 views
ChatGPT Prompt Engineering Course
30:36
ChatGPT Prompt Engineering Course
Hasan Aboul Hasan
1,044,723 views
Stop Learning Prompt Engineering... Do This Instead
7:38
Stop Learning Prompt Engineering... Do Thi...
Rick Mulready
97,458 views
How I'd Learn AI in 2025 (if I could start over)
17:55
How I'd Learn AI in 2025 (if I could start...
Dave Ebbelaar
1,444,533 views
Basics of AI - ChatGPT Masterclass & Midjourney | Ansh Mehra at IIM Bangalore
59:59
Basics of AI - ChatGPT Masterclass & Midjo...
The Cutting Edge School
1,090,508 views
Deepseek | China's New AI Model Destroys American ChatGPT | Dhruv Rathee
19:39
Deepseek | China's New AI Model Destroys A...
Dhruv Rathee
9,575,696 views
Copyright © 2025. Made with ♥ in London by YTScribe.com