Reading mode

CS 450 L5 · How generative AI responds

One static lecture with two views over the same document. Reading mode is the default continuous study document. Present mode changes layout, type, and navigation only.

How does generative AI produce a response?

CS 450 · AI and the World · September 14, 2026

It can pass the bar exam and still miscount the letters in strawberry

A bar exam result marked at the ninetieth percentile sits beside a chat reply that counts the letter r in strawberry as two.

A bar exam result marked at the ninetieth percentile sits beside a chat reply that counts the letter r in strawberry as two.

A classifier picks a label; a generator writes the next piece

leads toleads toleads toleads toadded back

Flower measurements

Model

Species

Text so far

Model

Next piece

Diagram explanation

A classifier turns measurements into a species label and stops, while a generator turns the text so far into a next piece that is added back to the text.

  1. Flower measurements leads to Model
  2. Model leads to Species
  3. Text so far leads to Model
  4. Model leads to Next piece
  5. Next piece leads to Text so far: added back
Generative AI
A model whose prediction is new content, not a category.
Language model
A model trained to predict the next piece of text.

The model never sees letters; it sees tokens

Token
A chunk of text from a fixed list, the unit the model works in.
One short sentence shown as seven coloured chunks, with thirty-six characters counted against seven tokens.

One short sentence shown as seven coloured chunks, with thirty-six characters counted against seven tokens.

Generation is one prediction, repeated

Next-token prediction
Score every possible next piece, pick one, add it.
Candidate next pieces for an unfinished sentence are ranked by score, and the top-scoring one is added to the sentence.

Candidate next pieces for an unfinished sentence are ranked by score, and the top-scoring one is added to the sentence.

A student asks a chat app what year Einstein published special relativity. It answers 1905, correctly. What happened?

  1. A. It found 1905 in a table of facts stored inside the model
  2. B. It predicted 1905 as the likely next piece
  3. C. It worked the year out from what it knows about Einstein
  4. D. It copied 1905 from a document it had read during training

This anonymous poll does not count toward your grade.

Two ways a question could be answered, one by finding a stored fact and one by calculating a probable next piece.

Two ways a question could be answered, one by finding a stored fact and one by calculating a probable next piece.

Nothing in the loop looks anything up

A question about Einstein is answered by scoring candidate years and returning the highest-scoring one, with the database route crossed out.

A question about Einstein is answered by scoring candidate years and returning the highest-scoring one, with the database route crossed out.

Parameters
Billions of numbers left behind by training, holding which pieces follow which.

Training played the same next-piece game on the internet

Pre-training
Show the model text, ask it to predict what comes next, correct it.
Fluent text, correct answers and apparent reasoning sit above the waterline; statistical patterns, token co-occurrences and training-data regularities sit below it.

Fluent text, correct answers and apparent reasoning sit above the waterline; statistical patterns, token co-occurrences and training-data regularities sit below it.

The next piece is drawn, not chosen

Sampling
The next piece is drawn from the ranked scores, not always the top one.
Temperature
A setting that sharpens the draw toward the top or spreads it out.
The same candidate scores are shown at three temperature settings, sharpening to one tall bar at the lowest and spreading almost flat at the highest.

The same candidate scores are shown at three temperature settings, sharpening to one tall bar at the lowest and spreading almost flat at the highest.

The same question got three different replies

One question asked three times returns three replies that differ in wording and in how sure they sound.

One question asked three times returns three replies that differ in wording and in how sure they sound.

You want story ideas for a creative writing class, and separately you want the exact dates pulled out of a contract. Which temperature for which?

  1. A. High for both
  2. B. Low for both
  3. C. High for stories, low for dates
  4. D. Low for stories, high for dates

This anonymous poll does not count toward your grade.

Two tasks, creative story ideas and extracting dates from documents, each with an empty temperature box above a scale from predictable to creative.

Two tasks, creative story ideas and extracting dates from documents, each with an empty temperature box above a scale from predictable to creative.

The scores measure plausible, not true

Hallucination
Fluent text that is false, produced by the same loop.
Two sentences about the Eiffel Tower read equally smoothly, and one of them is false.

Two sentences about the Eiffel Tower read equally smoothly, and one of them is false.

The least trustworthy parts are names, numbers, and citations

An example reply lists three academic references, and each invented title, journal and venue is flagged on the picture.

An example reply lists three academic references, and each invented title, journal and venue is flagged on the picture.

A language model writes the next piece; it does not look anything up

Candidate next pieces for an unfinished sentence are ranked by score, and the top-scoring one is added to the sentence.

Candidate next pieces for an unfinished sentence are ranked by score, and the top-scoring one is added to the sentence.