Mastery Calibration

Answer these questions to calibrate your starting mastery levels. L1 = can you recognize it? L2 = can you explain how it works?

Adam Optimizer

L1

What is the primary advantage of the Adam optimizer over standard SGD?

L2

Why does Adam use both first moment (m) and second moment (v) estimates of gradients?

Batch Normalization

L1

What does Batch Normalization normalize across?

L2

Why is Batch Normalization problematic during inference compared to Layer Normalization?

Scaling Laws

L1

According to neural scaling laws, what is the relationship between model performance and compute/data/parameters?

L2

What was the key insight from the Chinchilla paper regarding optimal compute allocation?

Learning Rate Schedules

L1

What is the typical pattern for learning rate schedules in modern deep learning?

L2

Why is learning rate warmup particularly important for large batch training?

Cross-Entropy Loss

L1

What does cross-entropy loss measure in language modeling?

L2

Why does cross-entropy loss become very large when the model assigns low probability to the correct token?

Overfitting & Regularization

L1

What is overfitting in machine learning?

L2

How does dropout regularization work during training versus inference?

Agent Memory Systems

L1

What are the three main types of memory systems used in AI agents?

L2

Why do agents need episodic memory when they already have long-term vector storage for retrieval?

Tool Use

L1

What is the primary mechanism that enables LLMs to use external tools?

L2

Why is tool use considered 'the bridge from language to action' rather than just another form of text generation?

Planning & Reasoning Loops

L1

What is the key difference between ReAct and simple chain-of-thought prompting?

L2

Why do planning loops often lead to better performance than single-pass generation, even when the total compute is similar?

Context Engineering

L1

What are the main components that context engineering carefully orchestrates in an LLM's input?

L2

Why is the ordering and placement of information within the context window crucial for performance?

Transformer Block (Full Assembly)

L1

What is the correct order of operations in a standard transformer block?

L2

Why are residual connections essential for training deep transformer networks?

Causal Masking

L1

What does causal masking do in decoder-only transformer models?

L2

Why is setting masked attention scores to negative infinity (rather than zero) crucial for the masking mechanism?

Tokenization (BPE)

L1

What is the primary purpose of Byte-Pair Encoding (BPE) in language models?

L2

Why does BPE iteratively merge the most frequent character pairs during training, rather than using a fixed set of subword rules?

Positional Encoding

L1

Why do transformer models need positional encodings?

L2

What is the key advantage of Rotary Positional Encoding (RoPE) over traditional sinusoidal positional encodings?

Self-Attention Score Computation

L1

In the self-attention mechanism, what does the formula QK^T / sqrt(d_head) compute?

L2

Why is the scaling factor sqrt(d_head) crucial in the attention score computation?

Top-k and Top-p (Nucleus) Sampling

L1

What is the main purpose of top-k and top-p sampling in language model inference?

L2

Why might top-p (nucleus) sampling be preferred over top-k sampling for creative text generation?

Temperature & Sampling

L1

How does temperature affect the sampling behavior in language models?

L2

What happens to the probability distribution when temperature approaches 0, and why is this mathematically significant?

Speculative Decoding

L1

What is the core idea behind speculative decoding?

L2

Why can speculative decoding maintain the same output quality as standard autoregressive decoding?

Quantization

L1

What is the primary purpose of quantization in neural network inference?

L2

Why can quantization from fp16 to int8 often maintain model performance despite the significant reduction in numerical precision?

Retrieval-Augmented Generation (RAG)

L1

What does RAG (Retrieval-Augmented Generation) do to improve LLM responses?

L2

Why is RAG particularly valuable for addressing the knowledge cutoff problem in LLMs, compared to simply fine-tuning on new data?

Guardrails & Safety Layers

L1

What are guardrails in the context of LLM deployment?

L2

Why do guardrails typically operate as separate layers around the LLM rather than being built directly into the model weights?

Hallucination

L1

What is hallucination in the context of large language models?

L2

Why is hallucination considered a fundamental limitation of the next-token prediction training objective rather than just a training data quality issue?

LLM Evaluation Metrics

L1

Which of the following represents different categories of LLM evaluation approaches?

L2

Why might a model with excellent perplexity scores still perform poorly on downstream tasks like code generation or reasoning?

Fine-Tuning & LoRA

L1

What is LoRA (Low-Rank Adaptation) designed to accomplish in fine-tuning?

L2

Why does LoRA's low-rank decomposition approach (W + AB) work effectively for adaptation, given that it uses far fewer parameters than full fine-tuning?

Implement micrograd from scratch

L1

In micrograd's Value class, what is the primary purpose of the `_backward` function that gets stored during forward operations?

L2

When implementing the backward pass for multiplication (c = a * b) in micrograd, why must you accumulate gradients using `+=` rather than direct assignment when updating a.grad and b.grad?