Next-Generation Large Model Architectures: Fusing Linear Attention with Sparse Retrieval

    This preview model evolves the hybrid linear-attention architecture by replacing dense global attention with block-level sparse attention, introducing gated multi-branch residual pathways, adding an N-gram embedding memory layer, and combining Muon with AdamW during training. Together, these changes aim to reduce long-context costs while preserving precise retrieval and improving training efficiency.

    1. Background: Why Large Model Architectures Need a Redesign

    Most leading large language models still rely on standard multi-head attention, whose computational complexity grows quadratically with sequence length, or O(L²). As long-context use cases such as code analysis, long-document question answering, and multi-turn Agent memory become increasingly important, this limitation directly increases both training and inference costs.

    As a result, two major architectural directions have emerged:

    1. Linear attention: Compresses historical information into a fixed-size state, bringing complexity close to O(L). This approach is effective for efficiently carrying long-term context, but its representational capacity is limited.
    2. Hybrid architectures: Insert a small number of global attention layers between linear attention layers. These layers provide “precise lookups” to compensate for the weaknesses of linear state memory in exact localization and token-level retrieval.

    A recently open-sourced preview model represents a further evolution of the hybrid approach. It retains the basic pattern of interleaving linear attention and global attention at a 3:1 ratio, while redesigning each component for greater efficiency. The key changes are outlined below.

    2. Attention Layer Redesign: From Standard Global Attention to Sparse Attention

    The limitations of the original design

    In the classic combination of three linear attention layers followed by one global attention layer, the global layer solves the precise retrieval problem, but its KV cache still grows linearly with sequence length, while its attention computation remains quadratic.

    As the context grows, this one-quarter of the architecture can account for a disproportionate share of the total compute cost.

    How sparse attention works

    The basic idea follows a two-stage “index first, compute later” process.

    First, a lightweight indexer scores historical tokens and selects a small number of the most important KV blocks. The actual attention computation then operates only on the selected positions. This reduces the complexity of the core attention operation from O(L²) to O(L·k).

    When the number of selected blocks, k, remains fixed, the computational cost grows approximately linearly with context length.

    Optimizing the indexer itself

    A remaining issue is that the indexer may still need to scan every historical token for each query. As the context becomes longer, the indexer itself could become a new bottleneck.

    The preview model addresses this with coarse-grained block scoring. Every four consecutive index keys are average-pooled into a single Micro Block, and the query scores these Micro Blocks rather than individual keys.

    This reduces the number of keys that the indexer must inspect to one quarter of the original count. The smoothing introduced by pooling has little impact on the goal of identifying broadly important regions.

    This is a typical hierarchical filtering strategy: coarse screening preserves efficiency, while detailed computation preserves quality.

    3. Residual Architecture Upgrade: From a Single Path to Four Gated Branches

    The traditional Pre-Norm Transformer residual structure provides a single information highway. Each layer’s output is added directly back to the main stream, and gradient flow relies heavily on this path.

    Its limitation is that information from different layers and at different granularities has no independent route. Cross-layer information reuse must therefore be learned implicitly through stacking.

    The preview model replaces this design with a four-branch gated residual structure. The main stream is divided into multiple parallel branches, and each branch has a learnable gating coefficient. The model can determine how much information to retain from each branch.

    Its potential benefits include:

    • Parallel transmission of multi-granularity information: Different branches can carry short-term local features and long-term global dependencies separately, reducing interference.
    • Dynamic routing through gating: The model can adapt the weight of each channel according to the input pattern.
    • Reduced representation degradation in deep networks: Multiple information paths provide richer gradient routes for very deep models.

    The design can be compared to the evolution of a computer network from a single bus to multi-channel QoS. The total bandwidth may not increase, but information scheduling becomes significantly more efficient.

    4. N-gram Embedding: Expanding Memory Capacity at Minimal Compute Cost

    The preview model introduces a single-layer N-gram Embedding in an early part of the network, at layer 2. This adds approximately 51B parameters while contributing almost no additional backbone FLOPs per token.

    Its design logic is notable for several reasons:

    1. The N-gram table acts as lookup-based memory: Frequent word and phrase combinations from the pretraining corpus are stored explicitly in the embedding table. The model can access these local association priors through table lookups.
    2. The shallow placement is intentional: Early layers handle local and surface-level pattern extraction, which aligns well with N-gram priors. Deeper layers can remain focused on semantic abstraction.
    3. Parameters and compute are decoupled: Although 51B parameters is a large number, lookup operations are nearly free, and the memory can be pruned as needed during inference. This is a typical trade-off of exchanging memory capacity for intelligence: when memory is more available than compute, the trade-off can be practical.

    Explicit memory components of this kind may be especially useful for tasks that depend on precise local recall, such as code generation and terminology recovery.

    5. Training Improvements: A Hybrid Muon and AdamW Optimizer

    Architectural changes must be supported by compatible training methods. The preview model replaces AdamW with a hybrid Muon and AdamW strategy, assigning different optimizers to different parameter groups.

    Muon is a newer optimizer that has attracted significant attention. Its central idea is to orthogonalize gradients so that the spectral distribution of parameter updates becomes more balanced. This can produce lower loss after the same number of training steps.

    A typical division of labor in the hybrid strategy is:

    • Matrix-shaped weights, including attention projections and feed-forward layers, are optimized with Muon to take advantage of its convergence benefits.
    • Embedding tables, normalization parameters, and other non-matrix or structurally specialized parameters remain with AdamW to avoid potential instability from orthogonalization in sparse-update scenarios.

    For pretraining, this means that a model may process more tokens under the same compute budget, or reach the same quality with significantly lower training cost.

    6. Conclusion: What This Preview Reveals About Future Architectures

    Taken together, the four changes point to a common theme: reallocating compute for the long-context era.

    Component Direction of Change Primary Benefit
    Global attention Dense to block-level sparse attention Attention complexity decreases from O(L²) to O(L·k)
    Residual structure Single path to four gated branches Multi-granularity information can flow across layers
    N-gram embedding Addition of explicit memory More capacity with almost no additional FLOPs
    Optimizer AdamW to a hybrid strategy Improved training efficiency and stability

    For developers, the main takeaway is that next-generation models should not be evaluated solely by benchmark scores. Their inference cost curves at extremely long context lengths and their ability to preserve retrieval accuracy are equally important.

    These are precisely the areas targeted by the architectural changes described above. For teams operating their own inference services, the KV-cache savings and reduced memory pressure enabled by sparse attention can translate directly into lower deployment costs. Meanwhile, training techniques such as hybrid optimization provide useful design directions for pretraining and continued training of custom models.