Residual Stream Duality

A two-axis view of the residual stream
Sequence position and layer depth offer different pathways for information flow — causal depth-wise residual attention is equivalent to sequence-axis short sliding-window attention.

March 16, 2026  ·  arXiv:2603.16039
Residual Stream Two-Axis View Depth vs Sequence Sliding-Window Attention

Abstract

The residual stream is the backbone of modern Transformers, yet it is usually treated as a single additive channel. We propose a two-axis framework in which sequence position and layer depth provide distinct pathways for information to flow and be mixed.

Within this view, causal depth-wise residual attention — attention that mixes representations across layers — turns out to be equivalent to sequence-axis short sliding-window attention. This duality connects depth-wise and sequence-wise designs, clarifying how locality along one axis corresponds to structure along the other and suggesting a unified design space for residual architectures.

Read the Paper Code

The Duality at a Glance

Residual stream duality: depth vs. sequence axes.
Figure: The residual stream viewed along two axes — depth-wise residual attention on the layer axis mirrors short sliding-window attention on the sequence axis.

Citation

If you find this work useful, please cite:

@article{zhang2026residual,
  title   = {Residual Stream Duality in Modern Transformer Architectures},
  author  = {Zhang, Yifan},
  journal = {arXiv preprint arXiv:2603.16039},
  year    = {2026}
}