AI 日课 @20230413:Prompt Engineering 02 - 原则
AI日课@20230413:Prompt Engineering 02 - 原则
学习 1:Prompt Engineering 02
今天继续学习 Prompt Engineering,主要是如何写 Prompt 的一些框架性的原则。
https://github.com/mattnigh/ChatGPT3-Free-Prompt-List
给出了一个叫 CRISPE 的框架性原则,如下
CRISPE Prompt Framework:
Capacity and Role: What role (or roles) should ChatGPT act as?
Insight: Provides the behind the scenes insight, background, and context to your request.
Statement: What you are asking ChatGPT to do.
Personality: The style, personality, or manner you want ChatGPT to respond in.
Experiment: Asking ChatGPT to provide multiple examples to you.
https://medium.com/@thorbjoern.heise/a-generic-framework-for-chatgpt-prompt-engineering-7097f6513a0b
也给出了一个类似的由 basic elements + specifiers 的框架:
https://humanloop.com/blog/prompt-engineering-101
这篇文章结合例子给出一个原则清单:
We have seen several tips for getting started with prompt engineering. For a quick recap:
Use clear, direct, and concise instructions
Try “complete this sentence” prompts for more natural responses
Use examples (few-shot learning) of the task
Align prompt instructions with a clear end goal
Use persona keywords to alter the style and voice of the response
Constrain the LLM’s responses by listing desired responses in the prompt
Experiment with variations of the prompt to see what works best for you!
Go on and start engineering prompts with these newfound skills and remember that if at first you don’t succeed, try and try (a different variation of a prompt) again!
总结一下,写好一个 Prompt,需要告诉 AI:
role:你是谁
instruction:要做什么
context:背景信息
examles:如有必要,举例子
requirements:输出的受众、格式等
如果只留一条:
Experiment:做试验,靠尝试
近期 AI 日课:
AI日课@20230412:Prompt Engineering
版权声明: 本文为 InfoQ 作者【无人之路】的原创文章。
原文链接:【http://xie.infoq.cn/article/5c813e1a8242276901f498201】。文章转载请联系作者。
评论