Attention Revolution Along the Depth Dimension: Rethinking Residual Connections in Large Models
This article examines a long-overlooked bottleneck in modern LLM architecture: the fixed residual connection. It explains the "PreNorm dilution" effect—where hidden states accumulate with equal weights and each layer's contribution fades as models deepen—and introduces the time-depth duality perspective that motivates attention-based residuals. Readers will learn how replacing fixed addition with dynamic, content-aware aggregation of historical layer outputs works, what engineering constraints it involves, and what practical steps teams can take to validate and adopt this direction.
Attention Revolution Along the Depth Dimension: Rethinking Residual Connections in Large Models
Introduction: The Overlooked “Law of Physics”
Over the past few years, architectural innovation in large language models has swept through nearly every corner of the Transformer. Attention mechanisms have evolved into multi-query, grouped-query, and even linear attention variants; feed-forward networks have been replaced by sparse mixture-of-experts structures; positional encoding has moved from absolute positions to rotary position embeddings; and normalization layers are still being debated between LayerNorm and RMSNorm.
Yet one component has remained virtually unchanged for almost a decade since its birth: the residual connection. The simple additive formula h_l = h_{l-1} + f_l(h_{l-1}) has been treated as an unquestionable law of physics. A recent architecture paper that sparked wide industry discussion (and even received public endorsements from several well-known tech figures) challenges this law: a fixed, indiscriminate additive residual mechanism is seriously limiting the expressive power of deep models. This article systematically breaks down the problem and the proposed solution.
1. Diagnosing the Problem: The PreNorm Dilution Effect
1.1 How Hidden States Accumulate in Modern Architectures
Almost all mainstream large models today adopt the PreNorm structure, where normalization sits inside each sub-layer and the residual path applies no transformation at all. This means that from the first layer to layer L, the hidden state is essentially an equal-weight accumulation of all preceding layer outputs:
h_L = h_0 + f_1(h_0) + f_2(h_1) + ... + f_L(h_{L-1})
Every term carries a fixed coefficient of 1. The model cannot express preferences such as “the output of layer 3 matters more than that of layer 20.”
1.2 Two Consequences of Dilution
This design creates two direct problems as models grow deeper:
- Persistent magnitude inflation: because every term contributes positively to the sum, the norm of the hidden state keeps growing with depth, putting pressure on numerical stability and training hyperparameters;
- Diluted per-layer contribution: assuming each layer adds information of roughly similar magnitude, the new information from layer l accounts for only about 1/l of the total. The deeper the model, the fainter each layer’s new “voice” becomes, making it hard for deep layers to finely correct existing representations.
The authors name this phenomenon “PreNorm dilution.” It explains why simply stacking depth yields rapidly saturating returns: it is not that deep layers fail to learn, but that what they learn gets drowned in the ocean of historical accumulation.
2. The Core Idea: Time-Depth Duality
The most inspiring aspect of the paper is an analogical perspective—the time-depth duality.
2.1 Revisiting How Attention Revolutionized RNNs
What did recurrent neural networks do along the time dimension? They compressed histories of arbitrary length, indiscriminately, into a fixed-size hidden state vector. Whether the 100th token or the 1st token mattered more, both were “kneaded” together equally, and early information decayed and was forgotten as steps accumulated.
The Transformer’s breakthrough was attention: instead of compressing history, it preserves the states of all historical positions and lets the current position retrieve information on demand through query-key matching. The time dimension thus shifted from “lossy compression” to “addressable memory.”
2.2 The Isomorphic Problem Along Depth
Rotate this perspective 90 degrees to look at the depth dimension, and a striking isomorphism emerges:
| Dimension | Old Mechanism | Problem | Revolutionary Solution |
|---|---|---|---|
| Time (sequence) | RNN recurrent compression | Historical information mixed indiscriminately | On-demand retrieval via attention |
| Depth (layers) | Fixed residual accumulation | Previous layer outputs added indiscriminately | ? |
The standard residual connection is exactly the “RNN” of the depth dimension—it blindly compresses information from all previous layers into an ever-inflating hidden state. Since the time dimension has already been revolutionized by attention, the fixed residual along depth deserves the same revolution.
3. The Solution: Attention Residuals
3.1 The Basic Idea
The core change of the new architecture can be summarized in one sentence: replace the fixed addition on the residual path with a weighted aggregation of historical layer outputs, where the weights are computed dynamically in an attention-like manner.
Conceptually, layer l no longer receives only h_{l-1}; instead, it can see a “set of historical layer outputs” and decides, through a query-key-like mechanism, how much information to read from each layer’s history:
# Traditional residualh_l = h_{l-1} + f_l(norm(h_{l-1}))# Attention residual (illustrative)scores = softmax(q_l · [k_0, k_1, ..., k_{l-1}]) # relevance to each historical layerh_agg = Σ scores[i] * v_i # weighted aggregation of historyh_l = h_agg + f_l(norm(h_agg))
In this way, every layer gains “addressable read” access to information along the depth dimension: low-level features from shallow layers can be retrieved directly by deep layers, without being relayed through dozens of accumulations.
3.2 Key Engineering Considerations
Computing pairwise attention across all layers directly would make complexity grow quadratically with depth—unacceptable for models with hundreds of layers. Practical implementations therefore typically combine the following engineering designs:
- Compressed historical representations: rather than storing the full outputs of every layer, maintain a low-dimensional, updatable inter-layer memory—similar to replacing a full key-value cache with a compact summary state;
- Chunked or sliding-window aggregation: attend only to a few neighboring layers or to representative layers sampled at fixed strides, keeping compute overhead under control;
- Cooperation with normalization: the aggregated representation has controllable magnitude, which naturally mitigates the norm-inflation problem under PreNorm and yields smoother training curves.
3.3 Relationship to Prior Improvements
It should be noted that “letting deep layers access shallow-layer information” is not an entirely new idea—DenseNet’s dense connections and the gating of Highway Networks share a similar intuition. The differences of this approach are:
- The weights are dynamically content-aware, rather than statically learned fixed gates;
- Complexity constraints are designed for modern LLM scale, not a theoretical toy from the small-model era;
- It provides a clear pathological diagnosis starting from PreNorm dilution, rather than pure engineering stacking.
4. Implications for Developers
4.1 A Signal for Architecture Selection
The biggest signal from this work is that the “untouchable constants” of LLM architecture are running out. With attention, feed-forward networks, positional encoding, and normalization all reinvented one by one, the residual connection—the last remaining “constant”—is now being re-examined, which means foundational architecture still holds considerable room for innovation. Teams working on model development should pay attention to diagnostic tools at the training-dynamics level (such as per-layer output magnitudes, effective rank, and information share) instead of staring only at the loss curve.
4.2 Practical Recommendations
For teams looking to explore this type of architecture, a few practical suggestions:
- Reproduce the pathology first: on your own PreNorm models, measure how hidden-state norms grow with depth and verify whether the dilution effect is significant;
- Validate in small steps: on small-scale models, compare the convergence speed and downstream-task performance of fixed residuals versus weighted residuals before deciding whether to scale up investment;
- Leverage infrastructure: architectural exploration requires massive parallel experiments. Teams can rely on general-purpose cloud capabilities provided by Baidu AI Cloud—container platforms, distributed training acceleration, log services, and monitoring/alerting—to build an efficient experiment pipeline, keeping attention on the algorithms themselves rather than environment operations.
Conclusion
“Along the time dimension, RNNs were replaced by attention; along the depth dimension, fixed residuals should also be attention-ized.” This sentence captures the soul of this round of architectural exploration. The transformation of the residual connection from an unshakable “law of physics” into a design variable that can be examined and reconstructed itself marks a more mature stage of LLM research: nothing is taken for granted, and everything can be re-derived from first principles. For every architecture researcher, this mindset may be more valuable than any single technical solution.
