AI learning path

Build the pieces of a Transformer in C#

9 challenges on how large language models work inside: tokenizers and byte pair encoding, positional encoding, self-attention, causal and multi-head attention, layer normalization and sampling the next token. Solve them in order in C#; each one runs in your browser with instant tests and an AI review.

  1. 1

    Tokenization

    Turn text into tokens: vocabularies, one-hot vectors and BPE.

    0/3
    1. 1 Word Tokenizer and Vocabulary Easy Solve in C#
    2. 2 One-Hot Encoding Easy Solve in C#
    3. 3 Byte Pair Encoding (BPE) Merges Medium Solve in C#
  2. 2

    Attention

    Positional encoding and self-attention, causal and multi-head.

    0/4
    1. 1 Sinusoidal Positional Encoding Medium Solve in C#
    2. 2 Scaled Dot-Product Attention Hard Solve in C#
    3. 3 Causal (Masked) Self-Attention Medium Solve in C#
    4. 4 Multi-Head Self-Attention Hard Solve in C#
  3. 3

    Normalization and generation

    Layer normalization and choosing the next token.

    0/2
    1. 1 Layer Normalization Medium Solve in C#
    2. 2 Temperature and Top-K Sampling Medium Solve in C#