Key Design Choices of a Next-Generation Hybrid-Architecture LLM
This article explains four core design choices in a new open-source hybrid-architecture large language model: hybrid attention that combines sliding window and sparse layers, a low-dimensional mixture-of-experts design, an N-gram memory table, and a multi-token speculative decoding network. It also covers how these choices reduce memory and inference costs for long-context workloads, and what they mean for engineering practice.
1. Background: Why Hybrid Architectures Are Becoming a New Trend
An open-source hybrid-architecture large language model recently sparked heated discussion in the community. Recent model development points to a clear signal. Experiments on inference framework adaptation and the release pace of new models both show that a purely dense Transformer or full-scale sparse attention is no longer the best option for long-context scenarios. The industry is moving toward hybrid architectures. These combine attention mechanisms at different granularities, finer-grained expert networks, external memory components, and lightweight decoding acceleration modules. The goal is to substantially reduce inference costs while preserving model quality.
This new open-source model is a concentrated example of this approach. Compared with its predecessor, its total parameter count is about 71% smaller, yet its number of experts doubles. For attention, it no longer uses sparse attention in every layer. It uses a layered hybrid design instead. The four core designs are explained below.
2. Core Design 1: Hybrid Attention
2.1 Layer Rearrangement
The previous version used the same type of sparse attention in all 78 layers, a approach similar to DeepSeek Sparse Attention. The new version rearranges its layers as follows:
Sparse × 2 | (SWA × 3 → Sparse × 1) × 10
Of the 42 layers in total:
- 30 sliding window attention (SWA) layers: Each layer attends only to the most recent 512 tokens. It maintains a fixed-size window, so both compute and memory overhead stay constant.
- 12 sparse attention layers: These select up to 2,048 tokens from the full global history for computation, which covers long-range dependencies.
- Both attention types still use Multi-head Latent Attention (MLA) to compress the KV representation, which further reduces KV cache memory usage.
2.2 Why This Design Works
Most semantic dependencies in long contexts are local. Code syntax, coreference resolution in text, and the immediate context of a conversation can usually be resolved within a few hundred tokens. Only scenarios that require looking far back into history need global retrieval. For example, analyzing a function defined 80,000 tokens earlier in a 200,000-token code repository requires only a small number of layers with global retrieval capability.
The core idea is division of labor. Local layers model nearby structure, while sparse layers use an indexer to retrieve distant key tokens on demand. In a design where every layer attends globally, the KV cache grows linearly with context length across all layers. In this design, only a few sparse layers keep the full history. As a result, memory and cache costs drop significantly.
2.3 IndexPool: Compressing the Indexer Too
This version upgrades the original IndexCache to IndexPool and introduces group-level selection. The indexer that looks up historical tokens is itself compressed and pooled. Instead of each indexer maintaining its own cache, indexers share a pooled structure and select within groups. This reduces duplicate storage on the indexing side. It is one of the key reasons the model’s cache pricing can be significantly lower. Both the attention computation and the infrastructure that supports sparse retrieval are cheaper.
3. Core Design 2: Latent MoE
3.1 Configuration Changes
The MoE design in the new version can be summarized as lower dimensionality with more experts:
- The 3,072-dimensional hidden representation is projected to 1,536 dimensions, and experts compute in this low-dimensional space.
- The total number of experts increases from 256 to 512.
- The number of experts activated per token increases from 8 to 16.
3.2 Design Rationale
These changes show a clear strategy: shrink each expert to gain a much larger space of expert combinations.
From a compute perspective, expert calculations happen in the low-dimensional space, so the FLOPs and parameter count of each expert drop significantly. From an expressiveness perspective, selecting 16 experts out of 512 creates far more combinations than selecting 8 out of 256. The model can assemble knowledge at a finer granularity, and each expert can specialize in a narrower subdomain. This design has an additional benefit during inference. Low-dimensional experts require less weight memory access, and MoE inference is often limited by memory bandwidth rather than compute.
4. Core Design 3: N-gram Memory Table (Engram)
The new version introduces a 63.5 billion-parameter N-gram memory table. It hands part of the local pattern recognition to hash-based table lookups, instead of relying entirely on neural network forward passes.
The N-gram memory table stores statistical representations of high-frequency local fragments, such as common code templates, fixed collocations, and idioms. During inference, the model first uses a hash lookup to match these patterns quickly. The matched results are injected into the backbone network as extra information, which reduces repeated computation on recurring patterns. This works like a low-cost cache layer. High-frequency, highly deterministic patterns go through table lookup, while low-frequency semantics that require deep understanding go through the neural network. Separating neural memory from parametric knowledge is becoming one of the mainstream directions in model design in China.
5. Core Design 4: Speculative Decoding Network (DFly2)
The original single-layer MTP (Multi-Token Prediction) module has been upgraded to a 5-layer lightweight speculative decoding network. Its key optimization is reusing the main model’s KV cache and sparse attention indices.
The standard speculative decoding process works as follows. A small model, or draft layers, quickly proposes several candidate tokens. The main model then verifies them in one parallel pass. In traditional implementations, the draft model maintains its own KV state, which adds memory overhead. This design reuses the main model’s attention results, so the draft layers add nearly zero extra KV cost. This makes multi-token speculation much more cost-effective. In greedy decoding scenarios, it can significantly increase end-to-end throughput.
6. Cost Perspective: A Quantitative Example
Consider a context of 1,048,576 tokens (about one million) with KV stored in BF16. If we count only the historical KV tensors needed for attention, excluding indexer cache, weights, and other runtime memory, the advantage of the hybrid structure is clear. The 30 SWA layers only need to maintain a fixed 512-token KV window. Only the 12 sparse layers must keep the full history. As a result, the memory cost of long contexts drops by an order of magnitude. This translates directly into lower cache billing and higher per-GPU concurrency.
7. Takeaways for Engineering Practice
- Hybrid attention is a practical solution for long contexts. Not every layer needs a global view. A combination of local layers and a small number of sparse layers strikes a better balance between quality and cost.
- MoE is moving toward low dimensionality, more experts, and fine-grained activation. Low-dimensional computation and a larger combination space improve both quality and memory access efficiency.
- External memory and speculative decoding are incremental levers for low-cost inference. Table lookups that replace part of the neural computation, and draft layers that reuse the KV cache, are highly cost-effective engineering techniques.
- The ultimate measure of an architecture is quality per unit cost. Substantially fewer total parameters with maintained capability show that structural innovation can replace pure parameter scaling.
8. Conclusion
The value of this open-source model lies not only in its own performance. It also offers a reusable recipe for efficient inference architecture. Hybrid attention addresses attention cost, latent MoE addresses expert computation cost, the N-gram memory table addresses the cost of repeated patterns, and speculative decoding addresses the cost of decoding steps. Together, these four techniques form a complete technical path toward lowering costs and improving efficiency in large models. For teams building long-context applications or developing in-house inference services, these design ideas offer direct reference value.
