LLM Prompt Engineering Practice: Preface

Original link: http://www.zmonster.me/2023/05/07/llm-prompt-engineering-practice-prologue.html

Not long after ChatGPT was released, I connected it to Feishu for use by colleagues in the company. Looking back at the chat records at that time, it still often refused to answer at that time, although it has greatly improved compared to the past dialogue robots. , but it still looks a bit stupid. I don’t know much about what it can do. Coupled with the company’s layoffs and the Beijing epidemic (the first half of December is the peak of the Beijing epidemic), I have no idea. Spend too much energy on this. After returning from the Spring Festival, it may be because the society has been released and after two months of fermentation, it is very obvious that the discussion is on the rise. How other people use it, on the other hand, start to read related papers to understand the technological changes behind it. I am generally familiar with the ChatGPT model except for RLHF, but in recent years I have been trapped in work and emotions and have not paid much attention to academic progress, so February and March are mainly making up lessons, following a few relatively high-quality articles The review paper looked at some of the work and ideas in the past few years, and slowly got some feelings about the problems and possible development directions of large language models.

There is no doubt that the large language model represented by ChatGPT is very valuable. From a professional point of view, if the cost is not considered, most of the original simple NLP tasks are no longer necessary. Some people worry that NLP engineers will lose their jobs, but I think it is a good thing for the NLP field as a whole, field and industry As a result, the lower limit of the ability has been improved. Things that we thought were very complicated and could only be used in small-scale applications at an expensive cost can now be popularized (such as document-based question and answer), and we can finally have more energy. Discuss the deeper principles and problems in natural language. From the user’s point of view, ChatGPT undoubtedly has great potential, answering knowledge questions, assisting writing, translating, summarizing, processing data, writing code, drawing… It seems that it can do everything we can think of through language And it’s doing well. As a tool, it has greatly improved the efficiency of users in handling things, and users are constantly digging out new usages and capabilities. Whether its long-term impact is good or bad, I don’t think so. One would deny the fact that it is very capable.

While benefiting from ChatGPT, many people are also very anxious, and I have a little bit of it. The source of this anxiety is mainly the uncertainty of the follow-up impact of ChatGPT. There are several ways to deal with this anxiety that have been observed so far:

  1. Prove that you can keep up with changes by tracking new information and trends, but often make yourself very tired and cause further anxiety due to limited energy;
  2. By predicting (or watching others predict) the future of the industry and society in the context of the popularization of large language models to reduce anxiety, but there are still relatively few people who really understand professional knowledge and have a macro perspective, and most of the relevant discussions among non-professionals often Fall into the category of metaphysical talk, or simply become the output of personal worldview;
  3. Participate in the construction of the new ecology through heavy use, development of relevant tools or applications, and promotion of relevant social governance norms. However, because it is still in the early stage of the new ecology, the tools and methodologies are very imperfect, and the imagination is still not enough.

As an engineer, I don’t think I have the macro vision to predict the future, but I think I can still participate in the construction of the new ecology. The effect of the large language model represented by ChatGPT is indeed very strong, but it still has a lot of problems. Like all machine learning models, these problems may be slowly alleviated in the future, but they will definitely not disappear. If To use the large language model as an infrastructure to build applications, these problems must have corresponding coping mechanisms. I believe that new ecology will grow on this basis. These issues have been raised and discussed in a large number of papers. I also maintain corresponding notes to track the research progress of these issues. I originally wanted to use each issue as a starting point to write some articles for some discussions. The research is still in the stage of exploration and discussion. It would be a bit boring to just sort it out as a popular science, so I decided to write a project to show my thinking and attempts to deal with these problems through code.

For large language models, the problems we currently know are:

  1. Model bias problem: The model will show a tendency to a specific field instead of being completely neutral and objective on various issues. When there is a context, the model will show recent bias and label bias;
  2. Evaluation problem: We lack sufficient effective evaluation methods for input and output results;
  3. Knowledge illusion problem: Sometimes the language model will output some content that does not match the given context or objective facts. This problem is caused by many complex factors such as training data noise, insufficient representation learning, decoding method, and lack of memory mechanism;
  4. Lack of memory mechanism: The language model itself does not design any memory mechanism. Products represented by ChatGPT can only input the content that needs to be memorized together with other content to the language model. It is necessary for the model to distinguish which part of the input is memory and which part It is instructions and other content, and therefore cannot maintain long-term memory like a human;
  5. Multi-round dialog state management: In the dialog mode, the start, jump out, return, and end of the dialog scene are currently all identified by the language model itself, but it is not particularly good;
  6. Processing of complex structured data: Data with large volume but simple internal structure can be sliced ​​and processed at present, but it is still troublesome to process data with complex internal structure (such as complete project source code);
  7. Execution of complex operations: Human beings are often not sensitive to the complexity of the instructions they give. Sometimes simple requirements that are taken for granted may actually need to be decomposed into complex steps to complete, and there may also be complex gaps between the decomposed steps. relation.

The project I am going to write, the plan is to advance from easy to difficult. At the beginning, it should be to implement a simple robot, set an initial prompt, bring the previous chat history with each conversation, and then gradually implement the memory mechanism, plus Dealing with the illusion of knowledge, integrating the ability to read web pages and documents, integrating image and audio comprehension capabilities, plus task decomposition and execution capabilities, achieving the consistency and continuity of human settings, simulating self-awareness, and ruling humans… These are all It’s not difficult, and it has been implemented in many other projects more or less. There is a high probability that there will be no special breakthroughs, and it may even be lost… In short, I am going to solve the most difficult problem now, that is , what should the name of this project be?

This article is reproduced from: http://www.zmonster.me/2023/05/07/llm-prompt-engineering-practice-prologue.html
This site is only for collection, and the copyright belongs to the original author.