Skip to content
English

Switch theme

// Stage 4 · Transformers & LLMs

Modern LLM Architecture

RoPE, SwiGLU, RMSNorm, GQA/MLA, FlashAttention, sliding windows and context extension.

about 12 hours12 algorithms5 paperslesson text in progress

01Goals

Do these first: Transformers & Attention

02Algorithms to master

Each card has the original paper, prerequisites and resources.

03Must-read papers

04Courses & videos

05Hands-on: project, code & exercises

Free, official or author-published pages. Most run in the browser or on a free Colab GPU.

PROJECT

Convert your small GPT to RoPE + RMSNorm + SwiGLU + GQA and record changes in parameter count, speed and loss.

  1. 1
    rasbt/LLMs-from-scratch ↗Reference code

    Build GPT with the book, then convert it to a Llama-style model (RoPE, RMSNorm, SwiGLU, GQA) via the bonus chapters.

  2. 2
    scaled_dot_product_attention ↗Official docs

    Swap hand-written attention for PyTorch SDPA and compare speed and memory.

06Self-test

Answer in your head, then open to check.

How much smaller is GQA’s KV cache than MHA’s?

By the ratio of KV heads to query heads.

What does RoPE make attention depend on?

The relative position of the two tokens.

What does FlashAttention mainly save?

Memory reads and writes (IO), not FLOPs.

On these routes: Algorithm Researchers

Data updated: AI algorithms & curriculum(UTC+8)