Learning path

How LLMs Work

Tokens, embeddings, attention, temperature and hallucinations: how large language models really work, with runnable Python. Part of the Gen AI Developer premium track.

  1. 1

    Tokens and Next-Token Prediction

    A large language model does one thing: predict the next token. Build a tiny next-word predictor in plain Python and see how text generation really works.

    3 min read
  2. 2

    Embeddings: Meaning as Numbers

    Embeddings turn words and sentences into lists of numbers where similar meanings sit close together. Compute cosine similarity by hand and build a mini semantic search.

    3 min read
  3. 3

    Transformers and Attention, Visually

    Attention lets each word look at the other words that matter for it. Compute attention weights with softmax in plain Python and see why transformers understand context.

    3 min read
  4. 4

    Transformers and Attention, Visually

    Attention lets each word look at the other words that matter for it. Compute attention weights with softmax in plain Python and see why transformers understand context.

    3 min read
  5. 5

    Context Windows, Temperature and Sampling

    Why the same prompt gives different answers, what temperature and top-k really do, and why models "forget" in long chats. With runnable Python you can tweak.

    4 min read
  6. 6

    Why Models Hallucinate and How to Reduce It

    LLMs sometimes state false things with full confidence. Learn why, and five practical defences, including grounding answers in sources and checking them with code.

    4 min read