A Deep Dive into a New-Generation Open-Source LLM Architecture: Compressed Attention and Mixture-of-Experts Design

    A new-generation open-source large language model preview has been released alongside open weights and technical details. This article breaks down its overall architecture, including compressed sparse attention, heavy-compression attention, sliding window attention, hybrid Mixture-of-Experts routing, multi-token prediction, and the practical implications for developers deploying long-context sparse models.

    A Deep Dive into a New-Generation Open-Source LLM Architecture: Compressed Attention and Mixture-of-Experts Design

    A major open-source large language model recently released a new-generation preview version, publishing both the model weights and technical details. This generation introduces several instructive design choices in parameter scale, context length, and attention structure, making it well worth studying. This article walks through the overall architecture and dissects the attention modules, the Mixture-of-Experts (MoE) modules, and the output prediction modules, helping readers build a systematic understanding of the internal computation flow of modern large-scale language models.

    1. Architecture Overview

    The model is a pure language model with 1.6T total parameters and approximately 49B activated parameters per forward pass, supporting context lengths of up to one million tokens. Controlling compute and memory overhead under ultra-long contexts is the central challenge this architecture is designed to address.

    At a high level, the model consists of 61 Transformer layers, with the first 3 layers and the remaining 58 layers using different MoE strategies:

    • First 3 layers: Hash-based MoE (hash-MoE), where the token-to-expert mapping is determined by a deterministic hash function rather than a learnable gating network. This reduces routing instability in the shallow layers.
    • Remaining 58 layers: Standard learnable gated MoE, where a routing network dynamically assigns tokens to experts.

    For attention, the model does not rely on a single mechanism but combines three attention types:

    1. Compressed Sparse Attention (CSA): compressed attention with an indexing mechanism, using a compression ratio of roughly 4:1;
    2. Heavy Compression Attention (HCA): aggressive compression with a ratio of up to 128:1;
    3. Sliding Window Attention (SWA): attends only to tokens within a local window, used in the final layer.

    The first three layers use HCA, HCA, and CSA respectively; in the remaining 58 layers, HCA and CSA alternate, with the final layer using SWA. In addition, instead of traditional residual connections between attention and MoE modules, the model introduces a multi-stream connection scheme with pre-processing and post-processing to strengthen information flow across layers. At the end of the model, a multi-token prediction (MTP) head assists with predicting subsequent tokens, serving both as an auxiliary training objective and, at inference time, as a component of speculative decoding to accelerate generation.

    2. Compressed Sparse Attention (CSA) Explained

    CSA’s core idea: rather than computing full attention between every query and all historical KV entries, the KV sequence is first compressed at a fixed granularity, then a lightweight indexing module selects the tokens that truly require fine-grained computation — significantly reducing compute while preserving quality.

    The computation roughly proceeds in three stages:

    1. Token-Level Compressor (C4A)

    The compressor aggregates consecutive tokens (4:1 compression, i.e., every 4 tokens) into a single compressed representation. Specifically, a learnable compression function fuses the keys and values within each window to produce compressed KV representations. Queries first attend to these compressed KV entries in a coarse-grained attention step, gaining a global view of the entire context.

    2. Index Module

    The index module is what distinguishes CSA from ordinary compressed attention. Based on the coarse-grained attention scores, it selects, for each query, the most relevant original token segments. Only these selected tokens participate in fine-grained, precise attention computation. The model therefore retains a global view while confining expensive per-token computation to the “truly important” local regions. This “coarse filter first, precise compute second” two-stage paradigm is analogous to the recall-then-rank approach in retrieval systems.

    3. Engineering Details

    At the implementation level, the outputs of the compression path and the index path must be merged by weight, typically requiring handling of boundary alignment, variable-length sequence masking, and vectorized gather operations for index results. During training, the index selection must be made differentiable or gradients must flow through a straight-through estimator — a common difficulty when bringing such sparse attention into production.

    3. Heavy Compression Attention (HCA) Explained

    HCA can be viewed as an extreme version of the CSA idea: the compression ratio rises from 4:1 to 128:1, meaning one compressed KV entry per 128 tokens. Such a high compression ratio means the fine-grained path is further weakened or removed entirely, and queries rely mainly on highly aggregated context representations for attention.

    The rationale is that not all layers need fine-grained long-range dependency modeling. Extensive research shows that different attention layers have very different granularity requirements: shallow layers focus on local syntactic structure, while some middle layers only need coarse semantic summaries. Stacking 128:1 heavy-compression layers alternately with 4:1 compressed sparse layers can reduce KV cache and compute overhead for long contexts by an order of magnitude with almost no quality loss.

    For inference deployment, the direct benefit is a substantial reduction in KV cache size: the compressed KV sequence is only 1/4 to 1/128 of the original length, making memory usage for million-token contexts manageable. When building your own inference services, you can use common cloud infrastructure such as container platforms, monitoring, and alerting to continuously observe and tune metrics like KV cache usage and time-to-first-token.

    4. Mixture-of-Experts (MoE) Design

    The model’s MoE portion contains two structures, worth discussing separately.

    1. Hash-Routed MoE

    The shallow layers use hash-MoE, where tokens are mapped to fixed experts via a hash function based on token ID or position. Its advantages: routing is fully deterministic, with no load imbalance or routing jitter; implementation is simple, with no extra gating parameters. The trade-off is a lack of semantic awareness, so it is only suitable for shallow layers where semantic specialization requirements are low.

    2. Standard Gated MoE

    The remaining 58 layers use standard gated routing. With 1.6T total parameters and 49B activated parameters, the sparse activation rate is roughly 3% — typical for today’s very large sparse models. The key engineering concern is load balancing under expert parallelism: common approaches include auxiliary balancing losses, per-expert capacity limits (capacity factor), and fallback routing when experts overflow. The training framework must also handle expert placement across devices and all-to-all communication overhead.

    5. Multi-Token Prediction and Connection Design

    The MTP module at the end of the model uses “predicting multiple future tokens at once” as an auxiliary training objective, providing denser supervision signals and improving the representation quality of the backbone. At inference time, the MTP head can act as a draft model combined with speculative decoding to significantly reduce decoding latency.

    Furthermore, the multi-stream connections (with pre-processing and post-processing) between attention and MoE allow more flexible fusion across multiple information streams compared to plain residual connections — a structural innovation worth watching in recent deep models.

    6. Takeaways for Developers

    The lessons this architecture offers the industry can be summarized in three points:

    1. Attention compression is the main line for ultra-long contexts: layer-wise differentiation combining 4:1, 128:1 compression, and sliding windows is more flexible than any single sparse pattern;
    2. Routing strategies can be customized per layer: the hybrid design of deterministic hashing in shallow layers and learnable gating in deeper layers balances stability and expressiveness;
    3. Structural innovation and systems engineering must go hand in hand: sparse indexing, expert parallelism, and speculative decoding only deliver value when implemented in inference frameworks and infrastructure.

    For teams looking to deploy such very large sparse models within their organizations, it is advisable to first evaluate how well your inference framework supports compressed attention and MoE expert parallelism, use standard container platforms, logging services, and monitoring/alerting capabilities to build an observable inference pipeline, and then progressively adopt optimizations such as quantization and cache reuse.

    Overall, this architecture makes clear and reusable engineering trade-offs across the “quality–cost–deployability” triangle. Its layered attention and layered routing design philosophy is likely to influence both future open-source and in-house models.