How to write a perfect GPT prompt
Basics
English
GPT使用英文语料训练。尽管它也能处理中文提问,但是在翻译的过程中会出现语义损失,导致输出结果偏差。
不过一般情况下用中文完全没问题。
Be specific with your rerquest
清楚地罗列信息/给出要求
避免模棱两可的词汇
“Tell me about climate change.”
“What are the primary causes of climate change, and what are some potential solutions to mitigate its effects?”
Provide context and background info.
提供上下文和足够的背景信息。
如果你想要转行/专业,问问GPT的意见。
Prompt: I have 3 years of experience as a software developer. Now I got bored with coding and want to transition to another career. My education qualifications are B. Tech in computer science, and I am well-versed in understanding the business side of software as well. Suggest a list of career options that are easy for me to transition.
Use explicit constraints and guidelines
使用明确的约束条件。例如:
标准化输出
- json、html类型输出(一般情况下用不到)
字数限制
我需要写一份读书报告:
Prompt: “Please provide a summary of the book “The Republic” by Plato in 100-150 words, focusing on the main points and conclusions.”
最后一个提示词能让GPT的输出有更多干货
Start with an action word
祈使句往往会有更好的效果。
Can you tell me how to become a content marketer?
Create a career plan to become a content marketer in 2023
Advanced!
Let’s play a game
Let’s play a game. Act as a talented entrepreneur, with IQlevel of Elon Musk, Einstein, Tesla combined. I will be asking you many business questions you have to answer all of whose.
官网把这类提示词叫做 system message,我不太会翻译。概括地来说,是和GPT玩角色扮演游戏。
Prompt:You are an assistant knowledgeable about gardening. Help me understand how to grow sunflowers successfully.
刚好在寝室里种向日葵
Prompt: “I want you to act as a personal trainer, who can create customized fitness programs, provide exercise instructions, and offer guidance on healthy lifestyle choices. Assess my current fitness level, goals, and preferences to develop a tailored workout plan that includes strength training, cardiovascular exercises, and flexibility routines. Share tips on proper exercise form, injury prevention, and progressive overload to ensure continuous improvement. Offer advice on nutrition, hydration, and rest to support my overall well-being. My first request is ‘Design a 4-week workout plan for me to improve my overall strength and endurance, considering my limited access to gym equipment.’”
太高级了,免费私教
Prompt: You are a renowned chef, and I am your apprentice. Teach me how to prepare a gourmet pasta dish with a unique twist.
让GPT教我做饭
反复追问
因为GPT拥有一定的上下文关联能力,适当的追问能帮助我们得到更好的回答。
Step by step:给出分步提问/分步回答
先…然后回答问题….
Prompt: “Please think through the advantages and disadvantages of solar energy, and then provide a balanced assessment of its potential as a renewable energy source.”
请GPT同学分点作答
Prompt: “What are the first three steps in building a website from scratch?”
References
Mastering ChatGPT: How to Craft Effective Prompts (Full Guide + Examples) (gptbot.io)
ChatGPT Prompts Library: 250+ Ready-to-Use Prompts (gptbot.io) 好用的Prompt模板
GPT best practices - OpenAI API TO_READ
如何炼丹
深呼吸,一步步思考,你也可以的。