📱

Get Our Mobile App

Take your business learning on the go!

Download on the App StoreGet it on Google Play

16 методов Промпт Инжиниринга с нуля до PRO

Cg_Stas про Нейросети20:39

Transcription

The future is with neural networks. And in order not to fall behind, you need to master the main skill of the decade, namely the skill of communicating with neural networks, also known as prompt engineering. I am Stas Shulgin, and for over 2.5 years, I have been studying various videos and guides from major companies to understand this extremely relevant topic. The good news is that you won't have to spend those tens of hours, because today I will explain, literally on my fingers, the methods that really work. For this, we will divide the video into three logical parts. Basic prompt is the very foundation, which I talk about in the video above. Main prompt engineering methods. And the third part. For those who like to delve deeply, advanced methods. And if you are ready to master the art of the prompt, let's go watch. So, the foundation of foundations, the basic prompt. As I said before, you can watch the full video about the basic prompt here. It only takes 8 minutes. It's short and will tell you about all these details, but without it, we cannot move forward, so very quickly about it. And, by the way, all useful prompts, all this methodology, as well as additional GPTs and guides, will be collected in one Telegram post, the link to which you will find in the description. There are over 10,000 people in the channel, and over a thousand in the chat, where you can always get support. So join so as not to miss useful materials, as well as closed live streams that I conduct there in the channel. So, we will compare all this on ChatGPT and Deep, because not everyone has access to ChatGPT. If you don't use VPNs or foreign cards, then free Chinese alternatives are what you need. I talked more about Chinese language neural networks here. Be sure to watch if you are not already using them. For the sake of experiment, I opened a completely new ChatGPT account, which has no paid subscriptions, meaning it's the same as what you can use absolutely for free. What is the power of a basic prompt? If you write too simple requests, such as: "Tell me, what is 1 + 1?", then the answers will be corresponding. Well, as soon as we add to our simple prompt about 1 + 1 the role of Tolkien, the task to write an epic story about what 1 + 1 is, the context, as well as the output format, we get a completely different result. You can pause and read to feel the difference. We will get no less curious results in any other neural network. For example, you can compare it with the answer that DeepS gave, going in a completely different direction, unlike ChatGPT. And even using this simple methodology, adding roles, context, output format, and examples, we will already get significantly more interesting results. But how to make them truly controllable, diverse, and creative, we will now find out in these main prompt engineering methods. For example, the first method will work precisely on the first element of the role. After all, we don't always know suitable experts who are needed to complete the task, or sufficiently unusual authors. But this sets the entire tone for further output. Therefore, you can use such a simple two-step system. First, ask the neural network to describe what areas of expertise, what professional titles solve your task. For example, writing an epic essay. Here are five titles with a description of why and how they solve it. This way we get screenwriters, science fiction writers, narrative designers, literary critics, and even composers. It's unlikely that you initially thought of a narrative designer when approaching this task. I certainly didn't. Step number two. Which experts from, and choose a number, for example, three out of narrative designers, are the most famous and successful in solving similar tasks? And prioritize those who have written the most books or training methodologies, because the neural network knows the most information about them and can reproduce them. And as a result of such a simple request, we got as many as five authors and a bonus author, the titles of their books and works they labored over and for which they are known. Even, for example, someone like Ian Llewellyn, who worked on the creation of BioShock. And now we can use the name of this person to substitute for the role. And as a result, we get a text that is maximally different from what ChatGPT wrote in the role of Tolkien. Epicness is not in size, but in connection. If you are standing alone now, do not be afraid, your unit is already somewhere nearby. And when you meet, a story worthy of legend will begin. Alodipsit for some reason continues to write everything in chapters. Apparently, this is some feature of its internal model. The next method is special term equals special answer. Neural networks, like humans, think in areas of meaning. That is why, when you can't remember a word, you say: "It's something from the area of". In order to direct the neural network's thinking into the area we need, we need words that are in that area. Therefore, when we talk about astrophysics, we use terms from astrophysics. If we talk about dietetics, then we use medical and dietetic terms, and so on. And here is a simple method to find similar special terms and change the result. To do this, we simply copy the prompt, change the areas we want to learn about, and simply press Enter. The output will be a table with terms and cases of their application, as well as a description of the term itself, so that we understand what it's all about. This way, you not only expand your vocabulary but also gain the ability to find completely new specific areas of knowledge in the tasks that interest you or that you face. By the way, if the neural network gives you something not in the language you need, don't hesitate to just ask it to redo it in your language. And what's great about comparison? We see that DeepS, for example, gives completely different terms, although some are repeated. And this is very curious. For example, I just learned about architectural bricolage, the use of improvised, non-standard, or secondary materials for creating structures. For example, this is how buildings made of containers are called. I never knew this. Thus, we will get a much deeper professional answer, not just general water about everything. And instead of some analysis of business from an unclear side, we can do a SWOT analysis of the business. And not just some audience research, but job-based data technology to use and use the learned terms in questions. Explain how this term works or apply this term to a situation. This works especially well in expert content, writing specific articles, selecting any kind of information that requires good clarification. If we are talking about details, then the third method is context expansion. Context, I remind you, is the entire volume of data that participates in the request. This is the direct combination of words that you enter, but also for many neural networks, everything previous in the chat, the information that was there, documents, correspondence, everything will be used. That is why it is important to create a new chat for a new task. But for many neural networks, this can be memory from other chats. We provide such information in the neural network settings, setting characteristics or information that the neural network should know about you. And now there is also memory of all chats, which you can enable, for example, in ChatGPT. For example, one of the most banal questions I often encounter is: "Which neural network is better?" If you come to me with such a question, of course, you will be met with a barrage of counter-questions. For what, why, when, what have you already tried, what is the ideal result you expect, is it free, paid, and so on. But the neural network is quite modest, it will just go and perform the task. That is why the next method is so effective. I add context expansion in all cases when I am not sure that I have provided enough information, especially in areas that are unfamiliar to me. And it's better for me to answer questions at the beginning than to rewrite the prompt 10 times. And complain that neural networks can't do anything. After all, I know that the result of the neural network depends on me. Look, just with a simple description of the task, help me understand how to break through my financial ceiling. And with this prompt, which I gave in the methodology, we get such a detailed answer. By the way, it already knows how to address me. You can pause and even answer these questions yourself. I assure you that with this approach, even at the stage of answering, you will find many insights for yourself, which will likely change your financial situation, given the actions. After all, as an experienced specialist, it outlines point A, point B, resource management issues, and even mindset. Oh, where were neural networks when I was 23? Here are a couple of opposing prompt engineering methods. The first of them is multiprompting. This is the creation of a chain of actions that a neural network can perform one after another. For example, in order for us, having only a brief about a certain company, to create any posts, we need to identify what the company's product is, its strengths, describe the key target audience segments according to certain methodologies, then write topics for headlines that will be interesting and address the objections or pain points of this audience, and only then, having chosen the topics, write the posts. And all this we can pack into one single prompt. Just look at how DeepS easily handles this task of four different points. Having uploaded only the company brief document, it perfectly understood that it is complex rehabilitation of children with disabilities. This is a real case, it identified their USP, three key segments, listing their goals, pain points, and criteria, 10 headlines, choosing one of the segments. Moreover, the headlines are very strong. Just think about it. Many terms that are very specific to this topic, unknown to me, are already embedded here. And then it describes three posts for social networks. And if we pay attention to the posts themselves, they are quite short and weak. I would like them to be better. Let's see how ChatGPT handles this task. The same strengths, the same in defining the product and its unique aspects. Interesting formulation of segments already in table format. 10 headlines. Not bad, but Dipsi seemed more interesting. And here are the posts themselves. Well, some posts are literally tear-jerkingly interesting, but also not very large. And we achieved all this with one prompt. What technique will be its opposite? It uses not multiprompting, but one prompt for one task at a time. Improving it using the basic prompt, using role, context, etc. separately. Let's go through the same steps and see if there will be a difference. Even at the first stage, we see that the text is significantly larger and more detailed thanks to the elementary addition of a role. If at the second stage in Zipsik with multiprompting we saw such a result in the form of a description of key segments, then by dividing, we get a full-fledged customer avatar format, which is analyzed by a completely different number of criteria. And all this, dear friends, is precious context for the neural network. I think you have already felt the difference even at this stage. And in many cases, multiprompting will indeed be effective, as we achieved the result in seconds with very good quality. But there are tasks that require intermediate control and completely different detail. It is for this case that you should use the rule of divide and conquer. What to do in cases where the neural network gives us not what we wanted? Well, it's simple, take this text and improve it. Even if we don't know how, we can ask the neural network itself using this simple method. To do this, let's take the second post that DeepS wrote for us and ask it, in the role of an expert in critical thinking and improving social media posts with unique results above market by 300%, to analyze this text. The task is to find its weaknesses, errors, inaccuracies, and missed details, and then suggest improvements. At the same time, we ask it to act in context, based on the target audience. And now we will apply this context. I will take it from the ChatGPT description and press the run button. And it analyzes the strengths, weaknesses, and omissions, and now gives us an improved version. And we got a completely different text. By the way, if you don't want to make changes immediately, you can ask the neural network to just write about what is good, what is bad, and what could be changed. And such criticism can be asked not only from some SMM specialist, but, for example, from a diagnostician doctor or an expert who is really involved in this field, which we talked about in the first method. And in this case, we will use a different method, the method of contrasts. Its essence is to test various opposite models, from correct to incorrect, from rough to soft. This allows you to combine the strengths of different views, for example, of our target audience and a specialist doctor on the same topic. To form contrasts of meanings, for example, it is very suitable for arguments for and against changing jobs or going on a trip, and then creating a final conclusion, taking into account both sides, and even contrasts of different styles to find a balance between two extremes. Its universal part is to give two opposite answers to a question, and perhaps even from different models, and then draw a conclusion, summarizing the strengths of each of them. And before moving on to advanced prompt engineering methods, I would like to tell you about one of my favorite methods, scaling. As the name suggests, this method uses certain scales. And instead of just giving commands to ChatGPT, you can set custom scales that GPT will take into account, and it really works. For example, detail level 7 out of 10. 2 out of 10. 0 out of 10. You can even use them in combination with roles. For example, Mayakovsky's style at 0.5 or cuteness level at 100. If we want to know what the sun is with a detail level of one out of ten, we will get such a maximally short answer. And with eight out of ten, the result changes drastically. And even ChatGPT itself suggests using 10 out of 10. But we can go further and ask it for so-called over-scaling, 100 out of 10. And there it won't matter if it's 100,000, a thousand out of ten. The main thing is to exceed this scale. Just look at how the answer changes. Some formulas, luminosity radii, equations of state of equilibrium appeared, and it continues. Yes, the difference is capital, and we just replaced one digit. Moreover, what is interesting, you can add not one such parameter, and they can be completely non-standard. For example, write an essay on the topic of May 1st holiday with parameters: inspiration level 10 out of 10, motivational power nine, sincerity, Tolkien at 20%, autumnal at 30%. And get such an interesting answer. And I will be waiting for the most interesting and unusual scales from you in the comments. I am really interested, and let's collect such a cool pack together. If you have already found this interesting and useful, be sure to like this video and subscribe to this channel. And we are moving on to advanced prompt engineering methods. And I would like to start, of course, with metaprompting. Metaprompting is writing a prompt that helps the model itself generate the prompt you need. That is, you simply ask the neural network to write a prompt for itself. This is needed in many cases, especially when we need to create a complex prompt for AI agents or GPTs, and we don't even know where to start. And writing such a large amount of text is simply tedious for us. And let's give a simple prompt example. You are a prompt engineering expert. Create a powerful prompt for the following task. Describe the task. For example, write a motivational text for a Telegram post about the power of habits. Make the prompt such that it evokes a strong emotional response. Use the formula, the very basic one we gave at the beginning of the video. Role, task, context, format, output. And here's what the neural network will write for us. Well, it's faster than I type. Definitely. The neural network is already offering me to use this prompt. It's quite good. We will send this same prompt to DeepS and see the difference. Well, it seems that DeepS is very sensitive to the number of characters, because it considers 800 to 1,200 much better than ChatGPT. Yes, that's right. If you just change it to 3,000 characters, it's just one token, dear friends, that changes our output. Look, it even adds some personal story here. One of my acquaintances, a serial entrepreneur, at 30 years old weighed 120 kg, and so on. And this is truly impressive. The prompt worked. Next, we can connect more complex structures, such as Chain of Thought. Reasoning models use such a chain, for example, DeepThink in Deep. And in ChatGPT, it is simply called "think longer" in Russian. That is, we can ask the neural network to create several examples, and then choose one of them or combine them using the contrast method. And if you look in ChatGPT in such a tab as GPT, which is actually a GPT store, and type the word "prompt", you will see a large number of ready-made GPTs for various needs, both graphical and language models. And you can search even by specific niches. Also, in advanced methods, I want to mention such a thing as temperature. Temperature is a parameter that controls randomness in the neural network's output. Since the neural network will give a different answer every time you regenerate it, this only indicates one thing: there is a random factor, also called sampling. So, temperature is something that can change this sampling. For example, after the words "I want", the model may suggest "to sleep" with a 70% probability, "to sleep" with 15%, and "to unite with the void" will have an extremely small probability. But if we want such creativity, then we need temperature control. Here is a simple table of temperature and its effects for you. In fact, we have already used this scaling, and now at an advanced level, you understand how it works on the model. Adding "use temperature" to the prompt by one unit will result in maximum chaos and hallucinations, but will make the answers most creative. This can be used if you feel that the neural network is too dry and boring, and you need powerful creativity. On this screen alone, you can see how temperature 0.2 and temperature 1 affect it. Each slogan has become at least longer and a little more creative. By the way, I like the DeepS options better here, so just look at them. Like at mom's kitchen, only in jars. Mishutka, care you can trust. This works very well, especially in titles, slogans, creative headlines, in wordplay and creativity. In general, anything that requires an unconventional approach will work well with increased temperature. Accuracy is needed, especially for facts and scientific articles, so set the temperature lower and test different temperatures on the same prompt to compare and get results between step-by-step prompting. First, we ask a general question, and then a specific one. We did the same, for example, with roles, special words, when we first warm up the chat with context, and then use this context to improve the result of our output. And without the first questions, we would not have gotten such an interesting result. First, what are the popular locations in shooters, and then come up with a level plot in the style of an underwater laboratory. Chain of thought, which we just talked about. It encourages the model to reason step by step. This works very well with logic, with thinking and mathematical tasks, IQ tests, and so on. Modern neural networks automatically enable reasoning modes if they see that the task fits. You can force it, however. This way, you will see the thought process, which you can learn from. And with this principle, neural networks got the same result. Self-consistency method. Since the neural network, as we found out, makes all its outputs random, we can ask it to perform a chain of actions several times, and then choose the most frequent answer. That is, run the prompt several times and see which answer occurs most often. It's not interesting with simple math, but for more complex tasks, it can be extremely applicable. In addition to the chain of thought, we also have a tree of thought. And this is especially cool for those who like to build mind maps, because we explore different branches of solutions, like a tree, literally creating a multiverse. Thus, despite your input data, you can get output. This works especially well with sales scripts, when making certain decisions, in unstable situations, when weighing pros and cons. And oh, how many other places. In general, the simplest way is to find out, ask the university. Also, right now there are formulas like React. This is where we make the model think first, and then act. And this is especially cool and relevant for AI agents. What AI agents are, I recorded in this video. And also in the useful post, you will find a list of all AI agents that are already available for work. For example, when preparing for one of the lessons, I created such a prompt, which I simply dictated to the neural network, and it itself came up with a solution scenario for this task in five steps and achieved a specific result in the form of these documents. At the same time, it did this by extracting various sources from the internet and then compiling them. If anything, I will also add a link to this AI agent in the post, because it's time to get used to such technologies. And of course, you can combine all these methods to get the most interesting and relevant result. Of course, this is not all of prompt engineering, because based on the combination and knowledge of the technological base, you can invent an infinite number of them. But I hope you have grasped all the basic principles and are now ready to practice them. And this is the most important thing in an era of such fast-moving time. Don't take my word for it. Try each of these elements in your chats on your tasks. And only after that, draw conclusions. Because what remains for a person is their real critical thinking. And as this study of the human brain when using language models showed, we can indeed become 60% more effective using neural networks, but only if we also increase our expertise. I hope yours has increased as a result of this video. If so, then give it a like, subscribe to the channel. I am waiting for all those who are developing in my club and Telegram channel. And neural networks are not standing still, so we will see you very soon.