How information flows through transformers: the residual stream and the K/V stream

repligate · x · 2026-12-06

repligate publishes a long explainer arguing that existing "transformers explained" pages fail, and offering a cleaner mental model: transformers have two distinct information highways — the residual stream, flowing vertically through layers at each position, and the K/V stream, flowing horizontally across positions at each layer. The post walks through how K/V values are computed and combined per layer per position, with diagrams of causal orderings (720 total orders over six nodes, 76 starting from node 1) and the concept of a "foliation" — slices of events where order matters between slices but not within. Widely shared as a genuinely clear explanation.

Original post →

More from Research

Research channel →