Beginner · 06

Meet the chatbots: LLMs

A large language model (LLM) is an AI trained on a huge amount of text to predict the next word. Chatbots like ChatGPT, Claude and Gemini are LLMs: they write each answer one small piece (a token) at a time, which is why they sound fluent but can still be confidently wrong.

6 min read · Tap underlined words for a definition

A large language model (LLM) is a trained on a huge amount of text. Its core skill sounds almost too simple: given some text, predict what comes next.

Thecatsatonthe?model scores every tokenmat62%floor18%sofa11%roof6%moon3%
The model scores every possible next token, picks one, appends it, and repeats.
Temperature controls how adventurous the next-word pick is.

Tokens, not words

Text is chopped into tokens: whole words, word pieces, or punctuation. "unbelievable" might become "un" + "believ" + "able".

Roughly, 1 token ≈ ¾ of an English word.

One token at a time

The model outputs a probability for every in its vocabulary, picks one, adds it to the text, and runs again.

A setting called temperature controls randomness: low = safe and predictable, high = more creative and more chaotic.

Quick check

At its core, what is an LLM trained to do?

From autocomplete to assistant

Step 1, pre-training: read a huge slice of the internet and books, predicting next tokens. Result: a brilliant but unruly autocomplete.

Step 2, fine-tuning: train on example conversations and human feedback so it follows instructions and is helpful and safe.

Hallucinations

generate what sounds likely, not what is verified. Sometimes that's confidently wrong: a fake citation, an invented date.

Always double-check facts that matter, especially names, numbers, quotes and sources.

Prompting tips that actually work

Be specific: say who it's for, how long, what format.

Give context and examples of what good looks like.

Ask it to think step by step for reasoning tasks.

Iterate: treat the first answer as a draft and refine.

Quick check

An LLM gives you a book citation that sounds perfect. What should you do?

Before you drift off

  • LLMs predict the next token, one at a time.
  • Pre-training makes them knowledgeable; fine-tuning makes them helpful.
  • They can hallucinate, so verify facts that matter.
  • Clear, specific prompts with context get better answers.

Terms in this lesson

Go deeper, free and open

Questions

Is ChatGPT an LLM?

Yes. ChatGPT is a chatbot built on OpenAI's GPT large language models. Claude (Anthropic), Gemini (Google) and Llama (Meta) are other well-known LLMs.

Why do LLMs make things up?

An LLM picks words that are likely to come next, not facts it has checked. When it doesn't know, the most likely-sounding answer can still be wrong. People call this a hallucination, so check anything important.

Do I need to know maths to understand LLMs?

No. This lesson explains LLMs in plain English with pictures. The Advanced level goes into transformers and training if you want the details later.

That's the lesson

Meet the chatbots: LLMs · 6 min

Each lesson you finish lights a star.

Finish & continue · Up nextTalking to AI: prompting wellBeginner · 6 min

Spotted a mistake? Suggest an edit

Previous: Data is everything