本文主要是介绍GPT提示词工程的学习,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Table of Contents
- Preface
- 一、A prompt contains any of the following elements
- 1.Instruction
- 2.context
- 3.Input
- 4.Output
- 二、Few-shot prompting(少样本提示)
- 1. Using prompt
- 2.Chain-of-Thought(CoT) Prompting
- 三、Internet+Embedding
- 1. Internet
- 2. Embedding search + GPT
- 四、ReAct
- 五、Summary
Preface
ChatGPT Prompt 提示词工程。
一、A prompt contains any of the following elements
1.Instruction
The specific task that the model should perform.
Example: Explanation, translation, generation, summarization, and illustration。
Tips:clear and specific
2.context
Background info.
Example: I am a student/worker/ 给出主语、环境信息等。
Tips: act as
3.Input
The content or question entered by the user.
Specific info, Example provide code.
Tips: ### or “”"
4.Output
The type or format of the output.
Example:以json格式输出、用自定义格式输出…
如图为例:
二、Few-shot prompting(少样本提示)
We can change form zero-shot prompting(零样本提示) to few-shot prompting(少样本提示)。
1. Using prompt
Few-shot prompting:
example1:
example2:
example3:
分析判断是否能让模型的输出通过few-shot prompting 举一反三。
2.Chain-of-Thought(CoT) Prompting
思维链:引导模型去推理。给出步骤:
prompt:
在Instruction后加入:Let’s think step by step:
First,
Next,
…
Finally,
Therefore
等关键词。
三、Internet+Embedding
1. Internet
web_results+prompt
2. Embedding search + GPT
Embedding将数据转换为相关度数组。
四、ReAct
Prompt:具有哪些工具(插件),有哪些作用。
思考:
Actiong:采用哪些工具。
输入:
观察:调用插件的结果。
五、Summary
这篇关于GPT提示词工程的学习的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!