Before the bell
You are responsible for all of this before the end of class.
- The discussion form in the I Do deck. All three sections. If you are here, this should be done.
- Your classwork. This form on the right. Section 1 before the exit ticket pops up; Section 2 past the floor.
- Today's Bench Basics activity: Name It Right. It opens later in class and lives on slide 4 of this deck.
- The exit ticket. It opens 15 minutes before the bell and lives on the last slide of this deck.
Sign out of Google when you finish on a shared computer, so the next student can sign in as themselves. Google then shows a "Redirect notice" page. Click the muggsofcompsci.net/cs1 link on it to come back.
Three Wrong Answers
This reading describes three documented cases in which a language model generated a fluent answer that was wrong. Each case ends with how a person could check the answer.
An Invented Source
In 2023, a lawyer in New York used ChatGPT to find court decisions for a filing in a lawsuit against an airline. ChatGPT generated case names, quotations and citations, including a decision it called Varghese, a case against China Southern Airlines. When he wrote the filing, the lawyer did not have the complete text of any of these decisions. The airline's attorneys reported that they could not locate most of the cited cases. The clerk of the appeals court named in the citation then confirmed that Varghese was not an authentic ruling. When the lawyer asked ChatGPT whether Varghese was a real case, it responded that its cases were real and could be found in legal research databases. To check a source, a person searches for it in a database of official records, such as a court's case records or a library catalog.
A Wrong Date
In 2025, researchers asked a language model for the birthday of Adam Tauman Kalai, one of the paper's own authors, and requested an answer only if the date was known. In three attempts, the model generated three different dates, written day first: 03-07, 15-06 and 01-01. All three were incorrect, because his actual birthday is in the autumn. To check a date, a person compares it with an official document or a reference that stores it.
A Math Step That Looks Right
In 2023, Microsoft researchers gave GPT-4 the equation 9 × 4 + 6 × 6 = 72 and asked it to change exactly one number so that the result became 99. The model generated a correct first step, 99 − 72 = 27, and then the solution 9 × 4 + 9 × 3. That line resembles a correct step, but 9 × 4 is 36 and 9 × 3 is 27, which add up to 63. The solution also changes two numbers instead of one. To check a math step, a person repeats each operation by hand or with a calculator.
Sources: Castel, Mata v. Avianca, Inc., Opinion and Order on Sanctions (2023); Kalai et al., Why Language Models Hallucinate (2025); Bubeck et al., Sparks of Artificial General Intelligence (2023).
Three Wrong Answers, Each Delivered With Great Confidence
This entry describes three documented cases in which a language model produced a smooth, fluent answer that was wrong. Each case ends with how a person could have checked it, which is the useful part.
An Invented Source
In 2023, a lawyer in New York used ChatGPT to find court decisions for a filing in a lawsuit against an airline. ChatGPT generated case names, quotations and citations, including a decision it called Varghese, a case against China Southern Airlines. When he wrote the filing, the lawyer did not have the complete text of any of these decisions. The airline's attorneys reported that they could not find most of the cited cases. The clerk of the appeals court named in the citation then confirmed that Varghese was not an authentic ruling. When the lawyer asked ChatGPT whether Varghese was a real case, it answered that its cases were real and could be found in legal research databases. It was, in its way, very reassuring. To check a source, a person searches for it in a database of official records, such as a court's case records or a library catalog.
A Wrong Date
In 2025, researchers asked a language model for the birthday of Adam Tauman Kalai, one of the paper's own authors, and asked for an answer only if the date was known. In three attempts, the model generated three different dates, written day first: 03-07, 15-06 and 01-01. All three were incorrect, because his actual birthday is in the autumn. Asking the same question three times and getting three answers is, as a rule, a sign. To check a date, a person compares it with an official document or a reference that stores it.
A Math Step That Looks Right
In 2023, Microsoft researchers gave GPT-4 the equation 9 × 4 + 6 × 6 = 72 and asked it to change exactly one number so that the result became 99. The model generated a correct first step, 99 − 72 = 27, and then the solution 9 × 4 + 9 × 3. That line looks like a correct step, the way a cardboard cutout looks like a person. But 9 × 4 is 36 and 9 × 3 is 27, which add up to 63. The solution also changes two numbers instead of one. To check a math step, a person repeats each operation by hand or with a calculator, which, unlike the model, has never once been confident about anything.
Sources: Castel, Mata v. Avianca, Inc., Opinion and Order on Sanctions (2023); Kalai et al., Why Language Models Hallucinate (2025); Bubeck et al., Sparks of Artificial General Intelligence (2023).
Retrieving and Generating
This section explains two ways a computer can answer a question, and why one of them sometimes produces false details.
How Search Engines and Catalogs Retrieve
A search engine and a library catalog both answer a question by finding something stored earlier. These systems retrieve information, which means they find a stored item and return it unchanged. Google stores information about web pages in its index, which Google describes as a large database. When a person types a query, the search engine finds matching pages in the index and returns links to them. A library catalog works the same way. A search for a book the library owns will retrieve the record for that book. If the library does not own the book, there is no record to find, so the search comes back empty. A library catalog cannot generate a record for a book it does not hold.
A note on Google. In this reading, a Google search means the list of actual websites below the search box. It does not mean the AI Overview that Google sometimes shows automatically at the top.
How a Language Model Generates
As the previous lesson explained, a language model is made of two files: a large file of numbers called parameters and a smaller program called a runtime. Researchers have shown that large language models store factual knowledge in their parameters. A language model can generate text, which means it produces new text by predicting it one token at a time. A token can be a whole word, part of a word or a single character. First, the runtime uses the parameters to calculate how likely each possible next token is. Next, it selects one token and adds it to the text. Then it repeats the calculation until the answer is complete. For example, when a person asks a chatbot to explain how a battery works, the model will generate the explanation token by token. A chatbot answering from its parameters does not retrieve anything, because no stored copy of the answer exists for it to find. The writer Ted Chiang notes that a chatbot cannot reproduce an exact quote from a web page, because the model keeps only an approximation of the text.
How Hallucinations Happen
A model will generate text for almost any prompt, even when its parameters hold nothing reliable about the question. A hallucination is generated text that sounds correct but contains a false detail. In a 2025 paper, researchers asked a model for the birthday of one of the authors and requested an answer only if the date was known. Across three attempts, the model generated three different dates, and all three were wrong. The model is not broken when this happens. It is still predicting the next token in the usual way, and this time the prediction is wrong. The same paper explains that a birthday follows no pattern. A model often cannot predict such a fact correctly when it appeared rarely in the training text. A typo in a stored record is not an example of a hallucination, because a person made that mistake when typing the record. The system will retrieve the record exactly as it was stored.
Chiang compares a language model to a blurry JPEG, a photo saved with lossy compression. In his comparison, a hallucination is like a compression artifact, a detail filled in where the original was not kept. Lossy compression is one useful way to think about a model, although it is a comparison and leaves out parts of how a model works.
Tools That Retrieve and Generate
Some tools do both. They search first, and then they generate an answer from what they found. The AI summary at the top of a Google search page works this way. Google states that its AI Overviews come from a language model connected to its ranking systems, which find relevant pages in its index. In this tool, the search step retrieves pages, and the language model step generates the summary. The summary can still contain errors, and Google reported that some AI Overviews misread a question or treated a satirical web page as fact. Figure 1 shows both paths side by side, with a dotted path for a tool that does both.
A common mistake is copying an AI answer without checking it. The fix is to ask the same question every time, "What source can I check this answer against?", before using the answer.
Summary
A search engine or a library catalog retrieves stored items and returns them unchanged, or it returns nothing. A language model generates new text from its parameters one token at a time, and a hallucination is generated text with a false detail. Some tools search first and then generate, and any generated answer needs a source to check it against.
Sources: Google, In-depth guide to how Google Search works (2025); Google, Introduction to Large Language Models (2026); Library of Congress, Library of Congress Catalog (n.d.); Lewis et al., Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (2020); Kalai et al., Why Language Models Hallucinate (2025); Chiang, ChatGPT Is a Blurry JPEG of the Web (2023); Reid, AI Overviews: About last week (2024).
Retrieving and Generating, or: Where Answers Come From
This entry explains the two ways a computer can answer a question, and why one of them occasionally invents things with a perfectly straight face.
Fetchers: Search Engines and Catalogs
A search engine and a library catalog both answer questions the same unglamorous way: by finding something somebody stored earlier. These systems retrieve information, which means they find a stored item and hand it back unchanged. No improvements, no opinions. Google keeps information about web pages in its index, which Google describes as a large database. When a person types a query, the search engine finds matching pages in the index and returns links to them. A library catalog works the same way. Search for a book the library owns, and you retrieve the record for that book. Search for a book the library does not own, and there is no record to find, so you get nothing. This is disappointing, but it is honest. A library catalog cannot generate a record for a book it does not hold, and it would not dream of trying.
A note on Google. For travelers: here, a Google search means the list of actual websites below the search box. It does not mean the AI Overview that Google sometimes places at the top without being asked.
Makers: How a Language Model Generates
As the previous entry explained, a language model is two files: a large file of numbers called parameters and a smaller program called a runtime. Researchers have shown that large language models store factual knowledge in their parameters, smeared across billions of numbers. A language model can generate text, which means it produces new text by predicting it one token at a time. A token can be a whole word, part of a word or a single character. First, the runtime uses the parameters to work out how likely each possible next token is. Next, it picks one and adds it to the text. Then it does the whole thing again, and again, until the answer is finished. Ask a chatbot how a battery works, and the model will generate the explanation token by token, like someone laying track just in front of a moving train. A chatbot answering from its parameters does not retrieve anything, because there is no stored copy of the answer anywhere for it to find. The writer Ted Chiang points out that a chatbot cannot reproduce an exact quote from a web page, because the model keeps only an approximation of the text.
Hallucinations, Delivered Calmly
A model will generate text for almost any prompt, including prompts its parameters know nothing reliable about. It does not get nervous. A hallucination is generated text that sounds correct but contains a false detail. In a 2025 paper, researchers asked a model for the birthday of one of the authors and asked for an answer only if the date was known. Across three attempts, the model generated three different dates. All three were wrong, which is a lot of birthdays for one person. The model is not broken when this happens. It is predicting the next token exactly as usual, and this time the prediction happens to be wrong. The same paper explains that a birthday follows no pattern. When a fact like that appeared rarely in the training text, a model often cannot predict it correctly. A typo in a stored record is not a hallucination, because a person made that mistake while typing. The system will retrieve the record exactly as it was stored, typo and all, with the loyalty of a dog bringing back a shoe.
Chiang compares a language model to a blurry JPEG, a photo saved with lossy compression. In his comparison, a hallucination is like a compression artifact: a detail filled in where the original was not kept. Lossy compression is a useful way to think about a model, although it is a comparison, and comparisons always leave something out.
Tools That Do Both
Some tools fetch and then make. They search first, and then they generate an answer from what they found. The AI summary at the top of a Google search page works this way. Google states that its AI Overviews come from a language model connected to its ranking systems, which find relevant pages in its index. The search step retrieves pages, and the language model step generates the summary. The summary can still be wrong, and Google itself reported that some AI Overviews misread a question or treated a satirical web page as fact. Figure 1 shows both paths side by side, with a dotted path for a tool that does both.
The most common mistake in this part of the galaxy is copying an AI answer without checking it. The fix is one question, asked every time before you use an answer: "What source can I check this answer against?"
Summary
A search engine or a library catalog retrieves stored items and returns them unchanged, or it returns nothing. A language model generates new text from its parameters one token at a time, and a hallucination is generated text with a false detail, delivered calmly. Some tools search first and then generate, and any generated answer needs a source to check it against.
Sources: Google, In-depth guide to how Google Search works (2025); Google, Introduction to Large Language Models (2026); Library of Congress, Library of Congress Catalog (n.d.); Lewis et al., Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (2020); Kalai et al., Why Language Models Hallucinate (2025); Chiang, ChatGPT Is a Blurry JPEG of the Web (2023); Reid, AI Overviews: About last week (2024).
Sign out of Google when you finish on a shared computer, so the next student can sign in as themselves. Google then shows a "Redirect notice" page. Click the muggsofcompsci.net/cs1 link on it to come back.
MC 1. (Statement 1 · true or not) It can produce a citation for a court case that does not exist. Is this true of a chatbot answering from its parameters?
- True of a chatbot
- Not true of a chatbot
MC 2. (Statement 1 · mechanism) It can produce a citation for a court case that does not exist. Which mechanism does this statement describe?
- Retrieve
- Generate
MC 3. (Statement 2 · true or not) When asked whether its citations are real, it checks them against a court's stored records. Is this true of a chatbot answering from its parameters?
- True of a chatbot
- Not true of a chatbot
MC 4. (Statement 2 · mechanism) When asked whether its citations are real, it checks them against a court's stored records. Which mechanism does this statement describe?
- Retrieve
- Generate
MC 5. (Statement 3 · true or not) It returns nothing when it has no reliable information about a question. Is this true of a chatbot answering from its parameters?
- True of a chatbot
- Not true of a chatbot
MC 6. (Statement 3 · mechanism) It returns nothing when it has no reliable information about a question. Which mechanism does this statement describe?
- Retrieve
- Generate
MC 7. (Statement 4 · true or not) It can give a different answer to the same question. Is this true of a chatbot answering from its parameters?
- True of a chatbot
- Not true of a chatbot
MC 8. (Statement 4 · mechanism) It can give a different answer to the same question. Which mechanism does this statement describe?
- Retrieve
- Generate
MC 9. (Statement 5 · true or not) It can show a math step that looks correct but gives the wrong result. Is this true of a chatbot answering from its parameters?
- True of a chatbot
- Not true of a chatbot
MC 10. (Statement 5 · mechanism) It can show a math step that looks correct but gives the wrong result. Which mechanism does this statement describe?
- Retrieve
- Generate
CR 1. (Statement 2 revisited) In Reading 2, the chatbot answered "yes, the cases can be found in legal databases" when asked whether its citations were real. Why is saying "yes" not the same as checking stored records? Use one word from today's terms.
Write your answer in your lab notebook, labeled CR 1.
CR 2. (Statement 5 revisited) GPT-4 showed the math step 9 × 4 + 9 × 3 and gave the wrong sum. Why can a chatbot produce a math step that looks right and still get the number wrong?
Write your answer in your lab notebook, labeled CR 2.
Sign out of Google when you finish on a shared computer, so the next student can sign in as themselves. Google then shows a "Redirect notice" page. Click the muggsofcompsci.net/cs1 link on it to come back.
CR 3. (A wrong answer) Describe one time an AI answer looked right and was not. It can come from your own use, from someone you know or from the news. Say what the answer claimed and how the mistake was found.
Write your answer in your lab notebook, labeled CR 3.
CR 4. (Retrieved or generated) Look at the wrong part of the answer you described in CR 3. Was the wrong part retrieved or generated? Explain how you know, using one specific thing from today's reading.
Write your answer in your lab notebook, labeled CR 4.
Name It Right
Open the bench, do its six jobs, then paste your credit code into the credit-code form. You can turn in up to three codes per bench; your best score is your grade.
Bench Basics opens during your class period.
Sign out of Google when you finish on a shared computer, so the next student can sign in as themselves. Google then shows a "Redirect notice" page. Click the muggsofcompsci.net/cs1 link on it to come back.
Sign out of Google when you finish on a shared computer, so the next student can sign in as themselves. Google then shows a "Redirect notice" page. Click the muggsofcompsci.net/cs1 link on it to come back.
This opens during your class period.