Abstract
Large Language Models (LLMs) face significant memory constraints during inference due to the linear growth of the Key-Value (KV) cache. This paper presents Cross-Layer Latent Attention (CLLA), a novel architecture developed by researchers from Tencent Hunyuan and the Tokyo Institute of Technology. CLLA reduces the KV cache footprint to just 2.1% of its original size while maintaining or improving performance across standard benchmarks. By combining latent compression, cross-layer sharing of latent vectors, and 4-bit quantization, CLLA achieves a 48x reduction in memory usage compared to standard Multi-Head Attention (MHA).
Introduction: The Memory Wall
As LLMs are deployed for increasingly long-context tasks, the KV cache—used to store previously computed keys and values to accelerate generation—becomes a primary bottleneck. The cache size scales linearly with sequence length and model dimensions, often exhausting GPU VRAM and limiting batch sizes or maximum context lengths. While techniques like Grouped-Query Attention (GQA) and Multi-Head Latent Attention (MLA) offer partial relief, they typically involve a trade-off between compression and model accuracy. The authors propose CLLA to break this trade-off, aiming for extreme compression without performance penalties.
Methodology: Cross-Layer Latent Attention (CLLA)
CLLA integrates three core strategies into a single framework to maximize efficiency:
- Latent Compression: Building on MLA, CLLA projects high-dimensional Key and Value vectors into a low-dimensional "latent" bottleneck.
- Cross-Layer Sharing: Unlike previous methods that share final activations, CLLA shares these latent vectors across multiple layers.
- Int4 Quantization (CLLA-quant): Latent vectors are further compressed from 16-bit floats to 4-bit integers during pre-training.
The architectural innovation lies in sharing the latent space rather than raw KV activations. Each layer retains its own unique projection matrices to reconstruct the specific KV information it requires from the shared latent pool. This allows the model to adapt the shared "summary" to the specific functional requirements of different network depths.
Experimental Setup and Results
The models were pre-trained on a 300-billion-token dataset of Chinese and English text. Evaluation spanned 15 benchmarks, including MMLU, CMMLU, and CEval.
Performance Comparison
In a 1B-parameter MoE model comparison, CLLA-quant demonstrated superior efficiency:
| Method | KV Cache Memory (per token) | Compression Ratio | Avg Score (English) |
|---|---|---|---|
| MHA (Baseline) | 6,144 Bytes | 100% | 56.73 |
| GQA | 3,072 Bytes | 50.0% | 56.83 |
| MLA | 576 Bytes | 9.4% | 57.16 |
| CLLA | 320 Bytes | 5.2% | 57.97 |
| CLLA-quant | 128 Bytes | 2.1% | 57.98 |
CLLA-quant achieved a 48x reduction in KV cache size while improving the average English benchmark score by 1.25 points over the MHA baseline.
Key Insights
- Shared Latents vs. Shared Activations: Sharing the latent representation is more expressive than sharing final KV vectors. Layer-specific projections allow for diverse interpretations of the same shared data.
- Quantization-Aware Pre-training: By applying 4-bit quantization during the pre-training phase, the model learns to compensate for precision loss, resulting in a "lossless" compression effect.
- Efficiency-Driven Scaling: The memory efficiency of CLLA allowed for an increase in Feed-Forward Network (FFN) parameters without increasing the total activated parameter count, contributing to the observed performance gains.
Conclusion and Future Work
CLLA represents a significant step toward making long-context LLMs more accessible. While the architecture introduces implementation complexity and potential inference latency due to additional projection steps, the massive memory savings enable significantly larger batch sizes and longer sequences on existing hardware. Future research will focus on optimizing the attention block for higher throughput and verifying the scalability of CLLA in models exceeding 10B parameters.
Summary updated