AUTA AI Academy crest AUTA AI ACADEMY
Home · Module 1 · Lesson 5
Module 1 · Lesson 5 · Week 1

Inside an LLM: Tokens, Context and Next-Word Prediction

Demystify the chatbot in 8 minutes

⬇ Study guide PDF

In this lesson you will

  • Explain tokens and why models count them
  • Describe context windows and why long chats degrade
  • Explain temperature and what 'creativity' settings really do

The model predicts the next token

An LLM reads your text as tokens - chunks roughly three-quarters of a word - and computes probabilities for what token comes next. It samples one, appends it, and predicts again. Everything a chatbot does is this loop dressed in a friendly interface.

Context window: the model's short-term memory

The model can only 'see' a limited number of tokens at once, the context window. Your instructions, the conversation history and its own reply all compete for that space. When a long chat gets confusing, the window is crowded: restate the goal instead of saying 'as I said before'.

Temperature is a risk dial, not intelligence

Temperature controls how strongly the model favours likely tokens over unlikely ones. Low temperature: focused, repeatable. High: varied, surprising, more prone to nonsense. For facts and forms use low; for brainstorming, raise it a little. It changes randomness, not knowledge.

Key terms

Token

The text chunk an LLM reads and predicts; ~0.75 of a word.

Context window

How many tokens the model can consider at once.

Next-token prediction

The core loop generating all LLM output.

Temperature

Sampling randomness control; higher = more varied output.

🛠 Hands-on task: Token experiment

Tools: ChatGPT / Gemini / Claude free tier

  • Paste a 200-word paragraph into any free chatbot.
  • Ask: 'Roughly how many tokens is this, and why?'
  • Then ask the same question twice more; compare how wording changes answers.
Key takeaways: Before you go, three takeaways from this lesson. One: Explain tokens and why models count them. Two: Describe context windows and why long chats degrade. Three: Explain temperature and what 'creativity' settings really do. And your hands-on task: token experiment. Paste a 200-word paragraph into any free chatbot. When it is done, mark the lesson complete on your dashboard, keep the artifact for your portfolio, and step into the next lesson. I will see you there.
← 4. The AI Family Tree: ML, Deep Learning, 6. Hallucinations, Bias and Garbage In: W →