Demystifying AI Visual Primer

<- Reference shelf · Master Plan · Companion lessons

Imported source: Z:\AI\demystifying_ai_export.zip on 2026-08-04.

This is the visual, beginner-friendly bridge for Transformer internals: FLOPS, precision, token IDs, embeddings, parameters versus activations, self-attention, FlashAttention, and structured sparsity. Use it when a weekly plan says the shape math is load-bearing and you want the concept drawn before you implement it.

Core Mental Model

Raw text
  ↓
Tokenizer
  ↓
Token IDs
  ↓
Embedding table lookup
  ↓
Input embedding vectors
  ↓
Positional information
  ↓
Transformer blocks
  ├─ Self-attention
  └─ Feed-forward network
  ↓
Contextualized token representations
  ↓
Output prediction

Weekly Integration

When Read Pull into the week Gate
Onboarding / Week 1 conversation transcript and parameters vs activations Vocabulary for learned parameters, temporary activations, and real-number matrix notation. Explain why theta is a bag of learned scalars, while Q, K, V, and layer outputs are computed activations.
Week 2 compute and precision plus the sparsity section in efficiency techniques FLOPS vs FLOP, exaFLOPS, FP8/FP4, 2:4 sparsity, and why precision claims must name the format. State why “10 exaFLOPS” is incomplete without precision and sparsity assumptions.
Week 5 tokens and embeddings, parameters and activations, and self-attention Tokenizer-to-embedding flow, d_model, Q/K/V projections, QK^T, and attention-score shapes before GPT implementation. For Q, K in R^(N x d_k), derive why QK^T is N x N, then say what each cell means.
Week 7 compute and precision and FlashAttention, sparsity, and efficiency Low precision as bandwidth relief, FlashAttention as IO-aware exact attention, and 2:4 sparsity as hardware-executable compression. Explain why FlashAttention changes memory traffic without changing the attention formula.
Week 8 carryover self-attention The K/V vocabulary used later for KV-cache and paged-attention serving discussions. Distinguish training activations from serving KV cache in one paragraph.

Source Files

File Use it for
01 - Compute and precision FLOP/FLOPS, exaFLOPS, FP8, FP4, storage vs multiply vs accumulation precision.
02 - Tokens and embeddings Token IDs, embedding table shape, d_model, initial vs contextualized representation.
03 - Parameters and activations Learned parameter counts, temporary activations, projection and feed-forward matrix sizes.
04 - Self-attention Q/K/V, transpose, scaled dot-product attention, multi-head attention.
05 - Efficiency techniques Naive attention memory, FlashAttention, structured sparsity, combined low-bit savings.
06 - From artificial neurons to decoder-only Transformers Coordinated architecture deep dive: dense layers, training mechanics, causal attention, GPT-style blocks, tensor shapes, and mastery exercises.
Transcript Condensed Q&A progression, useful for turning confusions into flashcards.
Handoff prompt Original continuation prompt from the exported material.

Visual Assets

Open the full-resolution diagram to zoom in or use the scrollbars above to inspect every detail.

Open the full-resolution Transformer diagram to zoom in or use the scrollbars above to inspect every detail.

Embedding stage

Self-attention flow

Diagram Use it when
Deep neural network: layers and training flows Week 1 neural-network vocabulary: forward activations, loss, backpropagated gradients, residual connections, optimizer updates, batches, and epochs.
Decoder-only Transformer: architecture and training flows Following the dense-network diagram into tokenization, causal self-attention, MLP sublayers, residual streams, next-token prediction, and block-local parameters.
Embedding stage, d_model focus Week 5 token-ID and embedding-table confusion.
Embedding stage, annotated legend Teaching the full text-to-vector path.
Embedding stage, real-number legend Repairing R^(V x d_model) notation.
Self-attention flow, English Explaining Q/K/V and token-to-token mixing.
Self-attention flow, Italian Same diagram in Italian.

Math Cards To Add

1 exaFLOPS = 10^18 floating-point operations per second
E in R^(V x d_model): V vocabulary rows, d_model columns
embedding_table[4317] selects row 4317; it does not create a 4317-element vector
Q in R^(N x d_k), K in R^(N x d_k), K^T in R^(d_k x N), so QK^T in R^(N x N)
attention(Q,K,V) = softmax(QK^T / sqrt(d_k)) V
attention projection params ~= 4 * d_model^2
feed-forward params ~= 2 * d_model * d_ff
FlashAttention = same attention math, fewer HBM reads/writes, no materialized N x N score matrix
FP4 + 2:4 sparsity can move raw weight storage toward 1/8 of FP16 dense, before metadata and scales

One-Sentence Summary

A Transformer is a large collection of learned numeric parameters that converts token IDs into vectors, repeatedly mixes those vectors according to context, and uses the resulting representations to predict what comes next.


This site uses Just the Docs, a documentation theme for Jekyll.