Breaking Down the Compressed Attention Design of a 1M-Context LLM

    This article breaks down the architecture of an open-source large language model's V4 preview, which targets a 1M-token context window. It covers how total and active parameters differ, how Hash-MoE and standard MoE layers divide their work, and how CSA, HCA, and SWA attention reduce KV cache costs. It also covers MTP, deployment constraints, and the specifications that still need confirmation from official sources.

    Large language models are moving toward longer contexts and more complex reasoning, and the parameter count and compute budget needed for these goals are in tension. The publicly described architecture of an open-source LLM’s V4 preview offers one approach to controlling compute at a 1M-token context. This article summarizes the core design from public materials and marks the parts that need confirmation from official documentation.

    1. Overall structure: total and active parameters are different things

    The public description lists 1.6T total parameters, about 49B active parameters per inference step, and 61 layers. Activating only 49B parameters means the compute per token is close to that of a dense 49B model. Memory needs do not fall by the same amount. All expert weights must stay resident in GPU or system memory, so storing and loading 1.6T parameters remains the main deployment barrier.

    The model divides its layers into two sections. The first 3 layers form a shallow feature extraction module. They use Hash-MoE, and their attention types are HCA, HCA, and CSA in that order. The remaining 58 layers form a deep semantic processing module. They use standard MoE, and their attention alternates between HCA and CSA. The final layer uses SWA. An MTP layer sits on top of the model to predict subsequent tokens.

    The public materials also state that the connection between attention and MoE does not use a conventional residual connection. Instead, the model uses an mHC connection mechanism with two processing steps, hc_pre and hc_post. The materials do not give a full mathematical definition of this mechanism. Readers should refer to the official implementation and technical documentation for details.

    2. Hybrid MoE: the routing method determines how compute is divided

    Hash-MoE uses a hash function to assign each token to its experts. It does not use a gating network. Hash routing has very low overhead, but it does not make routing decisions based on content. Expert load may be unbalanced, so training requires additional load-balancing measures.

    Standard MoE uses a Softmax gate to select several experts for each token. Deep layers handle more complex semantics, so the gate can allocate compute more precisely. The cost is the overhead of gate computation and communication between experts. Actual throughput also depends on expert capacity settings and the parallelism strategy.

    The goal of this combination is to reduce latency in shallow layers and preserve representational capacity in deep layers. The public description says this design balances representational capacity and compute throughput. The specific gains need measured data to confirm.

    3. Attention: compression makes long contexts practical

    The main costs of a 1M-token context come from KV cache storage and attention computation. The model uses three attention types: CSA, HCA, and SWA.

    CSA uses a 4:1 compression ratio and a dual KV path. The first path is a sliding window channel. Each token attends only to tokens inside its window. This path uses a circular buffer that keeps only the KV entries within window_size. During decoding with batch size 1 and one new token per step, the window cache has shape [1, head_dim] from a single-head view. The full cache expands across batch and KV heads to shape [batch, kv_heads, window_size, head_dim]. This path applies RoPE to the rope_head_dim portion of head_dim and quantizes the remaining dimensions to reduce memory use.

    The second path is the compressed channel. Input first passes through a Compressor module, which produces compressed KV entries. An Index module then selects up to topK of the most relevant compressed tokens. This path preserves long-range information. The public materials do not disclose the output length of the Compressor or the value of topK, so this article does not estimate them.

    HCA uses a higher compression ratio, which the public materials give as 128:1. It provides global, coarse-grained information at lower compute cost. This complements the fine-grained local information that CSA preserves. SWA appears in the final layer and keeps the output coherent with the immediately preceding context.

    4. MTP and deployment: inference speedup depends on specific conditions

    The MTP layer predicts multiple subsequent tokens in one forward pass. During training, it provides an extra supervision signal. During inference, combined with speculative decoding, it can increase the number of tokens produced per step. The actual speedup depends on the acceptance rate of draft tokens. That rate varies with task type and sampling parameters, so this article does not give a fixed speedup multiplier.

    For deployment, 1.6T parameters require a multi-GPU or multi-node environment. Model partitioning must account for expert parallelism, tensor parallelism, and pipeline parallelism. It must also plan for the communication that comes from alternating CSA and HCA computation. Quantization reduces memory use but can affect accuracy, so teams should evaluate it on their target tasks. At this parameter scale, single-machine or on-device deployment is usually impractical.

    When estimating memory, calculate three components separately: weights, KV cache, and activations. Compute the KV cache for each attention type using its own compression ratio. Do not apply the standard multi-head attention formula.

    5. How to use this information

    To evaluate this architecture, first confirm three items. Check the layer count and attention distribution in the official technical report or configuration files. Verify the compression ratios and topK settings for CSA and HCA. Confirm the MTP training method and the inference acceptance rate. Until then, treat the figures in this article as results from a public introduction, not as citable specifications.