← ⚙️ Inside AI

Inside AI · Topic 7 of 10

Large language models and generative AI

Generative AI makes new text, images or sound. Large language models write text by predicting the next token, one piece at a time.

📌 Key points

  1. Generative AI creates new content, such as text, images, music or code, based on patterns learned from its training data.
  2. A large language model (LLM) is a neural network, usually a transformer, trained on huge amounts of text such as books and websites.
  3. Text is split into tokens: words or pieces of words, e.g. "playing" might become "play" + "ing". The model turns tokens into numbers.
  4. An LLM writes by predicting the next token, adding it to the text, then predicting the next one again. It chooses from likely tokens, so answers can vary.
  5. "Large" means it is trained on a huge amount of text and has a huge number of parameters (weights), often billions.
  6. After this first training, models are usually fine-tuned, often with human feedback, to follow instructions and be more helpful and safe.
  7. LLMs can hallucinate: write confident-sounding text that is false, such as made-up facts or sources, because they predict likely words rather than check the truth.
  8. The text you give the model is the prompt. A model may not know about events after its training data ends (its knowledge cutoff).

📖 Key words

Generative AI
AI that creates new content such as text, images, music or code.
Large language model (LLM)
A neural network trained on huge amounts of text to predict and generate language.
Token
A word or piece of a word that a language model works with.
Prompt
The question or instructions you give to an AI.
Parameter
A number inside a model (such as a weight) that is set during training.
Hallucination
When an AI produces confident-sounding information that is false or made up.
Knowledge cutoff
The date after which a model has no training data, so it may not know newer events.

✏️ Worked example

How does an LLM continue the text "The cat sat on the"?

  1. The text is split into tokens, and the model works out a score for every possible next token.
  2. It might give: "mat" 40%, "floor" 20%, "sofa" 15%, and smaller scores for others.
  3. It picks a likely token, e.g. "mat", adds it to the text, then predicts the next token again (perhaps ".").
  4. This repeats, one token at a time, until the answer is finished.
  5. The model is choosing likely words, not checking facts. That is why it can sound sure and still be wrong.
💡 Remember

Remember: a chatbot is a very good next-word predictor, not a fact checker. Check anything important.

Test yourself8 questions from a bank of 19. A new mix every time.
Start the quiz →

It’s bedtime! 😴

It’s late, and even Numo is getting sleepy. The best thing you can do for your learning now is… go to sleep!

✨ Sleep helps you

  • 🧠 remember what you learned today: your brain saves it while you sleep
  • 🌱 grow and stay healthy
  • ⚡ wake up with energy, ready to learn and play
  • 😊 feel happy and calm

🦉 Going to bed late can make you

  • 😩 tired and sleepy at school tomorrow
  • 🤯 find it harder to focus and to remember
  • 😠 grumpy and easily upset
  • 🤧 catch colds more easily

Children your age need 9 to 12 hours of sleep every night. Numo will be right here tomorrow!