OkayStudy
EN English 한국어 日本語 中文 हिन्दी বাংলা اردو Español Português Français Deutsch Русский العربية Bahasa Indonesia Tiếng Việt ไทย Türkçe

How to enable notifications

Notifications are unavailable in this browser or on this address. Try a supported browser on the secure SONUB site.

If notifications are blocked, allow them in your browser settings.

  1. Open the site controls beside the address bar, or your browser’s site settings. Set Notifications for this site to Allow.
  2. In your device settings, allow notifications for your browser and check Do Not Disturb or Focus.
  3. Return to SONUB, reload the page, and use the bell to enable notifications.

On iPhone or iPad, add SONUB to your Home Screen, open it there, then allow notifications.

First Challenge

Language models: scores and choices

Learn how a language model scores the next word and picks one to write text, and why a likely answer still needs checking. Try guessing the next word yourself first.

Left: a hand always points at the tallest bar, so the same block appears every time. Right: a hand draws balls from a jar with many purple, fewer lavender and a few peach balls, so the results are mostly purple with an occasional other colour.
Lyen's Voice Narration You can listen to the text in Lyen's voice.
At a glance

How a language model picks the next word — four steps

A writes one at a time. Each time, it reads the text so far, gives every candidate a , picks one, adds it to the end, and starts again. This repeating loop is called .

  1. Read the context Everything written so far
  2. Score every candidate Scores become probabilities
  3. Pick one Greedy or sampling
  4. Add it to the end The sentence gets one piece longer

Repeat for the next token until the answer ends

A row of word blocks ends in an empty slot. Above it, three candidate blocks have bars of different heights; one is picked, attached to the end of the row, and an arrow loops back to choose again.
The never writes the whole answer at once. It fills one empty slot, then treats the longer sentence as the new for the next slot.

Try it yourself — finish the sentence

Imagine the model has read the sentence below and must choose the next word. The bars show a made-up for four candidates; together they add up to 100%.

The weather today is very ___

Candidates for the next word (example numbers) Example
  • hot 45%
  • cold 25%
  • nice 20%
  • windy 10%

These numbers are an illustration, not measurements from a real AI service.

Greedy: always the tallest bar

picks the candidate with the highest probability every time — here, the tallest bar. The same context always gets the same choice, so it is predictable, but long texts can become dull and repetitive.

Sampling: a draw that follows the bars

picks a candidate like drawing a ball from a jar: the tallest bar wins most often, but shorter bars are sometimes chosen too. Out of 100 draws, roughly 45 would give the first word and only about 10 the last. That is why the same question can get slightly different answers.

Left: a hand always points at the tallest bar, so the same block appears every time. Right: a hand draws balls from a jar with many purple, fewer lavender and a few peach balls, so the results are mostly purple with an occasional other colour.
Greedy decoding always picks the same top-probability word. Sampling follows the probabilities, so the result changes a little from draw to draw.

Temperature: sharper or flatter bars

changes the shape of the distribution before the draw. A low temperature makes the tall bar even taller, so answers become steadier. A high temperature flattens the bars, so unusual words appear more often. Neither setting makes an answer more true.

First, three ideas — AI, hallucination and reasoning mode

is not a living creature. It is a people built, and it answers by probability. There are many kinds of AI, such as recognizing faces, translating and recommending videos. This lesson is about the kind that writes text: the language model. A language model builds its answer one small piece, a token, at a time.

“” is only a technical nickname for an answer that sounds right but is wrong or has nothing to back it up — nothing inside is seeing things. When experts on the news say again and again that AI “makes mistakes” or “hallucinates,” the machine sounds alive, but that is not what it means.

“To think” and “to make a mistake” are words we use for living creatures. Yet many AI products have a “thinking (reasoning) mode,” which makes the machine look alive and thinking. A thinking mode only means the program first writes out its working — steps, a plan, a check — before it answers. That writing can be a few sentences or thousands of words, and it is built from probability too. It can help on hard problems, but it does not guarantee a right answer.

Scores and choices — from a bigram model to sampling

Inside the that runs a language model there is a part that scores every possible next piece and picks one. That is why we say an AI's answer is made from probability. You do not have to take this on faith — you can check it yourself. In a little while you will build a tiny of it: a model that only counts which word follows which. Real models are far bigger and score far better, but the last step — score, then choose — is the same.

Say you ask, “What color is the sky?” The AI does not answer because it knows the correct answer. It looks at the words so far and gives every word that could come next a score. Those scores come from patterns it learned from an enormous amount of writing — not from looking up a stored sentence.

Blue 70 points, gray 20 points, orange 10 points… (made-up numbers, just to show the idea). The AI draws one word from this score sheet — the higher the score, the bigger the chance — and there is nothing here worth calling a mind. Then it makes a new score sheet for the word after that, and repeats until the sentence ends.

Ask the exact same question twice and the answers may differ a little. Nothing mysterious is happening: it draws lots among the high-scoring words.

Sounding right is not the same as being right

AI gives convincing answers, doesn’t it? That is not because it understood you. It picked the words most likely to follow naturally from the writing it learned. Convincing and correct are not the same thing: a high score means “often written like this,” not “true.” A wrong claim comes out in exactly the same confident tone as a right one.

Probability describes a choice. Evidence supports a factual claim. Keep these two jobs separate.

No thoughts. No moods. No intent to lie. There is a calculated score sheet, and a draw made from it. A lie needs an intent to deceive, and a machine has none — which is also why it cannot notice when it is wrong. So treat AI as a tool you always check.

When an AI’s answer is wrong, do not say the machine “made a mistake” and stop there. Look for the cause. The writing it learned from may have been wrong or out of date. Its builders may have left out a step that checks facts, or a program may have had a . Or the question may have left out something it needed to know. Even without any of these, drawing by probability can still produce something false. A clear question helps a lot, but the check is still yours.

Three common misunderstandings

  • Misunderstanding AI looks up the correct answer on the internet.

    Actually A language model calculates scores for the next token from the it learned during . Even when a search tool is attached, you still need to check the sources it brings back.

  • Misunderstanding A high-probability answer is a true answer.

    Actually Probability only says which words often come next in a context like this. Whether a claim is true has to be checked against evidence.

  • Misunderstanding With temperature 0, the answer is always identical.

    Actually It is usually very similar, but the model version, attached tools and the way the computation runs can still change the output.

Training, inference, checking — and your first experiment

An AI may run an enormous number of calculations inside, but in the end it uses the patterns of words it learned from huge amounts of human writing to pick the next word by probability. Learning those patterns is called training; using them to answer is called . A document you paste into the chat changes what the AI reads this time — it does not retrain it.

When you get an answer from an AI, ask yourself: “Is this actually true, or is it just a phrase that shows up a lot?” Then check one thing for real. Open the original source, look at its date, or work the number out again. Make that one question a habit, and AI will never push you around.

Your first experiment: after one word, candidate A appears three times and candidate B once. What are the probabilities? Predict them before opening ‘Build AI’ below, then compare greedy selection with sampling.

Check the answer

A appeared 3 times out of 4, so its probability is 3 ÷ 4 = 75%. B appeared once, so 1 ÷ 4 = 25%. Greedy decoding always picks A. If you sample many times, about three draws in four give A and one gives B.

Now let’s build a tiny AI ourselves. Once you have made the score sheet yourself, you can see with your own eyes how an AI picks its answer.

Next Step

Now see probability with your own eyes and design your own little AI.

Build AI

Choose a pending booking to cancel. Each cancellation requires confirmation.

Your :

Close