The Residual Stream: How Transformers Actually Compute
About this lesson
Zero out a handful of dimensions in a transformer's residual stream and perplexity explodes by 600–1000%. Zero out random ones and almost nothing happens. This video traces why - from ResNets to Anthropic's privileged basis experiments. I cover how residual learning works (F(x) = H(x) − x), why the residual stream is best understood as a communication channel that attention and MLP layers read from and write to, and what Anthropic's kurtosis experiments reveal about where basis-aligned outlier features come from - testing LayerNorm, floating-point precision, and training dynamics as suspects. 📄 Papers covered: - Deep Residual Learning for Image Recognition (He et al., 2015): https://arxiv.org/abs/1512.03385 - A Mathematical Framework for Transformer Circuits (Elhage et al., 2021): https://transformer-circuits.pub/2021/framework/index.html - LLM.int8(): 8-bit Matrix Multiplication for Transformers at Scale (Dettmers et al., 2022): https://arxiv.org/abs/2208.07339 - Privileged Bases in the Transformer Residual Stream (Elhage, Lasenby & Olah, 2023): https://transformer-circuits.pub/2023/privileged-basis/index.html Chapters 00:00 What is residual learning 01:06 Deep Residual Learning for Image Recognition Paper Walkthrough 03:26 Transformers are residual networks and what is residual stream 05:52 How layers READ from and WRITE to residual stream? 07:02 Residual stream is a communication channel 08:25 Large values found in activations might signal that residual stream HAS a privileged basis 10:59 What causes large values found in Transformers activations 11:39 Random directions are isotropic Gaussian 14:25 LayerNorm hypothesis 15:54 Finite precision hypothesis 17:25 Finite precision and gradients hypothesis 📌 Subscribe for more AI deep dives! 🔥#DeepLearning #Transformers #ResidualLearning #AI #MachineLearning #ResNet #Interpretability #ml #transformers #anthropic #aiexplained Related Videos 1. Previous video that explains basic concepts
DeepCamp AI