Why LLM Architectures Are Converging: Engineering Trade-offs in Attention, Residuals, and Memory Modules
This article explores the phenomenon of converging Large Language Model (LLM) architectures, focusing on the engineering trade-offs in attention, residual, and memory modules. It details how mixed attention mechanisms, multi-path residuals, and external lookup memories optimize performance and cost. The article also analyzes the drivers behind architectural convergence and divergence, provides guidance on technical attribution, and offers practical engineering selection strategies.
1. The Phenomenon: Architectural Choices are Converging
Over the past year or two, the structural design of Large Language Models (LLMs) has shown clear similarities. While the backbone of most solutions remains the Transformer, approaches to attention, residuals, and memory are increasingly aligned: some layers are replaced with efficient attention, inter-layer residuals are expanded from single-path to multi-path, and some parameters are attached externally as lookup tables. Looking solely at structural configuration tables, the differences between models from different teams appear minimal.
However, this convergence does not mean designs are entirely identical. The proportion, position, and implementation details of the same type of module vary significantly across solutions. Actual performance still depends on training data, training pipelines, and inference frameworks. Therefore, when evaluating architectural trade-offs, one must consider module types, mixing ratios, and supporting engineering simultaneously, rather than just comparing module names.
2. Attention: Why Mix Different Mechanisms?
Standard full attention sees its computational complexity grow quadratically with sequence length. During inference, the memory footprint of the Key-Value (KV) cache grows linearly with length. In long-context scenarios, these two costs quickly become bottlenecks.
The industry commonly employs three categories of responses:
- Linear Attention: Replaces pairwise interactions with state recursion. Computational complexity grows linearly with length, and cache footprint is smaller. The trade-off is that performance on exact retrieval tasks may be weaker than full attention.
- Sparse Attention: Each position only attends to a subset of candidate tokens, filtered by an indexer. It preserves some exact interactions, but the indexer adds implementation complexity and potential training stability issues.
- Local Window Attention: Only attends to content within a nearby window. It is simple to implement and suitable for local dependencies, but requires other layers to supplement global information.
In practice, efficient layers and full attention layers are often interleaved at a fixed ratio. The rationale is that efficient layers handle the bulk of sequence processing, while a few global layers supplement long-range retrieval capabilities. Some solutions adopt a ratio of about 3:1, meaning that out of every four layers, three are efficient layers and one is a global or sparse layer.
The following is a pseudo-code illustration of the layering strategy, used solely to explain the structural configuration:
def build_layer_plan(num_layers, ratio=(3, 1)):plan = []cycle = ratio[0] + ratio[1]for i in range(num_layers):if i % cycle < ratio[0]:plan.append("efficient_attention")else:plan.append("global_or_sparse_attention")return plan
The ratio itself needs to be determined experimentally. A ratio that is too high will impair retrieval capability, while one that is too low diminishes the cost advantages for long contexts.
3. Residuals: From Single-Path to Multi-Path
Residual connections allow signals and gradients to flow through deep networks. As models deepen, the information capacity of a single residual stream is limited, and information mixing between different layers is relatively coarse. Multi-path residuals expand inter-layer information channels by maintaining multiple parallel residual streams and learning the read/write weights between them.
The benefits of this design are primarily reflected in training stability and representational capacity. The cost is an increase in activation memory and communication overhead. In model-parallel training, multi-path states require additional synchronization. Therefore, multi-path residuals must be considered alongside engineering techniques like operator fusion and recomputation, otherwise training throughput will drop significantly.
The stability of multi-path residuals also depends on initialization and normalization methods. Simply increasing the number of paths without adjusting these supporting settings can lead to loss oscillations during training.
4. External Memory: Decoupling Parameters and Computation
Conditional memory or lookup table modules organize a portion of parameters into a table that can be queried by key. During inference, each token only reads a small number of entries to participate in computation. Its advantage is that the total parameter count can increase while the activation computation per token remains basically unchanged. This is conceptually similar to the Mixture-of-Experts (MoE) structure, both trading sparse activation for model capacity.
Lookup table modules need to solve three key issues:
- How the lookup keys are designed, which determines what information can be retrieved.
- Whether reading the table affects latency, especially during batch inference.
- How the table content remains consistent between training and inference.
These issues are often more difficult to manage during deployment than the structure itself and require dedicated testing during the evaluation phase.
5. Why Are Structures Converging?
Architectural convergence is primarily driven by four factors:
- Similar Inference Cost Constraints: Long-context and high-concurrency scenarios have broadly similar demands on memory and latency, naturally centralizing solutions.
- Broad Reuse of Public Research: Once a method is validated in a paper, other teams typically adjust implementations based on it rather than starting from scratch.
- Evaluation System Driven: The capabilities focused on by benchmarks are relatively fixed. The metrics optimized by different teams converge, making structural choices similar.
- Mature Engineering Ecosystem: Inference engines and training frameworks increasingly support common operators, lowering the migration cost of adopting mainstream architectures.
6. Why Do Routes Still Diverge?
Even with similar technical backgrounds, teams’ choices still show significant differences, mainly influenced by the following factors:
- Risk Appetite: Radical structural changes may yield higher returns but also risk training failure. Well-resourced teams are more willing to take these risks.
- Training Pace: The scope of possible structural changes differs completely between pre-training from scratch and post-training iterations on an existing base model. The latter usually only allows replacing partial modules at a lower cost.
- Product Goals: Long-text, edge deployment, and inference throughput have different focuses, directly determining mixing ratios and memory capacity settings.
- Existing Assets: Teams with mature training pipelines tend to prefer incremental modifications.
7. Module Sources and Technical Attribution
When discussing architecture, a common question is who first proposed a certain module. When evaluating this, it is recommended to distinguish three levels of information:
- First Public Description: Usually found in papers or technical reports; should be based on the original literature’s publication time and authors.
- Subsequent Adoption: Other teams explicitly acknowledging or citing in official documentation; this information can be verified.
- Implementation Differences: Modules with the same name may use different indexing methods, normalization, or initialization across different models, and should not be directly considered the same implementation.
When writing or referencing technical materials, original phrasing should be preserved, distinguishing between “officially stated” and “inferred from structure.” For versions obtained through post-training iterations on existing models, it should be noted that they are not re-pre-trained base models to avoid conflating the two.
8. Engineering Selection Suggestions
When selecting architectures, the benefits and costs of each module type can be evaluated item by item according to the table below:
| Module Category | Main Benefit | Main Cost | Selection Focus |
|---|---|---|---|
| Efficient Attention | Reduces compute and cache footprint for long sequences | Exact retrieval capability may decrease | Validation results on retrieval tasks |
| Sparse Attention | Preserves partial global interactions | Complex indexer, risk of training instability | Indexer quality and decoding latency |
| Multi-path Residual | Expands inter-layer information channels | Increased activation memory and communication overhead | Initialization, normalization, and parallel strategy |
| Lookup Memory | Decouples parameter count and compute | Lookup latency, train/inference consistency | Key design and cache hit rate |
The evaluation process can be written as a unified check function, illustrated below:
def evaluate_architecture(candidate):checks = {"long_context_recall": run_retrieval_benchmark(candidate),"decode_latency": measure_decode_latency(candidate),"peak_memory": measure_peak_memory(candidate),"loss_stability": check_loss_curve(candidate),}passed = all(result.ok for result in checks.values())return passed, checks
For implementation, it is recommended to follow these principles:
- Change only one structural variable at a time, keeping a baseline model for comparison.
- Validate a single module in small-scale experiments first before combining them.
