01Chapter 1: How a model writes: predicting the next tokenThis chapter explains the basic mechanism behind every answer a language model gives. Once you see how text is produced one piece at a time, the later chapters on fabrication, red flags, and checking will make more sense. The key point is that the mechanism rewards text that sounds likely. Nothing i8 min read
02Chapter 2: Why fluent does not mean trueThis chapter assumes you have used a chat-based LLM assistant, can read short Python, and know that models are trained on large collections of text. It also assumes you know the basic idea from the previous chapter: a model writes by predicting the next token, one token at a time. Here you will see 6 min read
03Chapter 3: What we mean by a hallucinationThis chapter assumes you have used a chat-based LLM assistant and know that models are trained on large text collections. The earlier chapters in this tutorial covered next-token prediction and why fluent text is not the same as true text. This chapter uses those ideas to define the problem precisel7 min read
04Chapter 4: Gaps in what the model has learnedThis chapter assumes you have used a chat assistant, can read short Python, and know the idea from earlier chapters that a model predicts the next token from patterns in its training text. Here we look at one cause of fabrication: the model never learned the fact being asked about, or learned it onl7 min read
05Chapter 5: How sampling and temperature shape variabilityThis chapter assumes you have used a chat-based LLM assistant, can read short Python, and know that models are trained on large text collections. It also assumes you have read the earlier chapters on next-token prediction and on why fluent text is not the same as true text. Here you will see where t7 min read
06Chapter 6: Why models guess instead of saying they don't knowThis chapter assumes you have used a chat-based assistant and read the earlier chapters on next-token prediction and knowledge gaps. You should be able to read short Python. The code here is optional but short.7 min read
07Chapter 7: When the prompt itself leads the model astrayYou have used a chat assistant and read earlier chapters on next-token prediction and on what counts as a hallucination. You can read short Python. The earlier chapters covered errors that come from the model's own gaps. This chapter covers errors that come from the input: a question with a wrong as7 min read
08Chapter 8: Where fabrication is most likelyThis chapter assumes you have used a chat assistant and can read short Python. It also assumes you know the basic idea from earlier chapters: a model predicts one likely token at a time, and nothing in that process checks facts. Here you will learn which kinds of content fail most often and why. Tha7 min read
09Chapter 9: Warning signs in an answerThis chapter assumes you have used a chat-based LLM assistant, can read short Python snippets, and know the earlier ideas in this tutorial. Those ideas are that a model predicts likely next tokens, that fluent text is not the same as true text, and that some content types, such as citations, numbers7 min read
10Chapter 10: Asking again: checking consistency across samplesThis chapter assumes you have read the chapters on sampling and temperature and on warning signs in an answer. You should be comfortable reading short Python functions. You do not need to call a real model API to follow the examples.6 min read
11Chapter 11: Checking claims against real sourcesThis chapter assumes you have read the earlier chapters on why models fabricate and on red flags in an answer. You should be comfortable reading short Python. The goal is to turn a suspicion ("this looks off") into a decision ("this is supported" or "this is not").6 min read
12Chapter 12: Prompts that make uncertainty visibleThis chapter assumes you have used a chat-based LLM assistant, can read short Python, and know the earlier chapters' main points. A model predicts likely next tokens, it is rewarded for answering rather than abstaining, and fluent text is not evidence of truth. Here you will learn how to write promp7 min read
13Chapter 13: Grounding answers in supplied documentsYou should have read the earlier chapters on why fluent text is not the same as true text, on context failures, and on verifying claims against sources. You should be comfortable reading short Python. The chapter builds on one idea: a model that is given the source text and told to use it makes up f6 min read
14Chapter 14: What these checks cannot catchThis chapter assumes you have read the earlier chapters on next-token prediction, red flags, self-consistency, source verification, prompting for uncertainty, and grounding. You should be able to read short Python functions. The code here reuses the agreement and quote-checking ideas from those chap6 min read