Skip to content
All tutors

Next word prediction from the ground up

See how predicting one word at a time produces whole answers, and what temperature changes

By Skill Lab Beginner How language models work New

Your first 3 replies from the tutor are free. Then you can continue the lesson for $3 from your credit.

A taste of a lesson

One question and the answer, as this tutor gives it.

Next word prediction from the ground up AI tutor following Skill Lab's plan
Student:

I asked the same question twice and got two different answers. Is it broken?

Tutor:

Not broken, it is working as designed. At each step, the model produces probabilities for possible next words, and most chat apps pick among the likely ones with a bit of randomness, called sampling. A different early word sends the answer down a different path. This variety is useful for creative tasks. For factual questions, differing answers are a hint to check: if two runs disagree on a fact, at least one is wrong. Try asking a factual question three times. Do the facts stay the same?

Written with AI under Skill Lab's direction as an example. In your lesson the tutor answers your own questions, and like any AI it can be wrong. Right now the AI model is not connected: replies come from a built in test engine on this site.

What you will be able to do

  • Describe the loop a model uses to generate text token by token
  • Explain how probabilities, sampling and temperature shape an answer
  • Explain why the same question can give different answers
  • Evaluate the claims 'just autocomplete' and 'thinks like us' with balanced reasons

Lesson plan

5 lessons. Pick one to start there.

  1. 1 The prediction game Experience next word prediction yourself and connect it to models. Start
  2. 2 The generation loop Understand how one token at a time becomes a full answer. Start
  3. 3 Choosing words: greedy, sampling, temperature See how selection settings change style and reliability. Start
  4. 4 Why it seems so capable Understand how a simple objective leads to rich behaviour. Start
  5. 5 Autocomplete or mind? Weigh two popular descriptions of language models fairly. Start

Try asking

Tap a question to start a lesson with it.

About this tutor

For beginners who have heard that language models 'just predict the next word' and want to know what that really means and why it is both true and misleading. You play prediction games yourself, see how a model turns text into probabilities for the next token, and watch how sampling settings such as temperature change the result. You learn why the same question gives different answers, why models sometimes repeat themselves, and how such a simple objective can produce surprisingly capable behaviour. You finish able to explain the generation loop clearly and to judge claims that models are either 'just autocomplete' or 'thinking like us'.

Reviews

Students can review a tutor after a paid lesson. Nobody has yet.