Generative AI Starter · free course

Free course · Lesson 2 of 5

How Large Language Models Write

In this lesson you will

  • Explain tokens and next-token prediction
  • Explain why fluent text can be wrong

A large language model (LLM) writes one small piece of text, a token, at a time, each time choosing a likely next token based on everything written so far. It learned these patterns from huge amounts of text.

  • Fluent is not the same as correct: the model predicts likely text; it does not look facts up unless it is given documents or tools.
  • Local facts are weak spots: prices, opening hours, institutions and places in South Sudan are often unknown to the model, so it may invent them.
  • Tokens cost money: hosted tools count and charge by tokens, and free tiers have daily limits.
TemplateWhy the Price Was Wrong
Worksheet
Prompt:   "Write an advert for Green Hills Honey."Draft:    "... only 4,500 SSP for a 500 g jar ..."     (price invented) Reason:   The model was never told the price, so it produced a likely-looking          number. Fluent, confident and wrong. Fix:      Put the facts in the prompt: "500 g jar costs 6,000 SSP.          Use only the prices given." Then check the draft before posting.

Practice exercise

Using the worked example, explain in two sentences why an LLM might give a wrong price for a local shop.

Key takeaways

  • LLMs predict likely text, they do not look facts up
  • Give the model the facts you need it to use
In the full program Module 3: Introduction to Large Language Models See how this topic is taught in depth, with practical activities and an assessment.

Free self-study lesson — no certificate. For the full instructor-led program, see registration options.