# 第五章 少样本学习与示例驱动

进入第二部分核心技术篇，本章将介绍提示词工程中最有效的技术之一——少样本学习。这项技术通过在提示词中提供少量示例，引导模型理解任务模式并将其应用到新输入上。

少样本学习的强大之处在于其通用性：无论是文本分类、信息提取、格式转换还是创意生成，只要能提供恰当的示例，模型就能迅速“学会”任务的核心模式。与其花费大量时间描述规则，有时一两个好的示例更能清晰地传达意图。

本章将深入探讨少样本学习的原理、方法和应用，帮助读者掌握这一关键技能。

***

## 本章目标

* 理解本章核心概念与适用场景
* 掌握可复用的提示词/工作流模式
* 能将方法迁移到自己的任务中

## 先修知识

* 建议先阅读上一章或同等基础内容
* 如涉及代码示例，具备基本编程与 API 调用常识

## 本章内容

* [5.1 零样本与少样本提示](/prompt_engineering_guide/di-er-bu-fen-he-xin-ji-shu-pian/05_few_shot/5.1_zero_shot_few_shot.md)
* [5.2 示例的选择与设计策略](/prompt_engineering_guide/di-er-bu-fen-he-xin-ji-shu-pian/05_few_shot/5.2_example_design.md)
* [5.3 少样本学习的应用场景](/prompt_engineering_guide/di-er-bu-fen-he-xin-ji-shu-pian/05_few_shot/5.3_applications.md)
* [5.4 常见问题与解决方案](/prompt_engineering_guide/di-er-bu-fen-he-xin-ji-shu-pian/05_few_shot/5.4_troubleshooting.md)
* [5.5 本章实战练习](/prompt_engineering_guide/di-er-bu-fen-he-xin-ji-shu-pian/05_few_shot/5.5_practice.md)
* [本章小结](/prompt_engineering_guide/di-er-bu-fen-he-xin-ji-shu-pian/05_few_shot/summary.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://yeasy.gitbook.io/prompt_engineering_guide/di-er-bu-fen-he-xin-ji-shu-pian/05_few_shot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
