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.

· From your first line to a conversation

Now, let's build your very own AI.

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.
1

XSLM overview

means Extra Small Language Model, a term SONUB coined for learning to build . Pronunciation: 엑스에스엘엠. We aim for a complete learning project, not fluent answers.

Text becomes ; a learns to predict the next ; the loads its learned numbers; sends questions to the Runner. You write each part yourself. supplies arithmetic and files, not a pretrained brain.

Type and try

Open the and type the below. Then explain the five parts aloud. The small English sample keeps typing short; you can later replace it with text in your own language.

python3 -c "print('XSLM: text -> tokens -> GPT -> Runner -> XChat')"
Practice in the terminal

Check your understanding

Can you distinguish a , a , a Runner and a chat ? Completion means your own are trained, saved, reloaded and used by XChat, even if the response is nonsense.

If you get stuck

New to Python? Review , , , and in the Python course. Use the optional warm-up to see next-word prediction before tackling a .

Optional warm-up: count words with a bigram

A Plan That Leads to Real Development

Start small like a toy, understand the principles, then grow it bigger over time.

1

Collect sentences

Collect sentences about the topic you want to learn. Just 10 sentences is enough to start.

First time here? Follow these steps

This lab builds a tiny that only looks at the word right before. It counts which word came after which, turns those counts into and then rolls a weighted die to pick the next word.

On the left, a grid of tally marks counts which colored dot followed which; an arrow leads to a big die with colored faces, and a row of small tiles shows the dots it rolled one after another.
The count table (left) becomes the weight of the die. A word that followed more often comes up more often.
  1. Leave the sentences as they are and press "Generate again". A new sentence appears, made only of words from the training text.
  2. Look at the probability formula: the number of times the next word came after the previous word, divided by the number of times the previous word appeared, is the probability.
  3. In the count table, each row is a previous word and each column is a next word. The darker the cell, the more often that pair appeared.
  4. Switch the mode to and press again: you get the same sentence every time. Go back to and raise the — the sentences become stranger.
  5. Add one sentence of your own to the training text. The table and the probabilities change right away, because the is only these counts.

Want to go further? Build it yourself in Python (AI Course) How the next word is chosen

A Tiny Probability Calculator

The percentages in the table are at temperature 1. Temperature only changes how likely each word is to be drawn — not the counts or whether anything is true.

Generated sentence Choose a mode and press Generate again.
How the probability is calculated
Previous word Next word Times it followed All that followed Probability

There are no candidates yet following the last word of the starting sentence.

Next-word candidates

Percentages are rounded; their displayed total may differ slightly from 100%.

Which word came after which, and how often?
Previous wordNext word

Many words — showing only the first 8

Key Concept

The idea is simple: read many sentences and count which word comes right after which — including where a sentence ends. Those counts become a small table, and the table already lets the guess the next word. That is the whole model you build on this page.

Real works on the same idea, only far bigger. Instead of a small table of counts it learns billions of numbers, called , from examples, and it looks at much more than the one word before — your whole question and the conversation so far. It does not look up a stored sentence. But the last step is the same as yours: give every candidate a score, then choose.

This lab vs a real language model

This lab vs a real language model
This lab () Neural
What it looks at Only the previous word The long it is given
What it learns A table of counts Numeric
and No Yes
Checks facts by itself No No
FAI and reference documents

Based on your FAI project; the examples here are rewritten for Python. FAI uses , and a larger model. Environment references checked on 2026-10-18.

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

Your :

Close