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.
Roadmap
Section titled “Roadmap”- NLP Foundations: tasks, classical pipeline, n-grams, TF-IDF, word2vec, and the road to transformers.
- Tokenization: BPE, WordPiece, Unigram, byte-level schemes, vocabulary trade-offs, and failure modes.
- LLM Architecture in Depth: RoPE, RMSNorm, SwiGLU, GQA/MLA, MoE, KV cache, long context, and a minimal GPT.
- Pretraining: data curation, scaling laws, optimization, parallelism, mixed precision, compute accounting.
- Post-Training: SFT, Preference Tuning & RL: instruction tuning, RLHF, DPO, RLAIF, GRPO and reasoning models, safety tuning.
- Fine-Tuning in Practice: LoRA/QLoRA, data formatting, PEFT/TRL code, forgetting.
- Inference & Serving: decoding and sampling, KV-cache math, vLLM, speculative decoding, quantization, FlashAttention.
- Prompting & In-Context Learning: few-shot, CoT, structured outputs, injection, context engineering.
- Retrieval-Augmented Generation: embeddings, ANN search, chunking, hybrid retrieval, reranking, evaluation.
- Agents & Tool Use: function calling, ReAct, MCP, memory, multi-agent, sandboxing, reliability.
- Evaluating LLMs: benchmarks, contamination, LLM-as-judge, human eval, eval-driven development, red-teaming.
- Reasoning Models, Multimodality & Frontier Trends: test-time compute, distillation, vision/speech, SSMs and hybrids, open problems.
- Building LLM Applications: architecture, SDK usage, caching, streaming, guardrails, observability, cost, safety.
Prerequisites
Section titled “Prerequisites”- 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).
Suggested study plan
Section titled “Suggested study plan”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.