02Chapter 2: What few-shot prompting is and why it worksThis chapter assumes you know what a large language model is, can read short Python, and know the system, user, and assistant roles in chat prompts. It covers the core idea. Later chapters cover example design, selection, and testing.3 min read
03Chapter 3: Anatomy of a good exampleThis chapter assumes you know what a large language model is, can read short Python, and know the system, user, and assistant roles in chat prompts. Here you will take one few-shot example apart and see what each piece does.3 min read
04Chapter 4: Keeping format and wording consistentThis chapter assumes you know what a few-shot prompt is, can read short Python, and understand the system, user, and assistant roles in chat prompts. Here you will see why every example in a prompt should follow one pattern, and how to enforce that pattern in code.3 min read
05Chapter 5: Putting examples into chat messagesThis chapter assumes you know what a few-shot prompt is, can read short Python, and understand the system, user, and assistant roles in chat-style prompts. Here you will turn examples into a message list that a chat model reads as a real conversation.3 min read
06Chapter 6: Choosing representative and diverse examplesThis chapter assumes you can read short Python, know what a chat-style prompt is, and have seen a few-shot prompt with an instruction and labeled examples. It covers how to pick which examples go into the prompt.2 min read
07Chapter 7: How many examples are enoughThis chapter assumes you can read short Python, know how system, user, and assistant roles work in chat prompts, and have already built a few-shot prompt with consistent examples. Here you will decide how many examples to include and how to check that decision.3 min read
08Chapter 8: Order and label balanceThis chapter assumes you can read short Python and know how chat roles (system, user, assistant) work. You should also know how to put input and output pairs into a prompt. Here you will see how the order of your examples and the mix of labels can push a model toward certain answers, and how to cont3 min read
09Chapter 9: Teaching edge cases and out-of-scope inputsThis chapter assumes you can read short Python, know chat roles (system, user, assistant), and have built a few-shot prompt with consistent examples. Here you will add examples for inputs that sit at the edge of the task, or outside it.2 min read
10Chapter 10: Showing reasoning in examplesThis chapter assumes you can read short Python, know how system, user, and assistant roles work in chat prompts, and have already written few-shot prompts with consistent input and output pairs. Here you add reasoning steps to the examples, so the model works through a problem before it answers.3 min read
11Chapter 11: Selecting examples dynamically for each queryThis chapter assumes you can read short Python, know the system, user, and assistant roles in chat prompts, and have built a fixed few-shot prompt before. A fixed prompt shows the same examples for every input. Dynamic selection instead picks the examples that fit each query from a larger pool.3 min read
12Chapter 12: Testing a few-shot prompt on held-out dataThis chapter assumes you can read short Python, know what a chat prompt looks like, and have already built a few-shot prompt with labeled examples. Here you learn how to check whether those examples help.2 min read
13Chapter 13: Pitfalls: copying, bias, leakage, and token costThis chapter assumes you can read short Python, know the system, user and assistant roles in chat prompts, and have built a few-shot prompt like the sentiment classifier from earlier chapters. Examples steer a model strongly. That same strength causes four common failures.3 min read
14Chapter 14: When to choose instructions, fine-tuning, or other methodsThis chapter assumes you can read short Python, know how chat roles (system, user, assistant) work, and have already built and tested a few-shot prompt. Few-shot prompting is one tool among several. Here you will learn how to tell when another approach fits better.3 min read