2 | Standard & Few Shot Prompts

2024年6月19日创建
本文讨论了标准提示和少样本提示相关内容,介绍了标准提示输入大语言模型后会生成相应输出,还阐述了少样本提示的概念、示例及作用。关键要点包括:
1.
标准提示 :向大语言模型(如ChatGPT)输入标准提示,模型会生成相应输出,例如输入“世界上最高的山是什么?”,输出为“珠穆朗玛峰”。
2.
少样本提示的概念 :向模型展示少量(通常2到5个)示例,使其能快速适应先前遇到对象的新示例。
3.
少样本提示示例 :如“彩虹的第一种颜色是什么?红色”“彩虹的第二种颜色是什么?黄色”“彩虹的第三种颜色是什么?” 以问答格式呈现。
4.
少样本提示的作用 :将提示分解为少样本提示有助于构建和训练大语言模型,通过提供先前示例,更有可能获得想要的输出。
Let's take a quick look at standard or regular prompts. We'll go through how prompting a chatbot works and then quickly move onto few shot prompts.
Here's two regular prompt examples:
Regular Prompt
What's the highest mountain in the world?
Regular Prompt in Question and Answer format
Q: What's the highest mountain in the world?
A:
When you provide a regular prompt as an input to a large language model such as ChatGPT, it will generate a corresponding output or in prompt engineering terms, a completion. For example, this is illustrated below:
Q: What's the highest mountain in the world?
A: Mount Everest.
Now, there are also a few techniques you can employ to get better or more efficient outputs from a large language model such as Zero-shot, one-shot and few-shot prompting.
Few Shot Prompts
Few-shot prompting refers to a technique that involves presenting a small number of examples, typically ranging from two to five, to a model, enabling it to quickly adapt to new examples of previously encountered objects.