Attention Residuals Along the Depth Dimension: A New Exploration in LLM Architecture
Residual connections have remained largely unchanged in large language model architectures, even as attention, feed-forward networks, normalization, and positional encoding have evolved. This article examines the limitations of fixed residual accumulation in deep networks—such as information dilution and the lack of selective access to historical layer outputs—and introduces the concept of attention residuals, which apply attention-like dynamic weighting along the network depth dimension. It covers the technical rationale, potential benefits, engineering challenges, and evaluation criteria for this emerging architectural direction.
Attention Residuals Along the Depth Dimension: A New Exploration in LLM Architecture
Throughout the evolution of large model architectures, attention mechanisms, feed-forward networks, normalization methods, and positional encodings have all gone through multiple rounds of iteration. Residual connections, however, have remained remarkably stable in form. The common pattern is: each layer first normalizes its input, applies an attention or feed-forward transformation, and then adds the transformed output directly back to the original input.
This design is simple, stable, and easy to optimize—one of the key reasons deep networks can be trained successfully at all. Recently, however, researchers have begun to re-examine a long-assumed premise: along the depth dimension, is accumulating all intermediate results with fixed weights truly appropriate as model scale keeps growing?
The answer is not necessarily yes.
1. What Problem Do Traditional Residual Connections Solve?
Let the hidden state at layer (l) be (h_l), and the transformation function of the current layer be (F_l). The most basic residual form can be written as:
[
hl=h{l-1}+Fl(h{l-1})
]
Its value lies primarily in three aspects.
First, the residual path provides a shorter channel for gradient propagation. Even if a layer’s transformation performs poorly, information can continue flowing through the skip connection, mitigating the vanishing gradient problem in deep networks.
Second, the residual structure allows each layer to learn only “incremental information.” The network does not need to reconstruct a complete representation at every layer; instead, it refines an existing state, which is typically easier to optimize than learning a complex mapping from scratch.
Third, residual connections are engineering-friendly. They require no additional content-addressing modules and add virtually no parameters, which is why they have long been widely used in vision networks, sequence models, and large language models.
But simplicity does not mean there is no cost. As depth increases, the residual state effectively becomes the accumulation of outputs from many previous layers:
[
hL=h_0+\sum{l=1}^{L}Fl(h{l-1})
]
This means information from early layers persists all the way to later layers, participating in computation in a fixed manner by default. The network can partially correct this through normalization and parameter learning, but such correction is not the same as truly having the ability to “select historical information on demand.”
2. The “Information Dilution” Problem in Deep Models
In models using pre-normalization, hidden states are typically normalized before entering attention or feed-forward modules. This structure benefits training stability, but it also introduces a phenomenon worth attention: historical information in the residual backbone keeps accumulating, while each layer’s newly added content is only a small fraction of the whole.
A layer’s state can be thought of as a mixing container. As depth grows, more and more content accumulates in the container, and the proportion of the overall representation contributed by freshly written information from the current layer may gradually shrink. A single layer’s computation remains effective, but its marginal influence on the final state weakens.
This phenomenon can be understood from three angles.
2.1 Historical Information Weights Lack Selectivity
In traditional residual structures, outputs from earlier layers can only be adjusted indirectly by subsequent layers. Once information from an early layer enters the backbone, it persists unless later layers actively cancel it out.
This is analogous to placing all historical results into a fixed-size state without any explicit read-and-filter mechanism. For simple tasks, this accumulation may suffice; but for tasks requiring multi-step reasoning, long-range dependencies, and complex abstraction, fixed accumulation may limit the efficient use of representational capacity.
2.2 As Depth Increases, the Relative Contribution of New Information Declines
If each layer produces increments of similar magnitude, the overall magnitude of the hidden state may grow with depth. Even though normalization controls the numerical range, it cannot fully eliminate the problem of “new content being surrounded by massive historical content.”
This does not mean the model cannot be trained—it means the model must spend extra capacity learning how to balance old and new information.
2.3 Different Layers Should Not Be Treated Equivalently
In practice, shallow layers tend to focus on local patterns and basic semantics, middle layers handle compositional relationships, and deep layers take on abstract reasoning and task-specific transformations. If every layer’s output enters the final state in the same way, it becomes difficult to reflect the functional differences between layers.
A natural question follows: can the network dynamically select intermediate states across depths, the way it selects historical tokens in a sequence?
3. From Temporal Attention to Depth Attention
The core idea of traditional sequence attention is to stop compressing all historical information into a single fixed state. Instead, multiple historical positions are retained, and different weights are assigned to them during computation based on current needs.
If we treat network depth as another kind of “sequence,” then every intermediate layer can be viewed as a depth position. The model does not have to sum all layer outputs directly; it can perform weighted reads over representations at different depths based on the current token, the current layer state, and task requirements.
One abstract form is:
[
\tilde{h}l=\sum{i=0}^{l}\alpha_{l,i}v_i
]
Where:
- (v_i) denotes the representation produced at the (i)-th depth position;
- (\alpha_{l,i}) denotes the selection weight of the current layer over historical depth positions;
- (\tilde{h}_l) is the state after depth aggregation;
- The weights typically need to satisfy a normalization constraint, such as summing to 1.
Unlike fixed residuals, this approach allows the model to dynamically decide:
- Which early information remains useful;
- Which intermediate-layer representations deserve to be emphasized;
- Whether the current layer should rely more on the raw input or on deeper abstract results;
- Whether certain outdated or redundant representations should be suppressed.
This is the key idea behind “attention residuals”: not to eliminate residuals, but to transform the residual path from fixed addition into learnable information routing.
4. How Attention Residuals Differ from Ordinary Inter-Token Attention
It is important to note that attention residuals are not simply a copy of token attention inside the model.
Ordinary self-attention operates along the sequence length dimension. For an input sequence, the model computes relevance between different tokens, answering the question: “which contexts should the current position read?”
Attention residuals operate along the network depth dimension. They answer the question: “which historical layer representations should the current position read?”
The two operate on different dimensions, but share a similar philosophy:
| Mechanism | Primary Selection Target | Problem Addressed |
|---|---|---|
| Sequence attention | Tokens at different positions | Retrieving relevant information from context |
| Attention residual | Intermediate representations at different depths | Selecting useful features from historical layers |
| Fixed residual | Current state and new increment | Accumulating information in a fixed way |
From this perspective, attention residuals are not merely an added module—they redefine how information flows between layers.
5. Potential Technical Benefits
5.1 Improved Controllability of Deep Representations
Fixed residuals assume by default that all historical information is worth keeping, while dynamic weighting allows the model to filter information. In theory, this helps reduce redundant representations and alleviates the over-mixing of states as depth increases.
5.2 Better Collaboration Across Depths
Some tasks rely more on shallow lexical and local structure, while others require deep abstract relationships. Dynamic depth aggregation allows different tasks to form different inter-layer read patterns, rather than forcing all tasks to share the same residual pathway.
5.3 Increased Marginal Value of Each Layer’s Computation
If later layers can explicitly access and recombine historical representations, the information produced by each layer no longer has to be permanently compressed into a single backbone state. In theory, this reduces the risk that “the deeper you go, the harder it is for new information to make a difference.”
5.4 A New Design Space for Depth Scaling
In the past, scaling model depth mainly focused on adding layers, adjusting normalization, scaling residuals, or changing initialization strategies. Attention residuals offer another path: not only adding more layers, but also improving how those layers connect to each other.
6. Key Engineering Challenges
The architectural idea is appealing, but real-world implementation faces significant challenges.
6.1 Computation and Memory Overhead
If every layer needs access to all historical layer representations, the cost of depth aggregation grows with the number of layers. In large-scale training, storing many intermediate states adds substantial memory pressure.
Practical implementations usually require trade-offs such as:
- Accessing only a subset of historical layers;
- Using grouped or segmented aggregation;
- Compressing historical representations;
- Adopting local depth windows;
- Using low-rank or gating forms to approximate full attention.
Therefore, fully connected depth attention in theory is not necessarily the optimal engineering solution.
6.2 Training Stability
Fixed residuals are inherently stable. After switching to dynamic weighting, the weight distribution may become overly concentrated, fluctuate dramatically, or cause inter-layer competition.
If attention weights concentrate on a few layers for too long, the model may degenerate into a shallow pathway; if weights are too uniform, the benefit of dynamic selection is lost. Reasonable initialization, normalization, temperature control, or regularization strategies are typically needed.
6.3 Cache Management During Inference
In autoregressive generation, the model already manages caches along the sequence dimension. If the depth dimension also retains large numbers of historical representations, the cache structure becomes much more complex.
Engineering design must clearly define which representations need long-term retention, which can be discarded, and how to reduce memory usage while preserving model quality.
6.4 Compatibility with Existing Hardware Compute Patterns
Modern accelerators are highly optimized for regular matrix multiplication and fixed computation graphs. Dynamic depth selection may introduce extra data reads and irregular access patterns, meaning theoretical FLOP reductions may not translate into proportional throughput gains.
Evaluating such structures therefore requires looking beyond parameter counts or theoretical complexity, and considering:
- Actual training throughput;
- Memory footprint;
- Communication costs;
- Inference latency;
- Efficiency at different batch sizes;
- Scalability in long-context scenarios.
7. How to Objectively Evaluate This Kind of Architectural Innovation
The value of attention residuals lies first in raising a question worth studying: should residual connections always take the form of fixed accumulation?
This does not mean traditional residuals have failed, nor that dynamic residuals are necessarily superior on every task. The advantages of fixed residuals remain clear: simple structure, mature training practices, hardware friendliness, and low engineering cost.
A more reasonable interpretation is that residual connections may evolve from “fixed pathways” toward “learnable pathways.” For shallow models or resource-sensitive tasks, the traditional form may already be sufficient; for very deep models with complex reasoning chains and strong representation-reuse demands, dynamic depth aggregation may offer greater exploratory value.
When evaluating such methods, the following metrics deserve close attention:
- Whether model quality improves stably under the same parameter count and training budget;
- Whether the added computation and memory overhead is acceptable;
- Whether the model has genuinely learned meaningful depth selection;
- Whether gains are concentrated on specific tasks or generalize broadly;
- Whether results remain consistent across different depths, context lengths, and training scales.
8. Conclusion
The essence of traditional residual connections is “retain and accumulate,” while attention residuals further introduce “select and read.”
Along the temporal dimension, attention has already proven the value of dynamically retrieving historical information. Extending a similar idea to the network depth dimension is essentially a rethinking of inter-layer information flow: historical layers are no longer passively accumulated increments, but can become a set of representations accessed dynamically according to current needs.
This kind of design may alleviate information dilution, representation mixing, and inter-layer collaboration problems in deep networks—but it may also bring higher computational, storage, and implementation complexity. Its true significance is not just adding a new computational module, but reminding us that as model scale continues to grow, the fundamental connection patterns that have remained unchanged in our architectures are equally worth re-examining.
Future optimization of large models may focus not only on attention, feed-forward networks, or parameter scale, but also on how information flows across layers, which representations should be preserved, and whether the model can actively choose its own computational pathways based on task demands.
