使用 OpenAI 的最佳实践
如何向GPT-3和Codex提供清晰有效的指令。
Prompt 是怎样工作的 由于指令跟随模型的训练方式或它们所接受的数据,有特定的提示格式可以很好地配合当前任务并可靠地发挥作用。以下是我们发现可靠有效的一些提示格式,但请随意尝试不同格式,以找到最适合您任务的格式。
经验法则和示例 注意:"{text input here}“是实际文本/上下文的占位符
1. 使用最新模型 为了获得最佳结果,我们通常建议使用最新、功能最强大的模型。截至2022年11月,生成文本的最佳选项是“text-davinci-003”模型,生成代码的最佳选项是“code-davinci-002”模型。
2. 在提示的开头放置说明,并使用###或”““分隔指令和上下文 低效方式
Summarize the text below as a bullet point list of the most important points. {text input here} 高效方式
Summarize the text below as a bullet point list of the most important points. Text: """ {text input here} """ 3. 请尽可能具体、描述性和详细地说明所需的上下文、结果、长度、格式、风格等。 请具体说明上下文、结果、长度、格式和风格等。
低效方式
Write a poem about OpenAI. 高效方式
Write a short inspiring poem about OpenAI, focusing on the recent DALL-E product launch (DALL-E is a text to image ML model) in the style of a {famous poet} 4.