Phase 7Days 129-148

Transformers and LLM Internals

Self-attention, transformer blocks, BERT, GPT, T5, tokenizers, scaling laws, pretraining, decoding, HF internals, PEFT, tiny GPT

Phase Goal

Build the transformer stack from the inside out: attention, tokenizers, GPT-style models, scaling, generation, fine-tuning, and Hugging Face parity.

Progress

Day 129: Transformer Architecture Map

Day 130: QKV Self-Attention From Scratch

Day 131: Multi-Head Attention

Day 132: Positional Encoding and RoPE

Day 133: Transformer Block From Scratch

Day 134: Encoder Models and BERT

Day 135: Decoder-Only GPT From Scratch

Day 136: Encoder-Decoder Models and T5

Day 137: BPE and WordPiece Tokenizers From Scratch

Day 138: Scaling Laws and Pretraining Data

Day 139: Training Large Language Models

Day 140: Efficient Attention and Long Context

Day 141: Generation Decoding Algorithms

Day 142: Perplexity, Benchmarks, Contamination

Day 143: Prompting and In-Context Learning Internals

Day 144: Hugging Face Transformers Internals

Day 145: Fine-Tuning Encoder and Decoder Models

Day 146: Parameter-Efficient Fine-Tuning

Day 147: Reproducing GPT-2 Style Components

Day 148: Capstone: Tiny GPT and Transformer Internals

Capstone
Capstone: Tiny GPT and Transformer Internals

Build a tiny GPT-style model, implement or inspect the tokenizer, train or fine-tune it on a small corpus, compare with Hugging Face, and write an evaluation report.

  • Karpathy GPT and tokenizer-style depth
  • CS224N transformer assignment direction
  • Tiny GPT code, tokenizer notes, eval report, and README

Phase Complete!

After this phase, you'll be able to:

  • Implement self-attention and transformer blocks
  • Build or inspect BPE tokenizers and GPT-style training loops
  • Fine-tune and evaluate encoder and decoder models
  • Understand scaling, long context, decoding, and PEFT tradeoffs

You can connect Karpathy-style GPT internals with CS224N-style transformer rigor and practical HF workflows. Gate: explain without notes, build one independent artifact, diagnose a deliberate failure, and repeat a changed task after a delay. Record help and repair missing prerequisites.