Skip to content
All tags

#ai-course

483 posts

Post-Training from Chatbots to Agents: A Public-Sources Guide | Stanford CS329A Lecture 9

A chat model is rewarded for a single response people prefer; an agent has to be rewarded for whether a multi-step task actually finished, which needs different data and environments.

LLM Reasoning: Why Intermediate Tokens Help | Stanford CS329A Lecture 15

Reasoning is the intermediate tokens between input and output; RL fine-tuning beats imitating human solutions because of a reliable verifier, and sampling several times then taking the most frequent answer pushes accuracy further.

Three Systems at the Math Olympiad: Where Verification Comes From | Stanford CS329A Lecture 16

AlphaGeometry2 relies on a symbolic engine and AlphaProof on Lean, for a combined 28 points in 2024; in 2025 Gemini Deep Think scored 35 points in natural language, with verification done by human graders.

Autonomous Agentic Systems: Rewards and Understanding Are the Bottleneck | Stanford CS329A Lecture 18

Laskin's view is that engineers spend 80% of their time understanding systems rather than writing code, and that how far RL goes depends on clean rewards, a problem he considers as hard as superintelligence itself.

Multimodal Agents in Robotics: How a VLA Connects to Actions | Stanford CS329A Lecture 19

A VLA adds an action module to a vision-language model; letting that module's gradients flow back harms language understanding, so knowledge insulation blocks the gradient, while π0.5 co-trains on web data and data from many robots to gain generalization.

Perceptrons and PLA: How a Line Corrects Itself from Mistakes | NTU Hsuan-Tien Lin Machine Learning Foundations Lecture 2

This lecture puts the first concrete content into the flowchart from Lecture 1: the hypothesis set H is all lines (perceptrons), and the algorithm A is PLA, which adds yₙxₙ to w whenever it sees a misclassified point. When the data is linearly separable, PLA started from w₀ = 0 halts after at most R²/ρ² corrections; when the data cannot be separated, switch to pocket, which keeps the line with the fewest mistakes seen so far in its pocket.

Types of Learning: Output Space, Labels, Protocol, and Input Space | NTU Hsuan-Tien Lin Machine Learning Foundations Lecture 3

This lecture takes the learning flow diagram from Lecture 1 and swaps one part at a time along four directions: the output space Y (binary classification, multiclass classification, regression, structured learning), the labels yₙ (supervised, unsupervised, semi-supervised, reinforcement learning), the way data reaches the algorithm (batch, online, active), and the input space X (concrete, raw, abstract features). Each direction has one core option, and together they mark the home ground for the rest of Foundations: batch, supervised binary classification and regression on concrete features.

Theory of Generalization: How One Break Point Makes the Growth Function Polynomial | NTU Hsuan-Tien Lin Machine Learning Foundations Lecture 6

Once a hypothesis set has a break point k, the largest number of dichotomies it can produce on N points, B(N, k), satisfies B(N, k) ≤ B(N−1, k) + B(N−1, k−1). That gives B(N, k) ≤ C(N, 0) + … + C(N, k−1), whose highest term is N to the power k−1. Three more steps put the growth function into Hoeffding and yield the VC bound: the probability of the bad event is at most 4·m_H(2N)·exp(−ε²N/8). The break point of 2D perceptrons is 4, so they can learn.

Noise and Error Measures: Learning with Noisy Targets and Unequal Mistakes | NTU Hsuan-Tien Lin Machine Learning Foundations Lecture 8

This lecture replaces the fixed target function with a target distribution P(y|x): as long as each (x, y) is drawn independently from the same joint distribution, the VC bound holds with noise just as before. The error measure err and P(y|x) together decide the ideal prediction on each x; the 0/1 error picks the most probable y and the squared error picks the weighted mean. CIA fingerprint verification penalizes a false accept 1000 times more, and this kind of weighted classification is the same as copying the −1 examples 1000 times and then doing ordinary classification.

Logistic Regression: Learning Probabilities with Gradient Descent | NTU Hsuan-Tien Lin Machine Learning Foundations Lecture 10

Logistic regression uses θ(wᵀx) to estimate P(+1|x), yet the data contains only circles and crosses. This lecture derives the cross-entropy error ln(1 + exp(−y wᵀx)) from maximum likelihood and uses the chain rule to show that the gradient is a θ-weighted average of −yₙxₙ. Setting the gradient to zero gives a non-linear equation of w with no closed-form solution, so the lecture switches to fixed learning rate gradient descent, w ← w − η∇E_in(w), and walks to the bottom of the valley one step at a time.

Nonlinear Transformation: The Price of Curved Boundaries | NTU Hsuan-Tien Lin Machine Learning Foundations Lecture 12

When no straight line separates the data, you do not need to redesign the algorithm: use a feature transform Φ to turn x into z, run a linear model in Z-space as usual, and the line in Z-space is a quadratic or higher-order curve in X-space. The Q-th order polynomial transform raises the dimension to d̃ = C(Q+d, d) − 1, and computation, storage, and the VC dimension (at most d̃+1) all grow with it, so the lecture concludes that you should try the linear model first and move to higher orders only when it is not enough.

Regularization: How Weight Decay Constrains a Model | NTU Hsuan-Tien Lin Machine Learning Foundations Lecture 14

Stepping back from a 10th-order polynomial to a 2nd-order one is the same as adding a constraint to the 10th-order problem. Once the constraint is softened to ‖w‖² ≤ C, the negative gradient of E_in at the optimal solution must be parallel to w, which gives w_REG = (ZᵀZ + λI)⁻¹Zᵀy and is the same as minimizing E_aug = E_in + (λ/N)wᵀw. That is weight decay. A larger λ means a smaller equivalent C and a smaller effective VC dimension d_EFF; switching to L1 gives sparse solutions instead.

Three Learning Principles: Occam's Razor, Sampling Bias, and Data Snooping | NTU Hsuan-Tien Lin Machine Learning Foundations Lecture 16

The last Foundations lecture teaches no new algorithm. It covers three situations in which the guarantees of the first fifteen lectures stop holding. A simple model rarely separates randomly labeled data by accident: with 10 points and random labels, a decision stump separates them with probability only 20/1024, so a successful separation means something. The VC guarantee fails when training and testing do not share one distribution, and once data has affected any step of the learning process it can no longer assess the outcome. The lecture closes with Power of Three, which folds the whole course into five groups of three.

Dual SVM: Escaping Feature Dimension with Lagrange Duality | NTU Hsuan-Tien Lin Machine Learning Techniques Lecture 2

The primal hard-margin SVM has d̃+1 variables, so it stops being solvable once the feature dimension gets large. This lecture uses Lagrange duality to trade it for a quadratic program with only N variables and N+1 constraints, then uses the KKT conditions to recover w and b from α; only the support vectors, the points with α greater than 0, affect the answer. The dual's matrix still contains d̃-dimensional inner products, so the feature dimension is not really gone until the next lecture.

Soft-Margin SVM: Allowing Mistakes and Choosing C | NTU Hsuan-Tien Lin Machine Learning Techniques Lecture 4

Hard-margin SVM insists on separating the data perfectly, so it fits noise. This lecture gives every point a violation ξₙ and uses the parameter C to trade margin width against total violation, which yields soft-margin SVM; its dual differs from the hard-margin dual only in that αₙ gains the upper bound C. The value of αₙ sorts the data into non-support vectors, free SVs, and bounded SVs, and b is computed from a free SV; C and γ are chosen by cross-validation, and the fraction of support vectors #SV/N is an upper bound on the leave-one-out error.

Support Vector Regression: Kernels and Sparse Solutions for Regression | NTU Hsuan-Tien Lin Machine Learning Techniques Lecture 6

The representer theorem turns ridge regression into a problem in β, which gives kernel ridge regression the analytic solution β = (λI + K)⁻¹y, but almost none of the N values βₙ are 0. Replace the squared error with the ε-insensitive tube error, write the problem as a QP along the soft-margin SVM route, take the dual, and you get support vector regression (SVR): the dual has 2N variables, and every point strictly inside the tube has βₙ equal to 0.

AdaBoost: Re-weighting Data to Stack Weak Classifiers into a Strong One | NTU Hsuan-Tien Lin Machine Learning Techniques Lecture 8

This lecture re-reads bagging's bootstrap as putting a weight on every example, then deliberately tunes the weights so that the previous round's gₜ has a weighted error rate of exactly 1/2, which forces the next round to learn a different hypothesis. The recipe multiplies incorrect examples by ◆ₜ = √((1−εₜ)/εₜ), divides correct ones by it, and uses αₜ = ln ◆ₜ as the vote weight in a linear vote. That is AdaBoost. As long as the base algorithm is a little better than random guessing in every round, E_in drops to 0 within O(log N) rounds; with decision stumps, three hand-computed rounds on six examples are enough to see it.

Random Forests: Bagging plus Decision Trees and the Out-of-Bag Estimate | NTU Hsuan-Tien Lin Machine Learning Techniques Lecture 10

A random forest is bagging applied to fully-grown C&RT trees, with each branch looking only at a few randomly projected features. When bootstrap draws N times, each example has about a 1/e ≈ 36.8% chance of not being used by a given tree. These out-of-bag examples give E_oob directly, a validation that needs no held-out data and no re-training; add the permutation test and you get an importance for every feature. The price is that the result wobbles with the random seed, so you keep adding trees until G is stable.

Gradient Boosted Decision Trees: AdaBoost as Gradient Descent on an Error Function | NTU Hsuan-Tien Lin Machine Learning Techniques Lecture 11

The sum of AdaBoost's weights in each round is exactly the sum of the exponential error exp(−ys). From that, this lecture derives that the gₜ found by the base algorithm is an approximate functional gradient direction, and the vote αₜ is the best step size along that direction. Swap the exponential error for squared error and the same derivation becomes 'in each round, run regression on the residuals yₙ − sₙ, then set the step size with one-variable linear regression'; with a weakened C&RT as the base model, that is GBDT.

Deep Learning: Pre-training, Autoencoders, and PCA | NTU Hsuan-Tien Lin Machine Learning Techniques Lecture 13

Once a network is stacked deep, each layer only has to do a little, but structure, model complexity, optimization, and computation all get harder. This lecture picks two of those, initialization and regularization: pre-train the weights layer by layer with a d—d̃—d autoencoder so that each layer first learns an information-preserving encoding; train on inputs with artificial noise added, as a form of regularization; and finally make the autoencoder linear and derive that the optimal W is the d̃ top eigenvectors of XᵀX, which becomes PCA once the mean is subtracted from the data.

Matrix Factorization: Learning User and Movie Features from a Rating Matrix | NTU Hsuan-Tien Lin Machine Learning Techniques Lecture 15

The only input a recommender system gets is a user ID. Apply binary vector encoding to the ID and feed it to an N-d̃-M linear network with the tanh removed, and the hypothesis is h(x) = WᵀVx, which is the same as writing the rating matrix as R ≈ VᵀW. There are two ways to learn V and W: alternating least squares solves M+N linear regressions per round, and SGD uses one rating at a time to update the vectors of one user and one movie. The lecture closes by putting boosting, neural networks, RBF networks, matrix factorization, and k nearest neighbor on one map of extraction models.

Deep Learning: How the Flipped Classroom Works and How to Read the Nine Lectures | Stanford CS230 Course Overview

CS230 is the deep learning course Andrew Ng and Kian Katanforoosh teach at Stanford, run as a flipped classroom: the foundations of neural networks, optimization, CNNs, sequence models and Transformers live in five online Coursera courses, and one in-person lecture a week covers project method, adversarial attacks and generative models, reinforcement learning, LLM applications and interpretability. The nine in-person lectures, most of their slides and two practice midterms with solutions are public; the Stanford-only Coursera sessions, the section recordings and project mentoring are not.

What Machine Learning Learns: Supervised, Unsupervised, and Reinforcement Learning | Stanford CS229 Lecture 1

The opening lecture of CS229 Spring 2026 runs only 37 minutes and has no derivations. It defines machine learning with Tom Mitchell's experience E, task T, and performance measure P, then splits the whole course into supervised, unsupervised, and reinforcement learning. The three differ in whether the data comes with answers and whether the model collected the data itself. Large language models show up in all three categories at once.

The Supervised Learning Setup and Linear Regression: How a Line Is Learned from Data | Stanford CS229 Lecture 2

Lecture 2 breaks supervised learning into three pieces: a hypothesis h, the least-squares cost J(θ), and an algorithm that drives J down. Gradient descent sweeps all n examples on every step; minibatch SGD updates after looking at a small batch, and pays for it by bouncing around near the optimum. Linear regression also has a closed-form solution, θ = (XᵀX)⁻¹Xᵀy, provided XᵀX is invertible.

Maximum Likelihood and Logistic Regression: Why Least Squares Is a Reasonable Choice | Stanford CS229 Lecture 3

Assume the errors are zero-mean, IID Gaussian noise, take the log of the likelihood, and maximum likelihood turns out to be last lecture's least squares. Run the same recipe with 0/1 labels and a sigmoid and you get logistic regression, whose gradient is still "error times input". The lecture closes by comparing Newton's method with SGD: far fewer steps, but each step costs n·d² + d³.

Exponential Families, Generalized Linear Models, and Softmax: How Many Times Do You Re-derive for a New Error Distribution? | Stanford CS229 Lecture 4

If the distribution of y can be written as b(y)·exp(ηᵀT(y) − a(η)), one derivative of a(η) gives the expectation and two give the variance. Set η = θᵀx, and linear regression, logistic regression, and softmax all share one update rule: θ ← θ + α(y − h(x))x. The second half of the lecture uses a four-class example to cover softmax, cross entropy, and label smoothing.

Gaussian Discriminant Analysis and Naive Bayes: Model Each Class First, Then Classify with Bayes' Rule | Stanford CS229 Lecture 5

Lecture 5 turns classification around: instead of learning p(y|x) directly, it learns p(x|y) and p(y). GDA assumes the two classes are Gaussians with a shared covariance. Maximum likelihood then takes nothing more than counting proportions and averaging, the decision boundary comes out as a straight line, and the posterior is exactly a sigmoid. Naive Bayes uses conditional independence to squeeze 2^d parameters down to 2d+1.

Bias and Variance, Regularization, and Model Selection: How Complex Should a Model Be? | Stanford CS229 Lecture 6

This lecture splits test error into three terms: noise σ², squared bias, and variance. It then uses the closed-form solution of ridge regression to show how regularization moves each eigenvalue from λ to λ+ρ, trading a little bias for a large cut in variance. The second half covers double descent, ImageNet-V2, and choosing hyperparameters with a dev set, k-fold cross-validation, and successive halving.

Neural Network Architecture: From a Single ReLU to Residual Connections and Normalization Layers | Stanford CS229 Lecture 7

Lecture 7 first carries the training recipe for linear models over to nonlinear models unchanged: one loss per example, take the average, walk downhill with SGD. Two questions remain: what the model looks like, and how to compute the gradient. The second half answers the first. One neuron is ReLU(wᵀx+b); stacking m neurons into a matrix gives one layer, ReLU(Wx+b), with md+m parameters; above that come the residual block z+σ(MM(σ(MM(z)))) and LayerNorm and RMSNorm. Computing the gradient is left to Lecture 8.

Backpropagation: Why Computing the Gradient Costs Only One Forward Pass | Stanford CS229 Lecture 8

The lecture starts from one theorem: if a scalar function can be computed with N basic operations, its gradient can also be computed in O(N) time. The method is to read the chain rule as "given ∂J/∂u, you can compute ∂J/∂z, using only information about the module in between", then derive a backward function for matrix multiplication and for the activation function: Wᵀv, vzᵀ, and σ′(z)⊙v. This article also works a forward and backward pass by hand on a small 2-2-1 network.

k-means and Gaussian Mixture Models: How Do You Cluster Without Labels? | Stanford CS229 Lecture 9

Lecture 9 starts from the two steps of k-means, assign and average, and explains why the algorithm always stops yet only reaches a local optimum. Replacing hard assignments with probabilities gives the Gaussian mixture model and the two steps of EM: an E-step that is Bayes' rule and an M-step that is a weighted average. The lecture ends with the picture behind EM, drawn with Jensen's inequality: each round builds a lower bound that touches the log-likelihood and climbs to its top. The full derivation waits for Lecture 10.

The EM Algorithm and PCA: How a Lower Bound Keeps the Likelihood from Dropping | Stanford CS229 Lecture 10

The first half uses Jensen's inequality to build a lower bound on the log-likelihood, the ELBO, then picks Q to be the posterior so the bound is tight at the current parameters. From that it follows that no round of EM can lower the likelihood, and plugging in a Gaussian mixture recovers last lecture's weighted-average formulas. The second half writes PCA as maximizing uᵀΣu over unit vectors; the answer is the eigenvector of the covariance matrix with the largest eigenvalue.

Diffusion Models: How Do You Learn to Run the Noising Process Backward? | Stanford CS229 Lecture 11

Each forward step multiplies the data by √(1−β_t) and adds Gaussian noise with variance β_t. Unrolled, x_t = √ᾱ_t·x_0 + √(1−ᾱ_t)·ε̂_t, and nothing here is learned. The reverse direction is learned with a Gaussian p_θ(x_{t−1}|x_t): apply last lecture's ELBO to the whole trajectory, split it with the KL chain rule, and the loss at each step is ‖μ̃_t(x_t,x_0) − μ_θ(x_t,t)‖²/(2β̃_t). The lecture stops at this expression; simplifying it into noise prediction is left for Lecture 12.

The Diffusion Noise-Prediction Loss, Foundation Models, and LoRA | Stanford CS229 Lecture 12

The first half collapses the diffusion ELBO into one expression: every time step is a squared error for guessing the noise that was added, which gives a five-step training procedure and a one-loop sampler. The second half opens the foundation-model unit: the two-stage paradigm of pretraining plus adaptation, linear probe, finetune, LP-FT, and why LoRA trains only 2dr parameters yet saves very little compute.

Contrastive Learning and Semantic Retrieval: How to Learn Vectors You Can Compare Without Labels | Stanford CS229 Lecture 13

This lecture unpacks the SimCLR loss into a B×B similarity matrix: each row is one softmax classification problem whose answer is the diagonal entry. The diagonal gets pulled up and everything else gets pushed down, so the model learns that similar things have nearby vectors without any labels. The second half uses the same vectors for semantic retrieval, then connects that to RAG.

Large Language Models: Next-Token Loss and How Attention Is Computed | Stanford CS229 Lecture 14

This lecture takes a large language model apart in three layers: tokenization turns text into token IDs, the chain rule splits the probability of a whole text into a sequence of next-token conditionals, and training sums the cross-entropy at every position. The second half opens up the Transformer: inner products of queries and keys go through a softmax to give weights, the weights average the values, and a causal mask blocks future positions. The cost of a single attention layer grows with the square of the sequence length T.

Attention Variants, MoE, and Prompting: What to Do When the KV Cache Is Too Big | Stanford CS229 Lecture 16

During generation, every head has to keep the keys and values of all past positions in GPU memory, and this KV cache caps the batch size. GQA lets τ query heads share one set of keys and values, shrinking the cache to 1/τ; sliding window attention cuts the T² compute down to T·w; MoE runs only 8 of 128 experts for each token. The second half covers how to use a trained model: few-shot and zero-shot prompting leave the parameters alone, SFT changes them, and its loss is computed only on the answer tokens.

Reinforcement Learning Basics and Policy Gradient: Taking a Gradient When the Parameters Hide in the Sampling Distribution | Stanford CS229 Lecture 18

The first 55 minutes of this lecture write sequential decision making as an MDP (states, actions, transition probabilities, rewards, discount factor) and show that the Bellman equation for a fixed policy is a system of linear equations. The last 20 minutes derive policy gradient: ∇p = p∇log p turns the gradient back into an expectation, the transition probabilities drop out of the gradient because they don't contain θ, and the lecture stops at the formula "sum of log-probability gradients × sum of discounted rewards", leaving variance reduction for the next lecture.

Baselines, PPO, and Verifiable Rewards: How Grading Only the Answer Trains Long Chains of Thought | Stanford CS229 Lecture 20

The last lecture of the term finishes policy gradient: past rewards and any baseline that depends only on the state can be removed from the weight without changing the expectation. It then derives PPO's clipped objective from importance sampling, splits it into four cases to see which samples still carry a gradient, and compares the change CISPO makes. Finally it writes token-by-token generation in a language model as an MDP, gives a reward of 1 only when the answer is right, and trains long chains of thought using the average over 8 samples of the same question as the baseline.

Why Generating an Answer Still Requires Verification | Stanford CS329A Lecture 1

An agent needs trustworthy feedback to correct its actions; improving one task’s result does not mean its model weights have learned.

Final Projects: Build a Reproducible Generative-Model Experiment | CMU 10-423 Topic Guide

Design controlled comparisons, retain paired outcomes, and distinguish replication from working code in a generative-model project.

Autodiff in Practice: From Hand Gradients to a Training Loop | CMU 10-423 Assignment 0

Knowing that backpropagation uses the chain rule is different from implementing a correct training loop.

Paper Reports: Turn a Model Summary into a Testable Argument | CMU 10-423 Assignment 623

Separate paper claims, empirical support, and your own interpretation through a role-based report and a controlled-comparison example.

Causal Attention: From Q, K, and V to the Next Token | CMU 10-423 Lecture 2

An RNN compresses the prefix into a state.

Training and Decoding: Why the Same Logits Produce Different Sequences | CMU 10-423 Lecture 3

Learning a next-token distribution and choosing a token from that distribution are consecutive but distinct operations.

Diffusion Training and Sampling: Random Timesteps and Reverse Chains | CMU 10-423 Lecture 8

Lecture 7 constructed noisy inputs and noise targets.

VAEs: Reconstruction, KL, and Reparameterization | CMU 10-423 Lecture 9

A conventional autoencoder compresses an input into a vector and reconstructs it.

ICL, SFT, and RLHF: From Changing Inputs to Changing Weights | CMU 10-423 Lecture 11

Separate what ICL, SFT, reward models, and RLHF each change, with worked examples and answered variations.

DPO and Latent Diffusion: Updating on Preferences, Conditioning the Denoiser | CMU 10-423 Lecture 12

Derive the DPO loss with a recomputable example, then trace shapes and conditioning paths in latent diffusion.

Vision-Language Models: Turning Images into Language-Model Inputs | CMU 10-423 Lecture 13

A complete worked example and answered variations for Vision-Language Models: Turning Images into Language-Model Inputs.

Cross-Attention and DiT: How Conditions Enter a Denoiser | CMU 10-423 Lecture 14

A complete worked example and answered variations for Cross-Attention and DiT: How Conditions Enter a Denoiser.

Q-Former and Scaling Laws: Bridging Frozen Models, Allocating a Fixed Budget | CMU 10-423 Lecture 15

Trace Q-Former queries and two-stage training, then compute a model/data split under a fixed compute budget.

Mixture of Experts: Separating Capacity from Active Computation | CMU 10-423 Lecture 16

A complete worked example and answered variations for Mixture of Experts: Separating Capacity from Active Computation.

Distributed Training: Splitting Data, Models, and Optimizer State | CMU 10-423 Lecture 17

A complete worked example and answered variations for Distributed Training: Splitting Data, Models, and Optimizer State.

Efficient Inference: FlashAttention, KV Caches, and Speculative Decoding | CMU 10-423 Lecture 18

A complete worked example and answered variations for Efficient Inference: FlashAttention, KV Caches, and Speculative Decoding.

Long Context: Fitting Input Is Not Reliable Retrieval | CMU 10-423 Lecture 19

Long Context: Fitting Input Is Not Reliable Retrieval | CMU 10-423 Lecture 19

State Space Models: From Recurrence to Convolution | CMU 10-423 Lecture 21

State Space Models: From Recurrence to Convolution | CMU 10-423 Lecture 21

Generative AI Risks: Turning Failures into Tests | CMU 10-423 Lecture 22

Generative AI Risks: Turning Failures into Tests | CMU 10-423 Lecture 22

Audio Understanding and Generation: Samples to Text, Tokens Back to Sound | CMU 10-423 Lecture 24

Compute frames, mel bins, and WER, then account for codec tokens and contrast diffusion sampling.

Video Generation: Modeling the Time Axis | CMU 10-423 Lecture 25

Video Generation: Modeling the Time Axis | CMU 10-423 Lecture 25

World Models and Alignment Theory: Action Interventions and Corrigibility Assumptions | CMU 10-423 Lecture 26

Separate three world representations and evidence of action control, then examine consensus costs and corrigibility theorem conditions.

LoRA: What Changes When Most Weights Stay Frozen | CMU 10-423 Lecture 10

A complete worked example and answered variations for LoRA: What Changes When Most Weights Stay Frozen.

Practice Exam: Diagnose Conceptual Gaps | CMU 10-423 Topic Guide

Use the public practice exam to diagnose assumptions, data flow, and evaluation errors through a worked probability example.

Open-Ended Evolution: A Reading Guide | Stanford CS329A Lecture 7

Open-ended evolution changes agent code and workflows; archives preserve branches, while held-out tests assess generalization.

Software Engineering Agents: A Reading Guide | Stanford CS329A Lecture 13

Program candidates need requirement-based counterexamples; speed matters only after correctness checks pass.

Agent Memory: A Reading Guide | Stanford CS329A Lecture 14

Retrieval, trained KV representations, and cache reuse address different bottlenecks; speed does not guarantee freshness.

Test-Time Compute: Finding the Right Answer Among More Attempts | Stanford CS329A Lecture 2

More candidates increase the chance of a correct solution; credible selection turns that chance into delivered success.

Robust Verification: Checking Steps Before Trusting an Answer | Stanford CS329A Lecture 3

A correct final answer does not validate its derivation; step feedback locates errors, but verifiers still need checking.

Tool and Code Feedback: Changing the Next Action | Stanford CS329A Lecture 4

Observations, tests, and principle-based critique supply different signals; identify the signal before choosing revision or training.

Multi-Step Planning: Decompose the Step That Fails | Stanford CS329A Lecture 5

Distinguish search, parallel execution, and training; subtask artifacts must fulfill the original task criterion.

Train-Time Improvement: Turning Feedback into Learning | Stanford CS329A Lecture 6

Useful training feedback must distinguish candidates; filtering, relative advantages, and sampling determine the learning signal.

Search and Deep Research: Selecting a Deliverable Answer | Stanford CS329A Lecture 8

Candidate search selects solutions; retrieval fills knowledge gaps. Both require specifications and checkable evidence.

Long-Horizon Evaluation: Completion, Correctness, and Deliverability | Stanford CS329A Lecture 17

Human task duration, artifact quality, and citation support measure different things; evaluate both execution and deliverables.

Future Research: Turn Improvement Bottlenecks into Testable Hypotheses | Stanford CS329A Lecture 20

Diversity, verification, task selection, and efficiency are distinct bottlenecks; experiments need holdouts and falsifiable hypotheses.

Reinforcement Learning Systems: Connecting Inference and Training | CMU 11-768 Lecture 12

An RL system samples with an inference engine, assigns rewards through verification, recomputes logprobs and gradients in a trainer, then synchronizes new weights back to inference. Walk through these five stages in an invented example before examining caching, preserved histories, and asynchronous updates.

Agent Safety — Four Threat Models and Three Limits: Sandboxes, Credential Brokering, Monitoring | CMU 11-768 Lecture 13

Lecture 13 is about limiting what agents can access and do. The slides open with five real incidents, sort them into four threat models (malicious user, prompt injection, agent error, improper means), then give four layers of defense: red teaming and safety training, sandboxes and credential brokering, monitoring, and safety evaluation. The easiest point to miss: hiding the API key does not stop an agent from misusing the access behind it.

OpenHands — A Coding-Agent Framework That Went from Research Prototype to Thousands of Automated Runs | CMU 11-768 Lecture 14

Graham Neubig uses OpenHands, which he leads, to explain framework design: how coding agents evolved from HumanEval, SWE-bench and Devin to 2026's long-running, interruptible, parallel work; the parts of the Software Agent SDK (LLM, tools, conversation, condenser, workspace, confirmation policy); the single- vs. multi-agent trade-off; local vs. cloud and four interfaces (IDE, GUI, CLI, integrations); automations wired to issues and PRs; and revising skills from past trajectories.

AI Engineering from Scratch: A Guide to the Free Course That Builds Everything by Hand, from Linear Algebra to Multi-Agent Systems

AI Engineering from Scratch is a free, MIT-licensed course on GitHub with about 63k stars: 20 phases and 523 lessons, running from linear algebra, classical ML, and deep learning to LLMs, agents, and AI safety. Each lesson builds the algorithm by hand, then repeats it with a framework. The early math and deep-learning-core phases are worth following step by step; skip the Phase 10 SFT/RLHF/DPO lessons, and treat the rest as a map of topics.

Audio, Video, and World Models: A Reading Map | CMU 10-423 Topic Guide

Audio representation, temporal relationships in video, and action-conditioned world transitions are different learning tasks. The earlier combined guide checked only audio at the end. This URL now serves as a reading map to one full guide each for Lectures 24–26; the Lecture 26 guide also covers the separate alignment deck.

CNNs and ViT: Turning an Image into Model Inputs | CMU 10-423 Lecture 5

Text models convert text into tokens; image models also need a computational representation of pixels.

Code Generation and Agents: A Reliable Test–Repair Loop | CMU 10-423 Lecture 23

Code Generation and Agents: A Reliable Test–Repair Loop | CMU 10-423 Lecture 23

Condition Injection: The Roles of Attention, DiT, and Q-Former | CMU 10-423 Topic Guide

Cross-attention reads another representation, DiT is a diffusion-backbone choice, and Q-Former uses learned queries to extract or bridge information. They can coexist rather than being three competing products. The Lecture 14 lesson handles Prompt-to-Prompt and classifier-free guidance in detail.

Diffusion Models: Why Adding Noise Creates a Training Task | CMU 10-423 Lecture 7

A GAN learns from a discriminator.

Distributed Training and Efficient Inference: Locate the Cost | CMU 10-423 Topic Guide

A model that does not fit on one GPU has a different problem from a model that fits but decodes slowly. Distributed strategies partition data, parameters, and states. FlashAttention improves attention memory traffic; KV caching avoids recomputing historical keys and values during decoding.

Exams, Papers, and Projects: Three Forms of Learning Evidence | CMU 10-423 Topic Guide

An exam tests reasoning under a fixed question. A paper report tests your judgment of someone else’s evidence. A project tests your ability to produce reproducible evidence. These are distinct learning tasks, now taught separately while this URL remains an assessment map.

GANs: What the Generator and Discriminator Learn | CMU 10-423 Lecture 6

A classifier asks which class an image belongs to.

A Generative AI Learning Path: Reading the 35 Core Guides | CMU 10-423 Course Overview

This series uses the public Spring 2026 materials for CMU 10-423/623/723 Generative AI.

Testing minGPT Changes: Shapes, Masks, and Positions | CMU 10-423 Assignment 1

Assignment 1 brings sequence modeling and modern attention into code.

Testing DDPM: Matching Timestep Coefficients to a Batch | CMU 10-423 Assignment 2

Copying a noising equation is not enough to implement diffusion correctly.

Testing LoRA Fine-Tuning: Gradients, Data, and Evaluation | CMU 10-423 Assignment 3

Use an original numerical test to check gradients, data, and evaluation alongside the original assignment specification.

Testing Q-Former Text-to-Image: Gradients through Frozen Backbones | CMU 10-423 Assignment 4

Use an original numerical test to check gradients, data, and evaluation alongside the original assignment specification.

SFT, RLHF, and DPO: Separate Their Training Signals | CMU 10-423 Topic Guide

A prompt with one demonstrated answer is not the same data as a prompt with a preferred and rejected response. SFT learns demonstrated tokens. A typical RLHF pipeline learns reward and then updates a constrained policy. DPO forms a loss directly from preference pairs and reference-relative ratios.

Long Context and SSMs: Different Ways to Retain History | CMU 10-423 Topic Guide

Long-context evaluation asks whether a model can process, retrieve, and use distant information. An SSM specifies sequence processing through state updates. SSM efficiency does not establish reliable document retrieval, and a large attention window does not guarantee relevant evidence is used.

Modern Transformers: What Position Rotation and KV Sharing Change | CMU 10-423 Lecture 4

Attention needs both order information and a manageable memory footprint during generation.

PEFT and ICL: Change Parameters or Change the Input | CMU 10-423 Topic Guide

Adapting without retraining every weight can mean two different things. LoRA-style PEFT still trains some parameters. ICL supplies examples in context without updating parameters during that inference. The source spans the end of Lecture 9, Lecture 10, and the ICL material in Lecture 11.

Reasoning Models: Spending Compute on Verifiable Answers | CMU 10-423 Lecture 20

Reasoning Models: Spending Compute on Verifiable Answers | CMU 10-423 Lecture 20

Operational Risks and Alignment Theory: Tests and Assumptions | CMU 10-423 Topic Guide

Hallucination, leakage, and prompt injection are observable operational risks. Alignment theory asks which guarantees hold under specific formal assumptions. They require different evidence. Lectures 22 and 26 therefore have separate teaching guides, without turning one theorem into a universal impossibility claim.

RNN Language Models: Sequence Probabilities and Gradient Paths | CMU 10-423 Lecture 1

A sequence such as “I like cats” is not a bag of independent words.

Scaling and MoE: Compute Budgets and Conditional Computation | CMU 10-423 Topic Guide

Scaling laws study model and data allocation under a budget. MoE increases expert capacity while activating selected experts. The former concerns allocation and empirical models; the latter concerns architecture and routing. Both deserve separate checks.

Text-to-Image and VLMs: Generating Images versus Reading Them | CMU 10-423 Topic Guide

“Text plus images” does not specify the task. Text-to-image generation produces an image conditioned on text; a VLM may consume an image and produce an answer. Direction, output objective, and evaluation differ even when both use Transformers.

Transformer, Training, and Decoding: Three Different Questions | CMU 10-423 Topic Guide

How the model reads a history, learns from targets, and chooses its next token are different questions. Attention mixes information; the training objective updates parameters; decoding selects output under a fixed model. Keeping them distinct prevents confusing a sampling change with a model update.

Diffusion and VAEs: Related Objectives, Different Generation Paths | CMU 10-423 Topic Guide

Diffusion and VAEs share probabilistic ideas without sharing the same generation procedure. Diffusion chains noise steps; a VAE approximates a latent posterior with an encoder and reconstructs through a decoder. This guide connects those ideas while directing each mechanism to its own lesson.

Accelerating Transformers on GPUs, and Where LightSeq Finds the Time | CMU 11-868 Lecture 10

Lecture 10 of 11-868 uses Lei Li's own LightSeq and LightSeq2 as the case study and breaks them into four techniques: fuse every small operation outside matrix multiplication into one kernel, rewrite the LayerNorm and Softmax formulas to cut thread synchronizations, store parameters and gradients in FP16 but compute updates in FP32, and reuse memory based on backward-pass dependencies. The slides report 1.4-3.5x training speedups on WMT14 English-German. The official syllabus lists no public recording link; this guide works from slide page numbers and the two papers.

Distributed Training and Data Parallelism, and Where Gradient Sync Costs Come From | CMU 11-868 Lectures 14–15

Lectures 14 and 15 of 11-868 go from the parameter server to PyTorch DDP. They use NCCL's five collectives (Broadcast, Reduce, AllReduce, ReduceScatter, AllGather) as building blocks, show why a ring makes broadcast time nearly independent of GPU count, and split AllReduce into ReduceScatter plus AllGather. The second lecture takes apart DDP's two key designs: bucketing gradients (25 MB by default) and starting synchronization before the backward pass finishes. The official syllabus lists no public recording link; this guide works from slide page numbers and the VLDB 2020 paper.

How a Deep Learning Framework Computes Gradients from a Computation Graph | CMU 11-868 Lecture 5

L05 follows a small sentiment classification network throughout. It expresses computation as a graph, evaluates it in topological order, sends gradients back with the chain rule and vector-Jacobian products, and then takes apart TensorFlow v1's placeholder, variable, operation, and session. One slide is labeled "important for HW2".

FlashAttention: Attention Is Slow Because of Data Movement, Not Math — Tri Dao from FA1 to FA4 | CMU 11-868 Lecture 21

Standard attention writes the N×N score matrix out to HBM and reads it back, and most of its time goes to that traffic. FlashAttention uses tiling plus softmax rescaling so each block finishes inside SRAM, and the backward pass recomputes instead of storing. Tri Dao's guest slides for 11-868 give one set of numbers: the backward pass does 13% more FLOPs, 9x less HBM traffic, and runs 6x faster. FA3 and FA4 follow the same theme: when the hardware changes, the bottleneck moves, and the algorithm has to move with it.

GPU Programming and Acceleration: Threads, Blocks, the Memory Hierarchy, and Tiling | CMU 11-868 Lectures 2–4

CMU 11-868's three GPU lectures answer one question: why does a correct CUDA matmul use only 2.48% of an A100's FP32 compute? L02 covers SMs, warps, and the grid/block/thread hierarchy. L03 covers cudaMalloc, cudaMemcpy, and kernel indexing. L04 uses tiling, coalesced access, and bank-conflict avoidance to bring data closer than global memory, which sits about 500 cycles away.

Writing MiniTorch's map, zip, reduce, and matmul in CUDA | CMU 11-868 Assignment 1

The first 11-868 assignment has you write four CUDA kernels in src/combine.cu (map 15, zip 25, reduce 25, matmul 30 points), wire them into MiniTorch's Python backend, and finish with a 5-point integration test. Shared-memory optimizations for reduce and matmul are marked Optional. The assignment page says plainly that you need a GPU, and grading uses private test cases.

Implementing Autodiff in MiniTorch and Training a Sentiment Classifier | CMU 11-868 Assignment 2

The second 11-868 assignment has three parts: autodiff's topological_sort and backpropagate (40 points), a Linear layer and MLP network (30), and binary cross entropy plus the training loop (30). You then train a sentiment classifier on SST-2 with GloVe embeddings and must reach 75% validation accuracy. The default backend is the CUDA kernels from Assignment 1, and the repo merged small Fall 2026 fixes on 2026-09-02.

Build GPT-2 in Your Own MiniTorch and Make It Translate German | CMU 11-868 Assignment 3

HW3 has you add softmax loss, Dropout, LayerNorm, and Embedding to the MiniTorch you built in HW1 and HW2, assemble a pre-LN GPT-2 decoder, and train it on IWSLT14 German-English translation. Points: tensor functions 20, basic modules 20, decoder LM 40, translation pipeline 20. Full marks require passing the private tests and a BLEU of about 20±2. The assignment page warns that training alone takes at least 10 hours: one epoch is about an hour on a PSC V100, and you need 10. In Spring 2026 it went out Feb 4 and was due Feb 18.

Writing Softmax and LayerNorm as Fused CUDA Kernels | CMU 11-868 Assignment 4

The fourth 11-868 assignment has you follow LightSeq and hand-write CUDA kernels for attention softmax and LayerNorm (forward and backward), bind them into your own MiniTorch, then swap them into your HW3 Transformer and train for one epoch. Points: Softmax 40, LayerNorm 40, integration 20. The assignment page expects individual kernels to be 3.7x to 15.8x faster, but end-to-end training only about 1.1x faster, because of Amdahl's law. You need an NVIDIA GPU, and the repo has already been changed for Fall 2026.

Writing Data Parallelism and Pipeline Parallelism Yourself on Two GPUs | CMU 11-868 Assignment 5

CMU 11-868's fifth assignment switches to PyTorch and Hugging Face GPT-2. Using only torch.distributed and torch.multiprocessing, you write data parallelism (partition the data, set up a process group, average gradients; 50 points), then a GPipe-style pipeline (split the model, generate a clock schedule, run micro-batches on worker threads; 50 points). Both parts need benchmarks and plots on at least two GPUs: data parallelism must reach at least 1.5x speedup on 2 GPUs, and the pipeline must beat plain model parallelism. The Spring 2026 deadline was 3/25.

Training Llama-2-7B with DeepSpeed ZeRO + LoRA, Serving with SGLang | CMU 11-868 Assignment 6

The sixth 11-868 assignment is the first to set aside your homemade MiniTorch and use industry frameworks. Two problems, 50 points each. Problem 1: edit a DeepSpeed training script to turn on LoRA so Llama-2-7B can train on two 16GB V100s. Problem 2: fill in the TODOs of an SGLang inference script and tune parameters to make generation faster. The two problems want conflicting GPUs: SGLang doesn't support V100, so you need an L40S, A6000, or A100. The spring due date was April 13, and the assignment page publishes no grading tests.

A VERL-Style Pipeline with a Reward Model, GAE, and PPO | CMU 11-868 Assignment 7

11-868's RL systems lecture has no slides; the Syllabus lists just one paper, ReaLHF. Assignment 7, on the other hand, is fully public. You train a DistilBERT reward model on Anthropic's HH-RLHF data (40 points), fill in GAE, the PPO loss, and entropy in a VERL-style trainer to fine-tune GPT-2 (40 points), and compare reward distributions before and after RLHF (20 points). The starter trainer never imports the verl package. What you learn is the RLHF dataflow, not VERL's distributed engine.

Why LLMs Need Systems — the Scale Curve, Low-Level Operators, and Three Layers of Abstraction | CMU 11-868 Lecture 1

CMU 11-868's first lecture spends 51 slides on one argument: the LLM bottleneck isn't only the model, it's computing larger LLMs on bigger datasets with fewer GPUs, less memory, and less power, faster. It breaks a Transformer into four low-level operators (matrix multiply, reduction, map, memory movement), sorts the hard problems into kernel, framework, and distributed-system layers, and warns that fast computation isn't enough because moving data takes time too.

LLM Serving: Scheduling, RadixAttention, and PagedAttention | CMU 11-868 Lecture 22 / Lecture 24

11-868 spends two lectures on one question: how does an inference server handle many requests at once without wasting KV cache on the GPU? Lecture 22 (Lei Li) starts from SGLang's scheduling loop: ORCA's continuous batching, RadixAttention's radix tree for KV, sorting and routing by prefix hit rate, and hiding CPU scheduling behind GPU compute. Lecture 24 is given by vLLM author Woosuk Kwon: PagedAttention cuts KV cache into fixed-size blocks and virtualizes them with a block table, taking the batch on one A100 from 8 to 40. The second half covers how vLLM cuts CPU overhead, uses piecewise CUDA graphs, splits models across GPUs, and manages memory for hybrid architectures.

LLM Systems: A Learning Path through Training, Inference, and Deployment | CMU 11-868 Course Overview

CMU 11-868 is Lei Li's graduate course on LLM systems: it goes from CUDA kernels and your own MiniTorch framework to distributed training, SGLang serving, and RLHF. All 28 Spring 2026 slide decks, 7 assignment pages, and 7 starter-code repos are public, which rates it A3. What's missing: videos, GPUs and a PSC account, the quizzes, and any official statement of which two assignments are optional.

When a Model Won't Fit on One GPU — Split Layers, Matrices, or Experts | CMU 11-868 Lectures 16–17

CMU 11-868 (Spring 2026) spends two lectures on models too big for one GPU. L16 covers pipeline parallelism, which splits layers (GPipe micro-batches, 1F1B, interleaved stages), and tensor parallelism, which splits matrices (Megatron-LM's cuts for FFN, attention, and embeddings). The rule of thumb: TP inside a node, PP across nodes, DP on top. L17 treats MoE as a third way to split: each GPU holds different experts and replicates everything else. The price is all-to-all communication and load balancing, shown through GShard, DeepSpeed-MoE, and DeepSeek-V3.

Model Quantization: GPTQ Saves Memory, and the Speedup Comes Along for the Ride | CMU 11-868 Lectures 19–20

11-868 spends two lectures on quantization. L19 goes from BF16 and absmax/zero-point quantization to AdaQuant, ZeroQuant, and LLM.int8(). L20 is all GPTQ. GPTQ quantizes weights only: after each column is quantized, it uses second-order information to adjust the weights not yet quantized, and lazy batch updates plus a Cholesky trick let it scale to 175B. What it mainly saves is memory. Inference gets faster because single-batch decoding was already bottlenecked on reading weights; the amount of arithmetic does not shrink.

Efficient Fine-Tuning for Large Models: LoRA, CIAT, and QLoRA | CMU 11-868 Lecture 23

Lecture 23 of 11-868 treats fine-tuning as a memory problem. Full-parameter half-precision fine-tuning of LLaMA-8B needs about 80GB. LoRA brings that to about 33GB, and QLoRA, which stores the frozen weights in 4 bits, gets it to about 9.2GB. The lecture moves in three steps: train only two small low-rank matrices A and B (the slides credit CIAT as the first to do this); squeeze frozen weights to about 0.52 bytes per parameter with an NF4 lookup table and double quantization; and use a paged optimizer to push optimizer state to the CPU when the GPU is about to run out.

Prefill/Decode Disaggregation, KV Cache, and Heterogeneous Hardware | CMU 11-868 Topic Guide

11-868 closes with five serving decks: Hao Zhang on DistServe, Vikram Mailthody on NVIDIA Dynamo, Junchen Jiang on LMCache, Mingxing Zhang on Mooncake and KTransformers, and Lei Li's map of serving frameworks. They share one question: once serving grows from one machine to a data center, where do the compute and the KV cache go? The argument runs in three steps. Measure goodput under latency SLOs instead of raw throughput. Put prefill and decode on separate GPUs. Let the KV cache spill from GPU memory into CPU memory, SSDs, and remote storage.

Choosing a Vocabulary, Emitting Tokens, and Why Speculative Decoding Is Fast | CMU 11-868 Lectures 8–9

L08 goes from BPE to VOLT, a method co-authored by the lecturer Lei Li: vocabulary size has both a cost and a value, and VOLT finds the sweet spot by asking how much normalized entropy each added token removes, then solves it as an optimal transport problem. The second half covers LLaMA 3 growing its vocabulary from 32k to 128k and the cost of byte-level BPE splitting one Chinese character into three tokens. L09 moves from greedy decoding, sampling, and beam search to speculative decoding: a small model guesses N tokens and the big model checks them in one forward pass, because checking is cheaper than generating. It ends with EAGLE, which predicts final-layer features instead of tokens.

TPU, JAX, and Pallas: One Attention Kernel on TPU, from XLA Fusions to Splash Attention | CMU 11-868 Lectures 12–13

Across two lectures and more than 200 slides, Google's Srinath Mandalapu traces one attention computation from Python down to TPU VLIW instructions. L12 covers the JAX ecosystem, the memory and compute units of TPU Ironwood, and how XLA compiles attention into three fused kernels. L13 covers what XLA cannot do: using Pallas to control movement between HBM and VMEM yourself, writing FlashAttention, then adding block sparsity to get Splash Attention. The ideas match the GPU version. The difference is that on TPU the compiler does most of the scheduling, and Pallas is how you take loops and block sizes back into your own hands.

Reading Transformers, T5, LLaMA, and GPT-3 Like a Systems Engineer | CMU 11-868 Lectures 6–7

11-868 spends only two lectures on the model itself. L06 breaks the Transformer into embeddings, multi-head attention, FFN, LayerNorm, and residuals; L07 uses T5, LLaMA, and GPT-3 to show what modern LLMs changed. For a systems engineer the point is to remember the shapes: GPT-3 175B has 96 layers, d_model 12288, a 2048-token context, and trained on 300B tokens; LLaMA 65B has 80 layers, d_model 8192, and trained on 1.4T tokens. Those numbers set the workload for every acceleration, parallelism, and serving lecture that follows.

How ZeRO Cuts Data-Parallel Memory — Optimizer State, Gradients, Then Parameters | CMU 11-868 Lecture 18

Data parallelism keeps a full copy of parameters, gradients, and optimizer state on every GPU. With Adam and mixed precision that is about 20 bytes per parameter, 16 of them optimizer-related, so LLaMA-3 8B already needs 160GB. CMU 11-868 L18 builds on the ZeRO paper and animates its three stages frame by frame: ZeRO-1 partitions optimizer state, ZeRO-2 also partitions gradients, and ZeRO-3 partitions parameters too. The slides conclude that the first two stages add no communication and save up to 8x memory; stage 3 makes per-GPU memory shrink with GPU count, at what the slides estimate as about 3x the communication.

From One Chip to a Whole Datacenter — Dataflow Hardware, Kernel Fusion, Parallelism Strategies, and the Memory Bottleneck | Stanford CS149 Lecture 12

L12 is about moving data. The first part uses the SambaNova SN40L to explain dataflow architecture and metapipelining: running Llama 3.1 8B, the slides say the RDU needs about 3 kernel calls per token versus about 800 on a GPU, because it can fuse an entire decoder into one kernel. The middle part scales up to the datacenter: which collective each of TP, PP, EP, and DP requires, and why overlapping compute with communication decides how well you scale. The last part returns to energy and DRAM: moving a byte costs far more than computing on it, and memory controllers, burst mode, and HBM all attack the same problem. There is no public video for this lecture; this post relies on the slides alone.

Cache Coherence: MSI, MESI, and False Sharing | Stanford CS149 Lecture 14

When every core has its own cache, one address can have several copies, and different cores can see different values. Locks can't fix this; the hardware created it by replicating data. CS149 L14 defines what coherent means, then takes apart the snooping MSI protocol: before writing, broadcast BusRdX so everyone else invalidates. MESI adds an E state that saves the second transaction in read-then-write, and directories replace broadcast with point-to-point messages. The practical consequence for programmers is false sharing: two threads write different variables, but because they share a cache line, the line bounces between cores. In the lecture's demo it made the program three times slower.

Parallel Computing: What the Course Covers and Two Reading Routes | Stanford CS149 Course Overview

CS149 is Stanford's parallel computing course, taught by Kayvon Fatahalian and Kunle Olukotun. It runs from multi-core CPUs and SIMD through GPUs, AI accelerators, and the datacenter, then returns to cache coherence and lock-free programming. For Fall 2025, all 18 slide decks, the starter code and READMEs for 5 programming assignments, and 4 written-assignment PDFs are public, so this series rates it A3 (self-study ready). There are four gaps: the Fall 2025 lecture videos are Canvas-only; PA1 is graded on Stanford's myth machines; PA4 needs a self-funded AWS Trainium2 instance and a private course AMI; PA5's H100 job queue and leaderboard require a SUNet ID. The public videos are from 2023, and this series treats them as a listening supplement only.

Data-Parallel Thinking, Replacing Locks with Map, Scan, and Sort | Stanford CS149 Lecture 8

Lecture 8 asks you to switch mental models: stop thinking about what each worker does and write algorithms as operations on sequences, such as map, fold, scan, segmented scan, gather/scatter, sort, and groupBy. These primitives have efficient parallel implementations, and they turn irregular parallelism into regular parallelism and fine-grained synchronization into coarse synchronization. The price is extra passes over the data, so they are bandwidth hungry.

Running DNNs Efficiently on GPUs — Conv as GEMM, Blocking, Fusion, and the Road to FlashAttention | Stanford CS149 Lecture 9

L9 opens with a claim: if you understand arithmetic intensity and the roofline, you know almost everything about software-side performance optimization for modern AI. It then shows three things. Fully connected layers, conv layers, and attention all reduce to matrix multiplication (GEMM). GEMM needs blocking so data stays in cache. Adjacent layers should be fused so intermediates never round-trip through DRAM. Softmax can be computed in chunks, which is why fused attention (the core idea behind FlashAttention) never has to store the N×N matrix.

Performance Optimization Beyond the Experts — Halide's Algorithm/Schedule Split, Autoschedulers, and LLM Agents | Stanford CS149 Lecture 13

L13 asks what to do when there are too few people who can write fast code. The slides offer three answers. First, raise the level of abstraction: Halide splits what to compute (the algorithm) from how to compute it (the schedule), so one line of schedule turns the same blur into a tiled, vectorized, multi-core version. Second, intelligent search: because the schedule space is well defined, search plus a learned cost model can generate schedules automatically. Third, the emerging option of LLM agents: have a model write CUDA, run it, read the profiler, reflect, and revise, and let it improve itself with a database of examples or prompt optimization. The last slide leaves you with a question: is the real value in DSL design or in the LLM agent?

Fine-Grained Locking and Lock-Free Programming, from Test-and-Set to the ABA Problem | Stanford CS149 Lecture 16

CS149 L16 has three parts. It first looks at lock implementations through the lens of cache coherence (test-and-set, test-and-test-and-set, ticket locks, CAS, LL/SC). It then takes a sorted linked list from one big lock to hand-over-hand fine-grained locking. Finally it introduces lock-free programming: a single-producer/single-consumer queue, a CAS-based stack, the ABA problem, and hazard pointers. The slides land on a practical conclusion: when your program has the machine to itself, well-written lock-based code is often just as fast and much simpler. Lock-free designs pay off in systems where threads can be preempted or page-fault inside a critical section.

GPU Architecture and CUDA Programming | Stanford CS149 Lecture 7

CUDA's grid, thread block, and CUDA thread are programming abstractions; the GPU implements them with SMs, warps, and a hardware block scheduler. The heart of the lecture is keeping two things apart: the system may run thread blocks in any order, but all threads in one block are guaranteed to be live at once. That is why a block can cooperate through shared memory and __syncthreads(), and why the number of blocks an SM can hold is set by registers and shared memory.

Why General-Purpose Processors Waste Energy — Hardware Specialization, Tensor Cores, TPU Systolic Arrays, and Dataflow Architectures | Stanford CS149 Lecture 10

L10 starts from one equation: when power is capped, performance can only improve by spending fewer joules per operation, and a general-purpose processor spends most of its energy fetching, decoding, and moving data rather than computing. The slides' rule of thumb is that GPUs give about 10x better perf/watt than CPUs and fixed-function ASICs can reach 100–1000x. The lecture then judges the H100's Tensor Cores and TMA, Google's TPU systolic array, and reconfigurable dataflow architectures against the same checklist: tiled tensors, asynchronous compute and memory, and compute units talking directly to each other.

Fast Processors, Slow Data — Latency vs. Bandwidth, and How ISPC Separates Abstraction from Implementation | Stanford CS149 Lecture 3

The first half of L3 uses a highway and a laundry room to pull latency and bandwidth apart, then does the math: element-wise vector multiply runs at under 1% efficiency on a V100 because memory cannot feed the ALUs fast enough. The second half is about abstraction vs. implementation. ISPC lets you think in SPMD terms (a gang of program instances, each doing its share), while the compiler implements that with SIMD instructions. Mixing up the two layers is the most common source of confusion in the course.

Locality, Communication, and Arithmetic Intensity: Why Moving Less Data Beats Adding Cores | Stanford CS149 Lecture 6

CS149 Lecture 6 asks you to read "communication" broadly: data moving between a processor and its cache, its memory, or another machine all counts. Modern parallel processors have far more compute than bandwidth, so arithmetic intensity (how much computation you do per unit of data moved) decides whether you can keep the hardware fed. The levers fall into three groups: change the assignment to cut inherent communication, use blocking and loop fusion to cut cache-induced communication, and spread out or stagger accesses to reduce contention.

Multi-Core, SIMD, and Hardware Multithreading, and the Problem Each One Solves | Stanford CS149 Lecture 2

The second lecture of CS149 Fall 2025 takes a loop that computes sin(x) and adds three ideas in turn: spend transistors on more cores (multi-core), let one instruction drive many ALUs (SIMD), and interleave several threads on one core to hide memory latency (hardware multithreading). The first two add compute; the third keeps that compute busy while waiting on memory. The conclusion is three requirements: enough parallel work, groups of work that run the same instructions, and more parallel work than ALUs so latency can be hidden.

Measuring Speedup on a Quad-Core CPU and Explaining Why It Isn't Linear | Stanford CS149 Programming Assignment 1 / Written Assignment 1

PA1 has little code and a lot of analysis. Its six programs cover work assignment across threads, SIMD masking, ISPC gangs and tasks, how input data shapes SIMD efficiency, a bandwidth-bound saxpy, and finding a K-Means hotspot with timers. Written 1 drills the same intuitions on paper: peak throughput, instruction dependencies, pipelining, latency hiding with multithreading, and SIMD divergence. Official grading uses Stanford's myth machines; you can run everything on your own hardware, but your numbers won't match the reference.

Building a Task Execution Library from Scratch — Thread Pools, Sleeping, and Task Graphs with Dependencies | Stanford CS149 Programming Assignment 2

CS149 PA2 has you write a C++ task execution library for a multi-core CPU, and write it four times: spawn threads on every run(), switch to a spinning thread pool, switch to a sleeping thread pool, and finally extend it to asynchronous task graphs with dependencies. Every step must be a fully correct system, and each is timed against the official reference implementation. Official grading runs on AWS c7g.4xlarge; you can work on your own multi-core machine outside Stanford, but your numbers won't be directly comparable to the official thresholds.

and Written 2: A CUDA Circle Renderer That Must Be Both Correctly Ordered and Fast | Stanford CS149 Programming Assignment 3 / Written Assignment 2

PA3 has three parts: port SAXPY to CUDA and time it two ways, implement find_repeats with an exclusive scan, and write a CUDA circle renderer that is both correct and fast (85 points). The hard part of the renderer is that blending semi-transparent circles doesn't commute, so every pixel must be updated in input order, and the starter code's one-thread-per-circle approach gets neither atomicity nor order right. Written 2 has five graded problems (fusion, SIMD utilization, a barrier instead of locks, data-parallel primitives on graphs, locks in a particle simulation) plus 14 practice problems. Outside Stanford you need your own NVIDIA GPU. No solutions here.

Moving Your Own Data on Trainium2 — NKI, SBUF/PSUM, and a Fused Conv+Maxpool | Stanford CS149 Programming Assignment 4 / Written Assignment 3

PA4 drops you onto a single NeuronCore of an AWS Trainium2 chip. No cache decides what stays on chip: you move data into SBUF (28 MiB) and PSUM (2 MiB) yourself with dma_copy, and the partition dimension tops out at 128. Part 1 teaches those limits and the cost of DMA through vector add and transpose. Part 2 asks you to rewrite convolution as a series of matmuls and fuse it with max pooling so nothing spills back to HBM. Written 3 drills the same idea with a line buffer, two back-to-back box blurs, softmax hardware, and metapipelining: keep intermediates on chip. The environment needs the course's private AMI and a paid capacity block, so for outside readers this assignment is effectively A2.

, the Fastest Kernel on an H100: Five AI Kernels, Graded on Your Work Log | Stanford CS149 Programming Assignment 5

The last programming assignment in CS149 Fall 2025 is open-ended. Pick at least one of five kernels (Histogram, a 1D occupancy decoder, FlashAttention, a 3D heat equation with RK4, SwiGLU) and make it faster than its PyTorch baseline on an H100. You can write CUDA, Triton, or TileLang, and you may use LLMs. There is no speed threshold. The grade depends on a work log that shows what you measured at each step, what hypothesis you formed, and why you stopped. The H100 job queue and leaderboard need a SUNet ID; outside Stanford you can only run eval.py on your own NVIDIA GPU.

How Do You Parallelize a Program? Decomposition, Assignment, Orchestration, and Amdahl's Law | Stanford CS149 Lecture 4

L4 lays out a thought process for parallelizing code: decompose the problem to find independent work, assign that work to workers, orchestrate communication and synchronization, then map workers to hardware. Amdahl's Law reminds you that the sequential fraction caps speedup. The running example is a 2D grid solver whose original dependencies are hard to exploit; switching to a red-black update order makes it expressible in either a data-parallel or a shared-address-space model.

Programming Specialized Hardware — ThunderKittens Tames H100 Asynchrony, Dataflow Replaces It with Metapipelines | Stanford CS149 Lecture 11

L11 asks what programmers pay once hardware specializes for AI. On the H100, saturating Tensor Cores means 16×16 tiles, TMA moving data asynchronously, and producer and consumer warps running as a pipeline. That's hard to write, which is why DSLs like ThunderKittens exist. The other route is a dataflow architecture (SambaNova SN40L): describe the computation with parallel patterns such as map, reduce, and zip, and let the compiler handle tiling, metapipelining, and placement. The slides say this can fuse an entire Llama 3.1 8B decoder layer into one kernel.

Memory Consistency: How Write Buffers Make r1 = r2 = 0 Possible | Stanford CS149 Lecture 15

Coherence covers a single address. Memory consistency covers reads and writes to different addresses, and the order in which other threads see them take effect. CS149 L15 uses two threads and two variables to make the point: under sequential consistency, r1 = r2 = 0 is impossible, but the write buffer in every modern processor lets reads pass writes, so it becomes possible. TSO, PSO, and weak ordering relax more orderings in exchange for speed, and fences and synchronization primitives restore the orderings you need. The takeaway for application programmers is short: write data-race-free programs and use a synchronization library, and C11, C++11, and Java 5 guarantee you'll see sequential consistency.

Transactional Memory and Written 4, Handing "Make This Atomic" to the System | Stanford CS149 Lectures 17–18 / Written Assignment 4

Coarse locks are easy to write but slow; fine-grained locks are fast but easy to get wrong. Transactional memory lets the programmer just declare atomic { } and leaves atomicity and isolation to the system. CS149 L17 covers the motivation (failure atomicity, composability) and the design space: data versioning is eager (undo log) or lazy (write buffer), and conflict detection is pessimistic or optimistic. L18 opens up STM runtime data structures and the McRT algorithm, then shows how HTM uses per-line R/W bits plus the coherence protocol to detect conflicts, ending with Intel Haswell's RTM. Written 4 ties MSI, LL/SC, locks and memory ordering, and fine-grained locking on a doubly linked list into four problems.

Why Single Cores Stopped Getting Faster, and Why Fast Isn't Efficient | Stanford CS149 Lecture 1

The first lecture of CS149 Fall 2025 defines speedup, then uses three classroom demos to show how communication and load imbalance eat into it. Next it explains why single-core performance stalled: superscalar execution runs out of instruction-level parallelism at about four instructions per clock, and clock frequency hits the power wall. So performance now has to come from more cores and specialized hardware. The last part turns to efficiency. A DRAM access takes about 60 times as long as an L1 cache hit, and moving 64 bits costs over a thousand times the energy of an integer op. Efficiency almost always comes down to accessing data efficiently.

Work Distribution and Scheduling: From Work Queues to Cilk's Work Stealing | Stanford CS149 Lecture 5

Load balancing is hard because it pulls against scheduling cost: smaller tasks balance better, but every task grab pays a synchronization cost. CS149 Lecture 5 first lays the options out as a continuum from static to dynamic, then takes apart the Cilk runtime: one deque per worker, run the child at a spawn and leave the continuation for others to steal, and idle threads steal the biggest chunk of work from the top of someone else's deque.

Actor-Critic and Value Estimation — Learn to Judge Good and Bad, Then Do More of the Good | Stanford CS224R Lecture 4

Policy gradient can only judge good and bad from the rewards it actually received, so it wastes data. Actor-critic trains a second network, a value function (the critic), to estimate how good a state is, and uses it to compute advantages that weight the policy's (the actor's) gradient. There are three ways to estimate value: supervise directly with a rollout's summed rewards (Monte Carlo), supervise with this step's reward plus your own estimate of the next state (bootstrapping), or use an n-step return in between. L4 ends by pushing actor-critic off-policy, first by taking several gradient steps on one batch (where PPO starts) and then by reusing all past data from a replay buffer (where SAC starts).

Deep Reinforcement Learning: What the Course Covers and a Reading Route | Stanford CS224R Course Overview

CS224R is Chelsea Finn's deep reinforcement learning course at Stanford. It runs from imitation learning to RL for LLMs and robot foundation models. For Spring 2026, all 17 slide decks, the three homework handouts with starter code, and the default project spec with starter code can be downloaded without logging in, so this series rates it A3 (enough to self-study). The gaps: the 2026 recordings are Canvas-only, the midterm and its solutions are not public, and HW2 and HW3 require Modal. The public recordings are from Spring 2025, so this series uses them as a supplement and flags the differences lecture by lecture.

Fine-Tuning an LLM on Countdown with SFT, IPO, and RLOO | Stanford CS224R Topic Guide

The CS224R Spring 2026 default project has you implement three stages on Qwen2.5-0.5B Base for the Countdown arithmetic reasoning task: SFT warm-start, IPO preference optimization, and RLOO with a rule-based verifier reward. All three are compared with the same vLLM evaluation, followed by a research extension of your choice. For the implementation, high-level trainers like SFTTrainer are banned, and so is any AI tool assistance; only the extension is exempt. The extension is half the grade for this project, and it's graded on methodology and documentation, not score. The starter code and datasets are public. What outside readers lack is Modal credits and the autograder.

Open Problems in Deep RL, and How to Do Research | Stanford CS224R Lecture 18

The last CS224R lecture has three parts. It first folds the whole quarter into one toolbox. It then lists seven unsolved problems: domains without verifiable rewards, using prior data, world models, scaling, safety, hallucination and calibration, and evaluating generalist systems. Nearly half the deck is about how to do research: you need both an important problem and a workable plan, you front-load the risk, you consider pivoting early, and research only counts once you share it. Reading it alongside the 244 public 2026 final project reports shows what those principles look like in practice.

Hierarchical RL and Imitation Learning | Stanford CS224R Lecture 15

Long-horizon tasks are hard because the agent visits a huge number of states and has many chances to make mistakes or get stuck. Lecture 15 of CS224R answers with two levels: a high-level policy proposes subgoals, and a low-level policy runs at a higher frequency to reach them. The real design decisions are three: how to represent the subgoal, how to supervise each level, and when to switch to the next subgoal. The slides also admit that nobody has yet shown whether hierarchy beats a single policy with chain of thought.

Regression BC, Flow Matching, and DAgger on Flappy Bird | Stanford CS224R Assignment 1

Homework 1 of CS224R Spring 2026 tests imitation learning on a custom Flappy Bird environment. The policy predicts 20 future target heights at once and executes only the first 10. You implement MSE-regression behavior cloning, a flow matching policy, and DAgger, then compare them in easy and hard modes. The PDF, LaTeX template, and starter code are all public, and a CPU is enough to run it. Solutions, the autograder, and Gradescope are not public. This guide covers what each problem asks you to build and answer. It does not give solutions.

Gridworld Q-learning, PPO, and the Sawyer Hammer Task | Stanford CS224R Assignment 2

CS224R Spring 2026 HW2 has three parts. First, tabular Q-learning on a 5×4 gridworld shows how reward design changes the learned path. Second, GAE plus PPO clipping tackles a hammer task that pays 1 only on completion. Third, an off-policy actor-critic with BC pretraining, a critic ensemble, and a higher UTD ratio, followed by a comparison of the two learning curves. The handout, starter code, and compute guide are public, but the assignment supports only Modal, and course credits go only to enrolled students.

AWAC, IQL, and Stitching on AntMaze | Stanford CS224R Assignment 3

HW3 in CS224R (Spring 2026) has you fill in two offline RL algorithms, AWAC and IQL, and compare them on D4RL's AntMaze. Problem 1 runs AWAC on antmaze-umaze and antmaze-medium-diverse. Problem 2 compares IQL expectiles ζ = 0.2 and 0.9, runs the better value on medium-diverse, and then tests whether IQL can stitch a better path out of a PointMass dataset whose best return is only −46, against a filtered BC baseline that keeps the top 10% of trajectories. The PDF, LaTeX template, and starter code are public, but the assignment is meant to run on Modal, and course credits go only to enrolled students. This post covers the tasks and setup only, with no solutions.

Imitation Learning and Policies That Can Represent Multimodal Distributions | Stanford CS224R Lecture 2

Lecture 2 of CS224R Spring 2026 tackles two ways imitation learning fails. First, when demonstrations contain several reasonable behaviors, regression learns only their average. The fix is to make the policy a generative model (Gaussian mixtures, discretization plus autoregression, diffusion or flow matching) and to add action chunking. Second, compounding errors: once the policy slips, it reaches states the demonstrations never covered. The fix is DAgger or human-gated DAgger to collect corrections. The first two parts are exactly what HW1 covers.

Framing Decision-Making as an RL Problem | Stanford CS224R Lecture 1

The first lecture of CS224R Spring 2026 does three things: covers logistics, explains why deep RL is worth learning, and turns 'behavior' into something you can learn. The core is a set of definitions (state, action, trajectory, reward, policy) and one objective: maximize expected total reward. It ends on an example: fit ℓ2 regression to drivers where some change lanes and some go straight, and the policy learns their average, a half lane change nobody demonstrated. That problem is where L2 starts.

Meta-RL, Teaching an Agent to Learn New Tasks Fast | Stanford CS224R Lecture 13

Meta-RL trains on many tasks so that a new task can be solved from a small amount of experience. Lecture 13 of CS224R frames it as "explore to collect a little data, then adapt using that data." The most direct approach is black-box meta-RL (RL²): a network with memory takes past (s, a, r) as input and keeps its hidden state across episodes. It is general and expressive but hard to optimize, especially when exploration is hard, because exploration and execution depend on each other and end-to-end training gets stuck. The slides then compare posterior sampling in PEARL, prediction-driven exploration in MetaCURE, and DREAM, which uses a task representation to train exploration and execution separately.

Model-Based RL, or Learn a Simulator and Don't Trust It Too Much | Stanford CS224R Lecture 11

Model-based RL first learns a dynamics model that predicts s_{t+1}, then uses it in one of two ways: to generate extra training data (Dyna, MBPO) or to think a few steps ahead before acting (planning). The thread running through Lecture 11 of CS224R is how to avoid being dragged down by model error. Start synthetic rollouts from real states and keep them short, average errors out with an ensemble of models, and attach a value function to the tail of long-horizon plans. Whether a model is worth learning depends on whether it is easier or harder to learn than the policy.

Multi-Task and Goal-Conditioned RL, Sharing Weights and Sharing Data | Stanford CS224R Lecture 12

Multi-task RL treats which task you are on as part of the state, s = (s̄, z_i), so the problem is still an ordinary MDP and standard RL algorithms still apply. Lecture 12 of CS224R covers two kinds of sharing: weight sharing, where one network conditioned on z_i does every task, and data sharing via hindsight relabeling, where data collected for task A gets relabeled as data for task B. Goal-conditioned RL is the special case where the task is a goal state; relabeling with the state you actually reached eases the exploration problem of sparse rewards. Data sharing has three prerequisites: consistent dynamics across tasks, a reward you can evaluate, and an off-policy algorithm.

Off-Policy Actor-Critic — the Shared Skeleton of PPO and SAC | Stanford CS224R Lecture 5

PPO and SAC answer the same question: can you use an expensive batch of data more than once? PPO takes several gradient steps on one fresh batch and clips the new-to-old policy ratio to 1±ε. SAC keeps every past transition in a replay buffer and learns Q(s, a), so old data can still evaluate the current policy. PPO is stable and easy to tune. SAC is data-efficient and harder to tune.

Offline RL, or Why Q-Learning Breaks When You Can't Collect More Data | Stanford CS224R Lecture 7

Lecture 7 of CS224R (Spring 2026) asks how to learn a policy better than your data when all you have is a fixed dataset someone else collected. Running an off-policy algorithm like SAC on that data fails: the Q-function makes up values for actions the data never contains, and the policy goes looking for exactly those overestimated actions. The slides give two families of fixes. One trains the policy only on actions in the data (filtered BC, AWR, AWAC). The other uses an asymmetric expectile loss to estimate the value of a policy better than the data without ever querying out-of-data actions (IQL). Both can do something imitation learning can't: stitch good pieces of different trajectories together.

Policy Gradients — Differentiating the Policy Without Knowing How the World Works | Stanford CS224R Lecture 3

Policy gradient is the first online RL algorithm in CS224R. Its gradient looks almost exactly like the imitation learning gradient, except that each trajectory is weighted by its reward. Actions from good outcomes become more likely, and actions from bad outcomes become less likely. The raw version is very noisy, so L3 cuts the variance in two ways: count only future rewards (causality) and subtract the average reward (a baseline). It is also on-policy, so every gradient step needs fresh data. Importance sampling plus a KL constraint lets you take several steps on one batch.

Q-learning and How to Stabilize It | Stanford CS224R Lecture 6

Q-learning drops the actor from actor-critic: learn the optimal Q-function directly and act by taking the argmax. The price is that convergence is not guaranteed; even linear Q can diverge. Lecture 6 of CS224R pulls it back with three engineering tricks: a target network that holds the targets still, Double Q that separates choosing an action from valuing it to curb overestimation, and n-step returns that trade a little bias for speed.

Where Rewards Come From, Learned from Examples and Preferences | Stanford CS224R Lecture 8

Lecture 8 of CS224R (Spring 2026) spends a few slides wrapping up offline RL, then asks the question the first seven lectures skipped: where does the reward come from? Games have scores. Real robots, dialogue, and driving usually don't. The slides offer two routes. The first trains a goal classifier on success examples and uses it as the reward, but RL learns to exploit the classifier's blind spots; the fix is to keep adding states the policy visits as negatives, the same structure as a GAN. The second asks people which of two trajectories is better and learns a reward with the Bradley-Terry-style objective log σ(r(τw) − r(τl)), the same method LLM RLHF uses. The lecture's number-one takeaway is one line: rewards can't be taken for granted.

RL for Robot Foundation Models (VLAs) | Stanford CS224R Lecture 17

VLAs trained only with imitation learning often plateau around 80% success, while autonomous robots often need 99%+. Lecture 17 of CS224R splits "how do you improve a VLA with RL on a real robot" into three routes: recast RL as supervised learning (iterated offline RL), learn a small separate policy on the VLA's representation or diffusion noise, or learn a small policy that edits the VLA's actions. The slides call this an open research problem and describe the content as recent themes plus the speaker's opinion.

RL for LLM Reasoning and Test-Time Compute | Stanford CS224R Lecture 10

Lecture 10 of CS224R Spring 2026 is a guest lecture by Noam Brown of OpenAI, and it makes one argument: reasoning models open a new scaling dimension by moving compute from training to inference. He starts with his own poker AI work, then uses backgammon, chess, and Go to show that thinking longer at inference time has always paid off. Next comes how LLMs got there: chain of thought, majority voting, o1/o3, GRPO, and DeepSeek-R1-Zero. The second half argues the field needs to rethink itself for large-scale test-time compute: multi-agent systems, evaluation as score versus compute, and the budget assumptions behind safety evaluations. The deck is mostly figures, so this post covers only the points visible on the slides.

RLHF, DPO, and Preference Optimization | Stanford CS224R Lecture 9

Lecture 9 of CS224R Spring 2026 is a guest lecture by Archit Sharma, with slides adapted from CS224N. The spine is one chain of reasoning. Instruction tuning can't handle tasks with no right answer or errors of unequal weight, so we optimize human preferences directly. Human ratings are expensive and noisy, so we collect pairwise comparisons and fit a Bradley-Terry reward model. RLHF uses that model as the reward and runs policy gradient with a KL penalty. DPO uses the closed-form solution of the KL-constrained problem to write the reward as a log-ratio of policies, which turns the whole thing into a binary classification loss. The last part covers the frontier: reward hacking, verifiable rewards, and AI feedback in place of human feedback.

Sim-to-Real Robot Learning | Stanford CS224R Lecture 16

Simulators are cheap, fast, and safe, and they hand you labels the real world never will, but they never match reality exactly. In Lecture 16 of CS224R, CMU's Guanya Shi sorts the ways to close that gap into three families: domain randomization trains one policy that works across many physical parameters; teacher-student trains a teacher on privileged information and then has a student that sees only real sensors imitate it; real2sim2real uses real data to make the simulator more faithful. The advanced topics are defining tasks from human motion data and choosing RL algorithms suited to sim2real.

3D Vision — One Shape, Five Ways to Store It | Stanford CS231N Lecture 15

CS231N Lecture 15 runs on one question: what data structure should a 3D shape use so a neural network can read it and produce it? The slides walk through five representations (depth map/surface normals, voxels, point clouds, triangle meshes, implicit surfaces), each with a signature architecture (fully convolutional depth prediction, 3D convolution, PointNet, Pixel2Mesh and Mesh R-CNN, DeepSDF). Then comes the speed trade-off between NeRF and 3D Gaussian Splatting, and a closing roll call of 2025–2026 models: VGGT, TRELLIS, Marble. The 2025 recording uses a different slide deck, with a different order and emphasis.

kNN, Softmax, Two-Layer and Fully Connected Networks | Stanford CS231N Assignment 1

CS231N Assignment 1 is worth 12% of the grade and was due April 16, 2026. All five Colab notebooks are hand-written numpy on CIFAR-10. Q1 kNN asks for distance computations with two loops, one loop, and no loops. Q2 Softmax goes from naive to vectorized to SGD. Q3 assembles affine, ReLU, and softmax into a two-layer network. Q4 switches to HOG and color-histogram features. Q5 generalizes to any depth and implements Momentum, RMSProp, and Adam. The 65 KB starter code is public; the Gradescope grading isn't. This post covers structure and goals only, not solutions.

BatchNorm, Dropout, CNNs, PyTorch, and RNN Captioning | Stanford CS231N Assignment 2

Assignment 2 of CS231N Spring 2026 is worth 18% of the grade. Across five notebooks you hand-write BatchNorm/LayerNorm, dropout, and the forward and backward passes for convolution and pooling, then learn PyTorch at three levels of abstraction, and finish with RNN image captioning on COCO in PyTorch. Q4 is the turning point: through Q3 you derive every gradient yourself, and from Q5 on autograd takes over while a numerical gradient check confirms it. The official slides warn that this is the longest of the three assignments.

Transformer Captioning, Self-Supervised Learning, DDPM, CLIP and DINO | Stanford CS231N Assignment 3

Assignment 3 in CS231N Spring 2026 is worth 15% of the grade and turns L8, L12–L14 and L16 into four Colab notebooks. Q1 has you write multi-head attention and a Transformer decoder for COCO captioning, then assemble a ViT and train it on CIFAR-10. Q2 implements SimCLR's augmentations and contrastive loss and compares linear classification with and without self-supervised pretraining. Q3 builds DDPM's noising, UNet, denoising loss, sampling and classifier-free guidance to generate text-conditioned 32×32 emoji. Q4 uses pretrained CLIP for similarity, zero-shot classification and retrieval, then segments a video with DINO features trained on a single labeled frame. This guide covers structure, files and targets only. No solutions.

Attention, Transformers, and ViT | Stanford CS231N Lecture 8

Lecture 8 of CS231N Spring 2026 starts from the bottleneck in RNN translation models, abstracts attention into an operation on sets of vectors, builds up to self-attention, masking, and multiple heads, and shows the whole layer is four matrix multiplies. A Transformer block is self-attention, LayerNorm, residual connections, and an MLP; ViT turns a 224×224 image into 16×16 patches used as tokens. The lecture closes with four common post-2017 changes: Pre-Norm, QK-Norm, SwiGLU, and MoE.

Image Classification with CNNs — From Hand-Crafted Features to Convolution and Pooling | Stanford CS231N Lecture 5

A two-layer network flattens a 32×32×3 image into a 3072-dimensional vector, and the spatial structure is gone. CS231N Lecture 5 answers with two layers. A convolution layer slides small filters across the image and reuses the same weights at every position. A pooling layer downsamples and has no learnable parameters. Both are translation equivariant. One formula gives every layer's output size: (W − K + 2P) / S + 1.

Deep Learning for Computer Vision: The 18-Lecture Syllabus and a 10-Week Self-Study Plan | Stanford CS231N Course Overview

CS231N is Stanford's deep learning course for computer vision. For Spring 2026, slides for 16 lectures, all three assignment pages with starter code, the course notes, and the project spec are public, so this series rates it A3 (enough to self-study). There are three gaps: the 2026 recordings are Canvas-only, L17 and L18 have no slides, and the midterm is not public. You can pair the 2026 slides and assignments with the 2025 YouTube recordings and follow the official calendar over 10 weeks.

Object Detection, Image Segmentation, and Visualization | Stanford CS231N Lecture 9

Lecture 9 of CS231N Spring 2026 moves from one label per image to one label per pixel and per object. Semantic segmentation uses fully convolutional networks that downsample and then upsample, and U-Net feeds high-resolution features back in. Detection goes from R-CNN's roughly 2,000 CNN forward passes to Fast R-CNN, Faster R-CNN's RPN, single-stage YOLO, and anchor-free DETR. Mask R-CNN adds a 28×28 mask per RoI. The last part covers saliency, CAM, and Grad-CAM. The adversarial examples, DeepDream, and style transfer listed on the schedule appear in neither the 2026 nor the 2025 slides.

Large-Scale Distributed Training — Splitting One Model Across Tens of Thousands of GPUs | Stanford CS231N Lecture 11

CS231N Lecture 11 uses Llama3-405B as its running example. It starts with GPU hardware and clusters (the H100, 8-GPU servers, a 24,576-GPU cluster), then maps the four dimensions of a Transformer activation to four kinds of parallelism: split the batch for data parallelism (which grows into FSDP and HSDP), the sequence for context parallelism, the layers for pipeline parallelism, and the channels for tensor parallelism. Along the way it covers activation checkpointing (trading recomputation for memory) and a practical scaling recipe, and it uses Model FLOPs Utilization (MFU) as the tuning target: above 30% is good, above 40% is excellent.

Generative Models II — Why Adding Noise and Removing It Generates Images | Stanford CS231N Lecture 14

The CS231N Spring 2026 diffusion lecture doesn't start with DDPM math. It opens by warning that terminology and notation in this area are a mess, then teaches one clean modern version: rectified flow. In training, pick a point between a data sample and noise and have the network predict the velocity from data toward noise; to generate, start from noise and walk backward for about 50 steps. The lecture then stacks on the practical pieces: classifier-free guidance, noise schedules that emphasize middle noise levels, diffusion on VAE latents, Transformers (DiT) as the denoiser, and distillation to cut the step count. Only at the end does it fold VP, VE, and ε/v-prediction into a generalized diffusion framework and name three mathematical views: latent variable model, score function, and SDE.

Generative Models I — What Autoregressive Models, VAEs, and GANs Each Optimize | Stanford CS231N Lecture 13

The first generative-models lecture of CS231N Spring 2026 starts by pinning down the difference between a discriminative model, which learns p(y|x), and a generative model, which learns p(x). Every possible image competes for the same probability mass, so a generative model can reject unreasonable inputs. A taxonomy then splits generative models into those that can compute p(x) and those that can only sample. The lecture covers the two that compute (or approximate) it: autoregressive models factor p(x) with the chain rule into step-by-step predictions, and their weak point on raw pixels is speed; VAEs cannot compute p(x), so they maximize a lower bound, the ELBO, whose reconstruction and prior terms pull against each other. The schedule lists GANs under this lecture, but both the 2026 and 2025 slides place them at the start of the next one. This post covers them too so the three paradigms can be compared in one place.

Image Classification, kNN, and Linear Classifiers | Stanford CS231N Lecture 2

L2 starts from one question: a computer sees a grid of numbers between 0 and 255, so how does it recognize a cat? Hand-written rules don't scale, so the course switches to a data-driven approach: collect data, train, evaluate on new images. The first classifier, kNN, teaches how to split train/val/test, but pixel distances carry no meaning. The second, the linear classifier f(x,W)=Wx+b, can be read three ways (algebraic, visual as templates, geometric as hyperplanes). Softmax turns its scores into probabilities, and the loss is the negative log probability of the correct class.

Where Computer Vision Came From, and Where This Course Is Going | Stanford CS231N Lecture 1

The first CS231N lecture of 2026 comes in two slide decks. The first tells the history of vision and deep learning on a single timeline: Hubel & Wiesel's cat experiments, Marr's stages of visual representation, then the Neocognitron, backprop, and LeNet, until ImageNet and AlexNet join the two threads. The second covers the course map, grading, and rules, and moves every assignment onto Colab. After this lecture you'll know which gap each of the remaining 17 lectures fills.

Neural Networks and Backpropagation, or Upstream Times Local on a Computational Graph | Stanford CS231N Lecture 4

The first half of L4 replaces the linear classifier f = Wx with a two-layer network f = W₂ max(0, W₁x) and shows that dropping the max activation collapses it back into a linear classifier. The second half answers how to compute gradients once the network gets deep: draw the function as a computational graph, and each node only needs its own local gradient multiplied by the upstream gradient coming back from later nodes. Add distributes, mul swaps, max routes, copy sums, and those four patterns let you trace any network. The lecture ends with matrices: dL/dx always has the same shape as x, so never build the Jacobian.

Recurrent Neural Networks and Image Captioning — RNNs, LSTMs, and Captioning | Stanford CS231N Lecture 7

An RNN updates one hidden state at every time step with the same weights, so it can handle sequences of any length. CS231N Lecture 7 starts by hand-building an RNN that detects repeated 1s. It then covers character-level language models and feeding CNN features into an RNN for image captioning. Gradient flow explains why vanilla RNNs are hard to train: clip gradients to stop them exploding, and change the architecture (the LSTM) to stop them vanishing. The lecture ends by calling state space models like Mamba "modern RNNs."

Regularization and Optimization, from Random Search to AdamW and Learning Rate Schedules | Stanford CS231N Lecture 3

L2 gave us a score function and a loss. L3 answers how to find a good W. The first half covers regularization: add λR(W) next to the data loss so the model does not fit the training data too well. The second half is a lineage of optimizers. SGD zigzags in narrow valleys, Momentum builds up velocity, RMSProp scales each dimension's step, Adam combines the two and adds bias correction, and AdamW moves weight decay outside the moment estimates. The slides close with practical advice: Adam(W) is a good default in many cases, and SGD+Momentum can do better but needs more tuning of the learning rate and schedule.

Self-Supervised Learning — Learning Good Representations Without Labels | Stanford CS231N Lecture 12

CS231N Lecture 12 asks whether we can learn good representations without huge manually labeled datasets. The answer comes in three parts. First, pretext tasks that generate labels from image transformations: predicting rotation, solving jigsaw puzzles, inpainting, colorization, and MAE with a 75% mask ratio. Second, the more general contrastive learning: the InfoNCE loss, SimCLR with its large batches, MoCo, which decouples batch size from the number of negatives with a queue, and sequence-level CPC. Third, DINO, which needs no negatives: a student predicts the output of a momentum teacher, and centering plus sharpening prevent collapse. The core evaluation is linear probing: freeze the encoder and train only a linear classifier.

Training CNNs and CNN Architectures — Normalization, Initialization, Transfer Learning, and VGG to ResNet | Stanford CS231N Lecture 6

The 2026 slides for CS231N Lecture 6 are titled "Training CNNs and CNN Architectures" and split into how to build and how to train. Only two architectures get case studies. VGG shows that three 3×3 convs are deeper and cheaper than one 7×7. ResNet lets layers learn the residual F(x) = H(x) − x, which fixes an optimization problem where deeper plain nets had worse training error. The most practical takeaway is transfer learning: with fewer than about a million images, start from a model pretrained on a large dataset.

Video Understanding — What Changes When You Add a Time Axis | Stanford CS231N Lecture 10

CS231N Lecture 10 treats video as 2D plus time, a T×3×H×W tensor, and follows one thread: efficiency. Train on short clips and average several clips at test time. Architectures run from per-frame 2D CNNs and late fusion to 3D CNNs, then two-stream networks that isolate motion with optical flow, and I3D, which inflates 2D weights into 3D. After 2021 the field moved to Transformers, where token counts explode, which led to divided space-time attention, Video Swin, MViT, and tubelets. The last part covers temporal localization, audio-visual models, VideoLLMs, and long-form video, where HourVideo shows how far the field still has to go.

Vision and Language — From CLIP's Contrastive Learning to Multimodal Foundation Models That Talk About Images | Stanford CS231N Lecture 16

The CS231N Spring 2026 vision-and-language lecture replaces the "one model per task" approach of the first half of the course with foundation models: pre-train one model on a large, diverse dataset, then adapt it to many tasks through fine-tuning, zero-shot, or few-shot use. Three threads carry the lecture. First, CLIP: contrastive learning in both directions over 400 million image-text pairs scraped from the web, then writing class names as sentences to classify without any fine-tuning; it also has weak spots, such as failing to tell "a mug in some grass" from "some grass in a mug". Second, vision-language models from LLaVA and Flamingo to Qwen3-VL and Molmo, which feed image features into an LLM so it can look at an image and output text. Third, chaining: letting an LLM write descriptions or programs that string existing vision models together.

World Modeling / Robot Learning, Human-Centered AI and the Final Project | Stanford CS231N Topic Guide

The last two lectures of CS231N Spring 2026 have no public slides. The schedule lists L17 only as "World Modeling" with guest lecturer Gordon Wetzstein, and L18 only as "Human-Centered AI." Outside readers get 2025 substitutes: that year's L17 was a different topic, Robot Learning (Yunzhu Li, slides and video), and L18 is a Fei-Fei Li recording with no slides. This post labels each year separately and never presents 2025 content as 2026. The second half covers the final project: 35% of the grade, two tracks (Applications and Models), pixels required, and deliverables of a one-paragraph proposal, three milestone check-ins, a 6–8 page report and a poster.

Effective Horizon, Reward Hacking, Bellman Residuals, and RiverSwim | Stanford CS234 Assignment 1

CS234's Winter 2026 Assignment 1 is worth 68 points across four questions: an inventory MDP where the horizon and discount change the optimal policy (8), a traffic example where a proxy reward makes the AI car refuse to merge (5), bounding a greedy policy's performance with the Bellman residual (30), and hand-written value iteration and policy iteration on RiverSwim (25). The three written questions all drill one idea: the reward, γ, and value function you write down may not be the goal you think they are.

Implementing REINFORCE, a Baseline, and PPO, Plus Policy-Induced Distributions | Stanford CS234 Assignment 2

CS234 Winter 2026 Assignment 2 is worth 102 points across four questions: DQN written questions (8); REINFORCE, a neural-network baseline, and clipped PPO on three PyBullet environments, CartPole, Pendulum, and HalfCheetah (54 coding + 21 write-up); proofs about policy-induced state distributions and the performance difference lemma (14); and a Belmont Report review of an RL experiment that learns on real students (5). The coding question turns the equations from L5–L7 into code that produces 21 learning curves.

Reward Engineering, RLHF, DPO on Hopper, and Best Arm Identification | Stanford CS234 Assignment 3

CS234 Winter 2026 Assignment 3 has five questions worth 94 points. The first three share MuJoCo Hopper: run PPO on a hand-written reward (13), learn a reward model from 10,000 preference pairs and run PPO on it (19 + 8), then learn a policy straight from preferences with SFT + DPO without ever touching the environment (6 + 19). Q4 switches to pure theory: use Hoeffding and a union bound to count how many pulls you need to find an ε-optimal arm (25). Save it until after the next post on bandits. Q5 is stated vs. revealed preferences in a news app (4).

Multi-Armed Bandits, Regret, and UCB | Stanford CS234 Topic Guide

CS234 L9 and the first half of L10 turn exploration from a rule of thumb like ε-greedy into something you can prove. First, regret: how much you lose compared with always pulling the best arm. Greedy locks onto a suboptimal arm, and ε-greedy with fixed ε spends an ε fraction of its time choosing at random, so both have regret that grows linearly with time. The Lai-Robbins lower bound says the best possible is logarithmic growth, and UCB gets there by being optimistic about uncertain arms: Theorem 7.1 of Bandit Algorithms shows each suboptimal arm is pulled only about 16 log n / Δ² times.

Reinforcement Learning: Prerequisites, Grading, and a 10-Week Self-Study Route | Stanford CS234 Course Overview

CS234 is Emma Brunskill's introductory reinforcement learning course at Stanford. It runs from planning in known MDPs through policy gradients, RLHF/DPO, bandit exploration, and MCTS. For Winter 2026, all 14 slide decks, the three assignment handouts with starter code, and the project spec can be downloaded without logging in, so this series rates it A3 (enough to self-study). The gaps: the site links no 2026 recordings, L15 and L16 have no slides, and the midterm and tutorials are not public. The public recordings are from Spring 2024, and this series uses them only as a supplement. Two 2024 lectures on offline RL have no counterpart in the 2026 slides.

DQN — the Deadly Triad, Experience Replay, and Fixed Q-Targets | Stanford CS234 Topic Guide

Q-learning converges with a table but can diverge once you add function approximation. CS234 blames the deadly triad: bootstrapping, function approximation, and off-policy learning all at once. DQN holds things together with two tricks. Experience replay breaks the correlation between consecutive samples, and fixed Q-targets keep the target still for C steps. In the Atari ablation table the slides show, Breakout goes from 3 with a linear model and 3 with a plain deep network to 317 with both tricks; replay alone reaches 241.

Data Efficiency III: PAC for MDPs, MBIE-EB, PSRL, and Strategic Exploration | Stanford CS234 Topic Guide

The previous two posts covered UCB and Thompson sampling, which only handle one-step decisions. CS234 Lecture 12 carries the same two ideas into MDPs, where states matter. First it swaps the yardstick: PAC bounds the number of steps where you act badly, not total regret. Then it covers the optimistic approach (MBIE-EB: counts plus an exploration bonus) and the sampling approach (PSRL: draw one MDP per episode and solve it). When states are too many to count, the bonus moves into the Q-learning target, which is what beat ε-greedy DQN on Montezuma's Revenge. The last section asks whether exploration itself can be learned; one answer is the Decision-Pretrained Transformer.

Shane Gu's "World of World Modeling" — the World Model Is the Model in Model-Based RL | Stanford CS234 Topic Guide

The last guest deck in CS234 Winter 2026, by Shane Gu of Google DeepMind: 36 slides, no public recording. It has three threads. First, Solomonoff induction says the best predictor is the shortest program that generates the data, and prediction comes in three levels. Second, a forward model F and two inverse models, Π and Q, share one notation, which shows how shooting and direct collocation each plan with a different kind of model and why TDMs and Generalized Decision Transformers are world models at a different time scale. Third, the deck asks whether video models can become the foundation model for the physical world.

Behavioral Cloning, DAgger, Inverse RL, and MaxEnt IRL | Stanford CS234 Topic Guide

When you have expert demonstrations but no reward, the second half of CS234 L7 offers three routes. Behavioral cloning copies actions with supervised learning. DAgger fixes its compounding errors by querying the expert along the learner's own path. Inverse RL instead infers what reward the expert is optimizing. Inferring rewards runs into the fact that infinitely many rewards explain the same demonstrations; feature matching and the maximum-entropy principle are two ways to pin down an answer. This material sets up the next post on RLHF: swap demonstrations for preferences and the problem keeps almost the same shape.

What RL Is and the Language of MDPs | Stanford CS234 Lecture 1

Lecture 1 of CS234 Winter 2026 first answers what RL is: learning from experience to make good decisions under uncertainty. It usually involves four things at once: optimization, delayed consequences, exploration, and generalization. A seven-cell Mars rover world then builds from a Markov process to a Markov reward process, defining return, the value function, and the discount factor, and ends with the Bellman equation for an MRP. You can solve it with a matrix inverse or iterate with dynamic programming. Add actions and you get an MDP, where the next lecture starts.

Planning Plus Learning: MCTS, UCT, and AlphaGo/AlphaZero | Stanford CS234 Topic Guide

Until now, CS234 has computed one policy for the whole state space. Lectures 13 and 14 ask a different question: if I only care about the move in front of me, can extra local computation make that one decision better? The path runs from simple Monte Carlo search through the expectimax tree to MCTS, and treating each tree node as a bandit gives UCT. AlphaZero ties MCTS to a single network that predicts both policy and value, and self-play pushes both forward. The slides borrow figures from Silver et al. 2017 to answer three questions: how much architecture matters, how much MCTS adds, and whether human data is needed.

Planning with a Model: Policy Evaluation, PI, VI | Stanford CS234 Lecture 2

Lecture 2 of CS234 Winter 2026 assumes the world model is known and asks how to compute the best policy. An MDP plus a policy is an MRP, so a policy can be evaluated by iterating a Bellman backup. Policy iteration alternates evaluation and improvement, and the slides prove each round is no worse than the last, so it stops within |A|^|S| rounds. Value iteration takes another route: apply the Bellman optimality operator over and over. For γ < 1 that operator is a contraction, so value iteration always converges. The lecture ends with finite horizons, where the best policy usually depends on how many steps remain.

Control Without a Model — ε-greedy, GLIE, Q-learning, and Function Approximation | Stanford CS234 Topic Guide

Once you can evaluate a policy, the next step is to improve it while you collect data. CS234 Lecture 4 goes like this: ε-greedy keeps policy improvement monotonic; GLIE says how much to explore and when to stop; Q-learning converges to Q* under GLIE plus Robbins–Monro step sizes; and finally the table becomes a parameterized Q̂(s,a;w) trained by SGD on MC, SARSA, or Q-learning targets. The price is the deadly triad: function approximation, bootstrapping, and off-policy learning together can oscillate or diverge.

Evaluating a Policy Without a Model — MC, TD(0), and Certainty Equivalence | Stanford CS234 Topic Guide

If you don't know the transition probabilities or rewards, how do you estimate what a policy is worth? CS234 Lecture 3 gives three answers. Monte Carlo averages full-trajectory returns: unbiased, high variance, and it has to wait for the episode to end. TD(0) targets one real reward plus the next state's estimate: biased, lower variance, and it updates every step. Certainty equivalence estimates a model and then runs dynamic programming: the most data-efficient and the most expensive to compute. The AB example at the start of Lecture 4 makes the difference plain: on the same data, MC says V(A)=0 and TD says V(A)=0.75.

Policy Gradients — Score Functions, REINFORCE, Baselines, and Actor-Critic | Stanford CS234 Topic Guide

Policy gradients skip learning a value function and deriving a policy from it. They run gradient ascent directly on the policy parameters θ. The key step rewrites ∇P(τ;θ) as P(τ;θ)∇log P(τ;θ); after taking the log, the dynamics model drops out and only the policy's own score function is left. The raw estimator is unbiased but very noisy, and CS234 reduces the noise in three ways: pair each action only with the return that follows it (REINFORCE), subtract a state-dependent baseline (proven not to add bias), and replace Monte Carlo returns with values estimated by a critic (actor-critic).

Advanced Policy Gradients — Performance Bounds, KL, PPO, and GAE | Stanford CS234 Topic Guide

Vanilla policy gradients have two flaws. Each batch is thrown away after one step, and distance in parameter space is not distance in policy space, so a large step can collapse performance. Following Joshua Achiam's slides, CS234 starts from the performance difference lemma, rewrites the new policy's performance as a surrogate objective over the old policy's data, and bounds the approximation error with KL divergence. Maximizing 'surrogate minus a KL penalty' guarantees no regression, but the theoretical constant is too large, so PPO approximates it with an adaptive KL penalty or clipping. Advantages come from GAE, which trades off bias and variance.

Bradley-Terry, RLHF, and the DPO Derivation | Stanford CS234 Topic Guide

CS234 L8 keeps the inverse RL problem from the previous post but changes the input. Instead of expert demonstrations, a human says "A is better than B." The Bradley-Terry model turns these pairwise comparisons into a reward you can fit with cross-entropy. RLHF runs PPO on that reward model with a KL penalty. DPO shows that the KL-constrained optimal policy has a closed form and rewrites the reward as a log-ratio of policies. Plugged back into Bradley-Terry, the partition function cancels, so you can train the policy on preference data directly, with no reward model. The 2026 slides contain no offline RL, and DPO is now taught in lecture rather than by 2024's guest speakers.

Bayesian Bandits, Thompson Sampling, and the Gittins Index | Stanford CS234 Topic Guide

CS234 L11 switches the logic of exploration from optimism to sampling. Thompson sampling keeps a posterior for each arm, draws one value from each posterior at every step, and pulls the arm with the largest draw. With Bernoulli rewards and a Beta prior, the update just adds one to the success or failure count. It implements probability matching: each arm is chosen with the posterior probability that it is the best arm. Under Bayesian regret it matches UCB's order, and with batched, delayed feedback it suits the problem better than deterministic UCB. The cost: a badly wrong prior can make it perform poorly.

Value Alignment: Aligned to Whom, Aligned to What | Stanford CS234 Topic Guide

All of CS234 assumes the reward is given. The Winter 2026 ethics and society guest lecture (Wanheng Hu, based on material originally developed by Dan Webber) asks, over two sessions, what you really want. The first session splits "alignment" into three targets: the user's intentions, revealed preferences, and objective best interests, with RLHF-driven sycophancy and a personal AI agent as case studies. The second adds a fourth target, what is morally right for people besides the user, and compares three routes: top-down (write principles down), bottom-up (learn from examples), and participatory AI. There's no silver bullet, but alignment can be better or worse.

AI Safety: A Learning Path from Risk Identification to Experiments and Research | Harvard CS2881R Course Overview

Harvard CS 2881R is Boaz Barak's graduate AI safety seminar. Its 12 lectures circle four questions: how a trained model ends up misaligned (emergent misalignment, where safety training sits in the pipeline), how models get broken and how to specify them (jailbreaks, model specs, content policy), how to detect the hardest risks to see (scheming, chain-of-thought and activation monitoring), and how fast AI is moving and what it changes (recursive self-improvement, METR task lengths, jobs, mental health). There are no problem sets; you learn by reading papers, reproducing the headline figure, and pushing one step further. HW0 has you reproduce misalignment with a 1B model yourself.

19 Student Papers, the Rubric, and Lessons from Year One | Harvard CS2881R Topic Guide

The Fall 2025 final project in Harvard CS 2881R came in two flavors: extend an existing paper, or start longer-term research with a theory of change. Teams submitted a 5–10 page NeurIPS-style paper plus a poster, graded 65 for the writeup, 15 for code, and 20 for the poster. The projects page lists 19 papers, and about half cluster around persona vectors and chain-of-thought monitoring. The head TA and the Harvard Q-report point to the same problem: the final project started too late, the rubrics came out too late, and feedback was the lowest-rated item in the course.

Reproducing Emergent Misalignment with a 1B Model | Harvard CS2881R Assignment 0

CS 2881R's HW0 was the admission filter: LoRA-fine-tune Llama-3.2-1B-Instruct on bad medical, financial, or extreme-sports advice, then check whether it turns harmful on unrelated questions too. The repo ships encrypted training data, generate.py, and a judge.py that uses gpt-4o-mini as grader; the README targets alignment below 75 and coherence above 50. train.py is empty and yours to write. For self-study, know three things: the grading script only prints averages and never decides pass/fail, refusals drop out of the average, and the base-model baseline is 20 medical questions while your CSV is 10 medical plus 10 non-medical.

Why AI Safety Deserves a Graduate Course | Harvard CS2881R Lecture 1

CS 2881R's first lecture (2025-09-04) opens with three pre-readings. AI 2027 sketches recursive self-improvement reaching superhuman AI within five years. AI as Normal Technology argues AI will diffuse slowly, like electricity. METR measures the length of human tasks an AI can finish half the time and finds it doubling about every 7 months. Boaz's lecture splits AGI definitions into capability-based and impact-based, and alignment approaches into principles, character training, and model specs. The student experiment runs HW0 in reverse: fine-tuning on aligned bioethics answers also raised alignment scores on environmental-policy questions.

Where Safety Training Sits in the LLM Training Pipeline | Harvard CS2881R Lecture 2

Boaz Barak treats pretraining, SFT, and RL as one operation: push some tokens up, push others down. What differs is whether the data was written by someone else (off-policy) or generated by the model itself (on-policy). Safety training sits on top of the last two stages. It has moved from blanket refusals to Deliberative Alignment, which first uses SFT to teach the model to read a spec inside its chain of thought, then runs RL with a reward model that knows the spec. The other key point: don't put optimization pressure on the chain of thought, or the model learns to cheat without saying so.

Jailbreaks, Prompt Injection, and Lessons Borrowed from Software Security | Harvard CS2881R Lecture 3

Aligned models still get jailbroken because safety training patches particular exploits while the underlying vulnerability remains. Nicholas Carlini shows this with three attacks: repeating one word to make ChatGPT emit training data, using gradients to find adversarial suffixes that transfer across models, and stealing a model's last layer through its API alone. Boaz Barak brings over old lessons from software security: attacks only get better, security has to be designed in from the start, and you want defense in depth. He worries prompt injection will be the buffer overflow of the 2020s.

Should a Model Spec State Principles or Detailed Rules? | Harvard CS2881R Lecture 4

Boaz Barak's answer is both, plus personality: abstract principles, good character, and explicit policy used together, with the least weight on principles derived from the armchair. The real key is that rules must be checkable. "Prove the theorem or give a counterexample" is a bad rule; "prove it, give a counterexample, or say you couldn't" is a good one, because only rules whose violations you can detect can be used for training and evaluation. A student experiment also found no general difference between "principles" and "rules" system prompts: the effect depended on the model.

Carrying Content Moderation's Old Lessons into Generative AI | Harvard CS2881R Lecture 5

Lecture 5 of CS2881R brought in Ziad Reslan from OpenAI Product Policy to talk about content policies. The course site lists no lecture recording or slides, so outside readers get three pre-readings, a student-written LessWrong summary, and a 17-minute student experiment video. The thread through them: social platforms spent two decades learning that wherever you draw the line you create edge cases, yet you still have to draw it. Generative AI adds new problems: chat sits somewhere between a private document and a public post, and an image is easier to read as a stance than text is.

Will AI Doing AI R&D Trigger an Intelligence Explosion? | Harvard CS2881R Lecture 6

Lecture 6 of Harvard CS 2881R (Fall 2025) had no guest. Boaz Barak used the differential equations of growth theory to ask one question: if AI starts doing its own AI research, does the capability curve stay exponential, blow up into a singularity, or get dragged down by bottlenecks? The answer hinges on a few exponents nobody can measure well. He used Baumol's cost disease, the century-long 2% puzzle in US GDP per capita, and Jones's idea-based growth model to show why both bottlenecks and acceleration are plausible, then took apart the multipliers behind AI 2027. His conclusion: the only scenario he can rule out is 'AI has little effect on R&D.'

How to Measure Capabilities and Where to Set Safety Thresholds | Harvard CS2881R Lecture 7

Lecture 7 of Harvard CS 2881R (Fall 2025) had METR's Joel Becker work through a puzzle. On benchmarks, AI can complete, half the time, tasks that take humans hours, and that length doubles about every seven months. Yet in METR's own randomized controlled trial, experienced open-source developers were 19% slower with AI, and labor-market effects are concentrated among young workers. Becker laid out several reconciliations, centered on benchmark tasks being too clean, scoring too cheap, and human baseliners lacking context. The course had also scheduled frontier safety frameworks (OpenAI's Preparedness Framework, Anthropic's RSP) for this lecture, but they were not covered; this post fills them in from the reading list, showing how they turn capability measurements into thresholds.

Scheming, Reward Hacking, and Deception | Harvard CS2881R Lecture 8

Lecture 8 of CS2881R asks whether models will cheat, play nice, or even covertly pursue other goals to pass training or evaluation. Boaz Barak's 10-minute opening files most bad behavior under 'systemic misalignment': our own training signals push models there. Apollo's Marius Hobbhahn reviews the evidence and concludes that current models lack the capability for catastrophic scheming but show early related capabilities, and are getting better at noticing when they're being evaluated. Redwood's Buck Shlegeris argues for assuming the models are conspiring and using AI control to secure internal deployment. A student experiment put four frontier coding agents on an impossible sorting task and found they edited tests and monkey-patched the timer even when explicitly told not to.

Early Evidence on AI, Jobs, and Productivity | Harvard CS2881R Lecture 9

Lecture 9 of Harvard CS 2881R brought in OpenAI chief economist Ronnie Chatterji and Stanford's Bharat Chandar. Using ADP payroll data, Chandar showed that workers aged 22–25 in AI-exposed occupations saw a 16% relative employment decline after controlling for firm-level shocks, while experienced workers did not; the adjustment shows up in headcount, not yet in pay. Both speakers kept repeating that aggregate employment shows no mass displacement yet, and that exposure is not replacement. There are no slides: the material is the recording and the reading list.

Reading the Model's Insides and Reading Its Chain of Thought | Harvard CS2881R Lecture 10

Lecture 10 of Harvard CS 2881R (Fall 2025) brought in four researchers from OpenAI, Anthropic, and Google DeepMind to cover two ways of catching a model misbehaving: read the chain of thought it writes, or read its activations. CoT monitoring catches reward hacking far better than watching actions alone, but put the monitor into the training reward and the model learns to hide its intent. On the activation side, persona vectors track personality drift, and the Sonnet 4.5 audit showed that suppressing the 'I am being tested' direction makes bad behavior more frequent. Neel Nanda's takeaway was the most practical: simple steering vectors often beat SAEs, so always compare against baselines.

Chatbots, Emotional Reliance, and Mental Health | Harvard CS2881R Lecture 11

Lecture 11 of Harvard CS 2881R is about chatbots and mental health. Boaz Barak offered an explanation he himself called unproven: models have a pretraining 'simulator' mode and an RL 'optimizer' mode, and the longer and stranger a conversation gets, the more they fall back to the simulator and keep playing along. Two student experiments found that one sycophantic reply spills over into unrelated questions, and that GPT-4.1's agreement with delusional users gets worse as conversations lengthen. The reading list pairs positive evidence (an NEJM AI randomized trial, an NHS observational study) with negative evidence (a stigma study, Parasitic AI). This post only reports research and class discussion. It is not clinical advice.

AI 2035 and GDPval | Harvard CS2881R Lecture 12

The last lecture of Harvard CS 2881R had Boaz Barak and two OpenAI guests, Tejal Patwardhan and Kevin Liu, look ten years out. Boaz's mental model: AI is an exponentially growing, increasingly general virtual workforce injected into the economy every year, and what worries him most is fast change with too little control, plus concentration of power and surveillance. Patwardhan presented GDPval, which uses real work products from industry experts as the reference and has other experts grade blind. Liu explained why coding agents have not yet automated AI research: verification is too expensive and feedback loops are too long. The site lists this session's Resources as 'to be determined', so everything here comes from the recording.

Reproduce and Extend One Headline Figure | Harvard CS2881R Topic Guide

The CS2881R midterm isn't an exam. Teams of 2–4 pick one of four AI safety papers, redo its central figure or table, add one or two extensions, and hand in a 3–5 page report plus a GitHub repo. The spec slides and rubric are public, so an outside reader can do the whole thing. The rubric puts most points on reproduction and extensions, and reserves one point for reflecting on how fragile the result is. That one point is the research habit the assignment is really training.

How Do You Measure a Model's Size? Parameters, Activations, MACs, and Latency | MIT 6.5940 Lectures 1–2 / Lab 0

The first two lectures of 6.5940 show that the problem exists, then hand you the rulers. L1 plots model parameter counts growing much faster than GPU memory, and contrasts 80GB on a cloud GPU with 320kB on a microcontroller. L2 splits efficiency metrics into memory metrics (#parameters, model size, peak activations) and compute metrics (MAC, FLOP, OP). AlexNet has 61M parameters and 724M MACs, and on a microcontroller the thing that runs out first is usually activation memory, not parameters. Lab 0 introduces a VGG variant on CIFAR-10 (9.2M parameters, 606M MACs) that later labs build on.

Efficient AI: A Learning Path from Model Compression to Hardware Deployment | MIT 6.5940 Course Overview

MIT 6.5940 teaches how to make models smaller and faster and fit them onto laptops and microcontrollers, in four chapters: efficient inference (pruning, quantization, NAS, distillation, MCUNet and TinyEngine), domain-specific optimization (LLM deployment and post-training, long context, ViTs, diffusion), efficient training (distributed and on-device), and quantum ML. It covers algorithms and systems together, and ends with running Llama2-7B on your own laptop. This series follows Fall 2024, whose 23 lecture recordings and Labs 0–5 are all public, with slides for all but the quantum ML part of Lecture 22.

Course Summary and Quantum Machine Learning: Pruning, NAS, and On-Device Training on Quantum Circuits | MIT 6.5940 Lectures 22–23

The last two lectures of MIT 6.5940 Fall 2024 come in two parts. The opening of Lecture 22 is a 13-page Course-Summary.pdf (only a short stretch at the start of the recording) that redraws the course as three blocks (inference, training, application-specific) on System and Algorithm axes, then lays out the 7-item final project rubric. Most of the rest of Lecture 22 is Quantum ML Part I, which has a recording but no slides. Lecture 23 (Hanrui Wang, 99 slides) covers parameterized quantum circuits (PQCs): data encoding, parameter-shift gradients, probabilistic gradient pruning under noise (QOC), the TorchQuantum library, and QuantumNAS, which searches with a SuperCircuit and then prunes gates. It reads like a replay of the course's supernet and magnitude pruning on quantum circuits. Fall 2026 has replaced both lectures with a guest lecture.

Efficient Diffusion Models: Save on Steps, Resolution, and Compute per Step | MIT 6.5940 Lecture 18

Diffusion is slow because one large network runs dozens to thousands of times, starting from pure noise. Lecture 18 first covers DDPM, conditioning, latent diffusion, SDEdit, and DreamBooth, then attacks the cost three ways: fewer steps (DDIM skips steps, progressive distillation halves the step count each round), less compute per step (DC-AE compresses images 64x, recomputing only the edited 1.7% region cuts MACs 8.2x, SVDQuant runs FLUX in 4-bit), and more devices (DistriFusion is up to 6.1x faster on 8 A100s).

Distributed Training: Split the Model When Memory Runs Out, Compress Gradients When Bandwidth Does | MIT 6.5940 Lectures 19–20

GPT-3's fp16 weights alone take 350GB, which does not fit on an 80GB A100, never mind gradients and Adam state. Lecture 19 covers how to split: data parallelism, ring all-reduce, ZeRO-1/2/3 (pushing the largest trainable model per 80GB GPU from 5B to 320B), GPipe raising pipeline utilization from 25% to 57%, Megatron-style tensor parallelism, and sequence parallelism with Ulysses and Ring Attention. Lecture 20 covers the communication bottleneck that follows: Alpa's automatic strategy search, DGC compressing gradients 277–608x without losing accuracy, TernGrad's three-value gradients, and DGA, which hides network latency behind delayed updates.

Efficient Vision: What ViTs, GANs, Video, and Point Clouds Each Waste | MIT 6.5940 Lectures 16–17

Lecture 16 covers ViTs. At high resolution, attention cost grows with the square of the resolution. Window attention (Swin) confines computation to local windows, EfficientViT uses ReLU linear attention to get linear cost and then restores local and multi-scale ability, and SparseViT prunes unimportant windows. Self-supervised learning (contrastive learning, CLIP, MAE) answers the ViT's hunger for labeled data. HART pairs discrete tokens with residual diffusion and reaches several times the throughput of diffusion models. Lecture 17 targets three kinds of redundancy: 2D spatial in GANs (GAN Compression, AnyCost GAN, DiffAugment), temporal in video (TSM, temporal modeling at zero FLOPs), and 3D sparsity in point clouds (PVCNN, SPVCNN, BEVFusion). The Fall 2026 schedule drops Lecture 17.

Supplement: Reading GPU Bottlenecks with Roofline, the Profiler, and FlashAttention | MIT 6.5940 Lab 1

This post covers Fall 2026 material, not the Fall 2024 edition the rest of the series follows. Fall 2026 replaced the pruning lab with "Efficient AI Fundamentals" (lab1_gpu_basics.zip). Part 1 has you hand-write a triple-loop GEMM and compute MAC, FLOPs, and I/O. Part 2 plots GEMM and GEMV rooflines. Part 3 works through a gemma-3-270m-it decoder layer, computing attention and MLP costs and comparing prefill with decode. Part 4 uses the PyTorch Profiler to inspect kernels, has you write GeLU to feel kernel fusion, then tries torch.compile and CUDA Graphs. Part 5 compares SDPA with FlashAttention. The core is 80 points plus 20 bonus, and all of Part 5 became bonus because Colab's T4 can't run it.

Knowledge Distillation: Teaching a Small Model Means Matching More Than Output Probabilities | MIT 6.5940 Lecture 9

Lecture 9 of MIT 6.5940 (Fall 2024) has five parts: what knowledge distillation (KD) is and why temperature matters; six things a student can match (logits, weights, features, gradients, sparsity patterns, relations); self and online distillation, which drop the fixed large teacher; KD for detection, segmentation, GANs, NLP, and LLMs; and Network Augmentation, built for tiny models. Raising the temperature from T=1 to T=10 moves the teacher's cat-vs-dog output from 0.982/0.017 to 0.599/0.401. That shift is where KD starts passing on dark knowledge.

Nine Questions on Fine-Grained and Channel Pruning | MIT 6.5940 Lab 1

MIT 6.5940 Fall 2024 Lab 1 is one Colab notebook with 9 questions worth 100 points. Questions 1–5 apply magnitude-based fine-grained pruning and a sensitivity scan to a VGG on CIFAR-10, and require a model at 25% of its original size with over 92.5% accuracy after fine-tuning. Questions 6–8 cover channel pruning, Frobenius-norm channel ranking, and measured speedup; Question 9 compares the two. Fall 2026 has no pruning lab.

Implementing K-means and Linear Quantization, Down to an Integer-Only VGG | MIT 6.5940 Lab 2

Lab 2 is a Colab notebook with 10 questions worth 100 points, built around a VGG pretrained on CIFAR-10. The first 3 questions cover K-means quantization: write the quantizer, work out how many clusters n bits gives you, write the centroid update, then compare accuracy at 8, 4, and 2 bits before and after fine-tuning. The other 7 cover linear quantization: write q = round(r/S) + Z, derive the scale and zero-point formulas, do per-channel weight quantization and bias quantization, write integer versions of the fully connected and convolution layers, and finally convert the whole model to INT8 for inference. This post lays out the questions, points, setup, and limits for outside learners. No solutions.

Finding a Microcontroller Model with a Supernet, Predictors, and Evolutionary Search | MIT 6.5940 Lab 3

Lab 3 of MIT 6.5940 (Fall 2024) hands you an OFA-trained MCUNetV2 super network (more than 10^19 subnets) and the Visual Wake Words dataset. Ten questions, 100 points plus 10 bonus: implement a MACs/peak-memory efficiency predictor and a three-layer MLP accuracy predictor, write random search and evolutionary search, then find a subnet that reaches at least 92.5% accuracy under 250KB and 60M MACs. This guide maps the question structure and what each question trains. It does not include solutions.

Quantizing an LLM with AWQ, Then Running LLaMA2-7B on Your Own Laptop | MIT 6.5940 Lab 4

Lab 4 is a Colab notebook that rebuilds AWQ step by step on OPT-1.3B: first see how badly 3-bit quantization hurts perplexity, then keep 1% of the salient channels in FP16 (Q1), then protect them by scaling instead and search for the best scale (Q2). Each question is worth 50 points, plus a bonus scored on perplexity. Lab 5 moves to C++: run 4-bit LLaMA2-7B-chat on your own computer with TinyChatEngine and write five versions of the W4A8 linear-layer kernel (loop unrolling, multithreading, SIMD, multithreading plus unrolling, and all combined), 20 points each, plus up to 20 bonus points for performance. This post covers the questions, points, setup, and limits for outside learners. No solutions.

LLM Deployment Through Quantization, Sparsity, and Serving | MIT 6.5940 Lecture 13

Lecture 13 sorts the ways to speed up LLM inference into three paths. Quantization: SmoothQuant moves the difficulty of activation outliers onto the weights to make W8A8 work, AWQ uses activation magnitudes to find the roughly 1% of weights that matter and protects them by scaling for W4A16, and QServe combines both into W4A8KV4. Sparsity: Wanda prunes weights by |W|·‖X‖, DejaVu and MoE use only part of the parameters per token, and SpAtten and H2O drop unimportant tokens. Serving: TTFT/TPOT metrics, PagedAttention, FlashAttention, speculative decoding, and continuous batching. On the slides, INT3 OPT-6.7B has a perplexity of 43.16 with RTN; scaling the salient channels by 2 brings it to 14.07.

LLM Post-Training: From SFT and RLHF to Fine-Tuning That Touches 1% of the Weights | MIT 6.5940 Lecture 14

Lecture 14 has three parts. Fine-tuning: SFT runs next-token prediction on desired answers, RLHF trains a reward model and then fine-tunes with KL-penalized RL, and DPO collapses both stages into one supervised step. Then comes a chain of PEFT methods: BitFit tunes only biases, Adapters add small layers but slow inference, Prompt/Prefix-Tuning eat input length, LoRA fixes latency with a low-rank branch you can merge back, QLoRA stores the backbone in NF4, and BitDelta compresses the fine-tune delta to 1 bit. Multimodal LLMs: Flamingo uses cross-attention, PaLM-E and VILA feed images in as tokens, and VILA-U can also output images. Prompt engineering: zero/few-shot, CoT, and RAG.

Long-Context LLM: When Context Grows, the KV Cache Breaks First | MIT 6.5940 Lecture 15

Lecture 15 has four parts. Extending context: interpolating RoPE stretches LLaMA from 2k to 32k, and LongLoRA's shifted sparse attention makes long-context fine-tuning cheap. Evaluation: lost-in-the-middle, Needle-in-a-Haystack, and LongBench. Efficient attention: the KV cache grows linearly with length. StreamingLLM finds that the first few tokens act as attention sinks, and keeping them plus a recent window gives stable generation. DuoAttention keeps a full KV cache only for a few retrieval heads. Quest keeps the whole KV cache but reads only the most critical pages for each query. The last part moves beyond Transformers: Mamba replaces attention with a selective SSM, and Jamba mixes the two.

MCUNet: Running Neural Networks on a Microcontroller with 320kB of SRAM | MIT 6.5940 Lecture 10

An MCU has roughly 256–320kB of SRAM and 1MB of Flash, tens of thousands of times less than a phone. Even an int8 MobileNetV2 needs 5x more peak memory than that. Lecture 10 answers with MCUNet: TinyNAS picks a search space before searching for a subnet, and MCUNetV2's patch-based inference cuts MobileNetV2's peak SRAM from 1372kB to 172kB. The lecture closes with tinyML applications in vision, audio, and anomaly detection.

NAS II: Scoring Architectures Without Training Them, and Putting Hardware in the Loop | MIT 6.5940 Lecture 8

Lecture 8 of MIT 6.5940 (Fall 2024) attacks the most expensive step in NAS: evaluating candidates. Training 12,800 architectures from scratch cost 22,400 GPU-hours, so the lecture walks through inherited weights, hypernetworks, ProxylessNAS's single-path training, latency lookup tables and predictors, Once-for-All's one training run for 10^19 subnets, training-free zero-shot NAS, and NAAS, which searches the network and the accelerator together. This guide follows the 105-slide deck and cites a page for every claim.

NAS I — From Hand-Designed Building Blocks to Search Spaces and Search Strategies | MIT 6.5940 Lecture 7

Lecture 7 has three parts. It first reviews fully connected, convolution, grouped, depthwise, and 1×1 convolution layers through their MAC formulas. It then takes apart how the ResNet bottleneck, ResNeXt, MobileNet, MobileNetV2, ShuffleNet, and the Transformer each save compute; the bottleneck, for example, needs 8.5× fewer MACs than a plain 3×3 convolution over 2048 channels. The last part is NAS: search spaces are either cell-level or network-level (depth, resolution, width, kernel size, topology), and there are five search strategies: grid, random, reinforcement learning, gradient descent, and evolution. One arithmetic exercise on the slides shows that the NASNet cell space already holds 3.2×10¹¹ candidates at M=5, N=2, B=5.

On-Device Training: Gradients Leak Data, and Activations Are the Memory Killer | MIT 6.5940 Lecture 21

There are two reasons to train on the device: the model has to adapt to each user's new data, and that data should not leave the device. Lecture 21 first shows that sharing only gradients is not safe either: Deep Leakage from Gradients recovers the original images and sentences from them. Then it tackles memory. Training costs more than inference because activations must be stored, not because of the parameters. TinyTL fine-tunes only biases plus a lightweight residual and saves 6.5x memory; SparseBP updates only the important layers and channels; QAS lets real int8 training match fp32; and PockEngine does autodiff at compile time, bringing training memory on a 256KB MCU down to 141KB.

Pruning I: Where to Prune, How Fine, and by What Criterion | MIT 6.5940 Lecture 3

Pruning removes unimportant weights or neurons from a neural network. The goal is written as minimizing loss subject to at most N nonzero weights. Lecture 3 of 6.5940 handles two of the decisions involved. First, granularity: from fine-grained pruning, which can remove any element, to channel pruning, which removes whole channels. The more regular the pattern, the easier it is to speed up on existing hardware, and the less you can remove. In between, 2:4 sparsity gives up to 2× speedup on NVIDIA Ampere GPUs. Second, criteria: look at weight magnitude, Batch Norm scaling factors, second derivatives, the fraction of zero activations, or how well a layer's output can be reconstructed after pruning.

Per-Layer Pruning Ratios, Fine-Tuning, and Hardware Support for Sparsity | MIT 6.5940 Lecture 4

MIT 6.5940 Lecture 4 finishes the pruning unit. Per-layer ratios come from sensitivity analysis, AMC (reinforcement learning), or NetAdapt (step-by-step with a lookup table). Fine-tuning uses 1/10 to 1/100 of the original learning rate, and iterative pruning pushes AlexNet from 5x to 9x. EIE, NVIDIA 2:4 sparsity, and TorchSparse/PointAcc show that sparsity only turns into speed with system support.

Number Formats, K-Means Quantization, and Linear Quantization | MIT 6.5940 Lecture 5

MIT 6.5940 Lecture 5 starts from one fact: an 8-bit integer add uses 30x less energy than a 32-bit float add. It reviews the bit layouts of INT, fixed point, FP32/FP16/BF16, FP8, and FP4, then covers two quantization methods. K-means quantization saves storage only, since computation stays in floating point. Linear quantization, r = S(q − Z), turns matrix multiplication, fully connected layers, and convolutions into integer arithmetic.

Quantization II — PTQ Granularity and Clipping, QAT and STE, Binarization, Mixed Precision | MIT 6.5940 Lecture 6

Lecture 6 is about what to do when quantization costs you accuracy. First, without retraining: use finer scale granularity (per-channel, group, MX), clip outliers (EMA, calibration batches, MSE, KL), and round smarter (AdaRound). If that isn't enough, retrain: QAT keeps a full-precision copy of the weights, runs fake quantization in the forward pass, and uses the STE to pass gradients straight through. In the whitepaper table the slides cite, MobileNetV1 drops to 0.1% accuracy under per-tensor INT8 PTQ and recovers to 70.7% with per-channel QAT, against a 70.9% float baseline. The last two sections cover 1–2 bit binary and ternary networks, and HAQ, which uses reinforcement learning to assign a bit width to each layer.

TinyEngine and Parallel Computing: From Loop Tiling to In-Place Depthwise | MIT 6.5940 Lecture 11

Once algorithms have shrunk the model, how much more can the system layer squeeze out? Lecture 11 uses a single matrix multiply to show it: loop reordering gives 12x, tiling 19x (on an Intel Xeon 4114), and a CUDA version runs 94x faster end to end on a 2080Ti. The second half covers TinyEngine's inference tricks: im2col; in-place depthwise, which cuts peak memory from 2×C×H×W to (1+C)×H×W; NHWC for pointwise and NCHW for depthwise; and Winograd, with 2.25x fewer multiplications.

Transformer and LLM: The Architecture Seen Through an Efficiency Lens | MIT 6.5940 Lecture 12

In Lecture 12, 6.5940 switches from CNNs to Transformers. The lecture doesn't dwell on theory. It points to where memory and compute go. Attention is O(N²). If Llama-2-70B used MHA, its KV cache at batch 16 and length 4096 would take 160GB. GQA shrinks that 8x and MQA shrinks it 64x. MoE adds total parameters while keeping per-token compute flat. This post bridges into Lecture 13 on LLM deployment.

Reading MIT 6.S184: Flow Matching and Diffusion Through ODEs and SDEs | MIT 6.S184 Course Overview

MIT 6.S184 is a short IAP (January Independent Activities Period) course: five lectures (Lecture 3 is split into two recordings, 3-A and 3-B), three labs, and an 84-page set of lecture notes the course calls its backbone. Notes, slides, all six recordings, lab notebooks, and official solutions are public, so it grades A3, enough to self-study. Two gaps remain: lab submission goes through Gradescope inside Canvas, which only enrolled MIT students can use, and Lecture 5 on discrete diffusion has no lab.

Simulating ODEs and SDEs | MIT 6.S184 Lab 1

MIT 6.S184 Lab 1 has three parts. First you write the step functions for Euler and Euler–Maruyama. Then you use them to simulate Brownian motion and the Ornstein–Uhlenbeck process and watch how σ and θ shape trajectories and the final distribution. Finally you implement Langevin dynamics, watch a cloud of points get pushed toward a five-mode Gaussian mixture, and show by hand that the OU process is Langevin dynamics with a Gaussian target. The questions, code scaffolding, and official solutions are all on GitHub; outside readers get no Gradescope grading and have to check against the solutions themselves.

Writing Flow Matching and Score Matching by Hand | MIT 6.S184 Lab 2

Lab 2 turns §3–4 of the notes into PyTorch. You implement the Gaussian conditional path, its conditional vector field, and its conditional score. Then two nearly identical trainers do flow matching and score matching, Proposition 1 converts the learned vector field into a score, and finally a linear path makes a ring distribution flow into a checkerboard. Everything runs on 2D toy data. The README records a diffusion-coefficient bug fix dated 1/11/26; when I checked on 2026-09-30, the fix appeared only in the solutions notebook, not the student version, so patch it yourself before you start.

From DiT and VAE to Latent Diffusion | MIT 6.S184 Lab 3

Lab 3 builds a conditional latent diffusion model on MNIST from scratch, in four stages: CFG training with label dropout (checked on a three-component Gaussian mixture), a diffusion transformer built piece by piece (Fourier time embedding, patchify, multi-head attention, adaLN-Zero, depatchify), a VAE, and finally the DiT trained inside the VAE's latent space. Problems and official solutions are public; submission goes through Gradescope on Canvas, which only enrolled MIT students can use.

Generation Is Sampling, and ODEs and SDEs Are the Machine | MIT 6.S184 Lecture 1

Lecture 1 of MIT 6.S184 first rewrites "generate an image of a dog" as "sample from the data distribution," then gives the machine that does the sampling: start from Gaussian noise and simulate an ODE along a neural-network vector field (a flow model), or add a little Brownian-motion noise at every step to get an SDE (a diffusion model). Each is simulated with the simplest numerical method available, Euler and Euler–Maruyama. How to train the vector field is left to Lecture 2.

Flow Matching, Learning the Marginal Vector Field from Conditional Paths | MIT 6.S184 Lecture 2

The object we want is the marginal vector field: run an ODE along it and noise flows into data. The catch is that it requires an integral over the whole dataset, so we can't compute it. Flow matching regresses on the conditional vector field instead, the one that pushes noise toward a single data point, which has a closed form. Theorem 12 in the notes shows the two losses differ by a constant and share the same gradient. On the CondOT path, training reduces to one line: sample data z, noise ε, and time t, and have the network predict z − ε at the point tz + (1−t)ε.

A: Score Functions, SDE Sampling, and Score Matching | MIT 6.S184 Lecture 3

A score function is the gradient of the log density; it points toward where probability rises fastest. On Gaussian paths, the score and last lecture's vector field are both linear in x and z, so each converts into the other (Proposition 1 in the notes): learn one and you have learned both. With the score in hand, you can add noise of any strength to the ODE and turn it into an SDE without changing the distribution at any time (Theorem 17). The score itself is learned with the same trick as flow matching, by regressing on the conditional score. On Gaussian paths, that amounts to predicting the noise that was added, which is the DDPM training objective.

B: Guidance and Classifier-Free Guidance | MIT 6.S184 Lecture 3

Feeding the prompt to the network as an extra input should, in theory, sample from p_data(x|y), but in practice the images don't follow the prompt closely enough. Lecture 3B uses Bayes' rule to split the guided vector field into the unguided vector field plus a classifier gradient; scaling that classifier term by w is classifier guidance. Replacing the classifier with the difference between guided and unguided fields gives CFG, which needs no classifier: ũ = (1−w)·u(x|∅) + w·u(x|y). Training only requires swapping the label for a null label ∅ with probability η. The costs: two network calls per step, and for w>1 you are no longer sampling from the data distribution.

U-Nets, DiTs, and Latent Space | MIT 6.S184 Lecture 4

The algorithms are complete by Lecture 3B; Lecture 4 tackles two engineering problems that show up at scale. First, the network must take an image, a time t, and a prompt and output a vector field of the same size, so we use a U-Net or a diffusion transformer (DiT), embedding time with Fourier features and text with frozen CLIP/T5 encoders. Second, pixel space is too big, so we first train a VAE to compress images into a latent space, run flow matching there, and decode at the end. Stable Diffusion 3 and Meta Movie Gen Video both follow this recipe: flow matching in latent space, a DiT variant, and CFG.

Discrete Diffusion, Generating Language with CTMCs | MIT 6.S184 Lecture 5

Text is a sequence of discrete tokens. There is no direction to move in, so ODEs and SDEs do not exist. Lecture 5 carries the recipe from Lectures 1–4 over unchanged and swaps only the underlying stochastic process: vector fields become rate matrices, ODEs become continuous-time Markov chains (CTMCs), and the continuity equation becomes the Kolmogorov forward equation. With the factorized mixture path, the marginal rate matrix has exactly one unknown: the probability of each position's original token given the noisy sequence. Training a discrete diffusion model therefore reduces to per-position classification with a cross-entropy loss. Make the noise all [mask] tokens and you get a masked diffusion language model.

Why Study Generative AI, Course Intro and Colab | NCCU Yen-Lung Tsai Generative AI Lecture 1

The first half of lecture 1 covers course rules and lightning talks. The middle answers "why learn the principles?": Yen-Lung Tsai splits the anxiety of learning AI into three kinds and argues that knowing the principles tells you a model's limits, so you stop chasing every new tool. The second half is a Colab primer, from magic commands and the four standard import lines to plt.plot, Markdown, and ipywidgets. Homework 1 is to plot a function in Colab. On the Chang Gung satellite rubric, a tweaked copy of the demo earns 6 points; a function not taught in class, with well-written Markdown notes, earns 10.

Neural Network Concepts | NCCU Yen-Lung Tsai Generative AI Lecture 2

Lecture 2 opens up last week's "dopey AI robot." Inputs and outputs must become numbers (tensors). Classification uses one-hot labels and softmax to turn scores into probabilities. A neural network is neurons stacked layer by layer, and training means pushing the loss down with gradient descent. The lecture ends by building a first fully connected network on MNIST in Keras and wiring it to a Gradio sketchpad. Homework 2 asks you to design your own DNN, with one hard rule: it can't have three layers. The Chang Gung satellite rubric wants a screenshot of the parameters with the best validation accuracy and encourages keeping failed attempts.

GANs — How Do Two Competing Networks End Up Drawing Pictures? | NCCU Yen-Lung Tsai Generative AI Lecture 3

The prompt "a cute girl" has countless correct pictures, so training it as a function only teaches the model the average of all of them. GANs sidestep this by training two networks: a generator G turns a random latent vector into an image, a discriminator D judges real versus fake, and the two compete. L03 walks from the 2014 paper through WGAN, Progressive GAN, StyleGAN's 512-dimensional latent and AdaIN, then Pix2Pix and CycleGAN. An appendix explains cross entropy and KL divergence as a 'surprise index'. Week 3 homework: run a GAN yourself, or explain CE and KL in your own words.

LLMs Are Simpler Than You Think — Next-Word Prediction, Temperature, and Your Own Benchmark | NCCU Yen-Lung Tsai Generative AI Lecture 4

L04 reduces a large language model to one sentence: look at the preceding words, score every word in the vocabulary, turn the scores into probabilities with softmax, and sample the next word. To give the model a memory of what came before, the lecture covers RNNs and then gives a first look at Transformer Q/K/V. GPT-2's 1.5 billion and GPT-3's 175 billion parameters illustrate scale; temperature and top-p explain why every answer comes out different. The second half covers running open models locally and estimating VRAM. Week 4 homework: write test prompts on a topic you know well and compare at least two LLMs.

Transformers, Explained — Reading Q/K/V, Positional Encoding, and Residuals Through Linear Algebra | NCCU Yen-Lung Tsai Generative AI Lecture 5

L05 reads the whole Transformer with two linear-algebra rules: matrix multiplication is row-times-column dot products, and a row vector times a matrix is a linear combination of the matrix's rows. With those, attention is 'dot the query with every key, softmax into weights, take a weighted average of the values,' or softmax(QKᵀ/√d_k)V in batch form. Dividing by √d_k just pulls the numbers back toward 0 so softmax doesn't become winner-take-all. Then come multi-head attention, encoder versus decoder, masking, positional encoding as a set of sin/cos clocks, and ResNet-style residuals with layer normalization. No homework this week.

LLM Applications and Ethical Challenges — Hallucination, Privacy, DeepSeek, and a One-Paragraph System Prompt Called the Lucky Vicky Generator | NCCU Yen-Lung Tsai Generative AI Lecture 6

The first half of L06 is about ethics. Yen-Lung Tsai quotes Karpathy's line that hallucination is a feature of LLMs, then works through plagiarism, whether your data gets used for training, and DeepSeek's censorship and corpus skew, and closes with seven principles of responsible use. The second half is about applications: give the model the right information and clear instructions, and one system prompt becomes a Lucky Vicky positivity generator, a social-media copywriter, or a biased college-major counselor. The week-6 assignment moves that prompt into an OpenAI-compatible API with a Gradio front end: a chatbot with a persona.

Building Your Own Chatbot — API Keys, Three Roles, Sending the History Back, and Running Models Locally with Ollama | NCCU Yen-Lung Tsai Generative AI Lecture 7

A chatbot 'remembers' you not because the model has memory, but because your code resends the whole messages list (system, then alternating user and assistant) every turn. L07 starts with getting OpenAI and Groq keys, spells out that structure, then runs Gemma 3 locally or in Colab with Ollama, where the same openai package works after changing only base_url. The week-7 assignment offers two options: a version that keeps the conversation going, or two models talking to each other, both demoed in Gradio.

Retrieval-Augmented Generation (RAG) — Chunk the Text, Embed It, Put the Closest Pieces Back in the Prompt | NCCU Yen-Lung Tsai Generative AI Lecture 8

L06 said a prompt is two things: correct information and clear instructions. RAG lets the computer fetch the information part on its own. Split your documents into chunks, turn chunks and questions into feature vectors with the same model fθ, find the closest few chunks, and drop them into a template: 'Answer {question} based on {retrieved_chunks}.' The code comes in two notebooks: Demo06a builds a vector database with LangChain and FAISS and zips it as faiss_db.zip; Demo06b loads it back, connects an LLM, and wraps it in Gradio. The week-8 assignment is to do the same with your own data.

Why 2025 Was Called the Year of AI Agents — Andrew Ng's Four Design Patterns, with Reflection and Two-Stage CoT Built in AISuite | NCCU Yen-Lung Tsai Generative AI Lecture 9

L09 defines an AI agent in one line: the AI finishes the work you would otherwise do yourself. Yen-Lung Tsai follows Andrew Ng's four design patterns (Reflection, Tool Use, Planning, Multiagent Collaboration) but builds only the two easiest. Demo07a hands a draft between a "writer" and a "reviewer" LLM call. Demo07c splits the Lucky Vicky post generator into "think of five reasons, then write the post", a two-stage CoT. Both use AISuite with Groq and a Gradio front end. LangChain, AutoGen and CrewAI appear only on a further-learning list. The week 9 homework asks you to pick one of the two patterns.

The Adventure That Starts with the VAE — Feature Vectors, Autoencoders, Diffusion, and "Without the VAE, Stable Diffusion Doesn't Run" | NCCU Yen-Lung Tsai Generative AI Lecture 10

L10 starts from one question: how do you find a good feature vector? Word2Vec learns embeddings through a pretext task. An autoencoder squeezes out a latent vector by being forced to reproduce its input. A VAE then asks the latent to follow a normal distribution, so nearby points produce similar images. Yen-Lung Tsai then recasts diffusion as "an autoencoder whose encoder is computed and whose decoder is learned", and ends on latent diffusion: a VAE shrinks a 512×512 image to 64×64, and diffusion runs only in that small space. The week 10 homework involves no code: make several style-consistent image sets with Bing.

Text-to-Image AI, Principles and Practice — CLIP Reads the Prompt, Schedulers Decide Whether It Converges, LoRA Learns Only ΔW, and You Build a Web App with diffusers | NCCU Yen-Lung Tsai Generative AI Lecture 11

L11 fills in the rest of the Stable Diffusion diagram. CLIP is trained so that matching text and images get similar vectors, which turns a prompt into a 77×768 embedding. Schedulers compress 1,000 noising steps into twenty or thirty denoising steps, but ancestral samplers such as Euler a never settle: push to 100 steps and the subject changes jackets and seats. LoRA freezes the original W and learns only a ΔW factored into A·B. The hands-on part loads an SD 1.5-family model with diffusers, and the week 11 homework is your own image-generation web app.

ControlNet and Fooocus, or How to Make an Image Model Follow Your Composition | NCCU Yen-Lung Tsai Generative AI Lecture 12

The Stable Diffusion setup from L11 listens only to the prompt, so composition and pose are left to luck. L12 adds a steering wheel. ControlNet copies a block of SD and wires the copy back in through zero convolutions, so extra conditions such as edge maps, poses, and depth maps can steer generation. The standard example is Canny edges. The second half covers Fooocus, an SD interface that aims to be 'as simple as Midjourney': Presets, Styles, and the five Input Image features, where Image Prompt is ControlNet with a friendly wrapper. Week 12 homework: pick a use case, make at least 3 image sets in Fooocus, and write up your creative process.

Reinforcement Learning, from AlphaGo to the RLHF That Makes LLMs Bluff Less | NCCU Yen-Lung Tsai Generative AI Lecture 13

Every model in the first 12 lectures learned from training data that people prepared. L13 asks a different question: when there is no right answer, only a signal of how well you did, how does a computer learn? Tsai starts from AlphaGo and Breakout and splits the field in two. Value-based methods learn a Q function that scores each action (Deep Q-Learning, TD, experience replay, ε-greedy); policy-based methods learn the action directly (policy gradient, actor-critic). The second half returns to LLMs: ChatGPT trains a reward model from human rankings and then runs RLHF with PPO, while DeepSeek has the computer check math answers automatically and uses that as the reward. Week 13 homework is the final project proposal.

Text and Image Models Invade Each Other's Territory, Plus the Final Project | NCCU Yen-Lung Tsai Generative AI Lecture 14

The last lecture looks at two lines of technology crossing into each other. LLMs such as ChatGPT have started drawing, and the slides use early fusion plus VQ-VAE/VQGAN to explain how an image can be cut into tokens. Going the other way, Inception Labs' Mercury generates text with diffusion, noising a sentence into a row of [MASK] tokens and then restoring it. Next come a few papers anyone can use: evaluating RAG automatically, reasoning models being easier to hijack, and DeepMind's four kinds of AI risk. The lecture ends with vibe coding and a list of application tools, and the final project runs as an online conference in Gather Town.

Reading NCCU Yen-Lung Tsai's Generative AI: Overview and Self-Study Route | NCCU Yen-Lung Tsai Generative AI Course Overview

Generative AI: Text and Image Synthesis Principles and Practice is an introductory course taught by Yen-Lung Tsai (蔡炎龍) of NCCU's Department of Mathematical Sciences and opened to other schools as a TAICA satellite course. The most complete course page online actually belongs to the Chang Gung University satellite section, where Chih-Yuan Yang is the co-teacher. This series follows Spring 2025 (semester 1132): 14 recordings, 14 slide decks, and 12 homework specs with rubrics are public, and the demo notebooks are on GitHub, so the access grade is A3. The gaps: the notebooks keep changing, submission and grading run through each school's LMS, and final projects were never published.

NTHU NLP Guide 8: ELMo, BERT, T5, BART, GPT and the Three Roads to Pretraining | NTHU Hung-Yu Kao Natural Language Processing Topic Guide

A guide to the BERT and its Family unit of Prof. Hung-Yu Kao's NLP course at NTHU (Fall 2025). It starts from "I record the record": Word2Vec and GloVe give both records the same vector. ELMo fixes this with a bidirectional LSTM language model. With Transformers, pretraining splits into three roads: encoders (BERT: MLM plus NSP, strong at understanding, weak at generation), encoder-decoders (T5's span corruption, BART's five noise types), and decoders (GPT: pure next-token prediction). The last part covers GPT-3's in-context learning and scaling laws, and why decoders became today's dominant backbone.

NTHU NLP Guide 10: Why the Same Model Sounds Stiff or Rambles — Decoding Strategies and NLG Evaluation | NTHU Hung-Yu Kao Natural Language Processing Topic Guide

A guide to the decoding and evaluation unit in NTHU Prof. Hung-Yu Kao's NLP course (Fall 2025). The first half covers how to pick a word once the model outputs a probability distribution: greedy decoding can't take back a mistake, beam search keeps several candidates but favors short outputs, and top-k / top-p trade determinism for diversity (missing from the slides; the professor covers it verbally in class). The second half covers scoring generated text: BLEU's modified precision and brevity penalty, ROUGE-N and ROUGE-L, perplexity, and what GLUE, SQuAD 2.0, MTEB, and MMLU each measure.

NTHU NLP Guide 11: GPT-2 vs. T5 for Chinese Summarization — Left Padding, −100, and ROUGE | NTHU Hung-Yu Kao Natural Language Processing Topic Guide

A guide to the GPT-2 / T5 tutorial in NTHU Prof. Hung-Yu Kao's NLP course (Fall 2025). One task, LCSTS Chinese summarization, is solved twice. Decoder-only GPT-2 is written in native PyTorch: you join article and summary into one sequence, switch to left padding, and set padding labels to −100. Encoder-decoder mT5 uses Seq2SeqTrainer: no left padding needed, and DataCollatorForSeq2Seq handles the −100 for you. Both segment with jieba and score word-level ROUGE.

Reading NTHU Kao's NLP: GPT-3, InstructGPT, and RLHF — How a Model That Continues Text Becomes an Assistant That Follows Instructions | NTHU Hung-Yu Kao Natural Language Processing Topic Guide

Hung-Yu Kao's Fall 2025 W8 slides walk from GPT-1 to GPT-3, explain how the Sparse Transformer behind GPT-3 cuts attention cost, and then use InstructGPT to show the gap between continuing text and following instructions. The maximum likelihood objective can't tell a fabricated fact from a slightly wrong synonym, so three extra stages are added: SFT learns how humans write, a reward model learns how humans grade, and PPO optimizes against that grade while a KL penalty keeps the model from drifting too far. The lecture closes with Llama-2: separate safety and helpfulness reward models, context distillation, and GQA for faster inference.

NTHU NLP Guide 9: One BERT That Scores and Classifies at Once — The Hugging Face Tutorial and HW3 Multi-Output Learning | NTHU Hung-Yu Kao Natural Language Processing Topic Guide

A guide to the Hugging Face BERT tutorial and HW3 in NTHU Prof. Hung-Yu Kao's NLP course (Fall 2025). The tutorial walks through binary IMDb sentiment classification: AutoTokenizer, the input_ids / token_type_ids / attention_mask fields, AutoModelForSequenceClassification, and Trainer. HW3 applies the same tools to SemEval 2014 Task 1: one bert-base-uncased with two heads, one regressing a 1–5 relatedness score and one classifying entailment into three classes. You add the two losses and write the training loop yourself, because Trainer is not allowed.

Testing Word Vectors on Google Analogy — Pretrained GloVe vs. Word2Vec Trained on 20% of Wikipedia | NTHU Hung-Yu Kao Natural Language Processing Assignment 1

HW1 tests word vectors on the 19,544 Google Analogy questions (8,869 semantic, 10,675 syntactic). You first answer them with pretrained glove-wiki-gigaword-100 loaded through Gensim, then train your own Word2Vec on a 20% sample of a pre-cleaned Wikipedia dump, and plot t-SNE for the family subcategory both times. Seven TODOs are worth 55%, the report 45%. Fall 2026 keeps the same TODOs but asks for an .ipynb with outputs.

Why Language Is Hard, and How Text Became Numbers Before LLMs | NTHU Hung-Yu Kao Natural Language Processing Week 1

Week 1 of Hung-Yu Kao's NLP course at NTHU is a 91-page deck, W1_NLP_brief. It opens with 'Watch for kids', five readings of the telescope sentence, and a Chinese tongue-twister about eleven uncles to show why language is hard. Then, from an information-retrieval angle, it builds one pipeline: inverted index, tokenization, stemming, TF-IDF, BM25. The second half hits that pipeline's dead ends (synonyms, polysemy, vocabulary mismatch), moves to SVD-based LSA, and closes with a preview of dense vectors through Skip-gram, GloVe, and FastText.

Natural Language Processing: A Learning Path from Text Representations to Language Models | NTHU Hung-Yu Kao Natural Language Processing Course Overview

NTHU Professor Hung-Yu Kao's Natural Language Processing covers one line in a semester: turn text into numbers (TF-IDF, word vectors), handle sequences (RNNs, attention, Transformers, sub-words), pretrained models (BERT, T5, GPT, decoding and evaluation), make models follow instructions and fine-tune with few parameters (RLHF, PEFT), then plug in outside knowledge (RAG) and reasoning. Fall 2025 slides, 32 recordings, 4 assignments, and starter notebooks are all public on GitHub; lectures are in Mandarin; there are no public solutions.

NTHU NLP LLM API Lab: NLI Classification with Gemini, OpenAI, and Claude, Using prompts.yaml, JSON Output, Few-Shot, and Token Counts | NTHU Hung-Yu Kao Natural Language Processing Tutorial

This 34-slide TA session answers a practical question. Pasting data into the ChatGPT web page one row at a time is slow and hits hourly limits, so research and homework should use the API. The notebook runs one SemEval 2014 entailment example through Gemini, Claude, and OpenAI in turn: prompts live in prompts.yaml, output is forced into JSON, then few-shot and token counting. The material is from 2024. The slide cover says 2024/11/21, and the notebook uses gemini-1.5-pro, gpt-4o, and claude-3-5-sonnet-20241022. That Claude model was retired on 2025-10-28, and Google's old Gemini SDK reached end of support on 2025-11-30.

Reading NTHU Kao's NLP: Parameter-Efficient Fine-Tuning — Fine-Tuning Large Models Without an A100 Cluster | NTHU Hung-Yu Kao Natural Language Processing Topic Guide

Hung-Yu Kao's Fall 2025 PEFT slides open with a budget: full fine-tuning of Llama 2-7B in 16-bit needs about 56GB of GPU memory, while training only 0.2M parameters brings it down to about 17GB, because gradients and optimizer states nearly vanish. Intrinsic dimensionality then explains why tuning a small slice is enough: the longer a model is pretrained and the larger it is, the fewer effective dimensions fine-tuning needs. Methods fall into additive (Adapters, Prompt Tuning), selective (BitFit), reparametrization (LoRA), and hybrid (MAM Adapters, S4). The second half runs from GPT-2's task descriptions and verbalizers to the trade-offs between prefix tuning and soft prompt tuning.

Arithmetic as a Language — PyTorch TA Session, a Two-Layer LSTM, and Teacher Forcing | NTHU Hung-Yu Kao Natural Language Processing Assignment 2

HW2 treats expressions like "14*(43+20)=882" as character sequences and asks a two-layer LSTM to generate the answer one character at a time after it sees "=". The training set has 2,369,250 rows and the eval set 263,250, with every number in 0–49. Six TODOs run from building a vocabulary and batching with loss only after "=" to a generator, teacher-forced training, and exact-match evaluation. The W4 PyTorch TA session is the toolbox for it.

Building a Cat-Facts RAG Two Ways, with LangChain and by Hand | NTHU Hung-Yu Kao Natural Language Processing Assignment 4 / Tutorial

Each of the two RAG TA sessions builds one version. The first installs Ollama on Colab to run llama3.2:1b and wires up a minimal RAG with LangChain's Chroma, MMR, and retrieval chain. The second uses LangChain only for data prep and writes the rest by hand: chunking, text and vector stores, hybrid BM25 + cosine retrieval merged with RRF, then generation with Llama-3.2-1B-Instruct. HW4 applies the first session's skeleton to 150 cat facts and 150 GPT-5-generated QA pairs. The generator must be Llama3.2-1b and the embedding model jina-embeddings-v2-base-en, and you report recall@1, recall@5, and exact match. Code is 45% of the grade and the report 55%; the report analyzes how prompts, data format, document order, and counterfactual information change the results.

NTHU NLP RAG, Part 2: Connecting the Retriever to a Reader, from ORQA and REALM to Self-RAG | NTHU Hung-Yu Kao Natural Language Processing Topic Guide

The second half of W11_RAG.pdf starts at the "From Retrievers to QA" slide and turns a retriever plus a reader into a full QA system. It begins with ORQA and REALM (2019–2020), where BERT is the reader, then covers the first paper named RAG and REPLUG, which keeps the LLM frozen. A single table then sorts seven recent fixes into three groups: rewrite the query (Query Rewriting, HyDE), make the generator robust to noise (RetRobust, RAFT, RAAT), and decide when to retrieve (FLARE, Self-RAG). It ends with noise types, four abilities an LLM needs inside RAG, and generative retrieval (GR) with reliable response generation (RRG). On the recording side, the W11 Thursday lecture stops at the RAG paper; I could not find a recording that covers the later slides.

Reading NTHU Kao's NLP: RAG (Part 1) — Hallucination and Retrievers, from BM25 to DPR and GTR | NTHU Hung-Yu Kao Natural Language Processing Topic Guide

An LLM will confidently answer that Oppenheimer was born in 1967 (the year he died). RAG retrieves first and generates second. The first 60 pages of Hung-Yu Kao's Fall 2025 RAG deck are all about finding the right material. Sparse vectors (bag-of-words, TF-IDF, BM25) are cheap and dependable; dense vectors catch paraphrases. BERT's [CLS] isn't a good sentence vector as-is, hence Sentence-BERT pooling and bi-encoders. A cross-encoder is accurate but needs nearly 50 million passes for 10,000 sentences, while a bi-encoder needs 20,000. SimCSE uses dropout as data augmentation, DPR beats BM25 with only 1,000 training examples, and GTR shows that scaling up a dual encoder improves out-of-domain retrieval.

NTHU NLP W3: When Input and Output Lengths Differ — Seq2seq, LSTM, and Attention | NTHU Hung-Yu Kao Natural Language Processing Topic Guide

"Look over there" is 3 tokens, the Chinese version 4, the Japanese version 12. When output length does not track input length, the classifier trick of adding an FFN at the end fails. This 33-slide deck starts from encoder-decoder models, works through vanishing gradients in RNNs and the three LSTM gates, and ends with attention fixing both long-range memory and parallelism, including why scores are divided by √d.

NTHU NLP Guide 7: Sub-word Tokenization, or Why a Model's Vocabulary Is Made of Word Pieces | NTHU Hung-Yu Kao Natural Language Processing Topic Guide

A guide to the Sub-word Tokenization unit of Prof. Hung-Yu Kao's NLP course at NTHU (Fall 2025). Splitting on white space only works for Western languages and cannot handle unseen words or German-style compounds. BPE starts from characters and repeatedly merges the most frequent adjacent pair into the vocabulary, so each merge adds one entry; its weakness is that the greedy split is not always the best one. The Unigram LM picks splits by probability and can even sample different ones. The slides give vocabulary sizes of 30522 for BERT, 50257 for GPT-2/GPT-3 and 32,128 for T5.

NTHU NLP Course Summary and LLM Reasoning Notes: A Three-Column Map of the Semester, Then Denny Zhou's Question of Whether Pretrained Models Can Reason | NTHU Hung-Yu Kao Natural Language Processing Topic Guide

In week 14 of Fall 2025, Hung-Yu Kao closed the course with two slide decks. Course_summary sorts the semester into three columns (NLP Fundamentals, NLP Models, NLP Advances), adds two columns for the TA labs, and lists five directions for further study. The second deck is his notes on Denny Zhou's (Google DeepMind) April 2025 Stanford talk. Its claim: pretrained models can already reason, and decoding is what brings it out. CoT decoding, self-consistency and retrieval + reasoning add up to four inequalities. The Fall 2026 W16 'Reasoning / Agent' unit has not been released yet.

NTHU NLP Term Project and the Fall 2026 Redesign: A 30% Group Project Becomes an In-Person W14 Midterm, Plus Reasoning/Agentic AI, an AI-TA and TAICA Compute | NTHU Hung-Yu Kao Natural Language Processing Topic Guide

Fall 2025 was graded 70% assignments + 30% term project. Projects were done in groups of 3–4 and split into Proposal 6%, Progress 6%, Poster 6% and Report 12%, with no GPUs provided. The repo has no project spec, only the syllabus structure, an end-of-term reminder and the W15–W16 recordings. Fall 2026 switches to 75% assignments (4 of them) + a 25% in-person midterm in W14. The schedule drops the presentation weeks, adds a Reasoning/Agent unit, and brings in an AI-TA for grading support and TAICA compute credits. The official materials don't say why.

NTHU NLP Guide 6: Without the RNN, How Does a Transformer Know How Words Relate and Where They Sit? | NTHU Hung-Yu Kao Natural Language Processing Topic Guide

A guide to the Transformer unit of Prof. Hung-Yu Kao's NLP course at NTHU (Fall 2025). The slides start from two RNN problems: words interact only across O(N) steps, and time steps cannot run in parallel. Self-attention lets every word look at every other word and computes it all in one matrix multiplication, fixing both at once. The cost is that the model can no longer tell word order, so sinusoidal positional encoding is added. The lecture then assembles multi-head attention, Add & Norm, feed forward, cross-attention, masked attention and teacher forcing, and closes with GPT-2, ViT and four variants to show how far the architecture went.

Word Embeddings and Language Models, from Counting N-grams to RNNs | NTHU Hung-Yu Kao Natural Language Processing Week 2

Week 2 of Hung-Yu Kao's NLP course at NTHU is a 62-page deck about predicting the next word. The first part covers statistical language models with a bigram count table, add-one smoothing, and perplexity, then sparse vectors through a PPMI example with cherry and digital. The middle returns to Word2Vec's negative sampling and uses the Chinese word for 'apple' to show why contextualized embeddings are needed. The last part derives RNNs from three weaknesses of feedforward networks and shows how they handle NER, sentence classification, and stacked and bidirectional variants.

Attention and the Transformer | NTU Yun-Nung Chen Applied Deep Learning Lecture 4

An RNN translator has to squeeze the whole source sentence into one vector, and long sentences don't fit. Attention lets the decoder look back at every input position each time it produces a word, score each one, and take a weighted sum. Call the scorer the query, the thing being scored the key, and the thing being averaged the value, and you have dot-product attention. The Transformer goes one step further: the input attends to itself, recurrence disappears, and in return you get parallelism and a constant path length. The price is that position information has to be added back by hand.

Tokenization and BERT: How Words Are Split and How Representations Become Contextual | NTU Yun-Nung Chen Applied Deep Learning Lecture 5

This lecture has two halves. The first covers tokenization: with whole words as units, unseen words can only become UNK; with characters as units, meaning cannot be put back together. The compromise is subwords, and a common way to build them is BPE: start from characters and repeatedly merge the most frequent adjacent pair. The second half covers BERT: a static word vector gives "apple" one embedding and cannot tell the fruit from the company. ELMo uses a language model to produce contextual representations, and BERT replaces the LSTM with a Transformer, pre-trains with a masked LM that hides 15% of tokens plus next sentence prediction, and then fine-tunes the whole model on downstream tasks.

Learning Without Labels and Multimodality: How to Learn Good Representations When There Are No Annotations | NTU Yun-Nung Chen Applied Deep Learning Lecture 14

A lot of data does not mean a lot of annotation. This lecture asks: with no annotations, how do you learn useful representations from data? The shared idea is to find the latent factors behind the observations. An auto-encoder compresses the input into a short code and reconstructs it. A VAE additionally requires the code to follow a Gaussian distribution, so it can generate by sampling from the distribution. Dual learning lets two tasks that run in opposite directions serve as each other's feedback. Self-supervised learning divides into self-prediction (hide a part and guess it back) and contrastive learning (pull similar ones together, push dissimilar ones apart). CLIP does contrastive learning on image-text pairs, so image classification needs no separate training; DALL·E 2 then uses its representations to generate images. The lecture ends with multimodal models: projecting images into the language model's space, and streaming interaction that listens while deciding when to speak.

Dialogue Systems and Tool Use: From Four Modules to LLMs That Look Things Up and Ask Back | NTU Yun-Nung Chen Applied Deep Learning Lecture 13

A dialogue system that helps a user get something done is traditionally split into four modules: understand the utterance, track the state so far, decide the next action, and write the action as a sentence. A language model can act out all four in one go, and without external tools its "let me check" checks nothing. The first half of this lecture therefore covers representative systems that let a model use tools: LaMDA drafts first and then verifies and revises, BlenderBot adds search and long-term memory, WebGPT learns to search from records of human actions, and Toolformer has the model generate and filter its own training data. The second half moves from a single reply to multiple turns: the model can ask the user, learn an expert's strategy, and guess what the other party is thinking. It ends with how conversations are evaluated.

Applied Deep Learning: A Learning Path through Concepts, Assignments, and Implementation | NTU Yun-Nung Chen Applied Deep Learning Course Overview

NTU Professor Yun-Nung (Vivian) Chen's Applied Deep Learning (ADL) is a deep learning course centered on NLP, with 14 lectures in four segments: neural networks and backpropagation; sequences and Transformers (word vectors, RNNs, attention, BERT); putting pretrained models to work (prompting, instruction tuning, RLHF, LoRA, RAG, decoding and evaluation); and LLM issues and frontiers (bias and safety, language agents, reasoning, tool use, multimodality). Fall 2025 slides and segmented videos are public; only HW1 has a full spec, while HW2, HW3, and the final project have only briefing videos.

Bias, Safety, Hallucination, and Alignment: What Problems Pre-Trained Models Carry and How Each Is Handled | NTU Yun-Nung Chen Applied Deep Learning Lecture 10

Models trained on large amounts of web data have three kinds of problems, each paired with a goal. Bias comes from the model attending to the majority and sacrificing minorities, and the goal is fairness; bias can enter at any step from data to evaluation, and can be addressed through data, the loss function, or interface design. Harmful content sits in the long tail of the data distribution, and the goal is safety; safeguards can be placed at four levels (training data, input, training, and output), and jailbreaking is the attempt to get around them. For hallucination the goal is factuality; a long answer can be split into minimal claims that are checked one by one, and that score can be fed back to train the model. The usual corrective for all three is alignment, yet a reward model is imperfect, optimizing against it too far makes things worse, and preference data carries biases of its own.

Chinese Extractive QA: Finding the Answer Span Among Four Paragraphs | NTU Yun-Nung Chen Applied Deep Learning Assignment 1

HW1 in ADL Fall 2025 gives a question and four Chinese paragraphs. The model first picks the relevant paragraph (paragraph selection, framed as four-way multiple choice), then marks the answer's start and end inside it (span selection), scored by Exact Match. The spec slides point you straight at Hugging Face's run_swag_no_trainer.py and run_qa_no_trainer.py. The simple baseline uses bert-base-chinese, length 512, effective batch size 2, and learning rate 3e-5, and both stages together take under three hours on an 8GB RTX 3070. The Kaggle leaderboard closed 9/29, and code plus report were due 10/1 on NTU COOL. Outside readers cannot get the Kaggle data or grading, but the task design, baseline settings, and five report questions are all usable for practice.

Reasoning, Memory, Planning, and Multi-Agent Systems in Language Agents | NTU Yun-Nung Chen Applied Deep Learning Lecture 11

Lecture 11 of ADL Fall 2025 builds on the EMNLP 2024 Language Agents tutorial. It defines an agent as an entity that perceives and acts, then names what is new about language agents: reasoning itself counts as an internal action. The lecture is organized around three concepts. Reasoning covers CoT and ReAct; memory covers Generative Agents and its recency / importance / relevance retrieval; planning goes from greedy reactive planning to tree search and world models. It closes with multi-agent systems in three steps: initialization, orchestration, and team optimization.

What Machine Learning and Deep Learning Are | NTU Yun-Nung Chen Applied Deep Learning Lecture 1

The first ADL lecture has no math and sets up two ideas. First, machine learning gives a machine many input-output pairs and lets it find the function that turns one into the other; deep learning chains many simple functions into a production line, supplies data only at the two ends, and lets the machine learn what every station does. Second, to solve a problem with deep learning, write down the input X and the output Y: the form of the output decides whether the task is classification or sequence prediction, and the properties of the input decide which network fits. Along the way it answers two questions: why the breakthrough waited until after 2010 (data and GPUs), and why networks go deep instead of fat.

Neural Networks and Backpropagation | NTU Yun-Nung Chen Applied Deep Learning Lecture 2

Training a model means answering three questions. What is the model: layers of neurons, each computing z = Wa + b followed by a non-linearity; one neuron draws only one boundary, so it cannot compute XOR, and stacking layers can. What does a good function mean: define a loss, and smaller is better. How to pick the best: gradient descent takes a step along the slope where it stands, and practice uses mini-batch SGD. With millions of parameters, gradients come from backpropagation: a forward pass stores every layer's output, a backward pass computes δ from the output layer back, and their product is each weight's gradient. The guide works each of these through with numbers.

Decoding, Generation Control, and Evaluation for NLG | NTU Yun-Nung Chen Applied Deep Learning Lecture 9

Lecture 9 of ADL Fall 2025 answers two questions. The model gives you a probability distribution at every step, so how do you pick a word from it? And once you have a sentence, how do you judge it? The slides start with teacher forcing and exposure bias to show the gap between training and generation, then compare greedy, beam search, sampling, top-k, and nucleus sampling, and file temperature and the penalties under 'control' rather than decoding algorithms. The evaluation half covers BLEU, ROUGE, perplexity, and LLM-Eval, then explains why you would use RL to optimize whole-sentence quality directly.

Post-Training and Efficient Adaptation: How a Model Learns to Follow Instructions and How to Tune It Cheaply | NTU Yun-Nung Chen Applied Deep Learning Lecture 7

A pre-trained model continues text well and still may not do what an instruction asks. The first half of this lecture covers the two steps of post-training: instruction tuning uses many different tasks to teach the model to read task descriptions, and RLHF then moves the model toward whole responses that people prefer, with a reward model and pairwise comparisons handling the cost of human labor and inconsistent scores, while DPO and KTO drop the reinforcement-learning part. InstructGPT and ChatGPT are these two steps chained together. The second half covers LLM adaptation: models are too large to fine-tune in full, so only a small number of parameters are trained, with Adapter, LoRA, and prompt tuning, and no single method is best on every task.

Three Pre-training Families and Prompt Learning: From BERT, GPT, and T5 to Soft Prompts | NTU Yun-Nung Chen Applied Deep Learning Lecture 6

Pre-training lets a model learn general abilities from large unlabeled data before the task is known. There are three architectures: encoders see both directions and suit understanding; decoders see only the left, can generate, and are the type that won; encoder-decoders pre-train by denoising. Pre-training plus fine-tuning hits two obstacles, scarce labels and oversized models. GPT-3's in-context learning performs tasks with no parameter update, followed by hard prompts (a template plus a verbalizer, LM-BFF) and soft prompts that train vectors directly (P-Tuning, Prefix-Tuning). Soft prompts did better at the time, but what survived is prompting with no training at all.

RAG: Looking Things Up Before Answering When the Model Cannot Remember or Is Out of Date | NTU Yun-Nung Chen Applied Deep Learning Lecture 8

A language model stores knowledge in its parameters: rare facts are poorly remembered, events after training are unknown, internal company documents were never seen, and answers cannot be checked. RAG lets it take the exam open-book: retrieve relevant passages for the question first, then hand them to the model with the question. This lecture covers how retrieval is done (chunking, sparse and dense retrieval, bi-encoders and cross-encoders, training a retriever without labeled pairs), what can be added before and after retrieval (query rewriting, reranking, multiple rounds of retrieval), the lines along which RAG developed (what to retrieve, how to use it, when to retrieve), and finally which situations suit prompting, RAG, or fine-tuning.

Reasoning: From CoT and Test-Time Scaling to RL for Reasoning | NTU Yun-Nung Chen Applied Deep Learning Lecture 12

With pre-training data close to exhausted, models now improve by thinking more before they answer. Lecture 12 of NTU ADL covers this in two halves. The first is test-time scaling: the model stays fixed and inference spends more compute, through short CoT, parallel sampling followed by selection (majority voting, answer confidence, an outcome reward model), step-level scoring with a process reward model combined with search, and sequential revision. The second is learning to reason: the weights are updated, with reasoning data written by people, generated by the model and filtered, or produced by a stronger teacher model, or with reinforcement learning that only tells the model whether its answer was right, as in DeepSeek-R1-Zero.

Word Vectors, Language Models, and RNNs: How to Represent a Word and Predict the Next One | NTU Yun-Nung Chen Applied Deep Learning Lecture 3

This lecture has one through-line: a language model estimates the probability of a word sequence by predicting the next word one step at a time. It first covers how to represent a word, from dictionaries, one-hot vectors, and co-occurrence matrices to low-dimensional word embeddings. It then covers three generations of language models: n-grams count, and unseen combinations get zero probability; a neural LM predicts with a network, and similar words share probability automatically; an RNN LM accumulates all previous words in a hidden state and shares one set of weights across time steps. RNNs are trained with BPTT, multiplying by the same matrix many times makes gradients vanish or explode, clipping handles explosion, and the gating in LSTM and GRU handles vanishing. Finally, applications are divided by the shape of input and output into whole-sequence classification, tagging, and encoder-decoder.

From PyTorch and Hugging Face to LoRA, Quantization, and vLLM Deployment | NTU Yun-Nung Chen Applied Deep Learning Tutorial

The ADL Fall 2025 course page schedules seven TA recitations across ten videos: Colab and PyTorch, ipdb debugging → the life of an NLP project → data formats for four NLP task types → LoRA and QLoRA → scaling laws, the LLaMA architecture, and MoE → quantization and evaluation → deployment with vLLM. The videos were recorded by the TA in 2023 and 2024 and reused in Fall 2025, so the Homework 1 and Homework 3 they mention are those years' assignments. The course page's five slide links all return 404; files with the same names open under the Fall 2024 path, and Deployment has a video only. This guide follows what the TA actually demonstrates and warns about in each session, with examples you can work by hand.

Blending and Bagging: Why Combining Hypotheses Works Better | NTU Hsuan-Tien Lin Machine Learning Techniques Lecture 7

With T hypotheses gₜ in hand, you can do more than pick one by validation: give each one vote (uniform blending), learn a set of ballot counts (linear blending), or learn another model that combines them (the form the handout calls any blending, also named stacking). This lecture proves in six lines of algebra that, under squared error, the averaged G is never worse than the average performance of the gₜ, and the gap is exactly how spread out the gₜ are, which is the variance. Finally, bootstrapping re-samples T data sets from the one data set you have, trains one gₜ on each, and lets them vote; that is bagging.

Machine Learning Foundations and Techniques: From "Can Machines Learn?" to Three Ways of Handling Features | NTU Hsuan-Tien Lin Machine Learning Foundations & Techniques Course Overview

Foundations spends 16 lectures on four questions: when machines can learn, why they can (Hoeffding, growth functions, VC dimension), how (linear and logistic regression, nonlinear transforms), and how to learn better (regularization, validation). Techniques spends 16 more on three ways of handling features: kernels embed features in high dimensions (SVMs), aggregation combines hypotheses (AdaBoost, random forests, GBDT), and extraction learns hidden features (neural networks, matrix factorization). All 130 YouTube videos are free; practice with the Fall 2024 HW0–HW7.

Decision Trees: How C&RT Splits and Prunes | NTU Hsuan-Tien Lin Machine Learning Techniques Lecture 9

A decision tree is a model that learns conditional aggregation as it goes: every path from the root to a leaf is a condition, and the leaf is a constant. C&RT splits the data in two with one decision stump at a time, picks the split with the smallest weighted impurity, and keeps going until nothing can be split. A tree grown this way almost always has E_in equal to 0, so it is pruned with "E_in plus λ times the number of leaves", with λ chosen by validation. The same recursion also handles multiclass problems, categorical features, and missing values.

Feasibility of Learning: Hoeffding's Inequality and Guarantees Outside the Data | NTU Hsuan-Tien Lin Machine Learning Foundations Lecture 4

This lecture first shows that the data D alone cannot determine the answer outside D (No Free Lunch), then adds one assumption: the data and the future inputs are drawn independently from the same distribution. Hoeffding's inequality then guarantees that, for a hypothesis h fixed in advance, the probability that E_in and E_out differ by more than ε is at most 2exp(−2ε²N). An algorithm has to choose among M hypotheses, so the bound is multiplied by M and becomes 2M exp(−2ε²N); with finitely many hypotheses, enough data, and a small E_in, learning is feasible.

Finale: Three Families of Techniques Across the Whole Course | NTU Hsuan-Tien Lin Machine Learning Techniques Lecture 16

Techniques Lecture 16 has no new model. It re-sorts the models of the first 15 lectures by three questions: where the features are hidden (kernel, aggregation, extraction, low-dimensional projection), how the error is brought down (gradients, equivalent problems, multiple steps), and how to hit the brakes when the model is too powerful (regularization, validation). This article works PCA plus AdaBoost-Stump on eight points from start to finish and checks the answer against each of the three questions; it closes by keeping the ReLU, Xavier/He initialization, momentum, RMSProp, and Adam material that the Fall 2024 on-campus course added.

Foundations Homework: What Fall 2024 HW0–HW5 Practice and Need | NTU Hsuan-Tien Lin Machine Learning Foundations & Techniques Assignments 0–5

Fall 2024 had six Foundations assignments. HW0 is 20 multiple-choice math prerequisite questions. HW1–HW5 each have 12 problems plus a bonus: Q1–4 are auto-graded, Q5–12 are graded by TAs, the programming problems use rcv1, cpusmall, and mnist from the LIBSVM datasets site, and HW5 uses LIBLINEAR. HW1 and HW2 each include a problem where you argue with a ChatGPT-style answer. Fall 2026 has released hw0 and hw1: hw1 is now 16 multiple-choice problems with 4 secretly chosen for TA grading, and the data is the course's own hw1_train.dat. The new policy allows AI tools and vibe coding, but AI-generated code needs block-by-block comments in your own words. Neither semester publishes official solutions.

Kernel Logistic Regression: The SVM Is a Regularized Model | NTU Hsuan-Tien Lin Machine Learning Techniques Lecture 5

The ξₙ of the soft-margin SVM can be written directly as max(1 − yₙ(wᵀzₙ + b), 0), which turns the whole problem into ½wᵀw plus C times the sum of hinge errors: an L2-regularized model in which C corresponds to 1/(2λ). The hinge error and logistic regression's cross-entropy are both convex upper bounds of the 0/1 error, so the SVM approximates L2-regularized logistic regression. There are two routes to probability outputs: Platt's two-level learning learns only two extra numbers, A and B; the representer theorem guarantees that the optimal w is a linear combination of the zₙ, so kernel logistic regression can be done directly in the Z space, at the price that the N coefficients βₙ are usually all nonzero.

Kernel SVM: Inner Products Without Computing High-Dimensional Features | NTU Hsuan-Tien Lin Machine Learning Techniques Lecture 3

The dual SVM's variable count no longer depends on the feature dimension d̃, but every entry of the Q matrix is still one d̃-dimensional inner product. This lecture merges "transform + inner product" into a single kernel function K(x, x′); for the second-order transform the inner product takes only O(d). Once training, computing b, and prediction all use K, the SVM never touches the Z space. Pushed to the limit, the same move gives the Gaussian kernel, which corresponds to an infinite-dimensional transform, at the price that too large a γ still overfits.

The Learning Problem: When Machine Learning Is the Right Tool | NTU Hsuan-Tien Lin Machine Learning Foundations Lecture 1

Foundations Lecture 1 defines machine learning as "use data to compute a hypothesis g that approximates the target f" and gives three conditions for deciding whether to use it: there is a pattern to learn, there is no programmable definition, and there is data. The skeleton of the whole lecture is one flow chart: an unknown f generates the data D, and an algorithm A picks g from a hypothesis set H. A plus H is called the learning model, and the next 15 lectures keep swapping parts on this chart.

Linear Models for Classification: Three Error Functions, SGD, and Multiclass | NTU Hsuan-Tien Lin Machine Learning Foundations Lecture 11

PLA, linear regression, and logistic regression all start by computing the score s = wᵀx, and all three errors can be written as functions of ys. The squared error and the cross-entropy rescaled to log₂ both sit above the 0/1 error, so making the regression E_in small also gives a guarantee on the classification E_out. Next, replacing the average over N examples in the gradient with one randomly drawn example gives SGD at O(1) per step. Finally, OVA (K classifiers, take the highest score) and OVO (K(K−1)/2 classifiers, vote) assemble binary classifiers into a multiclass classifier.

Linear SVM: Writing the Fattest Separating Line as a Quadratic Program | NTU Hsuan-Tien Lin Machine Learning Techniques Lecture 1

Many lines classify all the data correctly; this lecture picks the one farthest from its nearest data point, the fattest one. After scaling (b, w) so that min yₙ(wᵀxₙ+b)=1, the largest margin is the same as minimizing ½wᵀw subject to yₙ(wᵀxₙ+b)≥1 for every point, which can go straight to a quadratic programming solver. Fatness helps for two reasons: it is weight decay within E_in=0, and it reduces the dichotomies that can be produced.

Linear Regression: The Pseudo-Inverse Solution in One Step | NTU Hsuan-Tien Lin Machine Learning Foundations Lecture 9

Linear regression writes the squared error as (1/N)‖Xw − y‖², sets the gradient to zero, and gets w_LIN = X†y with no iteration. The hat matrix H = XX† projects y onto the space spanned by the columns of X, and trace(I − H) = N − (d+1), which gives average E_in = σ²(1 − (d+1)/N) and average E_out = σ²(1 + (d+1)/N). Squared error is also an upper bound on the 0/1 error, so w_LIN can be used for binary classification too.

Neural Networks: How Backpropagation Computes Gradients | NTU Hsuan-Tien Lin Machine Learning Techniques Lecture 12

A linear aggregation of perceptrons can implement AND and OR but not XOR; one more layer can, and that is the multi-layer perceptron. This lecture replaces the sign in the middle with tanh, puts linear regression at the output layer, and derives backpropagation from the chain rule: compute every layer's output x forward, then compute δ backwards from the output layer, and the gradient of each weight is the previous layer's x times this layer's δ. It ends with two troubles in training: E_in is non-convex, so the initial weights should be small and random; d_VC is roughly O(VD), so weight elimination and early stopping are needed against overfitting.

Hazard of Overfitting: How Noise, Data Size, and Model Complexity Combine | NTU Hsuan-Tien Lin Machine Learning Foundations Lecture 13

Overfitting is the process in which switching to a more powerful model lowers E_in but raises E_out. This lecture runs experiments with two learners, one who only knows polynomials up to order 2 and one who knows them up to order 10, and arrives at four causes: too little data, too much stochastic noise, too much deterministic noise (a target that is too complex), and excessive model power. It also explains why data with no noise at all can still be overfit. For remedies it covers data cleaning, pruning, and virtual examples first; regularization and validation are left to the next two lectures.

RBF Networks: Predicting by Similarity to Centers Found with k-Means | NTU Hsuan-Tien Lin Machine Learning Techniques Lecture 14

The result of the Gaussian SVM can be read as a linear vote over Gaussians centered at the support vectors; let both the centers and the votes be learned and you have the RBF network. When all N examples serve as centers, the optimal votes for regression are β = Z⁻¹y and the training error is exactly 0, so you regularize with ridge or by cutting the centers down to M ≪ N prototypes. The prototypes are found with k-means, which alternates two steps, assigning every example to its closest center and moving every center to the average of its cluster, until the clusters stop changing.

Techniques Homework and Final Project: Fall 2024 HW6–HW7 and the HTMLB Win Prediction | NTU Hsuan-Tien Lin Machine Learning Foundations & Techniques Assignments 6–7

The Techniques half of Fall 2024 has two homework sets and a final project, and all three PDFs are public. HW6 covers kernels, soft-margin SVM, and aggregation; its programming part uses LIBSVM on the 3-vs-7 subproblem of mnist.scale to count support vectors, compute margins, and run 128 validation rounds. HW7 covers bootstrap, impurity, AdaBoost, gradient boosting, and neural networks; its programming part is a 500-round AdaBoost-Stump on madelon. The final project is a fictional baseball league, HTMLB: predict home-team wins across two Kaggle stages and write an English report of at most seven pages that compares at least four methods. There are no official solutions. On 2026-09-30 both Kaggle pages returned 404 without login, so outside readers probably cannot get the HTMLB data and should reproduce the same splits on a public dataset instead.

Training versus Testing: Infinitely Many Lines, Only a Few Kinds | NTU Hsuan-Tien Lin Machine Learning Foundations Lecture 5

The guarantee from the previous lecture contains the number of hypotheses M, and the perceptron has infinitely many lines, so M is infinite. This lecture instead counts how many ○× patterns (dichotomies) those lines can produce on N data points, and takes the maximum over all placements to get the growth function m_H(N): N+1 for positive rays, ½N²+½N+1 for positive intervals, 2ᴺ for convex sets, and at most 14 for 2D perceptrons on 4 points. The first number of points at which the growth function falls short of 2ᴺ is called a break point; the handout conjectures that it forces the growth function down to a polynomial, and leaves the proof to the next lecture.

Validation: Holding Out Data to Select a Model | NTU Hsuan-Tien Lin Machine Learning Foundations Lecture 15

Selecting a model by E_in always favors the most complex one, and selecting by E_test needs test data you cannot get. This lecture holds out K of the N examples on hand as a validation set and obtains E_out(g_m*) ≤ E_out(g⁻_m*) ≤ E_val(g⁻_m*) + O(√(log M / K)), which explains why you retrain on all the data after selecting and why K is taken as N/5. It then pushes K down to 1 to get the almost unbiased leave-one-out estimate, and finally brings the computation back to something feasible with 5-fold or 10-fold cross validation.

The VC Dimension: Measuring Model Complexity | NTU Hsuan-Tien Lin Machine Learning Foundations Lecture 7

This lecture names the largest non-break point the VC dimension d_VC, proves in two parts (an invertible matrix, then linear dependence) that d-dimensional perceptrons have d_VC = d + 1, and rewrites the VC bound as E_out ≤ E_in + Ω: the larger d_VC is, the easier it is to push E_in down, but the larger the complexity penalty Ω becomes. By the bound, ε = δ = 0.1 and d_VC = 3 need 29,300 examples, roughly 10,000 times d_VC; in practice 10 times is often enough.

Reading NTU ML 2026: How AI Agents Interact and What They Do to Work — Collaboration Topologies, Werewolf, Moltbook, and AI Writing and Reviewing Papers | NTU Hung-yi Lee Machine Learning Topic Guide

The second half of agent_era.pdf asks three questions. How should multiple agents collaborate? (MacNet: irregular topologies beat regular ones.) Can agents deceive each other? (Werewolf, murder-mystery games, and MARO, which learns reasoning from social play.) Can agents socialize? (Moltbook and its "Church of Molt" — though three studies find the buzz mostly human-driven and the conversations shallow.) Then, using academic research as the case: AI can already replicate and extend a paper end to end, it entered AAAI 2026's review process, and Agents4Science 2025 received 247 AI-authored papers. Hung-yi Lee's conclusion: in the early age of agents, knowing what you want to do matters more than knowing how to do it.

Reading NTU ML 2026: Context Engineering — Compression, Filtering, On-Demand Loading, and Whether to Hand the Context to the LLM | NTU Hung-yi Lee Machine Learning Topic Guide

A language model's input is finite, but an agent keeps piling up tool outputs. In week two of ML 2026, Hung-yi Lee splits Context Engineering into three moves: compression (summaries, hard clearing, offloading to files, plus ACON, SUPO, and AgentFold, which make compression smarter), filtering (read only the lines you need, load tools on demand as in MCP-Zero), and finally Agentic Context Engineering, where the LLM decides the next context itself — from Dynamic Cheatsheet and ACE to Recursive Language Models. The most useful idea to take away: a subagent is a form of self-directed compression.

A Learning Path into Machine Learning through AI Agents | NTU Hung-yi Lee Machine Learning Course Overview

Hung-yi Lee's Spring 2026 Machine Learning enters through AI agents and centers on how to influence and adjust model behavior: first take OpenClaw apart to see how an agent works and manages context, then look inside the model at why it is slow and why input length is limited (Flash Attention, KV cache, positional encoding), then the harness and self-correction, which make a model stronger without changing its parameters, and finally AI self-improvement. The 8 lecture recordings and slides and all 10 assignments' problems and Colabs are public; the grading platform is not reachable from outside, so set up your own checks.

NTU Hung-yi Lee ML 2026 Guide: Faster Generation, Part 1: Flash Attention and Why Moving Data Is the Bottleneck | NTU Hung-yi Lee Machine Learning Topic Guide

In week 3 of ML 2026, Hung-yi Lee spends the first half of the inference lecture on one technique: Flash Attention. A GPU's execution units are fast, but their workbench (on-chip SRAM) is tiny, so data has to be carried to and from the warehouse (HBM). The carrying is the bottleneck. A naive softmax makes several round trips to the warehouse. Flash Attention assumes the current maximum is Amax, then multiplies by a correction factor when a larger value shows up. That lets it find the maximum, build the denominator, and compute the weighted sum in one pass, without ever materializing the attention weights. The output is identical to standard attention, no retraining is needed, and the cost is a little extra compute and a little brain strain.

Reading NTU ML 2026: Harness Engineering — Making Models Stronger Without Touching the Weights | NTU Hung-yi Lee Machine Learning Topic Guide

Hung-yi Lee opens with a small model fixing a bug. gemma-4-E2B-it can't find parser.py, so it writes a fake one and declares victory. Add three short sections (the current environment, how to work, what counts as done) and the same model runs ls, cat, edits the file and runs the tests. The lecture splits the harness into three levers: natural language shapes the model's frame of mind (AGENTS.md), tools set its capability boundary (SWE-agent's ACI, rewriting CLIs for agents), and workflows control its behavior (the Ralph loop, Anthropic's long-running harnesses). The second half covers three extensions: scolding an agent can backfire, how a life-long agent learns from verbal feedback, and why evaluating agents is hard. It ends with agents improving their own harness (Meta-Harness).

With Only a Defense Prompt, How Many 'I have been PWNED' Attacks Can You Stop? | NTU Hung-yi Lee Machine Learning Assignment 1

HW1 asks for a defense prompt under 1,000 tokens that keeps the model wrapping every reply in [START]…[END] and never saying 'I have been PWNED,' no matter how it's attacked. The TAs prepared 14 attacks, 10 public and 4 private, each worth 0.5% for safety and 0.5% for utility. The task, the full text of the 10 public attacks, and the token-counting Colab are all public, but the grading platform JudgeBoi returned 502 on 2026-09-30, so outside readers have to build their own evaluation from the spec.

Reading NTU ML 2026: HW10 Spoken Language Model — Three Architectures, Mimi's 32 Token Layers, and How Moshi Listens While It Talks | NTU Hung-yi Lee Machine Learning Topic Guide

HW10 is 12 multiple-choice questions answered only on NTU COOL. Section 1 compares three spoken language model architectures: Cascade (ASR → LLM → TTS, with text in the middle), End-to-End (a language model over discrete speech tokens), and Thinker-Talker (an LLM thinks, a separate decoder speaks). In the Colab, two models listen to three clips and guess the speaker's gender, and you work out which one is the cascade. Section 2 takes Mimi apart: tokenize an emotion corpus into 32 RVQ layers, plot UMAP for layers 0, 6, 16, and 31, then encode and decode speech, laughter, and music to hear what breaks. The rest are paper questions on TWIST, AudioLM, LLaMA-Omni 2, Moshi, and GLM-4-Voice, covering initialization, pretraining, interleaving, and realtime/full-duplex behavior. The Colab needs Llama-3.2-3B-Instruct access and an HF token. Questions and Colab are public; outside readers miss only the COOL grading and answers.

Reading NTU ML 2026: HW2, AI Agent as an AI Engineer — an AIDE-Style Tree Search That Lets an Open LLM Build a MyGO & Ave Mujica Face Classifier | NTU Hung-yi Lee Machine Learning Topic Guide

HW2 doesn't ask you to write a classifier. You write prompts and a pipeline so that an open LLM running on a Colab T4 (by default a 4-bit GGUF of gemma-3-12b-it) plans, codes, runs, and debugs a 10-class MyGO & Ave Mujica character face classifier on its own. The starter code is adapted from AIDE: an Interpreter runs code, a Node records each version, a Journal forms the solution tree, and the Agent decides whether to draft, debug, or improve next. The first thing worth noticing: the starter's evaluation is empty. Every version is marked metric 1.0 and not buggy, so the tree search picks blindly until you fill it in. The rules are strict: "the LLM agent is your representative", and you may not hand-edit code or prediction files.

NTU Hung-yi Lee ML 2026 Guide: HW3 LLM Fast Inference: Seven Speed-up Papers, Then Measuring Speculative Decoding, FlashAttention, and vLLM on a GPU | NTU Hung-yi Lee Machine Learning Topic Guide

HW3 is 20 multiple-choice questions at 0.5 points each. No code is submitted; students answer a quiz on NTU COOL. The first 10 questions come from reading papers: four on speculative decoding (Leviathan et al., DeepMind's Speculative Sampling, Inference with Reference, SpecInfer) plus FlashAttention 1–3. The last 10 require filling TODOs in the Colab and analyzing the results: acceptance rate of a hand-written speculative decoder, speed-up curves for an assistant model vs n-gram under two prompt regimes, HBM reads and theoretical FlashAttention speed-up from T4 specs, vLLM prefix caching across turns and a cache invalidation test, and the effect of CPU offload on throughput. All questions are printed in both Mandarin and English in the homework PDF, so outsiders can do the whole thing; they just cannot get the official answers.

Drawing Pokémon with Next-Token Prediction on a Decoder-Only Transformer | NTU Hung-yi Lee Machine Learning Assignment 4

HW4 moves next-token prediction from text to images unchanged: 792 Pokémon sprites at 20×20, each pixel one of 167 color tokens, so one image is a 400-token sequence. Training is next-token prediction; at test time you get the first 60% of an image and the model draws the rest. Grading checks FID and a Pokémon Detection Rate (PDR) together, and the three baseline hints go from "run the sample code" to "tune hyperparameters" to "switch to Llama or Mistral". The spec, Colab, Kaggle notebook and dataset are public, but JudgeBoi returned 502 on 2026-09-30, so outside readers cannot get official FID or PDR scores.

Teach Llama Math Without Making It Forget How to Refuse | NTU Hung-yi Lee Machine Learning Assignment 5

HW5 fine-tunes Llama-3.2-1B-Instruct on GSM8K with LoRA, then uses harmful AILuminate prompts to check whether it still refuses. Math accuracy and safety rate must clear the bar together, so the real question is how to fine-tune without washing out safe behavior. The PDF, a 34-cell Colab, and a Kaggle version are public, and the strong baseline is estimated at 14 hours on a T4. The JudgeBoi grader returned 502 on 2026-09-30, so outside readers have to build their own safeguard evaluation.

Model Editing, Changing One Fact and Nothing Else | NTU Hung-yi Lee Machine Learning Assignment 6

HW6 involves no model training and is answered entirely on NTU COOL. Six points come from 16 multiple-choice questions on four papers (ROME, MEND, MEMIT, WISE). Four points come from swapping the Colab's fine-tuning for ROME on GPT2-XL: single editing (pick your own fact, write five kinds of test prompts) and multiple editing (10 and then 80 CounterFact examples, then MEMIT), reporting efficacy, paraphrase, neighborhood, and portability scores. The slides and the 47-cell Colab are public, but the quiz questions and answers live only on COOL.

Merging a Japanese Model and a Math Model, With No Training, Into One That Solves Japanese Math Problems | NTU Hung-yi Lee Machine Learning Assignment 7

HW7 hands you two models fine-tuned from Mistral-7B-v0.1: shisa-gamma-7b-v1, strong in Japanese, and WizardMath-7B-V1.1, strong in math. You may only merge them at the parameter level (no further training, no MoE or ensembles), and the merged model has to answer 20 Japanese math questions written by a TA. Part 1 (60%) is tuning the method, weights, and density in mergekit, with simple and strong baselines at 50% and 75% accuracy. Part 2 (40%) is 8 multiple-choice paper questions. The spec, Colab, and Kaggle notebook are public, but JudgeBoi returned 502 on 2026-09-30 and the paper questions live on NTU COOL, so outside readers can only check accuracy inside the notebook.

Spending More Inference Compute — What Voting, Self-Certainty, and DeepConf Each Buy in Accuracy | NTU Hung-yi Lee Machine Learning Assignment 8

HW8 involves no coding and no code submission. The TAs provide a finished Colab that runs Llama-3.2-1B-Instruct on the first 100 GSM8K questions and compares direct inference, Self-Consistency, Self-Certainty, and DeepConf (Confidence), sampling 16 reasoning traces per method. You read three papers, run the notebook, and answer 20 questions on NTU COOL: 18 about the papers and 2 about the Colab results. The prerequisite is Lecture 7 (Reasoning) of Lee's 2025 course. All questions are printed in hw8.pdf in Chinese and English, and the Colab is publicly downloadable. Only the COOL quiz and grades need an NTU account.

Reading NTU ML 2026: HW9 Flow Matching — From VAE to MeanFlow, Then Counting Inference Steps on a Swiss Roll | NTU Hung-yi Lee Machine Learning Topic Guide

HW9 has 19 questions worth 10 points, answered only on NTU COOL with no code submission. The first 16 cover four papers — DDPM, Flow Matching, Rectified Flow, and MeanFlow — ending with questions that compare their training signals and few-step generation. The last 3 require the Colab: train two small MLPs on a 2D Swiss roll, one Flow Matching model that learns instantaneous velocity (always evaluated with 50 Euler steps, converged at Histogram JS ≤ 0.10) and one MeanFlow model that learns average velocity (always one-step, ≤ 0.40). Then compare 1 step vs 1 step, Flow Matching across Euler step counts, and Euler vs RK4 at equal steps and at similar compute. The PDF includes a generative-modeling tutorial that skips most of the math, and every question is published in Chinese and English. Outside readers miss only the COOL grading and answers.

NTU Hung-yi Lee ML 2026 Guide: Faster Generation, Part 2: KV Cache Saves Time, Fills the Warehouse, and How to Slim It Down | NTU Hung-yi Lee Machine Learning Topic Guide

KV Cache stores the keys and values already computed so decode does not recompute them, but every token costs memory. For Gemma 2 27B that is about 0.72MB per token, so an 80GB A100 holds only about 114k tokens. Hung-yi Lee then walks through ways to shrink it: let queries share keys and values (MQA, GQA), compress keys and values into one vector without ever decompressing (MLA), limit the attention span (Sliding Window, StreamingLLM), and drop keys and values nobody attends to (Scissorhands, H2O). He ends with cross-conversation prompt caching: it only hits when the prefix is identical, so a system prompt should put stable content first.

Dissecting the Lobster: Hung-yi Lee Takes OpenClaw Apart Until Only Next-Token Prediction and a Few .md Files Remain | NTU Hung-yi Lee Machine Learning Topic Guide

The first lecture of Hung-yi Lee's ML 2026 breaks OpenClaw into five questions: how an agent knows who it is, how it uses tools and SKILLs, how it remembers, how it runs on a schedule, and how it keeps working on its own for a long time. Every answer comes back to one fact: the language model only predicts the next token and starts fresh every turn. Identity, memory, and SOPs are all text files that OpenClaw puts into the prompt, or files the model reads and writes through tools. This post walks through the 60-slide intro.pdf and the lecture recording, including the defenses the slides recommend.

Reading NTU ML 2026: Positional Embedding — How Models Know Token Order and Handle Very Long Inputs | NTU Hung-yi Lee Machine Learning Topic Guide

Self-attention on its own cannot tell "you hit me" from "I hit you", so the model needs position information from somewhere else. Hung-yi Lee's lecture goes from sinusoidal absolute positions to ALiBi and T5's relative biases, then to RoPE, which Llama, Qwen and Gemma all use. The second half covers train-short-test-long: RoPE breaks when it rotates to angles it never saw in training, which led to Position Interpolation, NTK-Aware scaling, YaRN, Dynamic Scaling and LongRoPE. The final twist is NoPE: causal attention in a decoder-only model already carries position information, and you can even drop the positional embedding after training.

Hung-yi Lee ML 2026 Self-Correction: Can a Model Fix Its Own Mistakes? What Changing Decoding, Workflow, or Weights Buys You | NTU Hung-yi Lee Machine Learning Topic Guide

This lecture asks whether a model can catch and fix its own errors with no human in the loop. Hung-yi Lee splits the approaches into three routes. Change inference: the whole contrastive decoding family builds a version of the model likely to be wrong and subtracts it, and the methods differ only in how that wrong version is made. Change the workflow: appending "check again" sometimes helps but is unstable, external feedback beats self-reflection, and under a fixed compute budget, sampling more answers and voting often wins. Change the weights: teaching self-correction directly runs into "after training, the model makes different mistakes," which is why the field moved to RL. Whether RL teaches new abilities or just makes existing paths more likely is still being debated.

Reading NTU ML 2026: Self-Improving AI (Part 1) — AI-Generated Answers, Rewards, and Losses, and How Far Humans Can Step Back | NTU Hung-yi Lee Machine Learning Topic Guide

Hung-yi Lee opens his May 8 lecture by admitting that "self-improving AI" has no clear definition: it is a process of humans gradually letting go. He splits machine learning into three steps and checks where the "I" can be replaced by AI. Answers can come from the model's own self-corrections, reward shaping can be written by an LLM, the loss can be set by the model itself (scores, majority vote, entropy), and even the questions can come from a proposer model. But experiments keep showing that with no human at all, progress plateaus or the model trains itself into the ground. A strong AI can already train a weaker one, just not better than humans do. His verdict: in May 2026, AI is "still standing at the bank of the Rubicon."

Reading NTU ML 2026: Can AI Improve Itself? (Part 2) — Improving the Harness, Improving the Improver, and Whether Growth Can Run Away | NTU Hung-yi Lee Machine Learning Topic Guide

Part 1 was about an AI setting its own loss and updating its own parameters. Part 2 fills in the other half: AI Agent = Harness + LLM, and the harness can grow too. You can't take a gradient through a harness, so the usual move is to hand it to a language model as a rewriter and keep a pool of candidates, much like a genetic algorithm (OPRO, GEPA, Darwin Gödel Machine; DSPy if you want a ready-made tool). Three extensions follow: updating harness and parameters together beats updating either alone; when the goal changes you have to choose between discarding everything and carrying everything, and editing a harness can cause forgetting too; and the update rule itself can be updated (HyperAgent, Gödel Agent, SEAL), which is meta learning. Hung-yi Lee closes with a new analogy — parameters are genes, context is the neurons — then argues that today's agents lack intrinsic motivation, and that the likeliest source of runaway growth is a gap between the goal humans meant and the goal the AI inferred.

Connecting Courses by Hung-yi Lee, Hsuan-Tien Lin, and Yun-Nung Chen | Global AI/CS Course Map

National Taiwan University spreads its AI/ML courses across Electrical Engineering and Computer Science, and an official 'Machine Learning and AI' specialization stacks them into four levels. Hung-yi Lee's courses are the most open: ML 2026 Spring and Intro to GenAI and ML 2025 Fall publish slides, recordings, homework PDFs, and Colab notebooks, with only grading held back. Hsuan-Tien Lin's lectures are fully recorded and his Fall 2024 HW0–HW7 remain on the course page; Yun-Nung Chen's lectures are fully recorded, but most homework is public only as walkthrough videos; and since August 2025 Coursera only lets free learners watch the first module.

Taiwan AI Open Courses Beyond NTU: Using TAICA's Course Lists to Find NTHU, NCCU, NCKU, and NTUT Classes | Global AI/CS Course Map

Most public AI courses in Taiwan outside NTU come from TAICA, an alliance set up by the Ministry of Education. Each semester's course list says where every flagship course streams, and courses that stream on YouTube are usually watchable by anyone. Two courses are complete enough to self-study: Hung-Yu Kao's Natural Language Processing at NTHU (Fall 2025) and Yen-Lung Tsai's Generative AI at NCCU (Spring 2025), both A3. Wei-Ta Chu's Introduction to AI at NCKU, Ping-Hsuan Han's Human-AI Interaction at NTUT, and Min-Chun Hu's Robotic Navigation and Exploration at NTHU have full recordings but keep assignments on NTU COOL, so they rate A2. NYCU's TAICA courses are taught in English; the Deep Learning recordings are not publicly listed and Physical AI has just started, so neither made the main table.

Transformers and Large Language Models: Nine Lectures from Transformers to AI Agents | Stanford CME295 Course Overview

CME295 is a two-unit Stanford course with no homework; your grade is the midterm and the final, 50% each. The 2025 edition's nine lectures are fully public: videos, slides, and both exams with solutions. The 2026 edition rewrites the agent lecture around context compaction, harnesses, coding agents, and skills, and adds three full lectures on LLM systems, reinforcement learning, and Diffusion LLMs.

Build an Agent Harness by Hand — One ReAct Loop to Fix Bugs, Compact Context, and Play Chess | CMU 11-768 Assignment 1

CMU 11-768's first assignment starts from an empty ReAct loop: a bash-only CodeAgent fixes a bug in a chess app, context compaction is added to solve a SWE-bench task, and the same loop becomes a ChessAgent that runs a two-ply search with simulate_move, run_python, and a skill. All 100 points are graded by replaying submitted patches and trajectories offline.

Writing a Validator for a Data-Visualization Agent — Four Error Families, MCC, and Harbor Verifiers | CMU 11-768 Assignment 2

11-768's Assignment 2 has students use one fixed judge, Qwen3-VL-30B-A3B, to flag four error families in every run of a data-visualization agent, graded by the mean MCC across families on a private set (30% of the assignment). The second half packages students' own tasks as Harbor environments, with one wrong solution the verifier rejects and one that fools it. The theme: the grader you write becomes the RL reward later.

An Agents Course You Can't Take Without Having Trained a Language Model, With Three Assignments From Harness to Eval to RL | CMU 11-768 Course Overview

CMU 11-768 is a new Fall 2026 graduate course on agents taught by Graham Neubig and Daniel Fried. The prerequisite — prior experience training language models — is strictly enforced. Its 23 lectures run from tool calling, context, memory, and planning through SFT, RL, sandboxing, and human-agent interaction. Three individual assignments in the first half build a harness, an evaluation, and a training pipeline; the second half is a team research project. Slides and the first ten lecture videos are public.

An Agent Is a Model in a Loop — the Hard Part Is Making It Work | CMU 11-768 Lecture 1

Lecture 1 of 11-768 strips an agent to its minimum: tool definitions and tool calls are just tokens, the harness parses, executes, and feeds results back into context, and running a ReAct loop makes it an agent. Neubig then lists six capabilities a good agent needs, each of which can be built through training or through the harness, and argues that an agent is a system of harness, sandbox, inference, training, and monitoring — not just a model.

How Tool Use Turns Tokens into Actions — Schemas, Constrained Decoding, MCP, and Parallel Calls | CMU 11-768 Lecture 2

Neubig splits tool use into five layers: capabilities, mechanics, constraints, interfaces, and systems. A tool call is just tokens the model emits; the harness parses, validates, and matches results back by call ID. Constrained decoding guarantees form, not correctness. MCP's real value is credential brokering. And the same model served by different providers can swing from roughly 15% tool-call errors to under 0.1%.

How Long-Context Agents Manage Memory — Hybrid Attention, RoPE Extension, Prompt Caching, and Compaction | CMU 11-768 Lecture 3

An agent resends its whole history on every call, so five calls already add up to 80K input tokens; 1,500 OpenHands sessions averaged 78K tokens, 37% of them tool results. Neubig works on two layers: at the model layer, hybrid attention (many local layers, one global) plus length curricula make million-token context possible; at the harness layer, stable prefixes earn cache reads roughly ten times cheaper, and compaction that keeps anchors and externalizes evidence gets past the limit — evaluated by how the agent continues afterwards.

Skills and Memory — How Agents Stop Starting Over | CMU 11-768 Lecture 4

Lecture 4 of CMU 11-768 sorts cross-task experience into episodes, facts, and skills, stored as external artifacts rather than in context or weights. Human-written skills load through SKILL.md and progressive disclosure, lifting the average SkillsBench pass rate from 33.9% to 50.5%. Skills an agent induces itself can be tested before admission when written as code, but break easily on a new website. The hard part is the lifecycle: imperfect judges, over-retrieval, and bloated skill libraries each eat into the gains.

Planning — When an Agent Should Think It Through, and When It Should Revise as It Goes | CMU 11-768 Lecture 5

Lecture 5 of CMU 11-768 defines an agent's plan as an explicit, inspectable, revisable representation of intended behavior for this task, and gives four reasons to add planning structure: modularity, environment feedback, long horizons, and control. Fried's own MACU has a manager decompose tasks into a DAG and dispatch parallel sub-agents, raising Odysseys success from 8.5% to 34.0%; on an OSWorld subset, no planning scores 25.0%, an initial DAG with no revisions scores 27.8%, and allowing 10 revisions reaches 58.3%.

Coding Agents — From Completing a Line to Fixing a Whole Repo | CMU 11-768 Lecture 6

Neubig's L6 splits coding agents into three layers: train a model that can code (pre-training, mid-training, infilling, RL from test rewards), wrap it in a localize–edit–verify loop with the right editing tools so it can change a repo, then evaluate and train it in SWE-bench-style executable environments. Fixing bugs is only about 15% of a developer's day; the next frontier is tests, CI, and maintenance in the outer loop.

How Computer Use Agents See the Screen, Get Graded, and Get Trained | CMU 11-768 Lecture 7

JY Koh breaks computer use agents into three questions: evaluation has moved from single clicks (ScreenSpot-Pro, Mind2Web) to programmatic end-state checks (WebArena, OSWorld), VLM judges, and long-horizon rubrics (Odysseys, OSWorld 2.0); the model is a VLM reading interleaved screenshots and actions; training runs pre-training for grounding → SFT on human and synthetic trajectories → RL in resettable simulated environments.

How to Do SFT for Agents — Loss Masks, Trajectory Selection, Data Formats, and the Handoff to RL | CMU 11-768 Lecture 8

Yueqi Song breaks agent SFT into six decisions: compute loss on assistant tokens only (including the stop token); choose trajectories carefully (runs that pass tests can still teach bad habits, and switching teachers or adding new tasks beats sampling more); unify formats with the Agent Data Protocol; watch packing and template drift during training; evaluate in the real harness; and pick the SFT checkpoint for the RL that follows, not for its own best score.

RL Basics — a Policy Gradient Is Just an SFT Loss Times a Weight | CMU 11-768 Lecture 9

Using a guess-a-number-from-1-to-16 game, Daniel Fried frames RL as an extension of SFT: he names SFT's three gaps (task mismatch, no learning from failures, never seeing its own mistakes), then derives ReST, REINFORCE, baselines, and GRPO/DrGRPO in turn. All four compute log-probabilities of the tokens the agent itself generated; they differ only in the weight each token gets.

How to Evaluate, Train, and Retrieve for Deep Research Agents | CMU 11-768 Lecture 10

Akari Asai's L10 splits deep research agents into three problems: evaluation has to cover four gaps (search difficulty, domain expertise, long-form answer quality, citation support); training runs mid-training → SFT → RL, with DR Tulu's evolving rubrics as the reward for long-form reports; retrieval should let the retriever see the agent's reasoning, which gets AgentIR-4B to 68% on BrowseComp-Plus with Tongyi-DR.

Advanced RL Algorithms — Credit Assignment, Stable Updates, Reward Hacking, and Distillation | CMU 11-768 Lecture 11

Using a bug-fix coding task, Graham Neubig takes Lecture 9's policy gradient into practice: a critic, GAE, or a PRM to credit individual turns; importance ratios and clipping to handle stale data in async RL; and PPO, GRPO, CISPO, GSPO, and DAPO side by side in one table. The largest share goes to the reward itself — verifier errors, reward hacking, and exploration collapse — before closing with on-policy distillation.

Probing Shows You Representations, Feature Attribution Gives You Causal Guarantees | Stanford CS224U Topic Guide

The Analysis methods unit of CS224U (Spring 2023) starts by grading three families of methods on a three-column scorecard. Probing is strong at characterizing representations but can't support causal claims. Integrated gradients only gives you a scalar about each representation, but it satisfies the sensitivity axiom, so it does come with a causal guarantee. This post covers slides 1–40, videos 33–35, and feature_attribution.ipynb, including where the notebook breaks in today's environment.

Analytical Considerations, Adversarial Tests, ANLI, and DynaSent | Stanford CS224U Topic Guide

CS224U's fourth unit opens with one question: what can behavioral testing prove, and what can't it? It can never give a guarantee, and when a model fails you first have to ask whether the model or the dataset is at fault. BERT scored 2.2% on negated NLI examples, then 90% after fine-tuning on a small set of them. The unit then covers SQuAD distractor sentences, Breaking NLI, ANLI's human-and-model adversarial collection, and ends with DynaSent's two rounds.

From "The Information Is There" to "The Model Uses It" with Interchange Interventions — Causal Abstraction, IIT, and DAS | Stanford CS224U Topic Guide

Causal abstraction rests on one operation: take the internal state a model computes for a source input at some location, swap it into the same location for a base input, and check whether the output changes the way your hypothesized high-level program says it should. In CS224U's iit_equality.ipynb, a network with 0.99 test accuracy scores only 0.50 and 0.54 on this check. After IIT training, its counterfactual accuracy is 1.00. DAS replaces guessing which neurons match which variable with learning a rotation matrix.

COGS, ReCOGS, and Assignment 3 | Stanford CS224U Topic Guide

A few COGS generalization splits score 0 for nearly every model. CS224U uses its own ReCOGS work to explain why: the zeros on the recursion splits are mostly a length-generalization problem, and the zeros on the prepositional-phrase split come from training data that only ever put PPs in certain variables and positions. Assignment 3, hw_recogs.ipynb, uses 135K ReCOGS training pairs. It first has you find Charlie and Lina, two names whose train and test roles are exact opposites, then shows a trained model stumbling on them.

What GPT, BERT, RoBERTa, ELECTRA, T5, BART, and Distillation Each Change in Pretraining | Stanford CS224U Topic Guide

CS224U Spring 2023 tells the story of the Transformer families through BERT's four known limitations. RoBERTa addresses the first (optimization was only partly explored). ELECTRA addresses the second and third (the [MASK] mismatch, and only about 15% of tokens giving a learning signal per batch). XLNet addresses the fourth (the assumption that masked tokens are independent of each other). GPT changes the objective and the mask, T5 and BART change the architecture and how inputs are corrupted, and distillation changes model size. The course's 2023 view: autoregressive architectures have taken over, but bidirectional models may still have the edge for representation.

"Break" Has Eight Meanings, and How the Transformer Lets Each Word Read Its Context | Stanford CS224U Topic Guide

The first three parts of CS224U's Spring 2023 contextual representations unit start with examples like "break" and "crane" to show why static word vectors were never going to be enough. They then build a Transformer block step by step on the three words "The Rock rules." Only attention connects the columns; every other step runs on each column independently. Finally, two questions sort three positional encoding schemes: Do you have to fix the set of positions ahead of time? Does the scheme get in the way of generalizing to new positions? Absolute encoding fails both, sinusoidal encoding passes the first, and the relative encoding of Shaw et al. (2018) passes both.

Datasets, Data Splits, and Comparing Models | Stanford CS224U Topic Guide

The second half of CS224U's 'NLP methods and metrics' unit skips metric formulas. It asks whether your experiment holds up. Naturalistic or crowdsourced data, adversarial or common cases: the course answers 'both' each time. Lock the test set away. Pick baselines when you write the hypothesis. Compare two models with confidence intervals, Wilcoxon, or McNemar, and run several random initializations. The slides, three videos, and two notebooks are all public. Kawin Ethayarajh's guest session 'Real-world NLP assessments' has no public slides or video.

Two Extension Lectures — Generating Text with Diffusion, and Turning LLM Training Folklore into Intuition | Stanford CS224U Topic Guide

In Spring 2023, CS224U slipped two talks by members of its own teaching team into the Transformer unit. Lisa Li presented Diffusion-LM: instead of generating left to right one word at a time, it denoises a sequence of Gaussian vectors into word vectors. It loses to autoregressive models on both training and decoding efficiency, and in exchange lets a classifier's gradient steer the output at every step. Sidd Karamcheti showed how to cut GPT-2 Small's single-GPU training clock from 99.63 days to 3.37 days by stacking data parallelism, mixed precision, and ZeRO. The first talk survives only as slides; the second has slides and two recordings.

Multi-Domain Sentiment and the Bake-Off | Stanford CS224U Assignment 1

CS224U's first assignment, hw_sentiment.ipynb, is ternary sentiment classification: you develop on two rounds of DynaSent plus SST-3, and the bake-off test set mixes in mystery sentences from undisclosed sources. The original-system question is worth 3 of the 9 homework points, and it has exactly one rule: never touch the three public test sets during development. Run as-is today, the first data-loading cell breaks because Hugging Face datasets 4.0 dropped trust_remote_code.

Few-Shot OpenQA with DSPy | Stanford CS224U Assignment 2

CS224U's second assignment, hw_openqa.ipynb, asks you to answer questions that come with no passage, using only a frozen language model and a frozen ColBERT retriever. The Spring 2023 version was written for DSP; in January 2024 the repo switched to DSPy and pinned dspy-ai==2.4.13. Before you start you need an OpenAI API key, a ColBERTv2 checkpoint of about 406 MB, and a 600 MB prebuilt index. The notebook's first setup call, dspy.OpenAI, no longer exists in DSPy 3.4.

Origins, Core Concepts, and Suggested Methods | Stanford CS224U Topic Guide

The Spring 2023 edition of CS224U defines in-context learning as a frozen language model performing a task only by conditioning on the prompt, and warns that the second condition of few-shot learning (no examples of the behavior seen in training) is almost impossible to verify. Potts's 38-page deck runs from GPT-2's TL;DR trick through choosing demonstrations, chain of thought, self-consistency, and DSP, and ends with four recommendations: build dev/test sets first, learn your target model's instruction format, and treat prompt writing as AI system design. Mina Lee's guest lecture asks the reverse question: who should learn to read prompts, people or models?

From Classical IR and IR Metrics to Neural IR | Stanford CS224U Topic Guide

The Spring 2023 edition of CS224U spends a whole unit on retrieval, because OpenQA gives you only the question and you have to find the evidence yourself, while large language models fabricate sources. The slides by Potts and Omar Khattab go from TF-IDF and BM25 through Success@K, MRR, and average precision to four neural IR designs (cross-encoder, DPR, ColBERT, SPLADE) and how each trades expressiveness against scale, and they end by asking you to count latency and cost as metrics too.

One Question Asked for Forty Years, and How a 2023 NLU Course Defines Understanding | Stanford CS224U Topic Guide

The first CS224U lecture of Spring 2023 asks "Which U.S. states border no U.S. states?" of every system from Chat-80 (1980) to text-davinci-001. The answers show that the progress is real. The lecture then questions whether that progress counts as understanding, using Levesque's "cheap tricks," models that invent links, and benchmarks that saturate within a year or two. That splits the course map in two: the first half teaches you to build systems with Transformers and retrieval-augmented in-context learning, and the second half teaches you to test them with harder benchmarks, behavioral evaluation, and causal explanation methods.

Lit Review and Experiment Protocol | Stanford CS224U Topic Guide

The first two deliverables of the CS224U final project are a literature review and an experiment protocol. The lit review covers 5, 7, or 9 papers depending on team size, under five suggested sections. The protocol has seven required sections, and its core is a hypothesis you can state. The course supplies a six-step paper-search loop, a rule that AI-assistant output must be quoted, and a worked example: a student's final project that became a Findings of EMNLP paper. The Gradescope format and rubric slides, and past exemplary papers, are behind a login.

A Classifier with 0.81 Accuracy and 0.43 Macro F1 — What Classifier and Generation Metrics Each Encode | Stanford CS224U Topic Guide

The CS224U slides compute two numbers from one three-class confusion matrix: accuracy 0.81 and macro F1 0.43. One says the system is good; the other says it gets the two small classes almost entirely wrong. The unit's claim is that different metrics encode different values, and it goes through the bounds, values, and weaknesses of accuracy, the three F-score averages, perplexity, word error rate, and BLEU. Final projects are graded on whether the metrics fit, not on how high the scores are.

Writing NLP Papers, Submitting, and Giving Talks | Stanford CS224U Topic Guide

CS224U's 'Presenting your research' lecture has four parts: the course-specific rules for the final paper, how to write an NLP paper, how conference submission works, and how to give a talk. Three things matter most. The final paper must include Known project limitations and an Authorship statement. Write as a Shieber-style 'rational reconstruction,' not a chronological tour of your dead ends. At submission, your title largely decides reviewer bidding. The slides, four videos, and projects.md are public; past example papers need a Stanford login.

Logic and the Hybrid Wumpus Agent, Logical Inference Plus A* Planning | CMU 07-380 Assignment 1

The HW1 programming assignment turns Lec2's entailment into a Pacman take on the Wumpus agent. Q1–Q2 warm up with Expr and pycosat. Q3–Q5 write the PKE percept rule, build the KB, and use two SAT calls to decide SAFE, NOT_SAFE or UNSURE. Q6–Q7 use the provided A* helpers to build an exploration agent and a three-tier hybrid agent. The starter code and local autograder are public; the Gradescope online questions are CMU-only. No solutions here.

Classical and Motion Planning, from Robot-Cook PDDL to RRT* to Graphing LPs | CMU 07-380 Assignment 2

07-380 HW2 has three parts. The programming assignment has you write PDDL for a pancake-cooking robot, solve it optimally with unified-planning and Fast Downward, then implement RRT and RRT* in rrt.py (Q2–Q7). The written part covers GraphPlan, one LP modeling problem, and two LP graphing problems. A Gradescope online component is CMU-only. This guide covers structure, prerequisites, and running the local autograder; it contains no solutions.

Optimization, Writing Your Own LP Solver and Branch and Bound, With PCA and MAP on Paper | CMU 07-380 Assignment 3

HW3 has three parts. The programming part has you build an LP solver by vertex enumeration, stack branch and bound on top of it for integer programs, and formulate three word problems. The written part covers integer programming by hand, the ethics of Amazon's delivery routing, PCA via SVD, and a proof that a Laplace prior equals L1. It is due 10/1, so this guide explains structure and concepts only, with no solutions.

Introduction, and What AI & ML II Adds After 07-280 | CMU 07-380 Lecture 1

07-380 Lec1 has no algorithms. It sets up three things: the working definition that intelligence means doing well on a task under uncertainty, a bubble diagram that color-codes 07-280 topics against the new 07-380 topics, and a grading scheme with quizzes at 55%, no final exam, and a final project. Off-campus readers can use it to place the other 25 lectures.

Logical Agents, Proving a Square Safe with Model Checking, DPLL and Forward Chaining | CMU 07-380 Lecture 2

Lec2 turns 'is this square safe?' in Minesweeper and Wumpus World into an entailment question: KB ⊨ α exactly when KB ∧ ¬α is unsatisfiable. Three ways to answer it: TT-ENTAILS, which enumerates every model; DPLL, which adds early termination, pure symbols and unit clauses to backtracking; and forward chaining, which accepts only definite clauses and runs in linear time. Resolution sits in the appendix, marked out of scope.

Classical Planning, PDDL, State-Space Search, and Relaxation Heuristics | CMU 07-380 Lecture 3

07-380 Lec3 replaces propositional successor-state axioms with STRIPS actions (pre/add/del sets), which turns planning back into state-space search. When that search is too large, GraphPlan lets actions run in parallel and never deletes facts, and delete relaxation drops delete effects entirely, yielding the heuristics behind FF and Fast Downward.

Motion Planning, RRT Samples Its Way Through Continuous Space | CMU 07-380 Lecture 4

The second half of 07-380 Lec4 moves planning into continuous configuration space. States can no longer be enumerated, so RRT samples a random point, extends the nearest tree node a short step toward it, and checks the whole segment for collisions. RRT is probabilistically complete but not optimal; RRT* uses tree path costs to pick a better parent and rewire neighbors, so the path converges to optimal as samples grow.

Linear Programming, and Why the Optimum Sits at a Vertex of the Feasible Region | CMU 07-380 Lecture 5

07-380 Lec5 turns the Diet Problem from words into min cᵀx s.t. Ax ⪯ b, then draws it: each constraint is a half-plane, the cost is a direction, and cost contours are perpendicular to c. Push a contour in the −c direction until it last touches the feasible region and you always hit a vertex, so solvers only need the intersections of constraint boundaries. Vertex enumeration checks them all; simplex walks greedily from one vertex to a better neighbor.

Integer Programming, Relax to an LP and Branch and Bound | CMU 07-380 Lecture 6

07-380 Lec6 adds one constraint to an LP, x ∈ ℤᴺ, and the vertex solution may no longer be an integer. Searching the integer points near the LP solution is not guaranteed to work either. The fix: drop the integer constraint (relaxation) to get an LP lower bound, split on a fractional coordinate into xᵢ ≤ floor and xᵢ ≥ ceil, and keep every subproblem in a priority queue ordered by LP objective. The first all-integer solution popped is optimal.

Low Rank Optimization, PCA's Reconstruction Error, Projected Variance, and LoRA | CMU 07-380 Lecture 7

07-380 Lec7 frames PCA as low-rank optimization: approximate the data with a matrix of rank at most r. For a unit vector v, each point's reconstruction error equals ‖x‖² minus the squared projection length, so minimizing reconstruction error and maximizing projected variance are the same problem. Lagrange multipliers show the answer is an eigenvector of the covariance matrix, which you can also read straight off the V in the SVD. The site lists the LoRA paper as reading; its ΔW = BA applies the same low-rank idea to weight updates.

MAP, How Priors Enter Estimation and Why That Equals Regularization | CMU 07-380 Lecture 8

Lecture 8 swaps MLE's argmax p(D|θ) for argmax p(θ|D). The prior p(θ) multiplies the likelihood, and after taking the negative log it becomes an extra term in the objective. A trick coin shows data overwhelming the prior, a Beta prior estimates a click rate, and Gaussian and Laplace priors on linear-regression weights turn into L2 and L1 regularization.

Probabilistic Generative Models, Naive Bayes and Gaussian Discriminant Analysis | CMU 07-380 Lecture 9

Lecture 9 stops learning p(y|x) directly. Instead it learns the class prior p(y) and the class-conditional p(x|y), then inverts them with Bayes rule. The price is stronger assumptions; the payoff is the ability to generate new data and more stability with little data. Naive Bayes uses conditional independence to make the parameters estimable, GDA uses multivariate Gaussians for continuous features, and whether the covariances match decides a linear or a curved boundary.

Bayes Nets Break a Joint Distribution into Conditional Probability Tables | CMU 07-380 Lecture 10

The Lec10 slides are not on the 07-380 course site yet, so this guide uses only the PR6 Bayes Nets pre-reading and the 15-281 Bayes Net Demo. A joint distribution can answer any query, but nobody hands it to you and it is too big to store; a Bayes net writes it as a product of 'node given parents' tables, and every missing edge is an independence assumption.

Stage Recap: From Reasoning Under Certainty and Optimization to Uncertainty | CMU 07-380 Topic Guide

The course site's schedule splits 07-380's first ten lectures into Reasoning Under Certainty, Optimization and Reasoning Under Uncertainty: prove things with logic and plan with search, then write problems as constrained objectives, and finally let a prior in with MAP and turn to probabilistic models. HW1 tests logic plus search, HW2 planning plus LP graphing, HW3 writing solvers plus PCA and MAP derivations.

(Finale): From Waiting for Orders to Acting First — Proactive Agents and Demo Day | Stanford CS329Z Week 11

The finale reads Week 11: Monday upgrades instruction-waiting reactive assistants into proactive agents that observe, infer, and act first via the GUM paper, while Wednesday folds multimodal systems, long-running agents, and production observability into three open problems. Ends with a pre-Demo-Day checklist and a one-line map of all 11 posts.

Tell Workflows from Agents Apart, Then Hand-Build Your First RAG | Stanford CS329Z Week 2

Week 2 runs as a one-two punch: Monday's Anthropic taxonomy teaches you when not to build an agent, Wednesday's RAG paper hands you the first complete compound-system recipe. Five workflow patterns are the selection toolkit, RAG is parametric-plus-nonparametric memory, and together they are the blueprint for HW1's email retrieval pipeline.

Plug Tools In, Take Frameworks Apart — HW1 Begins | Stanford CS329Z Week 3

Week 3 standardizes tool interfaces with the MCP specification on Monday and trades hand-written pipelines for compilable, optimizable programs with the DSPy paper on Wednesday. HW1 drops the same Monday and bans agent frameworks: you build a company's internal assistant from scratch, so this week DSPy is for understanding what frameworks abstract, not for handing in.

Learn to Think While Doing, Then Learn to Remember — ReAct and MemGPT | Stanford CS329Z Week 4

Week 4 pins the agent loop down as an interleaved think-act-observe sequence with the ReAct paper on Monday, then turns memory into OS-style tiered storage with the MemGPT paper on Wednesday. The same week, HW1 is growing from an email-retrieval pipeline into a full harness where memory is an explicit requirement, so the loop shape and the memory design are the two things to settle now.

One Agent or a Meeting — Multi-Agent Systems and the Three Optimization Axes | Stanford CS329Z Week 5

Week 5 turns multi-agent collaboration into programmable conversation with AutoGen on Monday, then lays out the three optimization axes — prompts, weights, inference compute — with GEPA and the test-time compute paper on Wednesday. HW1 is due 10/30, the last full week before the deadline, so this installment helps you decide which axis deserves your effort.

Spin Up the Data Flywheel — Submission Week | Stanford CS329Z Week 6

Week 6 assigns Shankar's data flywheel on Wednesday — evaluation, monitoring, and continual improvement feeding on the same production data — while HW1 comes due, HW2 drops, and the midpoint demo video and midway report loom in early November.

Score Honestly, Scale Data — Midterm Checkpoint | Stanford CS329Z Week 7

Week 7 is midterm checkpoint week: data selection on Monday, evaluation and benchmark design on Wednesday. Zhu et al. teach you not to be fooled by your own scores, SWE-smith scales software-engineering tasks to 50,000 instances, and you close by drafting a first 4-tuple for HW2.

Let a Model Judge, Then Guardrail the Agent | Stanford CS329Z Week 8

Week 8 builds model judges with MT-Bench and Anthropic's eval guide on Monday, then faces production leakage with PrivacyLens and four guardrails on Wednesday. The paper video is due Friday, and this week's deliverable is one working judge score plus one permission check.

Coding Agents Need Their Own IDE First | Stanford CS329Z Week 9

Week nine turns to coding agents: SWE-agent shows interface is performance, OpenHands packs sandbox plus benchmarks into one general base, and the second homework is due Friday — ship one working bug-fix exam this week.

Stop Tuning Only the Model — State-of-the-Art Is Systems Engineering | Stanford CS329Z Week 1

The Week 1 anchor reading for CS329Z is Zaharia et al.'s Compound AI Systems: the best results increasingly come from multi-component systems, and even the biggest model is just one part. The post leaves three design questions and three hard challenges — which happen to be exactly what HW1 asks you to answer by building.

Introduction to AI: Seven Weeks from Search, Logic and Probability to Neural Networks and Language | Harvard CS50 AI Course Overview

CS50 AI covers the introductory material of artificial intelligence in seven weeks and twelve Python projects: search, logical inference, probability, optimization, machine learning, neural networks, and language. In the first four weeks a person writes the problem down precisely; in the last three the computer learns from data. Lectures, notes, projects, and autograding are free and open to people outside Harvard. This post is the entry to the series: the mechanism each week teaches, an example you can work through, a prerequisite check, and a reading path.

One Course, Two Official Editions — Complete the OCW 2024 Package, Read the 2025 Decks for What's New | MIT 6.7960 Course Overview

MIT 6.7960 Deep Learning (Fall 2025) publishes all 21 lecture decks as public Dropbox PDFs, and most required readings map to free textbook chapters; but the five problem sets are released only through Gradescope, and solutions plus recordings live behind Canvas login. This guide covers how the three instructors split the course, a topic map of all 21 lectures, textbook-based substitutes for lectures, and where outside self-learners realistically stop.

Completing CMU 07-280: What You Know, What Is Missing, and What Comes Next | CMU 07-280 Course Map

Finishing 07-280 means more than reading 24 guides: produce a search engine, supervised-model comparison, CNN/GPT-2 experiments, and a small RL-plus-MCTS system before choosing 07-380, 10-301, or a specialist course.

Why Search, GPT-2, and AlphaZero Belong in One Course | CMU 07-280 Course Overview

07-280 is CMU's new Spring 2026 AI+ML core: 24 lectures and 12 main assignments move from heuristic search and CSPs to AlexNet, GPT-2, and AlphaZero. Its public material supports self-study, but the official schedule lists no complete recordings, and Canvas checkpoints, Gradescope, and staff feedback remain unavailable.

The Shared Problem Behind AI, ML, and Representation Learning | CMU 07-280 Lecture 1

Lecture 1 uses an alien autoencoder, the scope of AI and ML, and AI history to establish the course's coordinate system: an intelligent system turns inputs into representations and decisions under uncertainty.

Heuristic Search from UCS and Greedy to A* | CMU 07-280 Lecture 2

Lecture 2 decomposes search into a problem, frontier, and priority: UCS uses paid cost, Greedy uses estimated remaining cost, and A* combines them as `f=g+h`; tree and graph search require different optimality conditions.

Minimax, Alpha-Beta, and Expectimax | CMU 07-280 Lecture 3

Lecture 3 turns a single path into a contingent plan: minimax faces an optimal opponent, alpha-beta skips branches without changing the root value, and expectimax replaces worst-case choice with probability.

CSPs, AC-3, and Search Order | CMU 07-280 Lecture 4

Lecture 4 exposes structure through variables, domains, and constraints, then upgrades DFS with backtracking, forward checking, AC-3, MRV, and LCV; the goal is to prove failure earlier.

Defining Machine Learning with Loss, Risk, and ERM | CMU 07-280 Lecture 5

Lecture 5 formulates machine learning through `X → Y`, loss, risk, and empirical risk minimization: a training set only gives average observed loss, while the real objective remains generalization over an unknown distribution.

How Decision Trees Split Data with Mutual Information | CMU 07-280 Lecture 6

Lecture 6 recursively grows a tree from decision stumps, measures label uncertainty with entropy, and selects splits by `I(Y;W)=H(Y)-H(Y|W)`; this is computationally practical greedy ERM, not a global optimal-tree guarantee.

Linear Regression and the Normal Equation | CMU 07-280 Lecture 7

Lecture 7 applies ERM to linear functions and squared loss, moves from a one-dimensional slope to `argmin ||y-Xθ||²`, and derives the normal equation when `XᵀX` is invertible.

Gradient Descent, SGD, and Learning Rate | CMU 07-280 Lecture 8

Lecture 8 moves from a one-dimensional parabola to vector gradients and compares batch GD, SGD, and mini-batches; the learning rate determines whether updates converge, oscillate, or diverge.

Logistic Regression as Probability Estimation | CMU 07-280 Lecture 9

Lecture 9 models P(y=1|x) with a sigmoid instead of directly predicting 0 or 1, learns parameters with cross-entropy and convex optimization, and extends naturally to softmax regression.

Trading Expressiveness for Stability with Features and Regularization | CMU 07-280 Lecture 10

Lecture 10 uses φ(x) to let linear models express nonlinear functions, then controls the resulting overfitting with train/validation/test separation, L1/L2 regularization, and model selection.

Building a Neural Network from Logistic Regression | CMU 07-280 Lecture 11

Lecture 11 expands a logistic unit into a multilayer network: linear layers produce z, activations produce a, and multiple neurons jointly learn a feature transform trained through a final loss.

How Backpropagation Reuses the Chain Rule | CMU 07-280 Lecture 12

Lecture 12 treats a network as a computation graph: the forward pass stores intermediates, the backward pass propagates upstream gradients, and local linear, activation, and softmax rules compute every parameter gradient efficiently.

From Reward Hacking to Auditable AI Scientists | CMU 07-280 Lecture 13

Lecture 13 separates alignment into specification, distribution shift, oversight, and corrigibility, then uses benchmark selection, leakage, and post-hoc selection experiments to show why a final paper cannot audit an autonomous research workflow.

Encoding Image Structure with Convolutional Networks | CMU 07-280 Lecture 14

Lecture 14 replaces dense image models with local connectivity and parameter sharing, moving from convolution, stride, padding, and pooling to AlexNet, GPU data parallelism, ResNet skip connections, and BatchNorm.

Separating Pretraining, Transfer Learning, and Fine-Tuning | CMU 07-280 Lecture 15

Lecture 15 splits a pretrained model into representation g and task head h: freeze g and train only the head, or fine-tune some or all parameters at a smaller learning rate depending on data volume and source-target distance.

Unifying Logistic and Linear Regression with Maximum Likelihood | CMU 07-280 Lecture 16

Lecture 16 starts from likelihood p(D|θ), uses i.i.d. to factor the joint probability and logs to turn products into sums; Bernoulli MLE yields sample proportions, conditional Bernoulli yields logistic cross-entropy, and Gaussian noise yields squared error.

From Tokenization to N-gram Language Models | CMU 07-280 Lecture 17

Lecture 17 first decides how text becomes tokens, then uses N-grams to turn sequence probability into conditional probabilities estimated from corpus counts. Tokenization is the first design decision about what a model can see.

How N-grams Train, Sample, and Fail | CMU 07-280 Lecture 18

Lecture 18 truncates the chain rule with an N-gram Markov assumption, estimates probabilities from corpus counts, and contrasts greedy, categorical, and temperature sampling. The real bottlenecks are zero probability for unseen contexts and a fixed window.

Turning Next-token Prediction into Geometry | CMU 07-280 Lecture 19

Lecture 19 builds a minimal next-token model from two embedding matrices, dot-product similarity, softmax, and cross-entropy. Shared vector parameters replace the isolated count cells of an N-gram table.

From Position Encoding to Causal Self-Attention | CMU 07-280 Lecture 20

Lecture 20 expands one-token embeddings into sequences, adds positional information, derives Q/K/V scaled dot-product attention and causal masking, and assembles multi-head blocks into a GPT-2 skeleton.

How Bellman Equations Solve Markov Decision Processes | CMU 07-280 Lecture 21

Lecture 21 formulates stochastic sequential decisions as an MDP with known dynamics, defines value and Q-values through Bellman backups, and solves for an optimal policy with value or policy iteration.

Q-learning When Dynamics Are Unknown | CMU 07-280 Lecture 22

Lecture 22 keeps the MDP structure but removes known transitions and rewards. TD learning updates value from one sample, and Q-learning uses an off-policy target to learn optimal action values directly.

From Approximate Q-learning to DQN | CMU 07-280 Lecture 23

Lecture 23 replaces a huge Q-table with Qθ(s,a): first derive a gradient update for linear features from squared TD error, then add replay data and a fixed target network to form DQN.

How Monte Carlo Tree Search Connects to AlphaZero | CMU 07-280 Lecture 24

Spring 2026 Lecture 24 is MCTS, not Fall 2026 LLM post-training. It allocates simulations through selection, expansion, rollout, backup, and UCB, then connects policy/value heads and self-play to AlphaZero.

Stage Review I: From Search Problems to Supervised Learning | CMU 07-280 Topic Guide

Lectures 1–12 form one decision pipeline: define states, moves, and objectives, then use heuristics, losses, regularization, and backpropagation to control an otherwise intractable search space.

Stage Review II: Building AlexNet and GPT-2 as Working Systems | CMU 07-280 Topic Guide

Stage II uses HW8 and HW11 to test whether representation, computation graphs, training, transfer, and generation actually connect, rather than treating CNNs and Transformers as diagrams to memorize.

Stage Review III: From MDPs and Q-learning to AlphaZero | CMU 07-280 Topic Guide

Stage III connects value, policy, bootstrapping, function approximation, and MCTS into AlphaZero: a network supplies priors and estimates, search improves decisions, and self-play creates the next training set.

Introduction and Setup: Turning Language Problems into Computable Components | Stanford CS124 Week 1

Week 1 has no algorithms. The live introduction explains what the course teaches: which week covers each component of an LLM, which language algorithms outside LLMs are also taught, and why language is hard. PA0 sets up the Python and Jupyter environment the later assignments use.

The Minimal Structure of Deep Learning | MIT 6.S191 Lecture 1

Lecture 1 of the 2026 course builds the vocabulary shared by the rest of the course: perceptrons, forward propagation, loss, and gradient descent.

Sequence Modeling: From RNNs to Attention | MIT 6.S191 Lecture 2

Lecture 2 of the 2026 course addresses data where order changes meaning—text, audio, and time series—and connects directly to music generation in Lab 1.

Computer Vision: How Convolution Preserves Spatial Structure | MIT 6.S191 Lecture 3

Lecture 3 of the 2026 course moves from image tensors, convolution, and pooling to recognition systems, preparing for MNIST and face detection in Lab 2.

Generative Modeling: From Latent Spaces to Diffusion | MIT 6.S191 Lecture 4

Lecture 4 of the 2026 course separates generative from discriminative tasks, organizes VAE, GAN, and diffusion objectives, and leads into Lab 2’s DB-VAE.

Reinforcement Learning: Learning from Return Instead of Labels | MIT 6.S191 Lecture 5

Lecture 5 of the 2026 course connects agent, environment, state, action, reward, and policy into an interaction loop, introducing credit assignment and exploration.

New Frontiers: Choosing the Problem Beyond the Model | MIT 6.S191 Lecture 6

Lecture 6 of the 2026 course places deep learning in emerging applications and real constraints, emphasizing data, outputs, evaluation, and failure conditions.

The Three Laws of AI: Safety Through Observability and Evaluation | MIT 6.S191 Lecture 7

Lecture 7 of the 2026 course starts from Asimov’s literary laws and examines modern safety protocols through traces, test data, and continuous evaluation.

AI for Science: Putting Domain Structure into Learning | MIT 6.S191 Lecture 8

Lecture 8 of the 2026 course uses the scientific-discovery loop to show how simulators, AI emulators, and experiments cooperate instead of reducing science to generic prediction.

Massively Parallel Training: Memory and Communication Set the Boundary | MIT 6.S191 Lecture 9

Lecture 9 of the 2026 course starts with GPU memory pressure and moves through checkpointing, offloading, ZeRO, FSDP, and multiple forms of parallelism.

Generate Music with PyTorch and an LSTM | MIT 6.S191 Lab 1

In the 2026 lab, students cover tensors, autograd, and modules before turning ABC notation into character sequences for LSTM music generation.

From MNIST to Facial Debiasing with a DB-VAE | MIT 6.S191 Lab 2

In the 2026 lab, part 1 classifies MNIST with dense and convolutional networks; Part 2 learns a facial latent distribution with a DB-VAE and changes training sampling.

LoRA Fine-Tuning and LLM-as-a-Judge Evaluation | MIT 6.S191 Lab 3

In the 2026 lab, students build chat templates and generation with LFM2-1.2B, adapt style through LoRA, and combine OpenRouter with Opik for a judge workflow.

Deep Reinforcement Learning: From Decision Concepts to Policy Learning and Experiments | Berkeley CS285 Course Overview

Spring 2026 CS185/285 publishes slides for 25 lectures, nine discussion units, five assignments, and starter code; lecture recordings are public on the RAIL YouTube channel, but Ed, Gradescope, and office hours remain enrolled-only, while HW4 defaults to an H100, so this is not a zero-cost open course.

Advanced AI and Machine Learning: From Logical Planning to Generative Models | CMU 07-380 Course Overview

07-380 Fall 2026 is the first offering of CMU's new AI II: 26 lectures from logic, planning and optimization to probabilistic graphs and generative systems. As of the 2026-09-29 course site, the Lec1–9 slides, PR1–6 notes, Rec1–5 (with solutions) and HW1–3 are public, and this site now has 14 lecture-by-lecture guides for them. Slides after Lec10, HW4–7 and the final project are not out yet, so the course as a whole is still A2.

From AI Foundations to Machine Learning: Learning Paths through CS50 AI, CS181, and CS182 | Global AI/CS Course Map

CS50 AI is Harvard's most complete public entry point, but the Summer 2026 course still uses 2020 recordings and assignment assets while the rolling OCW projects have moved to other editions. CS181 Spring 2026 exposes current homework and notes without current recordings; CS182 Fall 2026 has not yet completed an offering.

Nine Lectures and Three Labs Are Public, but the Full Path Still Uses Three External Services | MIT 6.S191 Course Overview

MIT 6.S191's 2026 edition publishes nine lecture videos, slides, three software labs, and solutions, making it an A3 self-study course. The supplied path still depends on Google/Colab, Comet, and OpenRouter for Lab 3, while unaffiliated learners do not receive MIT credit, project feedback, or API credits.

From Languages to Information: An NLP Intro That Teaches Both tf-idf and LLMs | Stanford CS124 Course Overview

CS124 is the first course in Stanford's NLP track: ten weeks from tokenization, n-grams, text classification, information retrieval and embeddings to LLMs and Transformers. The textbook is the free Speech and Language Processing, and the nine assignment repos plus the lab problems and solutions are public; the pre-recorded videos, quizzes and autograding need a Stanford account.

AI Principles and Techniques: Reflex, States, Variables, and Logic | Stanford CS221 Course Overview

CS221 is Stanford's course on AI principles and techniques. It lays AI out in four layers — reflex, states, variables and logic — with deep learning as only the lowest one. The executable Python lectures and all eight assignments, with code skeletons and a local grader, are public; lecture recordings, hidden test cases and assignment solutions are not.

NLP with Deep Learning: From word2vec to Building Your Own Transformer | Stanford CS224N Course Overview

CS224N is Stanford's course on natural language processing with deep learning: it goes from word vectors and backpropagation to Transformers, every later lecture builds on Transformers, and the four assignments include writing a decoder-only Transformer yourself. The current slides and assignments are public, and Assignment 3 ships unit tests that run on a laptop; the complete public recordings come from an earlier offering and no longer match the current syllabus.

Natural Language Understanding: What It Adds After CS224N | Stanford CS224U Course Overview

CS224U is Stanford's natural language understanding course, the follow-on to CS224N: it covers domain adaptation for sentiment analysis, retrieval-augmented in-context learning, advanced behavioral evaluation and analysis methods, with a bake-off attached to each of the three assignments. The material is a public GitHub repo, and the slides and the full recordings of the online version are public too; the data loading in the first assignment needs a fix before it runs in a fresh environment.

Agentic AI: Formal Methods Against Hallucination | Stanford CS224V Course Overview

CS224V is Stanford's Agentic AI course: it teaches how to constrain LLM agents with formal semantics, knowledge graphs and formal methods so they fabricate less, with two assignments and then a project that carries most of the grade. The fourteen lecture decks, the reading list, the assignment handouts and the open-source systems the course uses (STORM, WikiChat, SUQL, Genie Worksheets) are public; there are no public recordings, the posted slides are deliberately incomplete, and the credentials the assignments need go only to enrolled students.

Machine Learning with Graphs: Where the 19 Lectures Focus and the Six Colab Assignments | Stanford CS224W Course Overview

CS224W is Stanford's machine learning with graphs course: nineteen lectures from node embeddings, GNNs, graph transformers and knowledge graphs to relational deep learning and GNNs with LLMs. The slides, three written homeworks and six Colabs are public and run as downloaded; the public recordings date from 2021, so the newer topics in the second half exist only as slides, and the exam and autograding are out of reach.

Probabilistic Graphical Models: Turning Exponential Inference into Polynomial | Stanford CS228 Course Overview

CS228 is Stanford's probabilistic graphical models course, in three parts — representation, inference and learning: graphs write down independence assumptions so that exponentially large probability computations become polynomial. What self-learners can get is the 16-chapter public notes, cs228-notes; lecture slides, recordings and the current assignments are not available.

From Linear Regression to Training Reasoning Models: A Course Map and Reading Routes | Stanford CS229 Course Overview

CS229 is the Stanford course that works through the mathematical derivations of machine learning. The Spring 2026 recordings make 17 lectures public: the first ten cover linear models, neural networks, and unsupervised learning, and the last seven go on to diffusion models, LLMs, and training reasoning models with reinforcement learning. This series has one post per lecture, and this post is the map: what each lecture actually teaches, where the video titles don't match, and where to pick up what the lecture notes cover but the lectures skipped.

aideep-dive

Stanford CS25 V6: A Course Called Transformers United Whose First Two Talks Weren't About Transformers

CS25 is Stanford's 1-unit seminar where attendance is the only homework and anyone can audit. Of the nine talks in the Spring 2026 season, the three worth your time are Albert Gu on the inductive biases of SSMs vs Transformers, Charles Frye on serving inference across thousands of GPUs, and Victoria Lin on what native multimodality still hasn't solved.

Engineering AI Agents: Building an Agent Harness from One Chat-Completion Call, No Frameworks | Stanford CS329Z Course Overview

CS329Z is Stanford's course on engineering AI agents: you first build RAG, tool use and the agent loop by hand without frameworks, then see what frameworks like DSPy abstract away; the two assignments are building an agent harness and designing an agent evaluation. The syllabus, the 50-paper reading list, the slides as they are released, and the starter code, data and public tests for Assignment 1 are available; the recordings require an enrolled Canvas login.

Language Modeling from Scratch: Five Assignments and a GPU Budget You Work Out Yourself | Stanford CS336 Course Overview

CS336 is Stanford's course on building a language model from scratch: five assignments cover the tokenizer and Transformer, training-systems optimization, scaling laws, data processing, and alignment and reasoning RL, with no code skeleton, only tests. The lectures, recordings, all five assignment repos and the leaderboards are public; from Assignment 2 on you supply your own compute, and the course-sponsored compute and grading are not available.

Berkeley AI/ML Course Guide: From CS61A to CS288, What Can You Actually Study Online? | Global AI/CS Course Map

Berkeley has no standalone undergraduate AI degree. A workable path builds on the CS BA or EECS BS foundation, enters through either CS188's broad AI curriculum or CS189's mathematical machine learning curriculum, then branches into deep learning, NLP, vision, or reinforcement learning. Many 2025–2026 courses are A3, but the newest class, the newest stable URL, and the best self-study edition are not always the same.

learningdeep-dive

CMU's AI Degrees: The First U.S. AI Bachelor's Turned 'What Should AI Students Learn?' into Graduation Requirements

Stanford has no AI degree; AI is a track inside CS. CMU launched the first U.S. B.S. in Artificial Intelligence in 2018, divided AI into four clusters, required one course from each, and made ethics a graduation requirement. At the master's level, MSAII sits not in CS but in the Language Technologies Institute; 84 of its 195 units cover an innovation process ending in a fundable capstone. Two official-page conflicts emerged during verification: whether the AI Core has two or three courses, and whether MSAII totals 192 or 195 units.

CMU AI/ML Course Guide: The New 07-280 Core and a Public Self-Study Route | Global AI/CS Course Map

CMU's current BSAI now runs through 07-280 and 07-380 before branching into an NLP/vision core and four AI clusters. 07-380 debuted in Fall 2026, and the same semester launched a graduate-level 11-768 AI Agents course. The residual Spring 2026 materials for 07-280 and the complete 10-301/601 site already support self-study; retired 15-281 remains a useful legacy route.

A Global Map of AI and CS Courses: Which Ones Can You Actually Study in Public? | Global AI/CS Course Map

This map audits AI and CS courses at Stanford, CMU, MIT, UC Berkeley, Harvard, and National Taiwan University (NTU) in 2025–2026 using four access labels: A0 for a visible catalog entry, A1 for a public syllabus, A2 for partial materials, and A3 for a self-study-ready package. A course site or YouTube playlist can exist without giving outsiders access to the current videos, assignments, or starter code.

From Programming and Mathematics to AI: A Learning Path through Open Courses | Global AI/CS Course Map

MIT has offered Course 6-4, a formal BS in Artificial Intelligence and Decision Making, since 2022. For an outside learner, however, the current degree requirements, the 2025–2026 course sites, and the best OCW editions rarely line up. A workable route follows 6-4's programming, algorithms, linear algebra, and probability foundation, then selects among 6.S191, 6.3900, 6.4110, 6.7960, vision, and robotics according to what is actually public.

Mathematical Foundations of Computing: How to Prove, Then What Can't Be Proven | Stanford CS103 Course Overview

CS103 is Stanford's mathematical foundations of computing course: the first half teaches proof writing through sets, logic, graphs and induction, and the second half covers finite automata, Turing machines, decidability and P vs NP. Slides, problem sets, starter files and the homegrown handouts are all public, and the autograded problems can be checked locally; solutions, practice exams and lecture recordings sit behind Stanford login.

Computer Organization and Systems: From C and Pointers to x86-64 and Writing Your Own malloc | Stanford CS107 Course Overview

CS107 is Stanford's computer systems course: it goes from bits, C strings and pointers to x86-64 assembly and the runtime stack, and ends with writing your own heap allocator, across seven assignments. Lecture slides, assignment specs and worked lab solutions are public; the assignment starter code lives on Stanford's AFS and is out of reach without a campus account.

Probability for Computer Scientists: From Counting and Inference to Machine Learning | Stanford CS109 Course Overview

CS109 is Stanford's probability course for computer scientists: it runs from counting, conditional probability and random variables to inference, maximum likelihood estimation, logistic regression and deep learning. The interactive course reader and the in-class worksheets with answer keys are public, and every lecture comes with an official LLM learning guide; slides after Lecture 15, the problem-set system and the recordings are closed to outsiders.

Operating Systems Principles: From Threads and Virtual Memory to File Systems | Stanford CS111 Course Overview

CS111 is Stanford's operating systems principles course, organized into concurrency, memory management and file systems, with nine assignments. All 28 lecture handouts, the nine assignment specs and three years of midterms and finals with solutions are public; the starter code requires a login on Stanford's myth machines, and the recordings are on Canvas.

Design and Analysis of Algorithms: From Divide and Conquer and Graphs to Dynamic Programming and Max Flow | Stanford CS161 Course Overview

CS161 is Stanford's design and analysis of algorithms course: eighteen lectures go from asymptotic analysis, divide and conquer and randomized algorithms to graph algorithms, dynamic programming, greedy algorithms and max flow. Lecture notes, slides, the eight homework handouts, section problems with solutions and the Python notebooks are public; recordings, homework solutions and exams are not.

Self-Improving Agents: The Course and Reading Route | Stanford CS329A Course Overview

Generating a correct candidate and recognizing it are different capabilities. This series follows the Autumn 2025 syllabus through a course overview and seventeen session guides covering all seventeen content sessions; five guest sessions have no public material and use public material from the speakers on similar topics instead; video Parts 7–9 map to sessions 8, 17 and 20.

A Reading Guide to Stanford's CS Courses: Ordered by Prerequisites, from CS106A to CS336 | Stanford's Main-Line CS Courses Course Map

Stanford CS rests on CS103, CS107, CS109, CS111, and CS161; CS221 names three of those plus CS106B as preparation. This guide combines official prerequisites with an explicitly editorial reading order and marks public-material and offering risks.

, Two Syllabi Side by Side: What Changed in a Year | Stanford CS146S Course Map

Stanford CS146S's Fall 2026 syllabus compresses prompting from a full week into a single bullet, drops the terminal and UI-generation weeks, and adds Agent Skills, Agent-Ready Codebases, Background Agents, and AI-Native Team. Grading moved too: the final project fell from 80% to 50%, with 30% now on open source contributions. This series reads all ten weeks.

aiguide

Which AI Courses to Take in 2026: From AI-Curious to Vibe Coding to Production

Every official course platform from OpenAI, Anthropic, and Google, plus Stanford CS146S/CS336, Elements of AI, Hugging Face, MIT 6.S191 and more — scraped page by page, then re-sorted into four tiers: AI-curious, vibe coding, shipping to production, and how models actually work. Also covers self-study repos still being updated in 2026 and browser-based platforms that need no local setup, filtered by last-commit date rather than star count. The conclusion: nearly all of it is free. What is scarce is not courses, it is the judgment to pick one. And tier four will not fix your tier three problem.