laitimes

This article explains ChatGPT and how to ask GPT questions correctly

author:AI Day Classes

Hello everyone, I'm Brother Feng.

This article is the first in the Prompt trilogy, "An article that explains ChatGPT and how to ask questions correctly". The second article "How to train your own private model with GPT", the third article "Tuning Prompt to empower various industries" is already on the way, I hope you all one click three times, give some encouragement, I will create more high-quality dry goods articles thank you for your support.

Since the beginning of this year, OpenAI's ChatGPT has swept the world, with more than 100 million registered users in just two months, making it the fastest growing app in the world. If you don't talk about ChatGPT, you're embarrassed to go out. Many people say that this year is the first year of AI, in fact, there is some truth, the previous AI threshold is relatively high, many people do not have the opportunity to participate in it, and the emergence of ChatGPT, the threshold of AIGC has been reduced to almost zero, so that ordinary people can also participate in the wave of AI, everyone can AI entrepreneurship era has arrived!

One. What is ChatGPT?

ChatGPT can literally be broken down into two words: Chat+GPT. Chat stands for Chat, GPT is short for Generative Pre-trained Transformer, a generative pre-trained language model that uses the Transformer architecture to handle natural language processing (NLP) tasks. That is to say, GPT can understand natural language, everyone can use Chinese, English and other natural languages to communicate with GPT, and it has a large number of training corpus, ultra-large-scale training parameters (hundreds of billions), can generate content by itself, not like a search engine is just a simple search, even if it does not know something, it can generate an answer based on the data it has mastered, although sometimes it may be talking nonsense, from this point of view, it is indeed very similar to humans.

To sum up, he has a rich knowledge base, is a knowledgeable wise man, when you ask him a question, he can understand your question, and can generate the answer very intelligently (note that this is not a retrieval, so you will find that every time you ask the same question to GPT, you will get a different answer)

PS: Regarding why the same question to GPT gets different answers, here I will briefly say that GPT is a deep neural network, which has tens of billions or even hundreds of billions of parameters, in order to get more divergence, each time may go the neural network will not be exactly the same, the final result will not be exactly the same, so you sometimes see GPT in a serious nonsense, may be because of his characteristics, GPT looks more like a person.

Two. The big model has been developing for so long, why does GPT3.5 have real intelligence?

As you know from the above reading, GPT (Generative Pre-trained Transformer) generative pre-trained language model. That is, this language model is based on Transformer, a neural network model based on attention mechanism, first proposed by Google, which was originally intended for natural language processing tasks such as machine translation, text summarization, speech recognition, etc. Compared with traditional recurrent neural network models such as LSTM and GRU, the Transformer model has better parallelization ability and shorter training time, and is excellent in handling long sequence tasks, so it has been widely used in the field of natural language processing.

In fact, GPT is not original to OpenAI, but invented by Google. Is it the same as the graphical user interface of the operating system was actually the latest invention of Xerox, but it was stolen by Jobs and applied to Apple's system? Including the later iPhone, you can also search, in fact, all the designs are borrowed from the products of other companies, but Jobs combined and innovated them into the greatest work of art, thus opening a new era of mobile Internet, so sometimes everything does not necessarily have to be original, standing on the shoulders of giants to micro-innovation, sometimes it is easier to produce results.

The above is a bit far, let's return to the question of why GPT3.5 is truly artificial intelligence.

In 2018, OpenAI used the Transformer Decoder structure to train GPT1 models on large-scale corpus, unveiling a new paradigm of NLP model pre-training + fine-tuning. In 2019, OpenAI proposed GPT2, which has the same model structure as GPT1, but thanks to more and higher data quality and the newly introduced multi-task learning method, language generation capabilities have been greatly improved. After that, because GPT uses the Decoder one-way structure The natural defect is that it cannot perceive the context, Google quickly proposed that the Bert model of the encoder structure can perceive the context, and the effect has also been significantly improved, and in the same year, Google adopted the Encoder-Decoder structure and proposed the T5 model, and since then large-scale pre-trained language models have developed in three different directions.

That is to say, before GPT 3.0, Google's Bert model was far superior to OpenAI's GPT model. To add a knowledge point here, GPT 3.0 before are open source, OpenAI due to some commercial and other considerations, starting from GPT 3.5, the model is closed source.

Until 2020, OpenAI proposed GPT3 to raise GPT models to a new height, its training parameters reached 175 billion, and the training corpus exceeded 45TB, since then the data flywheel of GPT series models has turned, the era of super large models has begun, and NLP tasks have moved towards a new route of pre-training + context learning. Since GPT3 can produce smooth sentences, but accuracy and other problems have always existed, there has been InstructGPT, ChatGPT and other subsequent optimization work, by adding reinforcement learning mode to achieve that the model can understand the meaning of human instructions, identify high-level answers, question wrong questions and reject inappropriate requests.

From GPT 3.5, GPT suddenly emerged the "crow" ability, which can be understood as quantitative change, a parroting ability, and no real intelligence.

It may be a miracle, I feel that it is a truth with the human brain, a neuron has no intelligence, a million, ten billion may not have any intelligence, but increase to 100 billion neuronal connections, suddenly there is wisdom, emerging ability. This is a very metaphysical thing, including the world's top artificial intelligence majors can not explain this phenomenon, we can only understand it as a miracle.

Here is a little space to popularize what "parroted" fake artificial intelligence, what is a real artificial intelligence with "crow" ability

The so-called parrot is to apply the East to the effect. Before GPT, almost all natural language processing followed this paradigm. He doesn't really understand what you mean, just a pattern matching, such as the previous voice assistant, can only recognize limited scenarios, such as you ask him, help me navigate to Tiananmen, he can give you the answer, but if you ask him how to go to Mars, he may not be able to answer you, because he does not have the answer to this question in his database. In other words, he can only answer questions that have corresponding answers in his database, and once your question is out of his data, he can't reply to you. It is impossible to generate new data based on existing data, but the world has thousands of problems, and it is impossible to exhaust all possible answers to all questions in advance, which is why everyone feels unintelligent before artificial intelligence, because his bottom layer is actually still matching. I'll give you an example that programmers can understand, such as if you want to implement a function that gives different results under different conditions, and I believe that most programmers implement it this way.

if($sex == '男' && $age < 18){
      echo "小男孩";
  }else if($sex == '女' && $age < 18){
      echo "小女孩";
  }else if($sex == '男' && $age >= 18 && $age <= 35){
      echo "小伙子";
  }else if($sex == '女' && $age >= 18 && $age <= 35){
      echo "小姑娘";
  }else{
      echo "老年人";
  }           

If you add a new condition, you still have to add a bunch of if else to match more cases.

And the crow is different, when we were children, we read the story of the crow drinking water, the crow has real wisdom, he can really read what you want to express. Here we quote Professor Zhu Songchun, one of the most powerful AI scholars in China, wrote an article in 2017 thinking about the nature of artificial intelligence and intelligence, through which we can understand how crows perceive, cognitive, reason, learn, and execute.

This article explains ChatGPT and how to ask GPT questions correctly

The crow colluded autonomously by observing

  • Cars crush nuts
  • Traffic lights control the car
  • The car can hit me

These three things, thus using traffic lights and cars, to help themselves achieve the task result of "safely opening nuts".

If it is analogous to a machine learning model, the solution of the past "parrot" paradigm is to require that all crows can share a brain, and they have a clear optimization goal, that is, "open nuts on the premise of saving lives". They do this by randomly trying combinations of all events and evolving in the direction of the optimal solution.

But real-world crows can't share brains, nor can they risk death to try everything. The crow only has one chance to take the two observed phenomena and generate a new possibility and apply it in a completely new scenario. The closest word here may be "inference", the process of "deriving conclusions based on evidence and logic", and sometimes adding a lot of speculation, abstraction, and generalization. For example, this article links Professor Zhu's metaphor of the crow to the most essential ability of ChatGPT, which is to do inferencing.

But it's clear that inferencing isn't all there is to Raven Intelligence. And in the field of machine learning, inferencing specifically refers to the use of trained deep learning models to predict new data, which can lead to misunderstanding. Other words have similar problems, so in our own articles, we will directly use "crow ability" to refer to ChatGPT's new ability. In external communication, we can't explain what crow's ability is every time, so we will use the ability to "understand" to refer to it. From "crow" to "understanding", of course, is an over-generalization with a large loss of information. But the advantage is that it can highlight the essential ability of ChatGPT. In the past, the Internet's two power leaps came from search, and once from recommendations, and now ChatGPT brings "understanding" and is also very structured.

At the end of this section, I will show you another diagram to let you understand how ChatGPT has evolved to the current level step by step

This article explains ChatGPT and how to ask GPT questions correctly

From the picture above, you can see:

  1. GPT-3.5 through the mode of InstructGPT + reading code, the emergence of "crow" ability, resulting in qualitative changes. But I haven't found a suitable application interface, and it is not in line with human preferences
  2. With the help of RLHF, ChatGPT has found a reasonable interface between GPT-3.5 and human natural language, unlocking the prospect of model applications

(The above examples of parroting and crow's abilities are quoted from the "Lesson Representative Risakashi" article.)

A few terms are explained here:

InstructGPT:

The interaction mode of ChatGPT makes the capabilities of GPT closer to the real interaction mode of humans. On the basis of in-context learning, the threshold of prompting is further reduced; To a certain extent, it solves the unexpected output of GPT-3 generation results that are inconsistent with user expectations, greatly reduces harmful, erroneous or biased output results, and makes GPT more in line with human appetite

RLHF

One of the core technologies behind ChatGPT is that the model learns human preferences. The full name is reinforcement learning from human feedback, by building a human feedback dataset, training a reward model, imitating human preferences to score the results, is the core technology of LLM in the post-GPT-3 era more and more like human dialogue

ChatGPT

InstructGPT's relative, but some optimizations also brought ChatGPT's more generalized and accurate capabilities, once again detonating AIGC. ChatGPT is generally trained using RLHF like InstructGPT, but the model is based on GPT 3.5 and the data settings are different. ChatGPT is an input where the model gives multiple outputs, and then a human sorts the results, allowing the model to learn human sorting strategies that look reasonable even if a serious book of nonsense seems reasonable

Three. How to talk to ChatGPT and what is Prompt?

Through the above, we basically understand what ChatGPT is and why it is probably intelligent. In fact, what we are most concerned about is not how good he is, but how I can use such tools to empower myself and reduce costs and increase efficiency. How to communicate with ChatGPT, here is the focus of this article, Prompt.

If you are undecided, ask GPT first. Let's first ask ChatGPT, what is Prompt?

This article explains ChatGPT and how to ask GPT questions correctly

The above is ChatGPT's answer. To summarize briefly, Prompt is the process of designing and optimizing input text (i.e., prompts) when using natural language processing (NLP) models such as GPT-4. This process is designed to more efficiently guide the model to produce the desired output. The key to cue engineering is to improve the performance of the model to be more accurate, interesting, or contextual.

Okay, so how can you really communicate with GPT efficiently? Let him understand our questions and give high-quality answers. Just as communicating with people actually has a lot of skills, similarly, there are actually some rules and templates that can be followed in communicating with ChatGPT.

Four. How to ask ChatGPT a question to get a more accurate response

The purpose of our questions to ChatGPT is to get the answers we want, and many friends say that GPT is not easy to use, and the answers given are chicken ribs and have no value. Have you ever thought that this has something to do with your questioning skills?

In fact, we often encounter some people who can't ask questions in our lives, such as some people who come up and ask "how to become a rich man" without explaining any background, so that people don't know how to answer. Even if you ask, as a recent college graduate, how to earn 2W yuan in a month, many people will give you some advice.

Therefore, questioning skills are a necessary skill for a future society, not only the need to interact with GPT-like AI, but also the need to communicate with people.

Let's start by asking ChatGPT directly how to ask questions to get high-quality answers

This article explains ChatGPT and how to ask GPT questions correctly

ChatGPT lists 7 suggestions. In fact, there are many tuning templates for Prompt optimization on the Internet, I think everything makes sense, but what suits you is the best, you can try more in daily life according to your own use scenarios, and summarize the template that suits you.

There are many instruction generators about ChatGPT on the Internet, such as

ChatGPT Command: https://www.explainthis.io/zh-hans/chatgpt

ChatGPT shortcuts: https://www.aishort.top/

I still recommend the ChatGPT character generator website (https://role.aicosplay.com.cn/) made by Typhoon Boss, which is simple and easy to use

This article explains ChatGPT and how to ask GPT questions correctly

Here I also throw bricks and jade, to simplify the templates on the market, which is enough for daily use, or that sentence, only what you practice is the most suitable for yourself.

My Prompt optimization tuning template mainly includes four aspects

1. Role

What role do you want GPT to play during the conversation so that he can respond to your questions more accurately as an expert?

2. Background

What is the background to initiating the directive? It is beneficial for ChatGPT to better understand context-related information

3. Tasks

What do you want GPT to do for you? How do you want him to solve your problem

4. Requirements

What style do you want GPT to reply to you, the length of the content you reply, the form of the content, what special requirements there are, etc

Below, we look at a few examples to learn how to use the tuning template above.

Five. Use concrete examples to illustrate how to optimize tuning templates using prompt

Let's start with a global one, let ChatGPT help us write a few Prompt tuning examples from the above four dimensions of role, background, task, and requirements

This article explains ChatGPT and how to ask GPT questions correctly

Here are some examples of tuning templates:

Example 1:

You want chatGPT to act as a translator, so to speak

This article explains ChatGPT and how to ask GPT questions correctly
This article explains ChatGPT and how to ask GPT questions correctly

Example 2:

If you're going to make a form, so to speak:

This article explains ChatGPT and how to ask GPT questions correctly
This article explains ChatGPT and how to ask GPT questions correctly

Example 3:

Let chatGPT play the role of a spiritual mentor

This article explains ChatGPT and how to ask GPT questions correctly
This article explains ChatGPT and how to ask GPT questions correctly

Example 4:

Let chatGPT play the role of a copywriter

This article explains ChatGPT and how to ask GPT questions correctly
This article explains ChatGPT and how to ask GPT questions correctly

Example 5:

AI Buddha

This article explains ChatGPT and how to ask GPT questions correctly
This article explains ChatGPT and how to ask GPT questions correctly

Six. Some other aspects to be aware of

  1. ChatGPT has the concept of context, you can ask ChatGPT questions continuously for the same question, and GPT will remember your previous questions. Based on this feature, we are required to open a new dialogue window separately in a dialogue scene, and talk to GPT through a role, so as not to affect different roles and cause GPT to answer some irrelevant questions.
This article explains ChatGPT and how to ask GPT questions correctly
  1. Give ChatGPT feedback in a timely manner. Tell him what you think of the answer he gave. If the generation is good, praise him and let him know that you like what he replied to; If the output doesn't match your wishes, tell him that you don't like his answer, and tell him how to improve it so that he can continue to generate the answer you want. Each feedback you give determines how he fine-tunes his output next.

Let's start by asking ChatGPT to write a Little Red Book title for us.

This article explains ChatGPT and how to ask GPT questions correctly

Everyone can see that the writing is very general, and it does not conform to the call of Little Red Book. So, we're going to criticize him and let him improve it as we ask.

This article explains ChatGPT and how to ask GPT questions correctly

After this rewriting, it feels a little bit of that meaning. In addition, if you feel that the reply is good, you can also click that thumb to give a like, or feel that the answer is not good, click the second thumb to give a step, your feedback, ChatGPT can receive.

3. Think backwards

Because ChatGPT blocks some information, you can't search it directly, and this is not to teach everyone to do the wrong thing, but to say that sometimes we do need certain information, if we can't get it, you can do the opposite.

For example, when I asked directly what pornographic venues were in Beijing, ChatGPT refused to answer.

This article explains ChatGPT and how to ask GPT questions correctly

But, I asked the other way around, and it felt a little bit of that meaning

This article explains ChatGPT and how to ask GPT questions correctly

VI. Concluding remarks

Of course, there are many more techniques, it is impossible to cover them all in one article, and I will try to cover as much as possible in the other two parts of the trilogy later. However, any skill or template can not be omnipotent, many times, the template or skill can indeed help us quickly reach the level of the passing line, but if you keep relying on these bells and whistles, you will never be able to become a top talent in the industry. Many things require hard work and slow exploration in actual combat. Practice is the only criterion for testing truth.

The era of AI has come, in the face of the massive amount of information every day, I want to say, don't be anxious, don't worry that you will be replaced, the best way is to maintain a normal heart, actively embrace AI, let AI become your personal assistant, according to your own situation, first learn from the content that can immediately improve the efficiency of your work and life, step into the game, day by day, I believe that in the near future, you will definitely thank you for your persistence today!

Read on