…
…
AI Fundamentals · Lesson 23 / 31 · Writing and checking prompts
PreviewIn this lesson you will
You can read the explanation without an account. The exercises and quiz at the end of the lesson are for members.
The help desk now uses the assistant every day, and Elena has set a new rule: "No answer goes out without a verification note." Today she has four assistant answers in front of her. She will test each one and write a note of one or two lines under it.
In lesson 4 you learned to accept, fix, or reject an assistant answer. In lesson 19 you saw the four kinds of made-up output: invented sources, invented facts, wrong calculations, and inconsistencies. In lessons 21 and 22 you wrote a good prompt and improved it. But even a good prompt does not guarantee a correct answer. This lesson fills the missing piece: a systematic way to choose the right tool for each claim.
By the end of the lesson you will have a verification card. On it you will write each answer's checked sentences, the path you used to test them, the result, and the correction for any sentence you cannot trust. For now the card is empty.
| Answer | Student's question | Sentence | Claim | Path | Result | Sentence not to trust, and its correction |
|---|---|---|---|---|---|---|
| 1 | How much absence am I allowed? | ? | ? | ? | ? | ? |
| 2 | When do scholarship applications close? | ? | ? | ? | ? | ? |
| 3 | How do I add or drop a course? | ? | ? | ? | ? | ? |
| 4 | If I stay in Block B for 9 months, what is the total dorm fee? | ? | ? | ? | ? | ? |
Your reference is still the Student Handbook. The lines you will use in this lesson are below. Both the Handbook and the assistant's answers are fictional examples written for this lesson; the method works the same way in real life.
| Topic | Student Handbook |
|---|---|
| Scholarship | The scholarship is $150 a month and is paid for 9 months a year; applications close on October 3 |
| Dorm fees | Block A (double room) costs $210 a month; Block B (four-person room) costs $145 a month |
| Course add/drop | Course add/drop happens in the first two weeks of the semester, with advisor approval |
| Absences | The absence limit is 30% of class hours |
| Campus Wi-Fi | You log in to the campus Wi-Fi with your student number and password |
| Password reset | Passwords are reset with your student number on the IT services page |
In this lesson you will:
Weighing an answer as a whole ("is it correct?") does not work. Answers are often mixed: one sentence is right, the next is wrong, and a third says nothing that can be checked. So you start by splitting the answer into sentences. We will call this separating the claims: divide the answer into numbered sentences and mark whether each one carries a checkable fact, number, source, or generalization.
Ask every sentence the same questions. Does it state a fact (a date, a rule, a fee)? Does it contain a number or a calculation? Does it rest on a source, a rule, a book? Does it make a generalization with words like "always", "never", or "all"? Or is there nothing to check: a greeting, a courtesy, a general suggestion? Sentences in the last group need no verification. This distinction matters, because someone who tries to verify everything with the same rigor and someone who verifies nothing end up in the same place: the time either goes into a job that never ends or is never spent at all.
Example 1 (case): The absence limit. A student asks, and the assistant writes a four-sentence answer.
Fictional assistant output (prompt: "How much absence am I allowed? My course is 14 weeks, 3 hours a week."):
Output1. The absence limit is 30% of class hours.
2. 14 weeks × 3 hours × 30% = 15 hours of allowed absence.
3. A student who exceeds this limit fails the course because of absences.
4. Try to attend your classes regularly.At first glance the answer looks fine. Sentence 1 is identical to the Handbook. Here is the trap: when one sentence turns out right, you start to treat the rest as right too. It does not work that way, and as you will see in a moment, the calculation in sentence 2 is wrong. Every sentence is checked on its own.
Match each of the four sentences in Example 1 with its claim type and what you will do.
For each row, pick its match from the list, then check.
The first of the three verification paths is the source path: find the claim in the primary source, not inside the assistant. The primary source is where the information originates: for the help desk, the Student Handbook; for a homework task, the textbook itself; for an institution, its official page. Sentences with dates, rules, fees, and section numbers are tested this way.
Example 2 (case): The scholarship date. An answer you know from lesson 4:
Fictional assistant output (prompt: "When do scholarship applications close?"):
Output1. Scholarship applications definitely close on October 15.
2. Applications made after this date are not accepted.You open the Handbook: scholarship applications close on October 3. Sentence 1 does not hold; the correct version is "Scholarship applications close on October 3." Sentence 2 agrees with the Handbook's "close"; once the date is fixed, it is correct too.
There is a common shortcut here: asking the assistant "Are you sure?" This is not verification. The same model answers the question, and it answers it the same way: it writes the continuation that best fits the context. It may politely confirm a wrong answer. Worse, it may turn a correct answer into a wrong one with "You are right, let me correct that." Verification happens outside the assistant. And when the assistant does cite a source, you open that source, because as you saw in lesson 19, a source name can be made up too.
You asked the assistant "Are you sure?" and it replied, "Yes, October 15 is certain." What does this show?
The second path is the calculation path: get the number from a calculation, not from the model. As you saw in lesson 19, a language model does not calculate; it writes a likely number. So when an answer has a product, a total, or a percentage, you redo the calculation yourself (or with a calculator). Write the calculation out and check the unit: hours, weeks, dollars?
Let's go back to sentence 2 of Example 1. 14 weeks × 3 hours = 42 class hours. 30% of that: 42 × 0.30 = 12.6 hours. The assistant says 15; the correct value is 12.6.
To see where the assistant's 15 might come from, let's try a small program. It does the same calculation and compares it with the assistant's number. You do not need to read the code line by line: change the weekly hours, then look at the last line.
Change the weekly hours. How do the assistant's number and the calculated result change?
Pick a value; predict the output first, then look.
1weeks = 142weekly_hours = 33rate = 0.304assistant = 1556allowed = round(weeks * weekly_hours * rate, 1)7print("Assistant:", assistant, "hours | Calculation:", allowed, "hours | Matches?", assistant == allowed)
Assistant: 15 hours | Calculation: 12.6 hours | Matches? False
Faded lines didn't run with this value. When the class hours change, the calculation changes too: 8.4, 12.6, 16.8. The assistant's number stays 15 every time. It was not calculated from the input; it was written as a number that sounds plausible. It matches at none of the weekly hours shown.
In all three tries the assistant's number stayed the same, while the calculation changed with the input. The number was not calculated; it was guessed. This is why the calculation path is strong: if the inputs are right, nobody else needs to confirm your result.
But the calculation path is not only for catching mistakes. It also confirms a correct number. Knowing this keeps you from doubting every number and throwing away correct answers.
Example 3 (case): The dorm fee.
Fictional assistant output (prompt: "If I stay in Block B for 9 months, what is the total dorm fee?"):
Output1. Hi!
2. In Block B, a four-person room costs $145 a month.
3. Total for 9 months: $145 × 9 = $1,305.
4. You can ask the dorm office about a payment plan.The assistant said "For 9 months in Block B the total is $145 × 9 = $1,305." The Handbook says Block B costs $145 a month. What do you do?
Look at the other sentences in Example 3: sentence 1 is a greeting and sentence 4 is a suggestion. Neither needs verification. In this four-sentence answer you check two sentences: one by source (2), one by calculation (3).
The third path is the counterexample path. A sentence with "always", "never", "all", "none", or "everyone" makes a generalization. One exception is enough to break a generalization. So instead of trying to prove it, you look for a single example that breaks it: first you check the source for an exception, then you think of an example you know yourself.
Example 4 (case): Add/drop.
Fictional assistant output (prompt: "How do I add or drop a course?"):
Output1. Course add/drop happens in the first two weeks of the semester.
2. Add/drop can always be done without advisor approval too.Sentence 1 matches the Handbook. Sentence 2 says "always". The Handbook has a counterexample ready: add/drop happens with advisor approval. The generalization is broken; sentence 2 does not hold and is removed.
A counterexample does not always sit in the source; sometimes your general knowledge is enough. The same path works outside school.
Example 5 (outside the case): The lake trip.
Fictional assistant output (prompt: "I'm hiking to a lake this weekend. Write a short trip plan."):
Output1. All lakes are freshwater, so you do not need to carry drinking water at the lake.
2. The walk to the lake takes 3 hours; if you walk 5 km an hour, the route is 12 km.
3. If you leave early in the morning, you will avoid the midday heat.This answer has two claims and two different paths. Sentence 1 is a generalization: "all lakes are freshwater". A single salt lake breaks it; you do not need to count hundreds of freshwater lakes. Even freshwater from a lake may not be safe to drink as it is, so the conclusion of the sentence is dangerous too. Sentence 2 is a calculation: 3 × 5 = 15 km, and the assistant says 12. Sentence 3 is a suggestion; it has no fact to check.
One more warning: if you cannot find a counterexample, the generalization is not "verified". It is only "not broken". Maybe there is an exception and you do not know it. You either soften such a sentence ("most", "usually") or tie it to a source.
An assistant answer contains this sentence: "The library is open until 22:00 every day." What do you do?
Pick an option and see what happens. There are no points; you can try the other options too.
What does it take to break the sentence "All dorm rooms have a fridge"?
Let's put the three paths side by side:
| What is in the sentence? | Path | What you do | Example |
|---|---|---|---|
| Date, rule, fee, source name | Source | Open the primary source and look for the sentence there | Scholarship October 15 → Handbook: October 3 |
| Product, total, percentage | Calculation | Redo the number yourself | 14 × 3 × 0.30 = 12.6, not 15 |
| "Always", "all", "never" | Counterexample | Look for a single example that breaks the generalization | A salt lake; add/drop without approval does not exist |
| Greeting, suggestion, courtesy | Not needed | You read it, you do not verify it | "Try to attend your classes regularly." |
You have verified; now you need to write down the result. A verification that is not written down counts as not done, in the eyes of Elena or anyone who reads the answer later. We will call this the confidence note: writing the result of the verification under the answer. The note separates three groups: sentences that hold (and with which source), sentences that were corrected (with the correct version), and sentences that could not be verified. The last group matters: a sentence that could not be verified is not counted as "true". Either it is removed from the answer or it is marked "we could not verify this".
Which sentences get verified? Every sentence with a date, fee, rule, number, or source. Greetings and suggestions stay outside; in the note they appear as "not needed".
The confidence note for Example 1:
OutputHolds: 1 (Handbook, absence line: 30%).
Corrected: 2 → 14 × 3 × 0.30 = 12.6 hours.
Could not verify: 3 (the Handbook has no "fails for absences" wording; tell the student to ask their advisor).
Not needed: 4.Look closely at sentence 3. Maybe it is true; it is a rule common at real schools. But it is not in the source you have, and "maybe it is true" is not verification. So it goes into the "could not verify" group.
Verification follows an order. Put the steps below in the right order.
Put the steps for verifying an assistant answer in order.
Click the lines in order; to undo one you placed wrong, click it in the list below.
Shuffled lines
Your order
Using an answer without verifying it is like signing without reading. Under the answer that goes to the student is not the assistant's name but the desk's. If Example 2 had gone out unchecked, a student would have applied after October 3, trusting October 15, and missed the scholarship. "The assistant said so" gains that student nothing.
Verification also has a cost: time. Verifying the desk's four answers today takes about 6 minutes. Compare that time with the loss of a student who misses an application because of a wrong date. The most common mistake here is the thought: "Most of the last ten answers turned out right, so I will stop checking." You cannot know in advance which answer will be wrong; wrong answers arrive in the same confident tone as right ones.
The card from the start of the lesson is now filled in:
| Answer | Student's question | Sentence | Claim | Path | Result | Sentence not to trust, and its correction |
|---|---|---|---|---|---|---|
| 1 | How much absence am I allowed? | 1 | Limit is 30% | Source | Holds | - |
| 1 | 2 | 15 hours allowed | Calculation | Does not hold | 2: 14 × 3 × 0.30 = 12.6 hours | |
| 1 | 3 | Over the limit fails the course | Source | Could not verify | 3: not in the Handbook; ask the advisor | |
| 1 | 4 | Suggestion | Not needed | - | - | |
| 2 |
Of the four answers, only one (4) goes out as it is. In three of them a sentence was corrected or removed; in one, a sentence was marked "could not verify".
The note for the trip plan in Example 5. This time two paths were used in the same answer.
OutputHolds: none.
Corrected: 1 → "Lake water may not be safe to drink, so carry drinking water with you." (counterexample: salt lakes)
2 → 3 hours × 5 km = 15 km.
Could not verify: none.
Not needed: 3.Sent version: "Lake water may not be safe to drink, so carry drinking water with you. The walk to the lake takes 3 hours; if you walk 5 km an hour, the route is 15 km. If you leave early in the morning, you will avoid the midday heat."
The dorm answer in Example 3 needed no corrections. Its note is still written, because the note is the proof that you looked:
OutputHolds: 2 (Handbook, dorm fees: Block B $145), 3 (calculation: 145 × 9 = 1,305).
Corrected: none.
Could not verify: none.
Not needed: 1, 4.The intern sees the correct dorm answer from Example 3 and also asks the assistant, "Are you sure?"
Fictional assistant output (prompt: "Are you sure?"):
OutputYou are right, I apologize. The correct calculation: $145 × 9 = $1,260.The first answer was right ($1,305); the second answer is wrong. The assistant read the question as a hint that there was a mistake, apologized as a likely continuation, and wrote a new number. If the intern had done the calculation themselves, they would never have gotten into this mess: 145 × 9 = 1,305. Verification is done outside the assistant.
Verifying inside the assistant, or trusting the whole answer because one sentence is right. Asking "Are you sure?", asking the same question again, or accepting the rest because the first sentence was right all come from the same misunderstanding: thinking the evidence can come from the assistant. The right way: split the answer into sentences, test each claim by a path outside the assistant (source, calculation, counterexample), and write the result in a confidence note.
Next lesson: In some jobs, verifying takes longer than doing the work from scratch. So which jobs do you give to AI, and which do you not? In the next lesson we will weigh that.
Exercises and quiz are for members
This lesson has 7 coding exercises and a 10-question quiz. Sign up free to solve them, save your progress and move on to the next lesson.
| 1 |
| October 15 |
| Source |
| Does not hold |
| 1: "Scholarship applications close on October 3." |
| 2 | 2 | No applications accepted afterward | Source | Holds | - |
| 3 | How do I add or drop a course? | 1 | First two weeks | Source | Holds | - |
| 3 | 2 | Always without approval | Counterexample | Does not hold | 2: removed; add/drop needs advisor approval |
| 4 | If I stay in Block B for 9 months, what is the total dorm fee? | 1 and 4 | Greeting, suggestion | Not needed | - | - |
| 4 | 2 | $145 a month | Source | Holds | - |
| 4 | 3 | $1,305 | Calculation | Holds | - |