Category: LLMs from Scratch

LLM_scratch #001: Large Language Models Explained Briefly — The Whole Picture in 8 Minutes

Large Language Models Explained Briefly — The Whole Picture in 8 Minutes Highlights: A large language model is one big function. It reads a piece of text and returns a probability for every possible next word. Grant Sanderson (3Blue1Brown) packs the whole story into eight minutes. It covers next-word prediction, parameters, training by backpropagation, a compute bill of more than 100 million years, pretraining versus RLHF, and the Transformer’s attention and feedforward blocks. This is…
Read more

LLM_log #039: Policy Gradient Baselines — From REINFORCE to GRPO

Policy Gradient Baselines — From REINFORCE to GRPO Highlights: Subtracting a simple 0.5 baseline cuts the gradient’s standard deviation from 0.325 to 0.108 without biasing the update, and GRPO gets its baseline for free from a group of rollouts. In CMU 11-768 AI Agents (Fall 2026), Daniel Fried explains why reinforcement learning for language agents requires relative reward baselines rather than raw trajectory returns. We walk through the mathematical proof of zero-bias baselines, analyze variance…
Read more

LLM_log #038: Policy Gradients — From Imitation to REINFORCE

Policy Gradients — From Imitation to REINFORCE Highlights: SFT can only copy demonstrations and never learns from failure; REINFORCE instead weights every sampled run by its reward, and with 0/1 rewards it becomes SFT on the successes. Daniel Fried’s lecture in CMU 11-768 AI Agents (Fall 2026) analyzes the limitations of supervised fine-tuning and establishes interactive reinforcement learning formulations for language agents. Using a pedagogical Number Search environment, we walk through POMDP trajectories, exposure bias,…
Read more

LLM_log #037: Coding Agents — Localize, Edit, Verify

Coding Agents — Localize, Edit, Verify Highlights: Coding agents now fix real repository issues: Hybrid-Gym lifts SWE-bench Verified from 7% to 32.4%. Graham Neubig’s lecture in the CMU 11-768 AI Agents course (Fall 2026) examines the transition from one-pass code prompting to iterative agentic software engineering. We walk through the localize-edit-verify repair loop, diff format tradeoffs, synthetic task generation via mutation, and multi-harness reinforcement learning. We also cover multimodal frontend testing and expanding agent evaluation…
Read more

LLM_log #036: Training Code LLMs — Data, Infilling, Tests

Training Code LLMs — Data, Infilling, Tests Highlights: Train only on code and MATH scores collapse from 33.2 to 10.3. The right data mix, infilling and test feedback make code models work. Graham Neubig’s lecture in CMU 11-768 AI Agents (Fall 2026) outlines the technical foundations required to build autonomous code generation systems and repository-level software engineers. We walk through the progression across three capability tiers, data curation and whitespace-preserving tokenization, bidirectional causal infilling, and…
Read more