02Chapter 2: What few-shot prompting is and why it worksYou should know that a large language model (LLM) turns a prompt into a completion, and you should be able to read short Python. You should also recognize the system, user, and assistant roles in chat prompts. The previous chapter showed where a zero-shot prompt, which has instructions and no exampl7 min read
03Chapter 3: Anatomy of a good exampleThis chapter assumes you know what a prompt and a completion are, can read short Python, and know the system, user, and assistant roles in chat prompts. The previous chapter showed that examples in a prompt steer a model. Here we look at what a single example is made of and which choices inside it m6 min read
04Chapter 4: Keeping format and wording consistentThis chapter assumes you know how a prompt produces a completion, can read short Python, and know the system, user, and assistant roles in chat prompts. It builds on the idea that a few-shot prompt is an instruction followed by input and output examples, and on how a single example is built from inp6 min read
05Chapter 5: Putting examples into chat messagesThis chapter assumes you know what a prompt and a completion are, can read short Python, and know the three chat roles: system, user, and assistant. It covers how to turn few-shot examples into a chat message list, where each part goes, and the errors that most often break it.5 min read
06Chapter 6: Choosing representative and diverse examplesThis chapter assumes you can read short Python, know what a prompt and a completion are, and understand system, user, and assistant roles in chat prompts. It also assumes you have seen a basic few-shot prompt: an instruction, a few input and output pairs, and an unfinished final entry.7 min read
07Chapter 7: How many examples are enoughThis chapter assumes you can read short Python, know the system, user, and assistant roles in a chat prompt, and have built a few-shot prompt like the ones in earlier chapters. It also assumes you have a pool of labeled examples to choose from.6 min read
08Chapter 8: Order and label balanceYou should already know how to write consistent input and output pairs and how to pick examples that cover the input range. You should be able to read short Python. You should also know how to score a prompt on held-out labeled data.6 min read
09Chapter 9: Teaching edge cases and out-of-scope inputsThis chapter assumes you can read short Python, know the system, user, and assistant roles in chat prompts, and have written a basic few-shot prompt with consistent input and output pairs. It also assumes you have seen how examples are chosen for coverage. Here the focus is the inputs that fall outs6 min read
10Chapter 10: Showing reasoning in examplesThis chapter assumes you can read short Python, know what system, user, and assistant roles are in a chat prompt, and have read the earlier chapters on example anatomy and format consistency. It covers how to put reasoning steps into few-shot examples and how to read the answer back out reliably.5 min read
11Chapter 11: Selecting examples dynamically for each queryEarlier chapters used a fixed set of examples that appear in every prompt. This chapter replaces that set with one chosen per query from a larger pool. It assumes you can read short Python, know the system, user, and assistant roles in chat prompts, and have read the chapters on choosing representat6 min read
12Chapter 12: Testing a few-shot prompt on held-out dataThis chapter assumes you can read short Python, know the system, user, and assistant roles in chat prompts, and have already built a few-shot prompt like the sentiment classifier from earlier chapters. Here you will measure whether that prompt works, instead of judging it by a few outputs that looke7 min read
13Chapter 13: Pitfalls: copying, bias, leakage, and token costThis chapter assumes you can read short Python and know how a few-shot prompt is built, including as chat messages. It also assumes you have scored a prompt on held-out labeled data. The chapter covers four ways a working few-shot prompt can quietly go wrong, and how to detect and reduce each one.6 min read
14Chapter 14: When to choose instructions, fine-tuning, or other methodsThis chapter covers the last decision in the tutorial: when few-shot prompting is the right tool and when something else does the job better. It assumes you can read short Python, know what a prompt and a completion are, and are familiar with system, user, and assistant roles. It also assumes you ha6 min read