Book a Call → mycocoon.life
← All PostsLEARN4 min read

How LLMs Actually Work — Explained by Building a Tiny One

You use a language model every day. Odds are, your mental model of it is one of two wrong pictures: a search engine that looks things up, or a mind that understands you. It's neither — and the real answer is both simpler and stranger.

The best way to get it isn't an article (ironically). It's watching a tiny model get built. That's why we made Micro LLM, a free tool that trains a real, miniature language model in your browser while you watch. But here's the walkthrough of what you'll see.

Step 1: It Starts by Counting

Feed a model text and, at the most basic level, it counts: after the word "good", how often does "morning" come next? How often "luck", "grief", "idea"? Do this across enough text and you get a giant table of "what tends to follow what".

A model this simple already writes! Badly — it wanders and contradicts itself — but recognisably. In Micro LLM you can watch exactly this stage: the model learns word proximities from the text you give it, and its guesses start echoing your text's style. There's no lookup and no understanding. Just counting, turned into probability.

Step 2: One Word at a Time, Every Time

Here's the core loop, and it never changes no matter how big the model: given everything so far, guess the next word. Then do it again.

The model doesn't plan the paragraph, know how the sentence will end, or "have" an answer that it's transcribing. Each word is a fresh probability draw over the whole vocabulary. When ChatGPT writes you an essay, it's this loop running thousands of times, fast.

Once you've watched a micro model do it — probabilities visibly shifting with each word added — a lot of big-model behaviour suddenly makes sense.

Step 3: Scale Does Something Weird

So how does "guess the next word" become "write working code and pass exams"? Scale. To get really good at next-word prediction across all human text, a model is forced to internalise grammar, facts, styles and reasoning patterns — because those are what make the next word predictable. Nobody programs the skills in; they precipitate out of the prediction task at scale. That leap still surprises the researchers who build these things.

The big models add another trick — attention, which lets the model weigh which earlier words matter for this guess ("it" refers to the contract, not the coffee) — but the engine remains the loop you watched in step 2.

Why This Explains the Weirdness You've Seen

Go Watch One Learn

Reading about next-word prediction is one thing. Typing text into Micro LLM, pressing train, and watching probability turn into language in front of you is another — it's the difference between reading about gravity and dropping the ball. Free, in your browser, no signup, about ten minutes.

Afterwards, the jargon version of all this will read easily — start with AI Jargon in Plain English, and for why this understanding is worth career money, Why Understanding AI Is the Real Career Edge.

Cocoon builds free AI tools and runs practical AI training for professionals and teams across Sri Lanka and Southeast Asia. Try the free tool from this article or talk to us about training.

BUILD A TINY AI IN YOUR BROWSER

Micro LLM lets you train a real (tiny) language model right in your browser — watch it learn, guess the next word, and demystify the AI you use every day. Free, no signup.

TRAIN YOUR MICRO LLM

READY TO GO FROM CURIOUS TO QUALIFIED?

Reading builds awareness; training builds careers. Cocoon is the region's premier AI training company, with hands-on programmes for every level and requirement:

Delivered on-site and online across Sri Lanka, Singapore, Malaysia, Cambodia, India and Dubai.

EXPLORE ALL PROGRAMMES →BOOK A FREE CALL