Episodes from AI Engineer about LLM Internals.

Text Diffusion — Brendan O’Donoghue, Google DeepMind
Jun 4, 2026 · 28:03
Brendan O'Donoghue, a research scientist at Google DeepMind, explains that text diffusion models generate tokens 10x faster than autoregressive models by performing 24 denoising steps to produce 256 tokens, dramatically reducing memory transfers. Unlike GPT-4o and Gemini 2.5 Flash, which incorrectly answered 40 and 42 on a math problem, Gemini Diffusion used bidirectional attention to self-correct from 60 to 49 to 39. The model adaptively allocates compute: 4 steps for memorized digits of π, 31 for quantum mechanics, and automatically stops when satisfied. Text diffusion also enables in-place editing, demonstrated by fixing code bugs or adding paragraphs. However, lower throughput on large batches makes it expensive to serve at scale today. O'Donoghue showcases low-latency applications: a fully generated Wikipedia, a Reddit clone with AI text and images, an on-the-fly operating system, and a to-do app built in 15 seconds by voice.

Training an LLM from Scratch, Locally — Angelos Perivolaropoulos, ElevenLabs
May 4, 2026 · 1:21:26
Angelos Perivolaropoulos from ElevenLabs walks through building a small GPT-2-like LLM from scratch on a local machine, demonstrating that the core techniques used by major labs are accessible in a few hundred lines of PyTorch code. The workshop uses character-level tokenization (65 tokens) on a Shakespeare dataset to enable fast training with limited compute. The model architecture includes multi-head self-attention, MLP layers, residual connections, and layer normalization, totaling 10 million parameters across six transformer blocks with a 256-token context window. The training loop employs next-token prediction with a warm-up cosine decay learning rate schedule and validation loss to detect overfitting. Inference uses temperature sampling (default 0.7) and top-k sampling to improve creativity. Perivolaropoulos explains that audio and multimodal models share the same transformer foundation but differ in tokenization (e.g., mel-spectrograms for audio) and use specialized losses like L2 or KL divergence, while reasoning models result from post-training base models with high-quality chain-of-thought data.

How LLMs work for Web Devs: GPT in 600 lines of Vanilla JS - Ishan Anand
Jul 13, 2025 · 1:41:34
Ishan Anand shows that GPT-2 small implemented in 600 lines of vanilla JavaScript makes LLMs understandable for web developers without ML backgrounds. He explains tokenization via byte-pair encoding, 768-dimensional embeddings representing semantic meaning via co-occurrence, and the Transformer's attention mechanism that lets tokens share context. The multi-layer perceptron learns next-token prediction through backpropagation, while the language head converts embeddings to token probabilities using softmax. Anand demonstrates each step—tokenization, embedding lookup, positional encoding, attention, MLP, and output—in a browser debugger, and notes that GPT-2's architecture underpins ChatGPT, with innovations like scale, supervised fine-tuning, and RLHF. The workshop provides an intuitive mental model of Transformers, turning perceived AI magic into understandable machinery.
Powered by PodHood