In the architecture of transformer models, the residual stream acts as a central information highway. Unlike traditional neural networks that replace data at each layer, transformers continuously add new computations from attention and MLP layers back into the residual stream, allowing information to flow throughout the entire network.
This design helps preserve earlier context while enabling deeper layers to refine and build on existing representations. In the field of mechanistic interpretability, the residual stream is often viewed as the model's shared workspace where different components write and read information.
Importantly, the residual stream is not where the model stores knowledge—it is where knowledge is continuously updated and combined. This mechanism is fundamental to understanding how large language models and other transformer-based AI systems process information.