ChatGPT was developed by OpenAI and is a powerful tool that can be used for various applications, including chatbots, content generation, and customer service. Its strength lies in generating human-like text based on the prompts it receives. In this tutorial, we will delve into the art and science of prompt engineering—crafting precise and effective prompts to get the best responses from ChatGPT.
We decided to focus on ChatGPT prompt engineering because it is a key skill when using language models. Understanding how to create effective prompts can lead to more accurate, targeted, and useful responses. See our course Introduction to ChatGPT for a quick understanding of the basics of this tool.
[baike]Quickly understand what ChatGPT is[/baike]Before we delve into prompt engineering, let us first understand how ChatGPT works. It is a large language model; it is a bot trained on various internet texts and other resources, but it does not know specific information about which documents are included in its training set. Therefore, it has text output and text filtering functions. The upgraded version, ChatGPT-4, can also generate images and recognize images.
[baike]ChatGPT's level of cognition[/baike]
ChatGPT knows almost all human knowledge. It can also program, translate, write, reason, co-create, and even call other software to help you complete tasks. According to AI expert Wu Jun, before ChatGPT emerged, our computers could already help us solve about 40% of difficult problems. Now that ChatGPT has emerged, the problems solved have reached at least 60%. The extra 20% is the result of its self-learning reasoning and integrated analysis.
[baike]Cognitive differences from humans[/baike]
If we compare human cognition with ChatGPT's cognition and understand the cognitive differences, then based on these circumstances you will know where you need to ask, which questions can get effective answers, which cannot, and how to ask.
Figure 1 compares the cognitive differences between humans and ChatGPT and derives four different situations. So what do you think the ? represents? Bring that into your thinking as we look at the next figure.
Figure 2 gives the answer. When both we and ChatGPT know, it is called the public area. The second type is when you do not know but ChatGPT knows; this is the second type, the knowledge-seeking area. We need to ask questions to learn and solve problems, and this is the most common situation. The third situation is when you know but ChatGPT does not; this is called the private area. Usually, data in the private area is precious and of high value, and it is also what ChatGPT wants to obtain. We usually use private data as our own knowledge base and do not make it public in order to realize practical value. The last situation is when neither of us knows, which is the aforementioned 40% of unsolved problems.
[baike]Characteristics of the differences[/baike]
No matter which area it is, we will use it. Our way of asking differs according to the different blocks. We need to fully understand ChatGPT's comprehension ability and communication logic in order to get answers, so we need to master certain skills. The moderator will list the characteristics of these four blocks separately; only after you understand them can you draw inferences from one instance.
1. Public area
The public area is where you know and ChatGPT also knows. When both sides know, it is easy to talk. You ask whatever, and it answers whatever; you can clearly know whether its answer is correct or good and give corrections. The public area is usually for validating questions, or for using your knowledge to educate others. It is a process of tuning and validation.
2. Knowledge-seeking area
ChatGPT knows, but you do not. This involves unknown or unfamiliar fields. You may have only a smattering of knowledge about this field or may be interested in it. At this time you only have a vague concept, and you do not know the specific way to ask or how to begin. If you ask poorly, you may instead go off track. Therefore, learning an unknown or unfamiliar field requires a set of learning methods, or at least a correct beginning.
I am a beginner, and I want to understand [xx industry]. What questions should I ask?
I am a beginner, and I want to understand [AI industry]. What questions should I ask?
This is a general prompt, but it is very useful. It will not let you go off track; instead, it will quickly get you to the point. For systematic teaching on the knowledge-seeking area, see: https://www.niuboyi.com/thread-650-1-1.html
3. Private area
The private area is usually our confidential area, our private data. We do not easily show it to others because data is valuable; only you know it and others do not, so it can usually be sold for money. The use of this part of the content is usually as training data: give the data to a bot to learn, create an automatic-reply bot, and use your data to give answers to others—of course, for a fee. Reference content: https://www.niuboyi.com/thread-631-1-1.html
4. Exploration area
Neither of us knows. For example, Sora was very popular recently. At present, there is only some official public test data, and the data has not yet been updated to the latest knowledge base. Those of us who work with frontier knowledge and share the latest knowledge often need such first-hand information most. When we do not know, asking GPT means we must use its analysis and reasoning abilities.
This is some of the currently available data on [sora] [provided content]. Let us discuss together whether there are similar products or technologies on the market, and how they perform.
In which industries do you think [sora] will play a role, and which fields will it affect?
After [sora] is released, what information do you think different audiences, such as the general public, experts, and social elites, most want to know?
[baike]Key to how ChatGPT works[/baike]ChatGPT generates text by predicting the next word in a sentence. It does this multiple times to create a complete sentence. For example, given the input "The sun is...", it may predict the next word as "shining" or "rising".
[baike]Basics of ChatGPT prompt engineering[/baike]Prompt engineering is obtaining the desired answer through prompts; it is also a skill of human-computer interaction that can effectively instruct ChatGPT to generate the required answer.
[baike]Principles of effective prompt engineering[/baike]
An effective prompt structure should include: persona, conditions, action, goal. In fact, this is the saying of our ancient sages: the conditions for achieving a goal are favorable timing, geographical advantage, and harmony among people. The whole sentence is complete and encompasses all conditions for success; it will not omit anything or be unclear. Conveying information with such a structure will not go wrong.
Example: Your friend gave you a Husky. You are very happy, but you do not know how to raise it. At this time, you want to know how to raise a Husky well.
Note: If you ask like this, as shown in the figure below, you think you have gotten the answer and you think you can raise it, but I tell you, you cannot raise it.
Because you have not yet explained the conditions concerning you and the Husky. The previous prompt only included the persona (you), action, and goal (basic). Suppose the actual situation is like this:
1. You: an 18-year-old woman. Because you are usually rather solitary, in poor health, and have mild autism.
2. Husky: 2 years old, male dog.
3. Raised in an apartment building in a residential community.
So after considering the comprehensive conditions, the answer should be that you cannot raise it.
To be continued with further updates.
|