Skip to content

NLP & LLMs — Overview

This section covers natural language processing with a focus on large language models: how text becomes tokens, how decoder-only transformers are architected, trained, aligned and served, and how to build, evaluate and secure applications on top of them. It assumes you already know the transformer basics from Attention and Transformers.

  1. NLP Foundations: tasks, classical pipeline, n-grams, TF-IDF, word2vec, and the road to transformers.
  2. Tokenization: BPE, WordPiece, Unigram, byte-level schemes, vocabulary trade-offs, and failure modes.
  3. LLM Architecture in Depth: RoPE, RMSNorm, SwiGLU, GQA/MLA, MoE, KV cache, long context, and a minimal GPT.
  4. Pretraining: data curation, scaling laws, optimization, parallelism, mixed precision, compute accounting.
  5. Post-Training: SFT, Preference Tuning & RL: instruction tuning, RLHF, DPO, RLAIF, GRPO and reasoning models, safety tuning.
  6. Fine-Tuning in Practice: LoRA/QLoRA, data formatting, PEFT/TRL code, forgetting.
  7. Inference & Serving: decoding and sampling, KV-cache math, vLLM, speculative decoding, quantization, FlashAttention.
  8. Prompting & In-Context Learning: few-shot, CoT, structured outputs, injection, context engineering.
  9. Retrieval-Augmented Generation: embeddings, ANN search, chunking, hybrid retrieval, reranking, evaluation.
  10. Agents & Tool Use: function calling, ReAct, MCP, memory, multi-agent, sandboxing, reliability.
  11. Evaluating LLMs: benchmarks, contamination, LLM-as-judge, human eval, eval-driven development, red-teaming.
  12. Reasoning Models, Multimodality & Frontier Trends: test-time compute, distillation, vision/speech, SSMs and hybrids, open problems.
  13. Building LLM Applications: architecture, SDK usage, caching, streaming, guardrails, observability, cost, safety.
  • Python and PyTorch fluency; comfort with linear algebra, probability and basic optimization.
  • The transformer and self-attention (see Attention and Transformers).
  • Basic command-line and Git skills; a GPU is helpful but not required (small experiments run on CPU or free notebooks; API-based exercises need an API key).

Roughly 40-60 hours including exercises.

Week Lectures Focus Hours
1 1-3 Foundations, tokenization, architecture; implement the minimal GPT 10-12
2 4-6 How models are trained, aligned and adapted; run one LoRA fine-tune 10-14
3 7-9 Serving math, prompting, RAG; build a small RAG pipeline 10-14
4 10-13 Agents, evals, frontier topics, app building; ship a small end-to-end app with an eval suite 12-16

Fast track for application builders: 8, 9, 10, 11, 13, then 2 and 7 for the cost/latency intuitions. Fast track for model builders: 1-7, then 11 and 12.

Suggested capstone: build a retrieval-augmented assistant over a document set you care about, with a 100-case eval suite, tracing, caching and a prompt-injection test set, then fine-tune or distill a small model for one sub-task and compare cost and quality.