Large Model Architecture Evolution: Why Attention Is Returning to Multi-Query
This article examines a recent open-source model preview that dropped Multi-head Latent Attention (MLA) and returned to Multi-Query Attention (MQA), and explains why that counterintuitive choice matters. It compares MHA, MQA, and MLA in terms of KV cache size, memory bandwidth, and expressiveness, then shows how attention changes force system-level adjustments across parallelism, operator fusion, cache management, and communication. The article also covers optimizer and compiler co-design, and closes with a practical checklist for engineering teams evaluating model architectures and inference cost.
1. Why a “Rollback” Is Worth Watching
A team released a preview of a new ultra-large open-source model last week. The parameter count is roughly twice that of the previous generation, and the technical report and weights were published alongside it. The focus of community discussion was not a capability leaderboard, but a counterintuitive architectural decision: the model dropped the Multi-head Latent Attention (MLA) used in the previous two generations—a scheme that compresses the key-value cache into a low-dimensional latent space to reduce memory usage—and went back to the older Multi-Query Attention (MQA), where all query heads share a single set of keys and values.
The significance is that it breaks an implicit assumption the industry has held for more than half a year: that the attention structure of advanced open-source models has converged, leaving only local fine-tuning. In reality, the architecture space is far from closed. The direct takeaway for developers is not to treat any single generation’s implementation as the default answer. When selecting a model, evaluate cache shape, bandwidth requirements, and parallelism partitioning together.
2. The Basic Trade-offs of Three Attention Variants
Understanding this rollback requires clarifying the trade-offs among three attention types.
- Original Multi-Head Attention (MHA): each head has its own keys and values, giving strong expressiveness, but the cache grows linearly with the number of heads, and decoding is clearly constrained by memory bandwidth.
- Multi-Query Attention (MQA): only one key-value head, so the cache is the smallest and most bandwidth-friendly, but expressiveness is limited and training stability is more sensitive.
- Latent Attention (MLA): projects keys and values into a low-dimensional latent space and caches the latent vectors, aiming to balance compression ratio and expressiveness. The cost is extra projection and inverse-projection computation on the decoding path, plus higher demands on operator implementations in inference frameworks.
Roughly speaking, the memory access per generated token during decoding is proportional to the number of cache bytes, and the cache bytes are determined jointly by the number of layers, the number of key-value heads, the head dimension, and the sequence length:
# Illustrates the order of magnitude only, not any specific implementationkv_bytes = 2 * layers * kv_heads * head_dim * seq_len * dtype_bytes# MQA: kv_heads = 1; MHA: kv_heads = num_heads
When total parameters reach the trillion scale and context length keeps growing, the cache term becomes the main throughput bottleneck. At that point, the contest between “compute a little less, store a little more” and “store a little less, compute a little more” is essentially solving a constrained optimization problem under specific hardware and framework conditions.
3. The Real Difficulty Is System-Level Coupling
The most worthwhile part of the technical report is that it describes the improvement as a set of interconnected decisions rather than a single-point innovation. Change the attention structure, and the parallelism strategy, operator fusion boundaries, cache management, and communication distribution all have to be rearranged. The sharding of optimizer states, the numerical precision strategy, and the long-sequence partitioning scheme shift as well. If any one of these fails to keep up, the cache savings on paper get eaten by extra communication or inefficient operators.
This explains why “switching back to MQA” looks simple but is hard to land: it requires the training framework and the inference framework to agree on the same memory layout. A common practice is to break such changes into independently verifiable steps:
- First align numerical error on a single layer with short sequences, confirming that precision is controllable.
- Then measure throughput and memory curves at medium scale, locating whether the new operators become hotspots.
- Finally validate communication changes on multiple machines and GPUs, confirming that linearity has not been broken.
4. Optimizer and Compiler Co-Design
Another thread mentioned repeatedly is the deep use of optimizer improvements and deep learning compilers in the open-source community. Matrix-type optimizers (a class of methods centered on orthogonalizing the momentum matrix) can improve convergence for large models, but they introduce extra matrix-decomposition-style computation. Training overhead stays manageable only if the compiler can fuse these fragmented operators and automatically handle memory planning and scheduling. The lesson for teams is that whether algorithmic gains materialize often depends on whether the compilation and scheduling layer is expressive enough.
5. A Practical Checklist for Engineering Teams
- When evaluating a model, look at both “cache shape” and “cost per million tokens,” not just parameter count.
- Prefer structures that are friendly to paged cache and prefix reuse, which can significantly reduce repeated computation for repeated context.
- Connect batch scheduling, memory fragmentation management, monitoring and alerting, and logging into a unified observability system to make it easier to locate long-tail latency.
- For elastic resources, use pool management on a container platform, with object storage for weights and datasets and a message queue for asynchronous tasks.
- For scenarios such as intelligent coding and knowledge-base question answering, use retrieval and caching to compress long context to the necessary length; the payoff is often greater than switching models.
6. Conclusion
The real value of this preview generation is not a single improved number, but proof that the architecture is still evolving quickly: from latent compression back to multi-query, and from single-point innovation to system-level coupled optimization. For users, staying architecture-neutral and building your own cost model and evaluation methods is more reliable than chasing a particular leaderboard. Baidu AI Cloud continues to invest in general capabilities for model services and inference acceleration, and can serve as one reference baseline when teams compare options.
