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 Operator | Memory / Compute Gain | Architectural 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- Routing | Mixture-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. | |
| Decode | Multi-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
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.
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:
- Compute Absmean Scale :
- Normalize by :
- 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.