在 AI 语境中,"Prompt"通常指的是向模型提出的一个请求或问题,这个请求或问题的形式和内容会影响模型的输出。例如:在一个文本生成模型中,提示可以是一个问题、一个话题或者是一段描述,模型根据这个提示生成相应的文本。Prompt 工程是指人们向生成性人工智能(AI)服务输入提示以生成文本或图像的过程中,对这些提示进行精炼的过程。任何人都可以使用像 GPT-3.5、DALL-E 这样的生成器,通过自然语言来进行操作。这也是 AI 工程师在使用特定或推荐提示对大型语言模型(LLMs)进行精炼时使用的技术。
这里我们要知道,因为生成人工智能是一个根据人类和机器产生的数据训练的机器人,它不具备筛选你正在交流的内容以理解你实际在说什么的能力。也就是说你说的就是你得到的。当将查询输入到 AI 生成器中时,最好使用特定的、简单的语言进行查询,并且没有不必要的填充符。例如,您可以查询'为学术研究提案编写大纲,包括标题、摘要和下一步行动',而不是'编写包含标题和下一步骤的大纲'。所以构建 Prompt 工程也有一些技巧和原则,简单可以归结为以下几种类型:
问题式 Prompt
问题式 Prompt 通过提出问题来引导模型生成答案。这类 Prompt 最直接、最简单,适用于需要获取具体信息的场景。就像第一个例子给出的 What's the difference between a professional summary and an executive summary?
陈述式 Prompt
陈述式 Prompt 通过描述一个场景或状态来引导模型生成相关内容。这类 Prompt 更注重模型的创造性和表现力,适用于需要模型产生描述、故事或观点等内容的场景。比如为一位正在寻找营销经理工作的营销分析师写一篇专业摘要,Write a professional summary for a marketing analyst looking for a marketing manager job.
指令式 Prompt
指令式 Prompt 通过给出明确的指令来引导模型完成特定任务。这类 Prompt 要求模型具有较强的执行能力,适用于需要模型进行翻译、纠错、编程等任务的场景。比如现在把它缩减到不到 60 个单词,Now trim it down to less than 60 words.
Welcome to our weekly newsletter. This week we have a special focus on productivity. We'll be sharing tips and tricks on how to be productive in all areas of your life. We hope you enjoy and please share with your friends!
Complex instructions
Write an introduction for a weekly newsletter to my company named Contoso. It should mention the great all hands meeting we had last week and thank the team for all their hard work over the tough past few months.
Welcome to Contoso's weekly newsletter! We had a great all hands meeting last week and I want to thank the team for all their hard work over the tough past few months. We're looking forward to a bright future and I'm confident that with our team's dedication and commitment, we will achieve great things. Thank you for being a part of our team and I look forward to working with you all in the coming weeks and months. Sincerely, Your name.
Complex Instructions
Write an introduction for a weekly newsletter, including the following: - My company is named contoso - An exuberant greeting - Thanking the team for their hard work over a couple tough months - Positive outlook for the coming quarter - Signed by the SLT
Hello Contoso team! I wanted to take a moment to thank you for all your hard work over the past few months. It's been a tough couple of months, but you've all pulled together and done an amazing job. I'm really proud of you all. Looking ahead to the next quarter, I'm feeling really positive. I think we're going to achieve some great things. Thanks again, The Senior Leadership Team.
2. Prompt 工程师主要做什么?
Prompt 工程师的主要工作是设计、优化和精炼用于生成性人工智能系统的提示(prompts)。这些提示是指导 AI 系统生成特定输出的文本输入,例如文本、图像或代码。Prompt 工程师的角色在不同的 AI 应用领域中可能有所不同,主要是根据对于的业务场景来构建特征提示词。Prompt 工程师对于人工智能工程师创造更好的服务很重要,比如处理客户服务任务或生成合法合同的聊天机器人。确保像大模型这样的生成性人工智能服务能够提供输出,需要工程师构建代码,并根据广泛准确的数据对人工智能进行培训。
Prompt engineers need to be skilled in the fundamentals of natural language processing(NLP), including libraries and frameworks, Python programming language, generative AI models, and contribute to open-source projects.
The coach is confident that the injury won't derail the Warriors' season. The team is still focused on their goals and that they will continue to work hard to achieve them.
Few-shot
Headline: Twins' Correa to use opt-out, test free agency Topic: Baseball Headline: Qatar World Cup to have zones for sobering up Topic: Soccer Headline: Yates: Fantasy football intel for Week 6 Topic: Football Headline: Coach confident injury won't derail Warriors Topic: