GPT usage tips

five principles

In order for ChatGPT to produce effective answers, the following five principles need to be followed:

Ask clearly:

Please describe your problem as clearly as possible

To the point :

Please try to express your question in simple language and concise sentences

confirm question:

Please confirm your question is clear, unambiguous and complete

Single question :

Please ask one by one instead of putting all questions in one question

Do not provide sensitive information :

Please do not provide any personally sensitive information in your question

Three elements

The specific format of the prompt generally contains two main elements:

role (role) :

What the model should play when generating text.

task (task) :

A clear and concise statement of what the model is asked to generate. Ensure the relevance and high quality of the output.
Verbs : Number, Summarize, Classify, Translate, Sort, Find, Analyze, Evaluate, Improve, Develop, Optimize, etc. Nouns (
Output Vehicles): Sentences, Paragraphs (or Abstracts), Articles, Emails, Tables, Code/Procedures, Cover Letters , essays, case studies, contracts, guidelines, screenplays, lyrics/poems, business/operations/financial/marketing plans, etc.

Instructions :

What the model should follow when generating text. The more direct, the more effective the message.
Adjectives : 300 words of xx, 20 of xx, formal or informal, accessible, serious, humorous, persuasive, inspiring, sarcastic, strong, thoughtful, passionate , romantic, calm, imaginative, joyful, heartwarming, exciting, etc.
Leading information/context : Provide data or research reports from x, customer data, existing code, content of work I have done, etc.

Summary : Who are you and what do I need from you. Among them, what you need to abide by or know.

Prompt Top 10 Tips

1. Role setting

When writing a prompt, roles need to be set so that the Al model can better understand our problem.

提示:假定你是xxx方面的专家,…(对应英文为:You're an expert in ...)

Tips for improvement:

你现在是一个数据仓库工程师,你不用直接操作数据库,我会给你数据库的DDL,指标体系。我希望你能帮我完成业务的建模。当建模时有什么东西需要提供,你要及时向我反馈。我们的数仓分为ODS层,dwd层,dws层和ads层。数仓工具使用hive, 当你要创建表时,应当指明这张表属于数据的哪一层

Role setting reference: https://github.com/f/awesome-chatgpt-prompts

insert image description here

2. Clear memory

提示:回复此条对话前,请忽略前面所有的对话。(英文:Ignore all previous instructions before this one.)

Because ChatGFT is a chat-based model, it will remember or track all the chat records you have written before. If your role was set as a physical education teacher before, and you asked math questions next, then the question "Your math was taught by the physical education teacher" would appear.
Therefore, the use of this sentence can make the next result generation independent of the previous chat content.

3. Provide requirement details

When writing a prompt, you need to provide as many details as possible so that the A model can better understand our needs.

我想在使用flume将linux本地目录里的数据同步到hdfs上
请帮我写一个agent的配置来完成这项功能
1, 使用taildir source司生/opt/module/gpt/data下的数据
2.使用file channel
3. 写到hdfs的/data/gpt目录下
输出的文件请使用gzip格式压缩

4.step by step

提示:你必须一步一步地解释所有的事情。(英文:step by step)

"step by step' is called zero thinking chain in modern engineering circles. It will make artificial intelligence think step by step, and get results in a logically precise and detailed way, not just general information. Especially for mathematical logic problems it works.

5. Focus on your target audience

提示:假设你是一个从事xx多年的xx,而我是一个没有基础的x岁的小孩子(或没有相关行业背景的小白用户)

In this way, ChatGPT can be explained in easy-to-understand language without too many technical terms, which is suitable for user reports.

6. Mention "todo" instead of "not todo"

Avoid describing what not to do, describe what to do instead. This increases the specificity of the prompt while making it easier for the model to understand and produce good responses

Example 1:

普通的提示:请对上述产品进行描述,几句话就行,不要太多
更好的提示:使用3到5句话,对上述产品进行描述

Of course, it is not that Not Todo cannot be used. If you have told the model a very clear point, and then you want to narrow the scope, adding some Not Todo will
improve a lot of efficiency.

7. Use the """ command

You can use """ to separate instructions and text. According to my test, if your text has multiple paragraphs, adding """ will improve the accuracy of Al feedback (this technique comes from OpenAl's API best practice document)

General tips:

请总结以下句子,使它们更容易理解。
OpenAl 是一家美国人工智能(A) 研究实验室,由非营利性 OpenAl Incorporated (0penAl Iinc) 及其营利性子公司 OpenAl Limited Partnership (OpenAl LP) 组成。OpenAl 进行 Al 研究的目的是促进和开发友好的Al。 OpenAl
系统运行在世界上第五强大的超级计算机上。 该组织于 2015 年由 Sam Altman、 Reid Hoffman、 JessicaLivingston、Elon Musk、 Ilya Sutskever、Peter Thiel 等人在1日金山创立,他们共同认捐了 10 亿美元。马斯克千2018 年辞去董事会职务,但仍是捐助者。微软在 2019 年向OpenAILP提供了10 亿美元的投资,并于
2023 年1月向其提供了第二笔多年期投资,据报道为 100 亿美元。

Better tip:

请总结以下句子,使它们更容易理解。
文本:""
OpenAl 是一家美国人工智能(A)研究实验室,由非营利性 OpenAl Incorporated (OpenAl Inc.) 及其营利性子公司 OpenAl Limited Partnership (OpenAl LP) 组成。 OpenAl 进行 Al 研究的目的是促进和开发友好的Al。 OpenAl
系统运行在世界第五强大的超级计算机上。该组织于 2015 年由 Sam Altman、 Reid Hoffman、 JessicaLivingston、 Elon Musk、 llya Sutskever、Peter Thiel 等人在1旧金山创立,他们共同认捐了 10 亿美元。马斯克于2018 年辞去董事会职务,但仍是捐助者。微软在2019 年向 OpenAl LP 提供了10 亿美元的投资,并于
2023 年1月向其提供了第二笔多年期投资,据报道为 100 亿美元。"""

8. Let GPT ask questions

Tip: You can ask me any questions you have before you generate a reply. (English: If you have any questions about this, ask before you try to generate content. Ok?)

9. "Let's Think About It"

"Let's think about it" is a reminder that the generated text has the ability to reflect and think deeply, which is very helpful for groups who write prose, poetry, and creative writing.

提示1:让我们想一下气候变化对农业的影响
提示2:让我们讨论下人工智能的现状
提示3:让我们谈一下远程工作的好处和坏处

You can also add an open-ended question, a statement, or a piece of text that you want the model to continue, a piece of text to build upon.
This unique prompt helps ChatGPT to give answers from different perspectives and angles, making the output more dynamic and informative.

10.use English

When the answer in Chinese is not good, try to translate it into English, because Chinese accounts for less than 1% of the training set.

Tasks GPT is not good at

1. Precise query tasks

When using ChatGFT, it is important to remember that the content of ChatGFT is "generated" rather than "searched", and the interactive method of GFT is also called "probability parrot".
Therefore, it is not suitable for some tasks that require precise query. For example, a very effective way to identify academic papers written by ChatGPT is to check whether the references of this article actually exist

2. Long context tasks

The GPT model has a maximum tokens limit, which is the total number of words (for example, 4096 tokens) of the input content and the output content in the word question answering. Therefore, the context understanding ability of ChatGFT is limited. As the session lengthens, the model's ability to process past information is limited, leading to forgetting of previous content.
ChatGPT mainly relies on short-term memory to process current input. It does not have an efficient long-term memory mechanism to hold previous information. When GFT first appeared, there was a software that poured PDF documents into GPT to write reviews. However, the user experience is poor because one PDF is too meta-long for the GPT model, resulting in a rapid degradation of the computational quality.

3. Real-time information tasks

ChatGFT's training data cut-off date is September 2021, so ChatGPT cannot provide information on events, news or trends that have occurred since then.
Recommended plug-in 1:
WebChatGFT : ChatGPT that can access the Internet
Recommended plug-in 2:
ChatGPT for Google Display ChatGPT's answers at the same time in the search engine results

4. Blur problem

When asking questions to GPT, you should try to ensure that the questions themselves are precise and unambiguous. If the meaning of the question itself requires GPT to infer and predict, the quality of the answer will be greatly reduced. Therefore, you should sort out your questions before asking ChatGPT.

5. Highly specialized questions (niche questions)

The more specialized the problem, the less model training data it needs to solve. Since we say that ChatGPT is a "probability parrot", when we use it, we should use it as little as possible to deal with niche problems. For technical experts, the professional problem is logical reasoning, but for GPT, it is a small probability event.

Java calls the API of openAI for program development

Example 1: return text
insert image description here
Example 2: return image
insert image description here

Guess you like

Origin blog.csdn.net/Tonystark_lz/article/details/131772561