Next-Gen Systems & Extreme Compression

Next-Gen Systems & Extreme Compression

Standard post-training optimizations—such as 4-bit weight quantization (AWQ/GPTQ) and Grouped-Query Attention (GQA)—treat the pre-trained Transformer architecture as fixed and compress weights or KV states after the fact. The next generation of efficiency breakthroughs redesigns the core mathematical operators from scratch during pre-training so that low-rank KV compression, ternary multiplier-free arithmetic, dynamic layer skipping, and multi-token decoding are native properties of the network.

Compression / Routing OperatorMemory / Compute GainArchitectural Role in Next-Gen LLMs
Multi-Head Latent Attention (MLA, DeepSeek-V2/V3): Compresses all keys and values into a single low-rank latent vector cached in HBM (93.3% KV cut).
1.58-Bit Ternary Weights (BitNet b1.58): Replaces floating-point multiply-accumulates (MACs) with pure integer additions and subtractions.
Top- RoutingMixture-of-Depths (MoD, Raposo et al. 2024): Dynamically routes only the top- salient tokens through Attention+MLP at layer , bypassing the rest via residual identity.
DecodeMulti-Token Prediction (MTP / Medusa): Predicts future tokens simultaneously from parallel projection heads without an external draft model.

Hardware-Co-Designed Breakthroughs: Multi-Head Latent Attention (MLA) & 1.58-Bit Ternary MatMul

A. Multi-Head Latent Attention (MLA KV Folding)Hidden ht∈ R7168Cached Latent Vector ctKV= WDKVhtdc= 512 (93.3% Smaller HBM KV Cache)Absorb WUKinto WQqtTkj= (WUK,Tqt)TcjKVAbsorb WUVinto WOZero Decompression in HBMB. BitNet b1.58 Ternary Adder-Only Matrix CoreStandard FP16 Multiply-Accumulate (MAC)yi= ΣjWij(FP16)× xj(FP16)Multiplier Energy: ~1.10 pJ per op (16 bits/weight)BitNet b1.58 Ternary Weight W̃ij∈ {-1, 0, +1}yi= ΣW=+1xj− ΣW=-1xj(Zero Multipliers)INT8 Adder Energy: ~0.03 pJ (36× Lower Compute Energy)
Figure 1 (Attention & Matrix Co-Design): (A) Multi-Head Latent Attention (MLA) projects into a 512-dimensional latent vector and folds the up-projection matrices directly into and during inference. (B) BitNet b1.58 quantizes weights to ternary values from scratch, replacing floating-point multipliers with pure integer adders.

1. Multi-Head Latent Attention (MLA — DeepSeek-V2 / V3)

In Grouped-Query Attention (GQA), reducing the KV-cache footprint requires forcing query heads to share a single key and value head (), which degrades representation capacity when becomes small. Multi-Head Latent Attention (MLA) (DeepSeek-AI, 2024) achieves even smaller KV caches than GQA while preserving distinct keys and values for every single attention head.

Low-Rank Joint KV Compression & Matrix Absorption

Given hidden state , MLA projects down into a shared low-rank latent vector (where ), and reconstructs full multi-head keys and values via up-projection matrices :

If the model had to materialize and in HBM during inference, the memory bandwidth savings would vanish. However, because matrix multiplication is associative, and are absorbed directly into the query and output projection matrices:

During decoding, we only store in the KV cache! Why do we still need a small decoupled key ()? Because Rotary Position Embedding (RoPE) injects a position-dependent rotation matrix between and , preventing from being statically merged into across varying relative distances . MLA solves this by concatenating a single shared -dimensional RoPE key alongside the -dimensional position-independent latent , caching just elements per token.

Attention KV-Cache Evolution: MHA vs. GQA-8 vs. Multi-Head Latent Attention (MLA)

Compare per-token KV-cache bytes and total memory across a 60-layer frontier model () as sequence length and MLA latent dimension vary.

Context (T): 64K Tokens
MLA Latent (dc): 512 ( + 64 RoPE)
Total 60-Layer KV-Cache Memory in HBM (FP16)1. Standard MHA (128 KV Heads — 2 nhdhelts/token)251.7 GB2. Grouped-Query GQA-8 (8 KV Heads — 2 nkvdhelts/token)15.7 GB3. Multi-Head Latent Attention — MLA (dc+ dRelts/token)4.42 GBPer-Token KV AuditMHA Elements / Layer:32,768GQA-8 Elements / Layer:2,048MLA Elements / Layer:576vs. MHA:56.9× Smallervs. GQA-8:3.56× SmallerEquivalent to 2.25 KV Heads
Matrix Absorption WUK → WQ
Context T: Latent dc:

2. 1.58-Bit Native Ternary Pre-Training (BitNet b1.58)

Post-training quantization (PTQ) degrades rapidly below 3 bits per weight because rounding a pre-trained Gaussian weight matrix destroys outlier pathways. BitNet b1.58 (Ma et al. 2024) trains the Transformer from initialization using Quantization-Aware Training (QAT) where every linear projection weight is constrained to the ternary set ():

where is an absmean quantizer differentiated via the Straight-Through Estimator, paired with per-token absmax 8-bit integer activation quantization:

Multiplier-Free Matrix Multiplication

In standard FP16 hardware ( CMOS), a floating-point multiplication consumes more silicon area and dynamic energy than an integer addition. Because , the matrix-vector product eliminates floating-point multipliers completely, reducing to conditional INT8 accumulation:


3. Worked Numerical Walkthrough: BitNet Absmean Ternary Quantization & MLA Cache

Part A: BitNet b1.58 Ternary Matrix Quantization

Consider a continuous weight matrix during a BitNet forward pass:

  1. Compute Absmean Scale :
  2. Normalize by :
  3. Apply : Given an input vector , computing requires zero multiplications: Row 1 computes , and Row 2 computes .

Part B: MLA vs. MHA vs. GQA Per-Token Cache Ratio

For a model with heads of dimension :

  • Standard MHA: elements/token/layer.
  • GQA (): elements/token/layer.
  • MLA (): elements/token/layer—achieving a reduction vs. MHA and a reduction vs. GQA-8.

4. Dynamic Compute Routing: Mixture-of-Depths & Multi-Token Prediction

1. Mixture-of-Depths (MoD — Token-Level Layer Skipping)

Just as Mixture-of-Experts (MoE) routes tokens across different FFN experts, Mixture-of-Depths (MoD) (Raposo et al. 2024) observes that predicting a simple syntactic token ("the", ")") does not require passing through all Attention and MLP blocks. At layer , a lightweight scalar router scores all tokens in the sequence and selects only the top- tokens (, e.g., capacity or with threshold ) to enter the Self-Attention and MLP block , while the remaining tokens bypass the layer completely via the residual stream:

Because only tokens participate in self-attention at layer , attention FLOPs drop quadratically to .

2. Multi-Token Prediction (MTP & Medusa Tree Decoding)

Instead of relying on a separate external draft model for speculative decoding, Multi-Token Prediction (MTP) (Gloeckle et al. 2024; DeepSeek-V3) and Medusa (Cai et al. 2024) attach lightweight sequential or parallel prediction heads directly onto the top of the target model’s trunk :

During training, predicting tokens ahead forces the hidden representation to plan multi-token phrasal structure rather than myopic next-token statistics; during inference, the auxiliary MTP heads act as a self-drafting speculative decoder, verifying tokens per forward pass with zero external draft model management.


Key Papers & References