Hello there. Are you ready to supercharge your interactions with AI? Today, we are…
- User
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 ChatGPT 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 responses. 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 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 ChatGPT. Okay. And then you have to test, you have a feedback, right? So basically 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 ChatGPT with your model and enforce or reinforce the model to give you a good result, a good output, which is what you want. For example, if you have a task on code generation.Now specific problem statement can be solved through various methods. For example, you want to output palindrome. Palindrome can be done by brute force. Palindrome can also be done by a recursive method. Recursion. For example, when you give ChatGPT a prompt, it will first give you a brute force method. You have to keep on instructing and providing an attempt or providing a prompt to ChatGPT 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 ChatGPT a prompt, the results it will show you that might not be satisfying enough.You have to tell your ChatGPT or your generative model iteratively what you want. Give them a feedback. For example, you have not received a good output. What you will tell your ChatGPT, 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 in this case, if you say ChatGPT, 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, ChatGPT prompt, and it gives you the result because in the backend, 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 will not work. Prompts are constituted 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? 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 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 zero to one. 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. 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 ChatGPT, your generative model gives you a good output, your good outcome, and you have less feedbacks for your ChatGPT 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 you 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 example, Tesla example, the input data is your business report or business article that you will provide to ChatGPT 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 ChatGPT to give you better and good results.Now, let's see an example here. We will see sentiment analysis. We are setting up a context. It is written, act as an analyst. You're acting as, you are asking your ChatGPT to act like an analyst working for an OTT platform. You are saying your ChatGPT that you will have to perform sentiment analysis based on the feedback provided by the consumers.You are working for an OTT 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 ChatGPT. Now, giving this, your ChatGPT knows that they need to think from an analyst perspective.They need to do sentiment analysis. Now second is instruction. You are saying to ChatGPT to classify the feedback into neutral, negative, positive. Where you are instructing or telling your ChatGPT that what is positive. Positive means your consumer is your promoter. Negative means they are demoter. Neutral means they are neither promoter or demoter.They are neutral towards your content. This is the instruction that you give. What the ChatGPT 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 are giving a good prompt, if you give examples for your generative model.Here, in this case, we are using ChatGPT. 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 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 storyline for the series was repetitive and abysmal and your output indicator here is sentiment. What is the sentiment for this? You're asking your ChatGPT what will be the sentiment of this entire prompt? That is your context that you have given, which tells ChatGPT 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. And here you are giving examples for the same, so that your ChatGPT can understand, learn, and then act accordingly. Now, the output for this particular feedback is negative.So if you copy paste this into your ChatGPT, 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 for your prompt. So that the output that ChatGPT 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 ChatGPT 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 ChatGPT 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 ChatGPT to give you in a priority order if you are working on such a 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 an analyst. That is creating a role. So that, ChatGPT assigns or processes based on your request, based on that role that you have asked. Next is clarity who the audience is or clarify who the audience is.Basically you are telling ChatGPT, 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're a teacher and you are using ChatGPT, 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're 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 ChatGPT in your prompt so that the purpose of your request is clarified to ChatGPT 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 ChatGPT 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 styles 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, ChatGPT operates within those parameters.For example, temperature, when you are telling, okay, I want to be creative. My temperature is this. I want my Top P to be this, right? You are defining the scope for your ChatGPT. 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 ChatGPT to produce relevant responses. So all these are checklists that you can keep in mind. Again, these are 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 10-year-old child. Or another example that is there. Explain the importance of eating greens. Assume I'm a skeptical child. So you are trying to tell ChatGPT that what is your audience persona and writing your prompt or designing your prompt, having the correct bits, explain to me, assume I am 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 tabular format.It can generate CSVs that can be provided, that you can download and provide it to your tool for visualization, data analysis tasks, modeling, 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.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 ChatGPT to have a complete itinerary generated for me if I am travelling from Bangalore to Darjeeling and from there I can take a train or a cab to Darjeeling. Now based on this, I am telling ChatGPT to complete my itinerary.This is a recipe pattern where you know you want to do a X task and you know that A, B, C are the sub 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 ChatGPT or generative model with placeholder with a template and a place holder so that my output ChatGPT fits my outputs in those placeholders.For example, I want a day wise travel itinerary if I am visiting to Paris, I am telling ChatGPT to generate day wise travel itinerary for visiting Paris. Now, my placeholders are day, for the day 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 output. It's indicated. For day, visit location at time for activity. So, if ChatGPT 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 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 imbibe while designing your prompts so that you have better responses from ChatGPT.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 ChatGPT to act as a person, where, or you want to give a idea. To ChatGPT, 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 sub tasks 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 vague or ambiguous prompts, when you just write what is joins, what is prompt engineering, that is your vegan 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 for fractions, but what is the target audience that you are acting? Are you a teacher that you are teaching? Is there any template? Is there any flow that you want to follow? Are you looking at creating a course?Are you looking as at teaching fractions as a slide? You want or as paragraph you want? Anything, any contextual information is missing. Then you have, insofar examples. You do not have examples. For example, you are just saying generate synthetic data for doing sentiment analysis. But what on you need to provide some context, some information that, okay, this is my data, not based on this.You generate synthetic data in a CSP format. For me to do sentiment analysis that is lacking your training data or examples, insufficient examples. Then that is complex or confusing prompts if you write full Lindy prompts, but it is very complex. It has several different informations such as you have dogged information.Also, you are acting as a target audience information. You are acting as an analyst and you have target audience, you have branding also you have campaigning also in that it is very confusing for you to pick one persona and act. Or for example, you are designing a campaign, but you have given a lot of information.You don't check out the Coca-Cola campaign that happened this year or check out this campaign and design my can. But it is confused. Then you give different reference points. You need to be very clear. You need to be less complex. Your prompt need to be very simplified so that you begin understand last is not testing prompt totally.You have given a very good prompt. You have designed a very good prompt and given to charge you. 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 designed prompt that is not testing prompt thoroughly and you will have less accurate responses and in some cases wrong responses.No. 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 on the content generation based on your target audience, based on who you are catering to.Next is customer support and engagement. There are various chat boards and virtual assistants 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 seven 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 hypothesis testing to do. So all these come under data analysis and data science. Then application comes under cogeneration and software development that is automating your code writing, debugging document generation documentation. So all of these using chargeability 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 Chargeability, your generative models are customized based on your prompts. Next is research and information retrieval, like, for example, the summarization question, answering anything and everything.You can give links as a context and tell that okay, these are the specific research is done in this field. Based on this, give me your hypothesis. What next can be done? For example, next is machine translation, information 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 brand engineering is used to create tools for this are the domains includehealthcare, where you can do diagnosis. You can create a system using generative model to diagnosis for a disease and you can prompt design. Prompt that. Okay, my patient is this. It has a history of this. Now these the symptoms. What is your diagnosis? Manufacturing in manufacturing. If you want to supply your manufacturing and your suppliers, you create a Al-Alam, you create a generative model where your users, your employer can ask if I am in fact doing 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 know without feeling last is retail and shopping that is e-commerce in your audio platforms or shopping e-commerce myntra different websites.Amazon, they can use generative models to take all these things and you promote 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 our prompts how to write them. So we are on a project engineering course.There. You understanding the outcome of this course is for you to understand what is prompt engineering, how to write a good product, right? So let's give Chargeability a simple prompt. That is what is prompt engineering and 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 a language model such as Djibouti.Then it's saying that prompt engineering involves considering various factors such as language used in both structure of prompt context. Effective prompt engineering can significantly improve performance and usefulness of EIA models in various domains, such as including natural language understanding, next generation dialog systems, etc.If you see this is a Kuwaiti that you have put, which you can also put on Google and get different links, not a text, not a paragraph, but different links there you can open the links and read it here on Djibouti. When you enter what is prompt engineering, you get this definition a elaborated explanation of what the generative model that discharged you pretty now uses.Djibouti 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 five days in India. Please make me. I didn't neti I give this a prompt according to Chad Djibouti understanding it you give me this arrival in Delhi.I have not said that Verma arriving from it assumed arrival in Delhi day to Delhi to Agra, day three, Agra to Jaipur. Therefore Jeb Bush sightseeing day five, Jaipur to Delhi. And it tells me then you are in that day you arrive in Delhi, for example, it is capital of India. Visit historic landmarks like Retford explore bustling streets of all Delhi experience optional visit is whom I used to argue Dominar look again Day two It's giving different.On day three it is giving different options. I have not said here what I like. I have not said that I am a beach person or a mountain person or a normal or I want to travel. Which kind of places? Hot, cool. Nothing. It has not aged. Also, this is my random brand that I have given Djibouti. Now let's see a different kind of example.I have a passage of three full sentences. I want to summarize in one sentence. Right? I am giving an example that my example fixed is scientists have discovered a new species of orchid 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 one prompt engineering and involves crafting precise quantities, instructions on queries, and these prompts provide guidance.We 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 in due 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 see please shorten this further.For example, I don't want this much, I want to shorten this. It still gives me this again. I say be 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 then I ask please shorten this further.It said Crafting precise instructions guide prompt to guide language models and shape their output. It announces model performance offers better control over generated 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 gives them all feedback what you want to do. So these are some examples of prompts. This is the first time you are looking at prompts in this course. So we try to cover from basic content generation, basic quality based prompts to traveling utility without any information to take summarization where you are giving an example and asking to summarize and giving you 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 Golden Generation. But there we have written provide a comprehensive overview of big summarization, which is not a 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 line, we are telling that we want our learners to grasp what is sticks for different domains. It can be for manufacturing domain, it can be healthcare. But what is stick summarization? We want learners to understand that now they have given some guidelines. Also here you need to follow below guidelines while answering.We are telling Chargeability provide an insight into tech summarization, a tool for condensing many text into shorter and more manageable versions. Sekhon DC explore various techniques like extraction abstraction used to achieve this and provide clarity on how it works. Today we are seeing provide relevant examples of different domains and use cases out there.This thick summarization can be applied for. It is explained to stick summarization how it is evolving and innovating with advancement in AI and machine learning, offering customized solutions for diverse needs. We are also extra instructions also that while providing insights, the learners are from different domains and have just a pre luminary knowledge of tech summarization cover the basics.So for that you cover the basics of summarization techniques highlight key concepts without diving into overly technical details what not to do. They have also specified this approach. We cater to our audiences level with familiarity of the topic. We can do low level also here, but let's see how it responds.Give explanation in clear, straight forward American English. We are telling the scope also they are telling the communication style. Also ensuring the accessibility and understanding. Maintain a clear and state fullerton, ensuring accessibility and ease of understanding for all learners. Well, let's give this prompt to charge you, buddy, and see how it responds.So it gives stick. 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 us a definition. Making it easier for leaders to grasp mean points without going to entire document. No, this is now breaking up geek aspects into better understanding insights into tech summarization where it tells that it can be taught 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 presenting a concise form that took it. That is the insight that it is giving. Now, the also highlighted that please ensure that you are using extraction and abstraction also to explain take summarization and along with that use examples and use cases.Also there it is highlighting what other applications in various domains in news aggregation, academic research, legal documents is your law in branding social media, in customer feedback analysis, which different companies uses, then it is giving the evolution and advancements video in what it has done customized summaries, multimodal summarization, real time summarization, evaluation metrics, various things that has evolved index summarization.Now, if you want more insights on take summarization where you want different techniques for it to explain different techniques, you need to tell. Please explain furthermore or elaborate for the more on techniques used on extraction or obstruction, 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 see 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 output, you can have a response, a final response that gives you what is stick summarization, What is the significance of summarization? What are different techniques of summarization? What are the different examples of summarization? What are the applications? How would do want when it started? What are the different things or different advancements in using A.I. now? So you can definitely look Furthermore, now this was strategy 3.5. Let's know see in charge before we create a new chat and give the same prompt to charge you before also and see how it responds. 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 there.It generates a content on take summarization and if you know the first line, it has not taken the same thing that we have given us prompt. It has written and explore in its different words or different explanation what is text summarization, which is a powerful tool in the field of natural language processing design to condense long pieces of text into shorter, concise summaries.Now it tells you the techniques of text summarization, which is abstraction and extraction videos and various examples of it. There is 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 and you can also give a feedback to charge you for that. I want a timeline Evolution for big summarization and it has briefly explained some advancement again as compared to 3.5 that is missing that you can give as a feedback and it can improve upon. So this is what good content generation example was in both charge 3.5 and jump for now let's see a different example that is static summarization. We learned about summarization. No, you have fairly a good idea what is the 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 you pretty an article and ask it to summarize it.So we have the take summarization example here where we are given an article on Indian Express based on this log policy, and we have asked that use being the 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 language for better understanding. So we have given a context and instruction. We have not given an example here, but we have given Kidd instruction and we have given restrictions Also. We have given a style also that be straightforward, right? You can further give that, okay, make your word limit to this much only.Okay, So let's first see what it generates. So in being the 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 the conclusion first. Then you will write your key argument.Okay, this is why I'm telling. And then you write the detailed information that is related. So basically we want because we asking for business, right? Business needs conclusion first. So we have concluded this was that India's decision to lower import taxes on Eevee could potentially be the way for Tesla, led by Elon Musk to enter Indian market.Nokia arguments are lowering import taxes. Tesla Entry into Indian Market boost for India's I.T. Industry. Then we have De Beers inputs from that report only that mentioned here. Right. So this is a text summarization in a structured way. Big summarization can also be if you go back in the first room that you have written there, we had four or five lines and it summarized for us that is also take 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 big summarization. Now let's do an example on good generation, which mostly from people from tech domain or data domain will use chargeability for.Right. So the prompt has a python recursion. Good for calculating factorial. There we are defining a method to calculate factorial if any is equal to one equal, equal to one return and else return. And in do calculate factorial. We are doing recursively right now the same calculating factorial we have done with non l recursive function.Right? V I'm giving an example on that as well. Now what we want is to write a program with recursive function to check if string is palindrome in python or not. Right there we have given two examples of recursion on factorial and we are asking Jack depicted to generate code for palindrome. Now this has given that okay, the comments that this is the base case.If the length of the string is zero one, it's a palindrome. 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 C.Okay, you can also in your prompt C, please explain line by line as well if you want further elaborated explanation as well, though it has given comments right? You can further ask give me further more explanation for this. Now let's see the same thing in charge of beautiful in jagged but before it actually has explained what is this function, what it does there Len is equal to zero a single character.What it will do, both cases will be true. It runs. It wants to look what is the recursive case first checks If the first and last characters of the string the same calls is palindrome, it is telling each and every thing 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 good for a specific problem statement and how for generate. So basically four is more optimized for code generation rather than 3.5. In 3.5, you can iteratively please optimize, please optimize this, Please optimize the straight in four. You can do once or twice and then actually it will give you an optimized version for the C and you can write for the mode to define 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. We are you giving an instruction where you are giving restrictions. We are doing very you are following items from your checklist.There you are following a pattern to provide a pattern to your body 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 a strategy party to perform task without any additional examples.For example, I just see classify my feedback into neutral, positive and negative and I give us line that is the input and it outputs the sentiment. That's it. This is my zero short few Short is teaching that examples that we saw previously that the give do examples. And third is that input there we are indicating how we want the output and it gives the output for the scene.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. Few short is giving examples for you to learn and produce your response. No chain of thought General start is designed for logical tasks. Anything logical, it is the best prompt strategy to follow.You give in chain of thought and example how to do a process. For example, you are adding you are given an example. Two plus two is equals to four. Then you see 15 +40 Student 19 Then you give an input. Okay, I want 3150 plus 10,500. What will be my until you are telling how to do the process and then you are asking in your input what would 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 Z with x? So all these logical questions, all these logical and complex bits is for chain of thought. Now let's see examples of these three prompt strategies on chargeability so that you understand it better.How to work with these on actual playground. Let's now see few examples on these advanced prompt zero short few short and chain of thought. Now zero short is giving no examples, just giving the instruction just me what it needs to do. So these take a simple example, very generalized example. There we are generating a passage in the style of William Shakespeare.Okay? We are giving this prompt based on what child you would have been trained on. It has given a passage from of William Shakespeare, but from there it is from you can ask from there. This passage is from the passage I provided is an original composition written in the style of William Shakespeare. While it captures the language, imagery and teens often found in Shakespeare in work, it is not directly derived from any specific text by the Bard do do do want the same right.You need to give the feedback now. I do not want in this manner. I wanted a extracts from his own plays or his own poetry and given and as an example. Right? Or is it following what you want right. You can give that as a feedback as well. No, this is zero short. If you want to make this as a few short, we need to give an example we have given an example generate a passage in the style of William Shakespeare.Example is what is the text to be or not to be? That is the question. Shakespearean style rewrite is whether this nobler in the mind to suffer the slings and arrows of outrageous fortune. Similarly, in example, do we have given all the words is a stage and all the men and women merely lose, right? So now we see this is few short.It has given an example out out brief candle lives, but a walking shadow, a full player that struts and Fritz his are upon the stage and then is heard no more right and Shakespeare in style for this. So this is an example of zero short and this is an example of few short right. Let's take another example.There we see charged but due to translate, it's a lot of William Shakespeare. William Shakespeare. Right. Let's take a simple, more simpler example. When I say translate this English sentence to Spanish, I am a Spanish. I this is the English sentence. I want to translate in good 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 more examples for the scene. I see 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 feel short for the scene in Georgia before there is an option that we want to highlight is that you can click on this attachment, add any attachment, it can be dataset, it can be images and clean your child.You pity that, okay, for example, you want to train. These are the picture of roses that 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 does 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 signs or data analysis, different activities visualizations as well. There you can give the data and ask Chad Djibouti to analyze, visualize the data and give you outputs for the scene. Now let's see the chain of thought. Chain of thought is set to be logical. It works on logical bits right here.In this prompt example, we have designed few question and answer that is on relation there. The first question is if Michael C's back picks, Mother is the only daughter of my mother. How is related to Patrick? Via are giving the answers. 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. 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 sister is Emma's aunt, which makes Thomas, who is Linda's son, Emma's cousin, right now on 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. Good. And it's based upon your examples.Chain of thought can be of different types as well, where you can give different examples. They are complex examples as well, and it works. It is short also. It does feel short also. So basically this comes on a few short chain of thought prompt. Okay, zero short is separate that you give directly what you want without more explanation in your prom designs.Right. And then there is 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 branch chaining, we have respond rephrase, we have drill start, have many advance 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 Chargeability. I hope you have understood these three different advance prompt strategies. Zero short the where you do not provide any examples, few short that you provide that you teach with few examples and chain of thought. It has three versions and is for logical thinking is used for logical thinking and logical problems can be 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 the understood different advance strategies.Prompt strategies, which is zero short, prompting few short prompting chain of thought that examples. These are what are the common prompting errors can happen if you miss something. And at last we saw applications of prompt engineering. What are the difference these in which prompt engineering can be used? So the key to becoming a proficient prompt engineer is to practice with different prompts again and again.Give feedback to your generative models. Be charged Djibouti, be a 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, 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 platforms to enhance your skills. This is how you can become sufficient Prompt engineer. I hope you enjoyed this course. Thank you.
- Assistant