MODERN AI
Large Language Models
Understand the actual mechanics of LLMs โ tokens, embeddings, next-token prediction, pretraining, instruction tuning, alignment, inference and how they become the foundation of modern AI systems.
LLM Learning Path
Learn the concepts in order. Each module builds toward a stronger understanding of how modern language models work and where they fit in the broader AI stack.
What Is an LLM?
Understand what a Large Language Model actually is, why it's called 'large,' what exactly is being modeled, and where the historical evolution from rule-based NLP to Transformers lands โ with a concrete, verified example of what a model is really predicting.
Tokens and Tokenization
Understand why LLMs consume tokens rather than words โ subword tokenization, token IDs, special tokens (BOS/EOS/PAD), and why the same sentence produces different token counts across models โ with verified, from-scratch examples.
Context Window
Understand what a context window actually is, why LLMs have hard limits on it, what happens when a conversation grows too large, and the direct relationship between context windows and RAG โ with a verified token-budget and truncation example.
Embeddings and Representations
The LLM-specific view of embeddings โ token embedding vs. hidden state vs. final representation, precisely distinguished โ with a verified, layer-by-layer trace showing a token's representation progressively drift away from its static starting embedding as it incorporates context.
Next Token Prediction
One of the most important modules in this course โ precisely what 'predict the next token' means mechanically: input sequence, logits, softmax, probability distribution, and selection โ traced with a real, executed computation, not just described.
Language Modeling and Probability
The mathematics underlying next-token prediction โ conditional probability, the chain rule, autoregressive modeling, cross-entropy, negative log-likelihood, and perplexity โ built intuitively first, then verified with real computed numbers.
How an LLM Generates Text
Assemble Modules 5-6 into the complete, iterative inference loop โ traced step by step with a real executed example, including an honest look at a genuine failure mode: repetition from greedy decoding on an undertrained model.
Pretraining
Understand what pretraining is, why it's required, how training data is constructed and cleaned, and how the training loop โ forward pass, loss, backprop, gradient descent โ connects directly to your Neural Networks and Optimization courses, applied at massive scale.
Self-Supervised Learning
Understand precisely why LLM pretraining is called self-supervised โ where the labels come from, and how enormous datasets can be used without any manual annotation โ building directly on your ML course's supervised learning foundation.
Transformer Inside an LLM
You already know Transformers completely. This module answers one specific question: now that you understand Transformers, exactly how are they assembled into a complete LLM โ end to end, with nothing re-derived from scratch.
Decoder-Only LLMs
Why modern GPT-style LLMs specifically use decoder-only architecture โ encoder vs decoder recap, causal attention, and precisely why future tokens cannot be seen โ with a verified 'I love machine learning' example showing what each position is allowed to attend to.
Model Parameters and Architecture
What it actually means when someone says '70B parameter model' โ computed directly from real architecture specs (layers, hidden dimension, attention heads, vocabulary size), showing exactly where parameters live and why more parameters don't automatically mean better performance.
Scaling LLMs
Why bigger models became possible, scaling laws, the compute/data/parameter trade-off, diminishing returns, and emergent capabilities โ with a verified illustrative power-law loss curve and a compute-optimal allocation example.
Inference
Production-oriented: what actually happens when you send a prompt to an LLM โ prefill, decode, and the KV cache โ with a verified FLOPs analysis showing exactly why decode without caching is catastrophically expensive, and why caching fixes it.
Temperature, Top-K and Top-P
From first principles: how a token actually gets selected from the probability distribution Module 5 produces โ temperature, top-k, top-p (nucleus sampling), greedy decoding โ with real, verified numbers showing exactly how each parameter reshapes the same distribution.
Fine-Tuning
Why fine-tuning exists, pretraining vs fine-tuning, full vs domain vs task-specific fine-tuning, and practical scenarios for when fine-tuning makes sense versus RAG โ with a verified example showing genuine loss reduction from fine-tuning steps starting at pretrained weights.
Instruction Tuning
Precisely why next-token prediction alone doesn't guarantee useful, instruction-following behavior โ base model vs. instruction-following model, SFT, and how a pretrained model becomes a genuinely useful assistant, building directly on Module 16's fine-tuning mechanics.
RLHF
Why RLHF was introduced beyond instruction tuning โ human preference data, reward models, the policy model, and reinforcement learning at a conceptual level (not deep RL mathematics) โ focused specifically on understanding the pipeline.
DPO and Modern Alignment
RLHF's practical complexity and Direct Preference Optimization (DPO) as a more streamlined alternative โ optimizing directly on preference pairs without a separate reward model or RL loop โ with a verified loss computation showing the loss genuinely decrease as a policy improves.
Prompting vs Fine-Tuning vs RAG
A practical decision framework bringing together prompting, fine-tuning (Module 16), and RAG โ genuine trade-offs across cost, latency, update frequency, and control, with concrete scenario-based guidance rather than a one-size-fits-all recommendation.
Hallucination
Why LLMs hallucinate, connecting directly back to Module 5's mechanism โ verified directly: a model produces a full, confident-looking probability distribution even for a fabricated fact it has no genuine grounding for, because next-token prediction has no built-in 'I don't know' signal.
LLM Limitations
The broader picture beyond hallucination: context limits, knowledge cutoff, reasoning and mathematical limitations, bias, security (prompt injection), cost, latency, and reliability โ with practical mitigation strategies for each.
LLM Evaluation
Why evaluating LLMs is genuinely difficult โ exact match, BLEU/ROUGE conceptually, perplexity's real limits, human evaluation, LLM-as-a-judge, and RAG/production evaluation โ with a verified example showing exact match failing on a semantically identical response.
Inference Optimization
Quantization, KV cache (Module 14), batching, continuous batching, speculative decoding, and distillation โ practical serving-side optimizations, with verified numbers showing real memory savings from quantization and real GPU waste from static batching.
Open-Source vs Closed-Source LLMs
Open-weight models vs closed/API models, self-hosting vs API-based inference โ genuine trade-offs across privacy, cost, customization, and deployment complexity, with realistic architecture scenarios for each choice.
Evolution of LLMs
The complete historical story, from statistical language models through RNNs, LSTMs, attention, Transformers, GPT-style models, instruction tuning, RLHF/DPO, to modern multimodal/reasoning models โ with the specific 'why' named at every transition.
LLM in a Modern GenAI System
Connecting everything from this entire course into a complete, concrete system architecture โ where embeddings, vector databases, RAG, prompt engineering, the LLM, tools, and agents fit together โ directly preparing for the upcoming Agentic AI course.
Real-World LLM Scenarios
Ten realistic engineering scenarios โ customer support, document Q&A, coding assistants, internal knowledge assistants, summarization, structured extraction, domain-specific assistants, high-throughput APIs, cost reduction, and hallucination reduction โ each mapped to problem, architecture, concept, and trade-offs.
Interview Questions
The final module: realistic, in-depth interview questions spanning the entire course, followed by 'LLMs โ What You Should Know Now,' a complete LLM Cheat Sheet, and a consolidated LLM Interview Question bank.
WHY LLMS?
Learn LLMs through the lens of modern AI
LLMs are the core foundation behind chat interfaces, copilots, document understanding, retrieval systems, code generation and many agentic workflows. Understanding how they predict tokens, scale, align and infer is essential to building effective AI products.