Demystifying popular work cheats: ChatGPT shows its talents! Efficient Prompt skills that easily improve work efficiency are exposed!

Table of contents

01 background

Benefits: There is chat-gpt pure sharing at the end of the article, no magic, no limit

02 What can AI help programmers do?

   2.1 Summary of Technical Knowledge

   2.2 Disassembly task

   2.3 Read code/optimize code

   2.4 Code generation

   2.5 Generate unit test

   2.6 More AI applications/plugins

AIPRM

Voice Control for ChatGPT

ChatGPT Sidebar

Famous application tool experience: Bing Copilot, ChatGPT, Google Bard

Google Bard (LaMDA): Google's recently released AI tool is currently only available in English. The characteristic is that it can give multiple answers, and the response speed is very fast. Integrated with Google it, after clicking, it will help you generate a google search keyword that is most suitable for your question. This is the opposite of Bing Copilot. One is to integrate chat into search, and the other is to integrate search into chat.

03 Prompt ability

   3.1 What are prompts?

   3.2 Better Prompt

Developers can use its context capabilities to help them correct grammar and provide better prompt training.

04 Summary


01  background

Benefits : There is chat-gpt pure sharing at the end of the article, no magic, no limit

I especially remember that every month when "The World's Most Popular Programming Language of the Month" is released, there will be a bloodbath among programmers. "Java has dropped one place, how is it possible", "JavaScript occupies the top of the list again, the threshold is too low, can it be used even if you write a script?", "C#, a single-platform language, is also a product of a closed-loop ecology" Such remarks There are endless streams, and everyone enjoys it, and it is already the previous traffic password.

However, all this seems to have quietly changed now. Everyone joked that the most used programming language is already English (natural language).

Now GPT has started the artificial intelligence frenzy. If I don’t talk about ChatGPT in the social circle, I feel not only out of touch with the times, but also have been expelled from IT~

The author began to experience ChatGPT in early December 2022. I started by asking it some interesting questions like "tell me about TCS" and so on. I believe this is the case for most people when they first used it. At that time, the Internet believed that its function should be to replace Zhihu and let ChatGPT be used as a platform for question-and-answer knowledge. The voice of Zhihu's death is rampant.

Later, everyone discovered that many of its answers were fabricated. For example, if you ask it about some new movies, it will make it up even if it doesn't know it. Everyone began to belittle it again, thinking that it was just an ordinary chat robot, or an awkward chat player.

Last year, there were relatively few sharings and introductions of relevant papers, and the evaluation and analysis on the market still think that ChatGPT can only summarize existing knowledge, or translate it.

But as more and more people use it, everyone knows that ChatGPT has nothing to do with language. You can ask questions in any language, and it can understand what you mean very well. Because it uses a language model, not a specific language library. If you still use the "keyword matching" and "keyword hit" ideas of search engines to think about artificial intelligence, it seems a little behind. After introducing how AI dialogue tools can help programmers work (full of dry goods) , this article will share with you the correct way to open AI - better prompt.

02  What can AI help programmers do?

  2.1 Summary of technical knowledge

When you first start learning a technology, you will inevitably need to check the documentation. The manual is very rich now. Often for a beginner, there is too much information to be exposed to, and the layout is varied, making it confusing to learn.

At this time, you can use the summary ability of ChatGPT. For example, if I want to learn about K8S, I send it the address of a document and let it summarize it for me.

prompt: 

https://kubernetes.io/zh-cn/docs/concepts/overview/ summarizes this document.

picture

As you can see, it summarizes this Chinese document very well, and summarizes each key point. Use the least amount of language so that you can understand the knowledge points you want.

Because ChatGPT has context, it knows that what you need is a summary in Chinese, so here you continue to send an English document to it, and it will also summarize it in Chinese for you.

prompt: 

Summarize this document https://kubernetes.io/docs/concepts/overview/components/.

picture

At present, the deadline for chatgpt's free version database is 2021, which means that if you ask it for newer content, it cannot be summarized, and it will even be compiled at will. For example, here is a question about the movie "The Wandering Earth 2", let it summarize the introduction in wikipedia. 

prompt: summary:

https://zh.wikipedia.org/zh/%E6%B5%81%E6%B5%AA%E5%9C%B0%E7%90%832 

picture

Because the movie has not yet been released at this time, the previous content is still wrong, and its summary is not accurate.

Let chatgpt summarize when we copy the content of the entire website. But at this time, you will find that the article is too long and you will receive an error report. 

picture

At this time, it is time to use your imagination and use prompt to make a breakthrough. We need to split the article into paragraphs, and each paragraph meets its standards.

picture

picture

Split the content into 7 segments, and after the sending is complete, it will be automatically summarized.

picture

In this way, a correct summary of a document can be obtained.

  2.2 Disassembly task

The content described above can be regarded as the use of AI to improve the efficiency of programmers' daily life. So how can AI help us improve efficiency at work?

After we obtain a demand from the demand side, in many cases our tasks cannot be estimated very accurately. The reason is that we have not clearly divided the tasks, so we cannot estimate each task, which leads to risks. occur.

At this time, we can briefly describe our needs this time, and let ChatGPT help us disassemble the task.

picture

You can see that the task as a whole has been broken down into small tasks. It can quickly allow us to convert tasks into tasks, or demand tracking sheets. This not only facilitates communication with product managers, but also facilitates our own scheduling. Switching to KANBAN mode also makes it easier to see the current progress.

If the other party still has questions, you can continue to ask for dismantling. For example, we want to ask how the third step should be further implemented. You can see that it even gives us concrete UI interactions. We can use such hints to provide some reference for our interaction and implementation. 

picture

  2.3 Reading Code/Optimizing Code

Developers often take over other people's code. The quality is uneven, and it will be caught in a lot of strange naming. When we read the overall logic or modify the logic, it may cause a deviation in understanding due to our own reading problems, further causing bugs.

What if this method is handed over to AI to read? You can see the effect.

prompt: 

Explain the following code + code content line by line, (a piece of open source code on github is used here for display, this code is a piece of timer-related content).

picture

It can be seen that ChatGPT correctly understood our code, explained and explained the code.

But at this time, only an overall description is generated, and each line is not explained separately. Now continue talking to it: 

prompt: 

Can you add comments on each line of code so that I can understand it?

picture

At this time, it will mark the code line by line, so that you can understand each line. If you then make a shallow optimization request to it, it will do so.

prompt: 

Can this code be refactored and optimized? The logic is a bit cumbersome.

picture

You can make more detailed requirements for a certain part and propose a better optimization direction for it. Here we raise the question about parameter order coupling. We can see that GPT also understands our needs and makes corresponding optimizations, as follows:

prompt: 

children: (isCounting: boolean, durationTime: number, startCount: () => void) => React.ReactNode // child component, receives three parameters and returns a React node

There are too many parameters here, and there is a strong dependence on the order, how to optimize here?

picture

  2.4 Code generation

There is another scene where developers have a relatively heavy workload in their work and require complex logical thinking. But in fact the final code may only need a few lines to get it done. You feel very painful during the thinking process and want to communicate with colleagues around you. Maybe after you explain this logic to him, instead of helping you think, he will turn one person's share of pain into two shares.

For example, if we want to perform data conversion, can we also hand it over to AI? We send it to a prompt like GPT to convert the data structure. The data source is:

 
 


[
    {
        "candidates": null,
        "candidatesX": null,
        "description": "role---用户角色",
        "label": "角色",
        "name": "role",
        "optional": true,
        "schema": null,
        "type": "String"
    },
{
        "candidates": null,
        "candidatesX": null,
        "description": "Topics of the pulsar server to create---需要创建的主题",
        "items": {
            "schema": [
                {
                    "candidates": null,
                    "candidatesX": null,
                    "description": "topic name---主题名称",
                    "label": "主题名称",
                    "name": "name",
                    "schema": null,
                    "type": "String"
                },
                {
                    "candidates": null,
                    "candidatesX": null,
                    "default": 1,
                    "description": "partition number---分区数",
                    "label": "分区数",
                    "name": "partitions",
                    "schema": null,
                    "type": "Integer",
                    "validator": ">0"
                }
            ],
            "type": "Object"
        },
        "label": "主题列表",
        "name": "topics",
        "optional": true,
        "schema": null,
        "type": "List"
    }
]


The data I want to get is the data of type List, and the data structure is:
 

[
{type:List, name:"topics", needValidates:[{
    name:"name", type:"String"
},{name:"partitions", type:"Integer"}] }
]

GPT will get us the correct result: 

picture

We only need to input the target data structure, the transformed data structure, without specifying the language. Because it will understand from your context what implementation you want to ask.

There are also execution scripts, we only need to describe our needs clearly, and it will also help us improve.

picture

Additionally, it can be interpreted:

picture

As you can see above, we have used a "natural language programming" operation process here. Whether you know how to use python or bash, you can describe your needs normally. to generate.

We can also perform code conversion. For example, you have written a piece of js code and you want to convert this code into python. In the past, we would search Google to see if there is a corresponding converter. Now we only need to hand it over to gpt for execution. Put forward your request, it will generate a piece of bug-free code for you within 10s, including exception handling. We do not give examples here.

  2.5 Generate single test

The code we just transformed into data, if we want to test it. In the past, we might think hard about many scenes to supplement. Now I just need to tell the AI ​​to generate a single test for me.

prompt: 

(code content) Generate unit test for this code.

picture

If you feel that the test conditions are not enough, then ask it again and let it generate again.

prompt: The data source is not rich enough, and there are many boundary conditions in the test set, such as data does not exist, data types cannot be converted, and data types are not equal.

picture

It will also explain to you what is done here. These test cases cover different scenarios, including:

When there is no field of type List in the data source, an empty array should be returned; when there is a field of type List in the data source, the correct field array should be returned, including the required validation.

  2.6 More AI applications/plugins

AI is like a basic application, and there are still many possibilities on it. The more you use it, the more skills you unlock. For example, the GPT series has even launched its own application market now. Let’s briefly introduce some popular plugins for you:

  • AIPRM

It is the app store of the ChatGPT3.5 era. Users train it through different prompts to achieve their own goals.

For example, the "long text summary" ability we introduced at the beginning of the article: when we communicate with it normally, the word limit will become a bottleneck. But if we transform our communication skills, we can overcome this limitation. AIPRM is a plug-in system full of whimsy, where you can find/publish all kinds of prompts you want.

picture

  • Voice Control for ChatGPT

Relying on such a system, we can use it to practice English (pseudo-demand). Or talk to it directly by voice, and let it write the code for itself. For example, all the script instructions we just made can be sent directly by voice to text.

It also serves some visually impaired people very well, because it will also read the content generated by GPT every time. Let everyone have equal access to AI.

picture

  • ChatGPT Sidebar

As more and more people use it, ChatGPT becomes slower and slower to respond. Sometimes I just want to ask a simple question, but I have to wait a long time. At this time, you can use the ChatGPT Sidebar plug-in.

It has a built-in ChatGPT API, which can be directly integrated into your search engine, every time you search will be triggered (can also be set to manual), free of registration, easy to use. You can also let it prompt you how to search for related keywords.

picture

In its sidebar, we can also perform other operations.

picture

  • Famous application tool experience: Bing Copilot, ChatGPT, Google Bard

Then let's look back at a few AI tools with relatively high influence. There are about 3 basic AI tools commonly used by the author, namely Bing Copilot, ChatGPT, and Google Bard. The most widely used ChatGPT (GPT3-5), let's take a look at its self-introduction first.

ChatGPT : The most frequently used AI. It has a powerful context and can be split into different conversations so that it can handle different conversations.

For example, a console project can have a separate dialogue, so that the context of its chat is around this topic, and there is no need to add contextual information for each new question and answer.

picture

Bing  : Bing used GPT-4 very early, but because the number of conversations is too small (expanded from 5 to 15), the length of each conversation is also very limited (so far only 2000 words) and The dialog context cannot be saved, which makes it really inconvenient to use. The advantage is that it is connected to the Internet in real time, so the author mainly uses it to search for the latest information and summarize the abstracts of some articles and documents, and to assist the use of ChatGPT to compare whether the logic generated by the two passes is consistent. The advantage is that the search results will give detailed sources and reference addresses.

picture

Google Bard (LaMDA) : Google's recently released AI tool is currently only available in English. The characteristic is that it can give multiple answers, and the response speed is very fast. Integrated with Google it, after clicking, it will help you generate a google search keyword that is most suitable for your question. This is the opposite of Bing Copilot. One is to integrate chat into search, and the other is to integrate search into chat.

picture

03  Prompt ability

  3.1 What are prompts ?

Overall, there are several strengths of the above-mentioned AI:

Summarization/comprehension skills . It does a good job of summarizing what you send it and summarizing it. In fact, this is also a kind of understanding ability. Because it understands the meaning of what you say.

Possesses strong context-association capabilities . You don't need each operation to be independent like using a search engine. You can turn an entire conversation into one giant search, and go through multiple conversations to elaborate on the information you want. It can even help you ask itself questions.

There is a wealth of expansion plugin potential

I believe that all readers can perceive these abilities in the above case. In the above case, in order to better use AI and take advantage of these capabilities, we frequently use a word called prompt—this is a very important content in the AI ​​era.

If you want to make good use of various AI efficiency tools, the best way is to continuously improve your prompt capabilities. Prompt is a prompt word, expressing the ability of language.

In previous development careers, we were "Google Engineers", "StackOverflow Engineers", and nicknamed "Developing for Search Engines". Every time we encounter an unsolved mystery, we usually change the search keywords constantly. 

At this time, the competition is our language ability - we need to change our thinking, from an engineer to a product manager, or a role of Business Analysis. We need to disassemble the task we have received and turn it into prompt words step by step. When you disassemble it enough, the task can be automatically completed automatically by AI. This will be explained in detail in the project application chapter.

   3.2 Better Prompt

Developers can use its context capabilities to help them correct grammar and provide better prompt training.

AI does not pick language? No matter which language you use, it uses data models for analysis, not thinking in a single language. This means that the resulting quality of the results will not vary greatly. Is it really?

In fact, through the introduction on the official website, we found that it has different understanding of languages, and of course the strongest understanding is English. We use English for prompt, which can not only exercise our English ability, but also better express our own problems. However, limited by our own English level, we may not be able to express our views clearly every time. At this time, we can use it to help us improve this point. We deliberately typed a wrong sentence to test it.

prompt:

you need answer my question obey the format, format should be like this


correct grammar is :
"insert correct grammar here"
________________________________ (keep the diver line)
you can also ask it like this:
"insert better prompt here"

________________________________
then tell the answer about what i ask below the divier also keep the diver line.
 

Correct grammar is should correct my question's grammar

picture

The return result of each training of AI is different. We may get what we want, but it may not fully understand what we mean. When our appeal is not fully understood, it can be further trained.

picture

After it gets it right, we commend it . Then try our other questions. It can be seen that everything is normal.

picture

If sometimes it forgets, you need to remind it to format again . It will re-export.

04 Summary

The author has been using AI tools such as ChatGPT for more than 4 months. At the beginning, I just tried it simply, and I didn't think there was anything special. It wasn't until browsing various tutorials that I discovered that those who previously shared financial knowledge had begun to use GPT for code creation to enrich their arsenal, such as icon analysis, software production, and so on. In fact, AI is not just simple question answering, it has the ability to solve problems and even create knowledge.

Of course, in the process of using it, there are many voices around me questioning the ability of AI. Think it's not as good as imagined. For example, if you talk to it directly, make a demand for me, or write a paper for me, it will not be able to complete it.

Because in fact we are using AI wrongly. Reasonable use should be "we do what we should do, AI should do what AI should do". In the era of search engines, we didn't just type "give me the answer" in the search box, right? Users should try to describe their problems clearly.

Now the requirements for programmers are no longer simply writing code. Because AI can do it, even better than your code quality. We need to transform our thinking from programmers to programmers with product thinking and programmers with BA thinking. You need to have a clearer understanding of the tasks, methods, and logic in your hands. Let humans do what humans should do, and let AI do what it is good at.

When you clearly describe what you want, you will find that AI is not here to replace you, but to help you work better. The above is the whole content of this sharing, welcome everyone to share and exchange in the comment area. If you find the content useful, welcome to repost~

Charger will bring you the latest and most comprehensive interpretation as soon as possible, don't forget the triple wave

                                                          

 Pay attention to the official account: Resource Charging Bar
Reply: Chat GPT
Charging Jun sent you: Enjoy using the Chinese version for free
Click on the small card to follow, reply: IT

I have all the information I want 

 

Guess you like

Origin blog.csdn.net/CDB3399/article/details/132316903