New Jobs Simplified, AI University
← Back to courses

Prompts & Prompt Engineering

Few-Shot & Zero-Shot Prompting

This lesson covers how to use few-shot and zero-shot prompting to guide the output of a generative model. We'll learn how to provide examples and instructions to help the model generate high-quality results. We'll also explore the differences between few-shot and zero-shot prompting, and see some examples of how to use them.

Why It Matters

In the real world of AI, few-shot and zero-shot prompting are essential techniques for getting the most out of generative models. By providing examples and instructions, we can guide the model to generate better results, which is crucial in applications like language translation, text summarization, and image classification.

Key Points

Few-shot prompting uses 2 or more examples to guide the output of a generative model. This helps the model to generate more accurate results by showing it what the output should look like.
Zero-shot prompting provides no examples, instead relying on instructions and context to guide the model's output. This is useful when we don't have any labeled data to train on.
Chain-of-thought prompting is a type of zero-shot prompting that uses a step-by-step approach to guide the model's reasoning.
Instruction-based prompting plays an important role in tasks like supervised classification, where we need to ask the model to classify examples into predefined categories.
Fine-tuning is different from zero-shot generation because it requires labeled data to train on. This allows the model to learn from the data and generate more accurate results.
Encoders, decoders, and encoder-decoder transformers are different types of models that can be used for various tasks, including translation and summarization.

Key Concepts

Few-shot prompting

A technique that uses 2 or more examples to guide the output of a generative model.

Zero-shot prompting

A technique that provides no examples, instead relying on instructions and context to guide the model's output.

Chain-of-thought prompting

A type of zero-shot prompting that uses a step-by-step approach to guide the model's reasoning.

Instruction-based prompting

A technique that uses instructions to guide the model's output, often in tasks like supervised classification.

Fine-tuning

A technique that requires labeled data to train on, allowing the model to learn from the data and generate more accurate results.

From the books
“not leverage examples, one-shot prompts use a single example, and few-shot prompts use two or more examples. Figure 6-13. An example of a complex prompt with many components. Adopting the original phr…”
“output is to provide the generative model with examples of what the output should look like. As we explored before, few-shot learning is a helpful technique that guides the output of the generative mo…”
“step-by-step,” which is illustrated in Figure 6-16.7 Figure 6-16. Chain-of-thought prompting without using examples. Instead, it uses the phrase “Let’s think step-by-step” to prime reasoning in its an…”