Multi-Head Latent Attention (MLA) is an innovative architecture designed to enhance the efficiency of large language models (LLMs) by compressing the Key-Value (KV) cache into a latent vector, thereby reducing memory overhead and improving inference speed. While DeepSeek has been a pioneer in implementing MLA, recent research has focused on adapting existing Transformer-based models to incorporate MLA without the need for extensive retraining.
One notable approach is TransMLA, a post-training method that converts pre-trained models utilizing Grouped-Query Attention (GQA)—such as LLaMA, Qwen, and Mixtral—into MLA-based models. This conversion allows for enhanced expressiveness and reduced KV cache size without the necessity of training from scratch. The authors also plan to develop MLA-specific inference acceleration techniques to maintain low latency in the transformed models.
Another significant contribution is X-EcoMLA, which employs post-training distillation to transform pre-trained attention mechanisms into efficient hybrid or full MLA variants. This method enables extreme KV cache compression while preserving model performance, achieved through lightweight post-training adaptation. For instance, using an 8-billion-parameter teacher model, X-EcoMLA compresses the KV cache size of the Llama3.2-1B-Inst baseline by 6.4 times, maintaining 100% of its average score across multiple tasks on the LM Harness Evaluation benchmark.
Additionally, the MHA2MLA method offers a data-efficient fine-tuning strategy to transition from Multi-Head Attention (MHA) to MLA. This approach includes removing Rotary Position Embedding (RoPE) from less contributive dimensions and introducing joint Singular Value Decomposition (SVD) approximations based on pre-trained key and value parameters. These strategies enable significant reductions in KV cache size with minimal performance degradation.
These advancements demonstrate a growing interest in integrating MLA into various LLMs beyond DeepSeek, aiming to achieve more efficient and economical inference without compromising performance.