Manuscript Offprint
arXiv:2610.17202MLAfication: Efficiently Enabling High-Fidelity MLA for Modern LLMs
Abstract
Multi-Head Latent Attention (MLA) compresses the KV cache into a latent representation, reducing inference memory and bandwidth. Existing MHA2MLA/TransMLA methods do not support QKNorm and require costly recovery on modern LLMs, especially MoE. We present MLAfication, a QKNorm-compatible, parameter-efficient extension of MHA2MLA. It combines calibrated KNorm, parameter-efficient distillation, contribution-aware Partial-RoPE, and activation-aware joint KV initialization. Across MHA and GQA models, including QKNorm- and MoE-equipped variants, MLAfication preserves performance under substantial KV-cache compression, surpasses the current SOTA on commonsense and long-context benchmarks, and extends MLA conversion to modern architectures. On Qwen3-30B-A3B, MLAfication delivers up to the serving throughput of BF16 GQA and, combined with 4-bit KV quantization, reduces the KV-cache footprint by 94.73%. Our code is available at https://github.com/JT-Ushio/MLAfication.
1 Introduction
The rapid scaling of LLMs has led to increasing challenges in inference efficiency, particularly due to the substantial memory and bandwidth costs of Key-Value (KV) caches. To address this bottleneck, DeepSeek introduced Multi-Head Latent Attention (MLA, 2024), which compresses KV representations into a compact latent space while preserving expressive attention capabilities. MLA has since been adopted by several large-scale foundation models, including DeepSeek-V2/V3/R1/V3.2 (DeepSeek-AI 2025), Kimi K2/K3 (Kimi Team et al. 2026), and the GLM-5 series (Zeng et al. 2026), highlighting its potential as an efficient attention architecture for modern LLMs.
MHA2MLA (Ji et al. 2025) first demonstrated that LLMs originally optimized for MHA (2017) or GQA (2023) can be efficiently adapted to MLA inference without retraining from scratch. By introducing ①Partial-RoPE and ②KV-joint low-rank approximation, MHA2MLA enables data-efficient conversion and effectively recovers performance. TransMLA (Meng et al. 2025) further improved Partial-RoPE variants (RoRoPE and FreqFold) and KV balancing, delivering stronger zero-shot performance and more efficient fine-tuning. Beyond text-only LLMs, the paradigm has recently been extended to other model families, including vision-LMs (Fan et al. 2026), ASR models (Zhang et al. 2026), and autoregressive video diffusion models (Yesiltepe et al. 2026), demonstrating its broader applicability.
However, extending MHA2MLA to modern LLMs remains challenging due to incompatibilities with widely adopted architectural components, particularly QKNorm (2020) and Mixture-of-Experts (MoE, 2017). While QKNorm stabilizes attention computation by mitigating logit explosion, its normalization conflicts with MLA's latent projection mechanism (Team et al. 2025; Anson and Aitchison 2025). Similarly, MoE improves model scalability but makes full-parameter MHA2MLA vulnerable to disrupting the expert load balancing learned during pre-training.
We introduce MLAfication, extending MHA2MLA (Ji et al. 2025) to QKNorm and MoE architectures. It resolves QKNorm's incompatibility with efficient MLA decoding through calibrated KNorm and recovers performance through parameter-efficient distillation. We further refine MHA2MLA's Partial-RoPE and low-rank approximation stages using MHA2MLA-VLM (Fan et al. 2026) and SVD-LLM V2 (Wang et al. 2025), respectively.
• QKV-only distillation trains 1.6%–11.1% of model parameters while matching full fine-tuning and limiting MoE routing drift.
• Across four model families, MLAfication improves both commonsense and long-context accuracy over SOTA and delivers up to serving throughput.
2 MLAfication
MLAfication builds on MHA2MLA (2025) and extends it in three key respects . §2.1 resolves the incompatibility be-
These authors contributed equally.
Corresponding author.
Given space constraints and the inherent complexity of both the MLA and the MHA2MLA paradigm, we defer their detailed background to the Appendix C. Readers unfamiliar with either are encouraged to consult the original papers or the Appendix C.
RoPE-applied Cached Linear

(a) GQA
(b) MLAfication prefill
(c) MLAfication decode
Figure 1: Adapting QKNorm to efficient MLA decoding. For compactness in the schematic, we write and for and , respectively, and use the same convention for .
tween QKNorm and efficient MLA decoding, enabling the MLAfication of MHA/GQA models equipped with QKNorm (Figure 1). §2.2 introduces parameter-efficient distillation for low-cost architecture editing. §2.3 improves the two initialization steps by adopting the Partial-RoPE strategy from MHA2MLA-VLM (2026) and the activation-aware low-rank approximation from SVDLLM-V2 (2025).
2.1 QKNorm Compatibility
Why Does QKNorm Prevent MLA Decoding? Modern LLMs such as Qwen3 (Yang et al. 2025) apply RM-SNorm (Zhang and Sennrich 2019) to each query and key as , where , is a learnable element-wise gain, and denotes the root-mean-square magnitude. QKNorm stabilizes training by controlling attention-logit magnitudes. Its key-side normalization, however, conflicts with the matrix absorption used in standard efficient MLA decoding (Anson and Aitchison 2025; Team et al. 2025).
After Partial-RoPE conversion and joint KV compression, the pre-RoPE key of head h is reconstructed as
where is the compressed KV representation. Without KNorm, the NoPE attention logit can be rewritten as
Thus, can be absorbed into the query projection, and attention can operate directly on the latent KV cache.
KNorm breaks this absorption because its normalization factor depends on both components of the reconstructed key:
While the learned scale is static and can be folded into a projection, varies across tokens. It therefore cannot be absorbed into a fixed query-side projection. Preserving exact KNorm would require either materializing the reconstructed keys or caching a normalization factor for every token and KV head and applying it with a specialized attention kernel. Either option departs from standard latent-cache MLA decoding.
QNorm remains compatible with MLA because only the current query is materialized during autoregressive decoding. It can therefore be normalized. We retain QNorm unchanged and adapt only KNorm.
Calibrated KNorm approximation. Removing KNorm would alter the key scale inherited from pretraining. We instead replace the token-dependent with its calibration average, using one constant per layer and KV head. Omitting the layer index for clarity, we then define , where belongs to a calibration sample set. We then approximate the normalized key as .
Since both and are token-independent, their NoPE component can be folded into the key up-projection:
The NoPE logit can therefore be computed directly from the latent cache:
The same static scaling is folded into the RoPE key projection before rotation. This restores standard MLA decoding without extra cache states or custom normalization kernels. During recovery training, the edited projections and QKNorm parameters are jointly refined.
| 1K | 2K | 4K | 8K | 16K | |
|---|---|---|---|---|---|
| 0.8243 | 0.8185 | 0.8228 | 0.8260 | 0.8305 |
Table 1: Stability of across context lengths, estimated on a calibration set of 64 samples.

Figure 2: Parameter-Efficient Distillation. Snowflakes and flames denote frozen and trainable modules, respectively.
In a preliminary experiment, we examine whether is sensitive to context length. We select the middle KV head in the middle layer of Qwen3-8B and estimate using sequences ranging from 1K to 16K. Table 1 shows that the estimates remain within a narrow range of 0.8185~0.8305, with a coefficient of variation of only 0.48%. This stability supports using a single calibrated constant in place of the token-wise KNorm denominator.
2.2 Parameter-Efficient Distillation
Full-parameter recovery incurs substantial compute and memory overhead and may unnecessarily perturb pretrained representations, including MoE routing and expert specialization. As shown in Figure 2, we instead combine distillation with parameter-efficient fine-tuning (PEFT), updating only the parameters modified by MLAfication.
Distillation. The original MHA/GQA model serves as the teacher and the MLAfied model as the student. Given the same sequence, we minimize the KL divergence from the teacher distribution to the student distribution:
where and denote the teacher and student output distributions. Unlike one-hot next-token targets, the teacher distribution provides dense supervision and conveys implicit knowledge. It improves data efficiency during MLAfication.
PEFT. We update only the Q/K/V-side parameters modified by MLAfication, including the latent down- and up-projections, the projections associated with the RoPE-preserved subspace, and the corresponding QKNorm pa- rameters. The attention output projections, embeddings, LM head, and all FFN parameters remain frozen.
For modern MoE models, we also freeze all routers and experts. This preserves the load-balancing behavior learned during pretraining. Distillation further limits routing changes caused indirectly by altered attention representations. Freezing the backbone removes its gradient and optimizer-state costs and allows the teacher and student to share the same frozen parameter storage. This leaves only 0.91B of 8.19B parameters (-88.9%) trainable in Qwen3-8B and 0.50B of 30.53B parameters (-98.4%) trainable in Qwen3-30B-A3B.
2.3 Refining MHA2MLA's ①&② Approximation
① Partial-RoPE. MLA retains a small RoPE component for positional encoding while compressing the remaining NoPE key dimensions. We adopt the contribution-aware Partial-RoPE strategy from MHA2MLA-VLM (Fan et al. 2026), which retains the rotary subspaces that most strongly influence the attention distribution. Since we adopt this procedure without modification, we omit its details here for brevity and refer readers to the original paper.
② Activation-aware low-rank approximation. Let denote the NoPE key projection. We stack it with the value projection as . Vanilla truncated SVD minimizes the weight-space error , ignoring the input distribution.
We instead adopt the loss-optimized objective of SVDLLM-V2 (Wang et al. 2025). Given calibration activations , it minimizes
We first eigendecompose the activation second-moment matrix as and form . Let be its rank- truncated SVD. We initialize the MLA factors as
where is evaluated over the nonzero eigenspace. Their product gives the rank- approximation that minimizes Equation (7). This initialization minimizes KV output reconstruction error on the calibration rather than naive SVD.
3 Experiments
We evaluate four model families : MHA (SmolLM ), GQA (Qwen2.5 ), GQA+QKNorm (Qwen3 ), and GQA+QKNorm+MoE (Qwen3 ). Following prior work (Ji et al. 2025; Meng et al. 2025), we source the fine-tuning data from SmolLM training corpus (Allal et al. 2024). We evaluate model performance on Commonsense, which comprises six sub-datasets, and LongBench v1 (Bai et al. 2024). We adopt continued pre-training (CPT) as a baseline to eliminate performance differences caused by the training
The same stability is observed across all layers and heads.
All models are Base models instead of Instruct ones.
| Model | Tokens | KV Mem. | Avg@→ | MMLU | ARC | PIQA | HS | OBQA | WG | Avg@LB |
|---|---|---|---|---|---|---|---|---|---|---|
| MHA foundation models | ||||||||||
| SmolLM-1.7B | 1T | - | 55.90 | 39.27 | 59.87 | 75.73 | 62.93 | 42.80 | 54.85 | 18.66 |
| + CPT | - | 55.42 | 38.68 | 58.79 | 76.12 | 61.33 | 42.80 | 54.78 | 16.76 | |
| + TransMLA | 300M | -68.75% | 38.60 | 58.95 | 74.97 | 61.52 | 43.00 | 54.38 | ||
| + MLAfication | -68.75% | 38.14 | 58.72 | 75.63 | 60.52 | 42.60 | 54.54 | |||
| + CPT | - | 55.71 | 38.80 | 58.72 | 76.06 | 61.98 | 43.60 | 55.09 | 16.09 | |
| + TransMLA | 700M | -81.25% | 37.79 | 57.53 | 75.52 | 59.88 | 42.80 | 55.17 | ||
| + MLAfication | -81.25% | 37.10 | 56.28 | 75.46 | 59.68 | 44.00 | 53.99 | |||
| + CPT | - | 55.84 | 39.15 | 59.38 | 75.63 | 62.26 | 43.00 | 55.64 | 16.49 | |
| + TransMLA | 1B | -87.50% | 37.24 | 56.32 | 74.81 | 60.08 | 42.40 | 53.20 | ||
| + MLAfication | -87.50% | 37.67 | 55.58 | 75.46 | 59.12 | 42.40 | 53.43 | |||
| GQA foundation models | ||||||||||
| Qwen2.5-7B | 18T | - | 63.36 | 47.21 | 64.40 | 79.76 | 77.48 | 45.40 | 65.90 | 29.12 |
| + CPT | - | 64.13 | 48.24 | 66.27 | 80.09 | 76.55 | 46.20 | 67.40 | 29.14 | |
| + TransMLA | 50M | -43.75% | 46.60 | 68.84 | 79.49 | 74.66 | 46.40 | 64.01 | ||
| + MLAfication | -43.75% | 47.22 | 68.00 | 79.33 | 76.27 | 45.80 | 65.19 | |||
| + CPT | - | 64.42 | 47.94 | 69.98 | 80.30 | 76.02 | 46.00 | 66.30 | 28.90 | |
| + TransMLA | 600M | -68.75% | 45.31 | 66.72 | 79.60 | 72.33 | 43.80 | 63.54 | ||
| + MLAfication | -68.75% | 46.39 | 68.17 | 78.94 | 74.13 | 44.80 | 64.88 | |||
| + CPT | - | 64.11 | 47.96 | 69.55 | 79.87 | 75.80 | 45.20 | 66.30 | 29.36 | |
| + TransMLA | 1.2B | -81.25% | 43.36 | 63.31 | 78.78 | 70.25 | 42.00 | 60.06 | ||
| + MLAfication | -81.25% | 44.11 | 62.98 | 78.45 | 71.68 | 44.40 | 60.54 | |||
| GQA+QKNorm | ||||||||||
| Qwen3-8B | 36T | - | 64.15 | 50.14 | 68.71 | 79.22 | 77.01 | 43.60 | 66.22 | 30.96 |
| + CPT | - | 65.05 | 50.93 | 71.47 | 79.92 | 75.88 | 45.40 | 66.69 | 31.45 | |
| + MLAfication | 300M | -43.75% | 50.43 | 72.42 | 79.87 | 75.35 | 43.40 | 64.17 | ||
| + CPT | - | 64.97 | 50.58 | 71.30 | 80.30 | 75.72 | 45.00 | 66.93 | 31.50 | |
| + MLAfication | 600M | -68.75% | 48.68 | 70.15 | 79.54 | 73.75 | 43.40 | 62.35 | ||
| + CPT | - | 65.09 | 50.88 | 71.96 | 80.20 | 75.82 | 44.80 | 66.85 | 31.44 | |
| + MLAfication | 1.2B | -81.25% | 46.75 | 67.83 | 78.24 | 72.29 | 44.40 | 60.93 | ||
| GQA+QKNorm+MoE | ||||||||||
| Qwen3-30B-A3B | 36T | - | 65.97 | 53.48 | 68.74 | 80.96 | 79.63 | 45.60 | 67.40 | 32.65 |
| + CPT | - | 66.75 | 54.11 | 71.13 | 81.61 | 78.01 | 46.80 | 68.82 | 30.68 | |
| + MLAfication | 300M | -43.75% | 51.84 | 70.26 | 81.28 | 77.57 | 45.40 | 65.75 | ||
| + CPT | - | 66.25 | 52.85 | 70.20 | 81.99 | 78.51 | 46.60 | 67.32 | 29.67 | |
| + MLAfication | 1.2B | -68.75% | 49.91 | 70.77 | 81.18 | 76.82 | 44.00 | 65.19 | ||
| + CPT | - | 66.88 | 54.27 | 70.36 | 81.83 | 78.37 | 47.40 | 69.06 | 30.05 | |
| + MLAfication | 2B | -81.25% | 47.59 | 67.03 | 81.01 | 74.32 | 43.80 | 63.22 | ||
Table 2: Main results across MHA, GQA, QKNorm-based GQA, and QKNorm-based MoE models. Avg@ and Avg@LB denote the averages over short-context benchmarks and LongBench, respectively. Tokens denotes recovery-training tokens, and KV Mem. denotes the reduction from the original KV cache. Subscripts report absolute score differences from the CPT baseline.
data, since our fine-tuning corpus differs from the proprietary data used to train Qwen. We also compare against TransMLA, the current SOTA method. Note that TransMLA does not apply to models equipped with QKNorm. Unless otherwise specified, MLAfication use contribution-aware partial-RoPE, SVDLLM V2, calibrated KNorm approximation when QKNorm is present, and parameter-efficient distillation. Full hyperparameters are provided in Appendix A.
3.1 Main Results
Table 2 reports the main evaluation across four model families. Importantly, the data-control experiment reveals the SmolLM-derived dataset is effective: CPT outperforms the original models in 17/21 settings for the Qwen series. Comparing MLAfication against CPT is therefore essential, as comparisons only against the original models would incorrectly attribute data-induced improvements to our method.
First, MLAfication and the current SOTA TransMLA can be fairly compared across both MHA and GQA families. On commonsense (CS) benchmarks, MLAfication underperforms TransMLA on MHA-based models by an average of 0.21 points, but outperforms it on GQA-based models by an average of 0.68 points. On LongBench (LB), MLAfication achieves better results in 5/6 evaluation settings, highlighting its effectiveness in long-context scenarios. Given that GQA—as a refinement of MHA—is increasingly preferred in architectural choices, and that long-context capabilities are becoming more critical in multimodal and agent-based applications, our results suggest that MLAfication offers greater practical value than the current SOTA TransMLA.

Figure 3: Normalized inference throughput across prompt lengths and concurrency levels. Throughput is normalized to the baseline under the same setting; the dashed horizontal line denotes the baseline.
Second, the results hold on recent mainstream architectures that use QKNorm and MoE. With calibrated KNorm approximation, MLAfication resolves the structural conflict between QKNorm and MLA-style matrix absorption, enabling conversion of Qwen3-8B and Qwen3-30B-A3B. On Qwen3-8B, even the strongest compression ratio keeps the CS and LB drops from CPT at 3.35 and 2.12 points, respectively. This degradation is comparable to Qwen2.5-7B, showing that our QKNorm adaptation preserves the recoverability of MLAfication on normalized attention models. On Qwen3-30B-A3B, at KV reduction, CS and LB are 1.60 and 0.13 points below CPT, respectively. At the strongest compression ratio, the CS and LB gaps remain 4.05 and 2.04 points, respectively. Together, these results show that MLAfication successfully adapts to the QKNorm-based GQA and MoE architectures that are dominant in recent LLMs.
Third, consistent with prior findings, more aggressive KV-cache compression leads to greater performance degradation because it introduces larger approximation errors. Moreover, GQA already reduces the KV cache through KV-head sharing, leaving less room for further compression than MHA.
Overall, the main results show that MLAfication can be applied to recent mainstream LLM architectures including GQA, QKNorm, and MoE, while minimizing quality degradation under KV-cache compression.
3.2 Serving Efficiency
We evaluate end-to-end serving efficiency with vLLM on a single NVIDIA H200 GPU, using BF16 model weights with either BF16 or FP8_E4M3 KV cache. Following the evaluation protocol of TransMLA, we use equal input and output lengths: 4K+4K, 8K+8K, and 16K+16K. We measure output-token throughput under concurrency levels of 32, 64, 128, and 256. Figure 3 reports throughput normalized by the corresponding BF16 GQA baseline under the same workload. Evaluation settings are provided in Appendix B.
We adapt optimized inference kernels to multiple latent dimensions, , while fixing the RoPE dimension to , and support both BF16 and FP8_E4M3 formats. To our knowledge, TransMLA evaluates the perfor- mance of the service only for a workload setting with , and does not report the FP8 KV-cache.
| Model | KV Mem. | Avg@CS | Avg@LB |
|---|---|---|---|
| Qwen3-8B | - | 64.15 | 30.96 |
| w. KNorm removal | -43.75% | 63.40 | 30.60 |
| w. Ours | 64.27 | 30.83 | |
| w. KNorm removal | -68.75% | 62.16 | 30.09 |
| w. Ours | 62.98 | 31.06 | |
| w. KNorm removal | -81.25% | 60.84 | 28.31 |
| w. Ours | 61.74 | 29.32 | |
| Qwen3-30B-A3B | - | 65.97 | 32.65 |
| w. KNorm removal | -43.75% | 58.46 | 21.95 |
| w. Ours | 65.35 | 31.36 | |
| w. KNorm removal | -68.75% | 61.23 | 26.03 |
| w. Ours | 64.65 | 29.54 | |
| w. KNorm removal | -81.25% | 59.47 | 23.71 |
| w. Ours | 62.83 | 28.01 |
Table 3: Effect of QKNorm adaptation. Compared with directly removing KNorm, our method consistently improves downstream performance under different KV-cache reduction ratios.

Figure 4: KL-divergence loss curves for QKNorm ablation. Our method achieves lower loss and faster convergence than directly removing KNorm.
Figure 3 shows the largest gains generally occur in more memory-intensive serving regimes, especially for lower-dimensional MLA with FP8 KV caches. On Qwen2.5-7B at 16K+16K and concurrency 256, BF16 MLA-512/256/128 achieves normalized throughput, while FP8 MLA-128 reaches . The gains also transfer to the MoE architecture, under the same workload, BF16 MLA-512/256/128 reaches on Qwen3-30B-A3B, and FP8 MLA-128 further increases throughput to over the BF16 GQA baseline.
It shows that MLAfication not only improves serving efficiency across both dense and MoE, but also composes effectively with KV-cache quantization, with their combination yielding the strongest throughput gains.
| Precision | r = / | r = 512 | r = 256 | r = 128 | ||||
|---|---|---|---|---|---|---|---|---|
| KV Mem. | Avg@LB | KV Mem. | Avg@LB | KV Mem. | Avg@LB | KV Mem. | Avg@LB | |
| BF16 | 100.00% | 32.65 | -43.75% | 31.36-1.29 | -68.75% | 29.54-3.11 | -81.25% | 28.01-4.64 |
| FP8Quanto | -50.00% | 31.97-0.68 | -71.88% | 29.31-3.34 | -84.38% | 28.98-3.67 | -90.63% | 26.90-5.75 |
| Int4_HQQ | -71.88% | 31.76-0.89 | -84.18% | 29.19-3.46 | -91.21% | 28.63-4.02 | -94.73% | 27.00-5.65 |
| Int4_Quanto | 31.47-1.18 | 29.28-3.37 | 28.89-3.76 | 27.21-5.44 | ||||
| Int2_HQQ | -84.38% | 28.97-3.68 | -91.21% | 25.11-7.54 | -95.12% | 24.89-7.76 | -97.07% | 21.70-10.95 |
| Int2_Quanto | 10.92-21.73 | 23.33-9.32 | 23.22-9.43 | 18.80-13.85 | ||||
Table 4: LongBench results of Qwen3-30B-A3B-base under different latent dimensions and KV-cache precisions. KV-memory reductions are measured against the original BF16 cache; with a group size of 64, quantization results in effective precisions of 4.5 bits for Int4 and 2.5 bits for Int2. Subscripts denote absolute score differences from the original BF16 baseline (32.65).
3.3 QKNorm Compatibility
QKNorm blocks standard MLA matrix absorption unless the KNorm denominator is handled explicitly. We compare calibrated KNorm approximation with direct KNorm removal. As shown in Table 3, removing KNorm degrades downstream performance under all compression ratios. On Qwen3-8B, our method improves CS by to and LB by to over KNorm removal. On Qwen3-30B-A3B, the improvement is more pronounced, with CS gains of to and LB gains of to . The loss curves in Figure 4 further show that our method converges faster and reaches lower distillation loss. These results show that our method preserves conversion-induced degradation while keeping the attention computation compatible with latent caching.
3.4 Integration with KV-Cache Quantization
MLAfication and KV-cache quantization act on different components of cache size and can therefore be combined. As shown in Table 4, adding MLAfication to Int4_Quanto increases the KV-cache reduction from to while still achieving 27.21 on LongBench. At , Int4_Quanto scores 28.89 with a reduction, while quantization-only Int2_HQQ scores 28.97 with an reduction. The combined configuration therefore reduces the remaining cache by a further with a difference of only 0.08 LongBench points.
3.5 Ablation Studies
Parameter-Efficient Distillation We ablate two key choices in recovery training: the training objective and the trainable parameter set (Table 5).
First, logit distillation provides more effective recovery supervision than next-token prediction (NTP). It improves CS in 9 of the 12 matched comparisons and LB in all 12, with larger and more consistent gains on LongBench. At the strongest compression ratio under full-parameter tuning, distillation improves LB by 3.0 points on SmolLM-1.7B and 4.1 points on Qwen3-8B. Unlike NTP's single hard target, distillation transfers the teacher's full output distribution and better constrains the deviation introduced by MLAfication.
| L | Fine-tuning | KV Mem. | Avg@CS | Avg@LB |
|---|---|---|---|---|
| SmolLM-1.7B-MLA | ||||
| NTP | Full | -68.75% | 54.69 | 14.53 |
| QKV-only | 54.51 | 13.72 | ||
| Distill | Full | 54.38 | 16.54 | |
| QKV-only | 55.03 | 15.59 | ||
| NTP | Full | -81.25% | 53.43 | 13.55 |
| QKV-only | 53.31 | 13.67 | ||
| Distill | Full | 53.26 | 15.72 | |
| QKV-only | 54.42 | 15.39 | ||
| NTP | Full | -87.50% | 52.88 | 12.92 |
| QKV-only | 52.35 | 12.96 | ||
| Distill | Full | 53.41 | 15.87 | |
| QKV-only | 53.95 | 14.48 | ||
| Qwen3-8B-MLA | ||||
| NTP | Full | -43.75% | 63.57 | 28.07 |
| QKV-only | 63.83 | 28.73 | ||
| Distill | Full | 63.24 | 31.05 | |
| QKV-only | 64.27 | 30.83 | ||
| NTP | Full | -68.75% | 61.84 | 26.73 |
| QKV-only | 62.38 | 26.58 | ||
| Distill | Full | 62.28 | 31.79 | |
| QKV-only | 62.98 | 31.06 | ||
| NTP | Full | -81.25% | 61.00 | 26.15 |
| QKV-only | 60.97 | 26.06 | ||
| Distill | Full | 61.30 | 30.29 | |
| QKV-only | 61.74 | 29.32 | ||
Table 5: Ablation of distillation and QKV-only fine-tuning.
Second, QKV-only fine-tuning matches full-parameter tuning closely under the same recovery budget. Averaged over all matched CS and LB comparisons, its score differs from full-parameter tuning by only -0.015 points, while requiring substantially fewer trainable parameters and optimizer states. We therefore adopt logit distillation with QKV-only fine-tuning as our default recovery configuration.
Low-Rank KV Initialization Table 6 compares low-rank KV initialization methods before recovery training using layer-wise attention-output MSE on Qwen2.5-7B.
SVDLLM V2 consistently yields substantially lower attention-output MSE than vanilla SVD. For example, at
| Stage | ΔM | KV Mem. | Attn. MSE ↓ |
|---|---|---|---|
| Low-rank KV Approximation | |||
| MHA2MLA | w. SVD | -68.75% | 482.43 |
| MLAfication | w. SVDLLM V2 | 86.58 | |
| MHA2MLA | w. SVD | -81.25% | 866.92 |
| MLAfication | w. SVDLLM V2 | 244.69 | |
| MHA2MLA | w. SVD | -87.50% | 1189.58 |
| MLAfication | w. SVDLLM V2 | 442.26 | |
Table 6: Attention-editing ablation on Qwen2.5-7B, measured by the average layer-wise MSE between original and edited attention outputs before recovery.
| Model | KV Mem. | Avg@CS | Avg@LB |
|---|---|---|---|
| LLaMA-2-7B | - | 59.85 | 27.40 |
| + TransMLA | -68.75% | 58.20 | 1.34 |
| + MLAfication | 52.68 | 1.06 | |
| + TransMLA | -87.50% | 51.19 | 0.95 |
| + MLAfication | 42.89 | 1.19 | |
| + TransMLA | -92.97% | 43.26 | 0.74 |
| + MLAfication | 34.43 | 0.84 | |
| Qwen2.5-7B | - | 63.36 | 29.12 |
| + TransMLA | -43.75% | 61.38 | 4.08 |
| + MLAfication | 60.44 | 7.48 | |
| + TransMLA | -68.75% | 52.34 | 1.76 |
| + MLAfication | 50.51 | 4.94 | |
| + TransMLA | -81.25% | 34.97 | 0.82 |
| + MLAfication | 34.33 | 3.33 |
Table 7: Zero-shot TransMLA vs. MLAfication.
68.75% compression, it reduces the MSE from 482.43 to 86.58, with the advantage remaining pronounced under stronger compression. This shows that activation-aware reconstruction better preserves the original attention behavior and provides a stronger initialization for recovery training.
3.6 Diagnostics and Practical Considerations
Training-free conversion is only a diagnostic. Table 7 shows training-free performance provides limited evidence of practical effectiveness. Although both methods retain a substantial fraction of the base models' short-context accuracy, their LongBench scores drop to near zero on both LLaMA-2-7B and Qwen2.5-7B, precisely in the long-context regime where KV-cache compression is most relevant. One possible explanation is that modification of RoPE weakens positional discriminability, which is more critical for long-context tasks than for short-context benchmarks. We therefore report training-free results only as diagnostics and base our main comparison on performance after recovery stage.
MoE routing. For MoE models, attention conversion could in principle shift hidden-state distributions and disturb expert routing. As shown in Table 8, MLAfication does not exhibit an increasing trend in load-balancing violations during recovery stage: across all compression ratios, the mean violation rate remains stable and is only above the HF baseline. In contrast, KNorm removal raises mean violations by above the baseline. This provides additional evidence that our method avoids substantial routing drift and preserves the pretrained MoE behavior.
| Method | KV Mem. | Max Vio. | Mean Vio. |
|---|---|---|---|
| Baseline | - | 5.48 | 2.59 |
| Ours | -43.75% | 6.04 | 2.70 |
| -68.75% | 5.74 | 2.69 | |
| -81.25% | 5.92 | 2.73 | |
| KNorm removal | -43.75% | 10.53 | 4.21 |
| -68.75% | 12.48 | 3.28 | |
| -81.25% | 11.77 | 3.24 |
Table 8: MoE load-balancing violations on Qwen3-30B-A3B. Max Vio. and Mean Vio. denote the maximum and mean of the layer-wise maxima, respectively.
4 Related Work
Post-training migration to MLA. MLA caches a low-dimensional KV tensor for efficient decoding (DeepSeek-AI 2024). MHA2MLA converts pretrained MHA/GQA using Partial-RoPE and joint low-rank approximation (Ji et al. 2025), while TransMLA improves positional conversion and KV factorization (Meng et al. 2025). MHA2MLA-VLM extends contribution-aware MLA conversion to vision-language models (Fan et al. 2026). MLAfication builds on contribution-aware Partial-RoPE and SVD-LLM V2 initialization (Wang et al. 2025), focusing on QKNorm compatibility and low-cost recovery for dense or MoE models.
Low-rank KV-cache compression. Palu compresses projected keys and values through low-rank factorization (Chang et al. 2025); TALE and SALS further adapt rank or sparsity to token importance (Lee et al. 2025; Mu et al. 2025). MLAfication instead produces an MLA parameterization directly consumable by optimized latent-attention kernels.
Orthogonal cache compression. KV-cache quantization reduces numerical precision (Liu et al. 2024b; Hooper et al. 2024; Li et al. 2025), while token selection and cross-layer sharing reduce the sequence or layer dimension (Li et al. 2024; Liu et al. 2024a; Zuhri et al. 2024). These methods complement architectural conversion, motivating our evaluation of MLAfication with low-precision KV caches.
5 Conclusion
We demonstrate that pretrained MHA/GQA checkpoints can be migrated to MLA with controlled quality loss across a broad range of KV-cache budgets. MLAfication achieves this consistently across standard attention, QKNorm, and Mixture-of-Experts architectures through architecture-aware conversion and targeted recovery. The resulting cache reductions translate into substantial serving gains and remain compatible with low-precision KV-cache formats. Together, these findings make post-training MLA conversion a practical way to improve the inference efficiency of existing LLMs without retraining them from scratch.
Acknowledgments
This work was partially funded by Grant No. JCKY2024206A015, the National Natural Science Foundation of China (Grant No. 62506079), and the Fudan Kunpeng & Ascend Center of Cultivation. The computations for this research were performed on the CFFF platform at Fudan University.
References
Ainslie, J.; Lee-Thorp, J.; de Jong, M.; Zemlyanskiy, Y.; Lebrón, F.; and Sanghai, S. 2023. GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpoints. In Bouamor, H.; Pino, J.; and Bali, K., eds., Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, EMNLP 2023, Singapore, December 6-10, 2023, 4895–4901. Association for Computational Linguistics.
Allal, L. B.; Lozhkov, A.; Bakouch, E.; von Werra, L.; and Wolf, T. 2024. SmolLM: Blazingly Fast and Remarkably Powerful. Hugging Face Blog.
Anson, B.; and Aitchison, L. 2025. Controlling changes to attention logits. arXiv preprint arXiv:2511.21377.
Bai, Y.; Lv, X.; Zhang, J.; Lyu, H.; Tang, J.; Huang, Z.; Du, Z.; Liu, X.; Zeng, A.; Hou, L.; Dong, Y.; Tang, J.; and Li, J. 2024. LongBench: A Bilingual, Multitask Benchmark for Long Context Understanding. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), 3119–3137. Association for Computational Linguistics.
Chang, C.-C.; Lin, W.-C.; Lin, C.-Y.; Chen, C.-Y.; Hu, Y.-F.; Wang, P.-S.; Huang, N.-C.; Ceze, L.; Abdelfattah, M. S.; and Wu, K.-C. 2025. Palu: KV-Cache Compression with Low-Rank Projection. In International Conference on Learning Representations.
DeepSeek-AI. 2024. DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model. CoRR, abs/2405.04434.
DeepSeek-AI. 2025. DeepSeek-V3.2: Pushing the Frontier of Open Large Language Models. CoRR, abs/2512.02556.
Fan, X.; Sun, Z.; Ji, T.; Shen, L.; and Gui, T. 2026. MHA2MLA-VLM: Enabling DeepSeek's Economical Multi-Head Latent Attention Across Vision-Language Models. In Koenig, S.; Jenkins, C.; and Taylor, M. E., eds., Fortieth AAAI Conference on Artificial Intelligence, Thirty-Eighth Conference on Innovative Applications of Artificial Intelligence, Sixteenth Symposium on Educational Advances in Artificial Intelligence, AAAI 2026, Singapore, January 20-27, 2026, 30638–30646. AAAI Press.
Henry, A.; Dachapally, P. R.; Pawar, S. S.; and Chen, Y. 2020. Query-key normalization for transformers. In Findings of the Association for Computational Linguistics: EMNLP 2020, 4246–4253.
Hooper, C.; Kim, S.; Mohammadzadeh, H.; Mahoney, M. W.; Shao, Y. S.; Keutzer, K.; and Gholami, A. 2024. KVQuant: Towards 10 Million Context Length LLM Inference with KV Cache Quantization. In Advances in Neural Information Processing Systems, volume 37.
Ji, T.; Guo, B.; Wu, Y.; Guo, Q.; Shen, L.; Chen, Z.; Qiu, X.; Zhang, Q.; and Gui, T. 2025. Towards Economical Inference: Enabling DeepSeek's Multi-Head Latent Attention in Any Transformer-based LLMs. In Che, W.; Nabende, J.; Shutova, E.; and Pilehvar, M. T., eds., Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), 33313–33328. Vienna, Austria: Association for Computational Linguistics. ISBN 979-8-89176-251-0.
Kimi Team; et al. 2026. Kimi K3: Open Frontier Intelligence. arXiv:2607.24653.
Lee, J.; won Hwang, S.; Qiao, A.; Campos, D.; Yao, Z.; and He, Y. 2025. TALE: Token-Adaptive Low-Rank KVCache Approximation with Reconstruction Elimination. Transactions of the Association for Computational Linguistics, 13: 1298–1318.
Li, X.; Xing, Z.; Li, Y.; Qu, L.; Zhen, H.-L.; Yao, Y.; Liu, W.; Pan, S. J.; and Yuan, M. 2025. KVTuner: Sensitivity-Aware Layer-wise Mixed Precision KV Cache Quantization for Efficient and Nearly Lossless LLM Inference. In Proceedings of the 42nd International Conference on Machine Learning, volume 267, 36451–36485. PMLR.
Li, Y.; Huang, Y.; Yang, B.; Venkitesh, B.; Locatelli, A.; Ye, H.; Cai, T.; Lewis, P.; and Chen, D. 2024. SnapKV: LLM Knows What You are Looking for Before Generation. In Advances in Neural Information Processing Systems.
Liu, A.; Liu, J.; Pan, Z.; He, Y.; Haffari, G.; and Zhuang, B. 2024a. MiniCache: KV Cache Compression in Depth Dimension for Large Language Models. In Advances in Neural Information Processing Systems, volume 37, 139997–140031.
Liu, Z.; Yuan, J.; Jin, H.; Zhong, S.; Xu, Z.; Braverman, V.; Chen, B.; and Hu, X. 2024b. KIVI: A Tuning-Free Asymmetric 2bit Quantization for KV Cache. In Proceedings of the 41st International Conference on Machine Learning, volume 235, 32332–32344. PMLR.
Meng, F.; Tang, P.; Yao, Z.; Sun, X.; and Zhang, M. 2025. TransMLA: Migrating GQA Models to MLA with Full DeepSeek Compatibility and Speedup. In Belgrave, D.; Zhang, C.; Montoya, L. N.; Lin, H.; Pascanu, R.; Koniusz, P.; Ghassemi, M.; Chen, N.; Ruíz, I. V. M.; and Loaiza-Bonilla, A., eds., Advances in Neural Information Processing Systems 38: Annual Conference on Neural Information Processing Systems 2025, NeurIPS 2025, San Diego, CA, USA, December 2-7, 2025 / Mexico City, Mexico, November 30 - December 5, 2025.
Mu, J.; Huang, H.; Zhang, J.; Yu, M.; Wang, T.; and Li, Y. 2025. SALS: Sparse Attention in Latent Space for KV Cache Compression. In Advances in Neural Information Processing Systems, volume 38.
Shazeer, N.; Mirhoseini, A.; Maziarz, K.; Davis, A.; Le, Q.; Hinton, G.; and Dean, J. 2017. Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer. In International Conference on Learning Representations.
Su, J.; Lu, Y.; Pan, S.; Murtadha, A.; Wen, B.; and Liu, Y. 2023. RoFormer: Enhanced Transformer with Rotary Position Embedding. arXiv:2104.09864.
Team, K.; Bai, Y.; Bao, Y.; Charles, Y.; Chen, C.; Chen, G.; Chen, H.; Chen, H.; Chen, J.; Chen, N.; et al. 2025. Kimi k2: Open agentic intelligence. arXiv preprint arXiv:2507.20534.
Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A. N.; Kaiser, L.; and Polosukhin, I. 2017. Attention is All you Need. In Guyon, I.; von Luxburg, U.; Bengio, S.; Wallach, H. M.; Fergus, R.; Vishwanathan, S. V. N.; and Garnett, R., eds., Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, 5998–6008.
Wang, X.; Alam, S.; Wan, Z.; Shen, H.; and Zhang, M. 2025. SVD-LLM V2: Optimizing Singular Value Truncation for Large Language Model Compression. In Chiruzzo, L.; Ritter, A.; and Wang, L., eds., Proceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers), 4287–4296. Albuquerque, New Mexico: Association for Computational Linguistics. ISBN 979-8-89176-189-6.
Yang, A.; Li, A.; Yang, B.; Zhang, B.; Hui, B.; Zheng, B.; Yu, B.; Gao, C.; Huang, C.; Lv, C.; et al. 2025. Qwen3 Technical Report. arXiv preprint arXiv:2505.09388.
Yesiltepe, H.; Hu, J.; Meral, T. H. S.; Akan, A. K.; Oktay, K.; Eldardiry, H.; and Yanardag, P. 2026. VideoMLA: Low-Rank Latent KV Cache for Minute-Scale Autoregressive Video Diffusion. arXiv:2605.30351.
Zeng, A.; Lv, X.; Hou, Z.; Du, Z.; Zheng, Q.; Chen, B.; Yin, D.; Ge, C.; Huang, C.; Xie, C.; et al. 2026. Glm-5: from vibe coding to agentic engineering. arXiv preprint arXiv:2602.15763.
Zhang, B.; and Sennrich, R. 2019. Root mean square layer normalization. Advances in neural information processing systems, 32.
Zhang, S.; Wei, J.; Lu, W.; Yue, X.; Li, W.; Li, Q.; Zhao, P.; Cai, M.; and Si, L. 2026. Whisper-MLA: Reducing GPU Memory Consumption of ASR Models Based on MHA2MLA Conversion. In ICASSP 2026-2026 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 18412–18416. IEEE.
Zuhri, Z. M. K.; Adilazuarda, M. F.; Purwarianti, A.; and Aji, A. F. 2024. MLKV: Multi-Layer Key-Value Heads for Memory Efficient Transformer Decoding. CoRR, abs/2406.09297.
Supplementary Material
A Training Configuration
We follow MHA2MLA and TransMLA in reporting recovery hyperparameters by model and KV-cache reduction ratio. All runs use the MHA2MLA data mixture, i.e., FineWeb-Edu-Dedup, Cosmopedia-v2, Python-Edu, Open-Web-Math, and StackOverflow. The recovery setting combines logit distillation from the original model with QKV-only fine-tuning. For contribution-aware partial rope scoring, we use 128 calibration sequences of 4K tokens each. QKV-only fine-tuning updates QKV projections and attention normalization parameters. Unless otherwise specified, we use a global batch size (GBS) of 32 on H200 GPUs and warm up over 3% of the training data. Table 9 summarizes the model-specific recovery hyperparameters.
Table 9: Recovery hyperparameters for MLAfication. The trainable parameters are restricted to QKV projections and attention normalization parameters. Approximate trainable ratios are 17.6% for SmolLM-1.7B, 6.1% for Qwen2.5-7B, 11.1% for Qwen3-8B, and 1.6% for Qwen3-30B-A3B.
| Model | KV Mem. | Tokens | LR | L | |
|---|---|---|---|---|---|
| SmolLM-1.7B | -68.75% | 1024 | 300M | 1e-4 | 2K |
| SmolLM-1.7B | -81.25% | 640 | 700M | 5e-4 | 2K |
| SmolLM-1.7B | -87.50% | 384 | 1B | 5e-4 | 2K |
| Qwen2.5-7B | -43.75% | 512 | 50M | 1e-4 | 4K |
| Qwen2.5-7B | -68.75% | 256 | 600M | 1e-4 | 4K |
| Qwen2.5-7B | -81.25% | 128 | 1.2B | 1e-4 | 4K |
| Qwen3-8B | -43.75% | 1024 | 300M | 1e-4 | 4K |
| Qwen3-8B | -68.75% | 512 | 600M | 1e-4 | 4K |
| Qwen3-8B | -81.25% | 256 | 1.2B | 1e-4 | 4K |
| Qwen3-30B-A3B | -43.75% | 512 | 300M | 1e-4 | 4K |
| Qwen3-30B-A3B | -68.75% | 256 | 1.2B | 1e-4 | 4K |
| Qwen3-30B-A3B | -81.25% | 128 | 2B | 1e-4 | 4K |
B Evaluation Configuration
Hardware and software. We run all serving experiments on a single NVIDIA H200 GPU with 143,771 MiB of memory. Each experiment uses one GPU with tensor parallel size 1, thereby measuring single-GPU serving efficiency without cross-device communication. The system uses NVIDIA driver 570.133.20, CUDA compiler version 12.9, and CUDA runtime 12.8. The software stack consists of PyTorch 2.11.0+cu128 and vLLM 0.19.2.
Models and numerical formats. We benchmark Qwen2.5-7B and Qwen3-30B-A3B to cover both dense and MoE architectures. Model weights remain in BF16 for all experiments. For MLAfication, we evaluate latent dimensions with the rope dimension fixed to . The KV cache is stored in either BF16 or FP8 E4M3; therefore, the FP8 setting changes only the KV-cache representation rather than the model weights.
Serving workloads. We use equal prompt and generation lengths of , , and tokens. These workloads progressively increase the pressure on KV-cache capacity and memory bandwidth while keeping the prefill and decoding lengths balanced. For each sequence length, we evaluate concurrency levels of 32, 64, 128, and 256. Prefix caching is disabled so that throughput gains cannot come from reusing cached prefixes across requests. Decoding uses temperature 0.0.
Measurement and normalization. For every combination of model, latent dimension (where applicable), cache precision, sequence length, and concurrency, we first run one warmup iteration, which is excluded from measurement, followed by five timed iterations. We measure output-token throughput as the total number of generated tokens divided by the corresponding wall-clock time. To make results comparable across models and workloads, we normalize each measurement by the throughput of the original BF16 GQA model evaluated with the same model, sequence length, and concurrency:
where is the throughput of the evaluated configuration and is that of the matched BF16 GQA baseline.
Detailed throughput results. Table 10 reports absolute output-token throughput for each GQA BF16 baseline and normalized speedups for all other configurations. Each speedup uses the baseline from the same model, prompt/output length, and concurrency. All model weights remain in BF16; BF16 and FP8 in the configuration names denote the KV-cache precision, with FP8 using the E4M3 format. TransMLA is reported only on Qwen2.5-7B because it is not applicable to the QKNorm-based Qwen3 models. Under matched settings, our lighter-weight rope handling yields slightly higher throughput than TransMLA; entries are omitted where its optimized kernels do not support the latent size or where QKNorm makes TransMLA inapplicable.
C Background: MLA and MHA2MLA
C.1 MHA and GQA
Given an input token , standard MHA projects it into a query, key, and value for each attention head (Vaswani et al. 2017):
During autoregressive decoding, the keys and values of all previous tokens must be cached. MHA therefore stores elements per token, where is the number of heads and is the head dimension. GQA reduces this cost by sharing each key/value pair among a group of query heads (Ainslie et al. 2023), but still caches full-dimensional keys and values for every KV head.
Table 10: Absolute output-token throughput (tokens/s) for the GQA BF16 baselines and normalized speedups for all other configurations. Here, 4K, 8K, and 16K denote equal prompt and output lengths, and C denotes concurrency.
| Configuration | 4K | 8K | 16K | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| C32 | C64 | C128 | C256 | C32 | C64 | C128 | C256 | C32 | C64 | C128 | C256 | |
| Qwen2.5-7B | ||||||||||||
| GQA, BF16 | 3942 | 5463 | 6762 | 7272 | 2963 | 3766 | 4301 | 3914 | 1988 | 2303 | 2083 | 2079 |
| GQA, FP8 | 1.09× | 1.14× | 1.16× | 1.20× | 1.17× | 1.20× | 1.22× | 1.41× | 1.23× | 1.26× | 1.50× | 1.39× |
| MLA-512, BF16 | 1.03× | 1.13× | 1.21× | 1.26× | 1.15× | 1.24× | 1.32× | 1.44× | 1.27× | 1.35× | 1.55× | 1.38× |
| TransMLA-512, BF16 | 1.01× | 1.10× | 1.19× | 1.23× | 1.13× | 1.22× | 1.31× | 1.41× | 1.26× | 1.34× | 1.55× | 1.37× |
| MLA-512, FP8 | 1.07× | 1.25× | 1.35× | 1.45× | 1.24× | 1.44× | 1.56× | 1.89× | 1.50× | 1.65× | 2.11× | 2.10× |
| MLA-256, BF16 | 1.16× | 1.33× | 1.49× | 1.61× | 1.37× | 1.59× | 1.78× | 2.18× | 1.66× | 1.88× | 2.47× | 2.30× |
| TransMLA-256, BF16 | 1.08× | 1.19× | 1.26× | 1.33× | 1.22× | 1.33× | 1.42× | 1.68× | 1.39× | 1.47× | 1.85× | 1.72× |
| MLA-256, FP8 | 1.16× | 1.37× | 1.62× | 1.77× | 1.44× | 1.73× | 2.01× | 2.52× | 1.80× | 2.18× | 2.95× | 3.24× |
| MLA-128, BF16 | 1.20× | 1.40× | 1.56× | 1.69× | 1.44× | 1.68× | 1.88× | 2.31× | 1.76× | 2.04× | 2.67× | 2.87× |
| MLA-128, FP8 | 1.22× | 1.47× | 1.76× | 1.98× | 1.50× | 1.88× | 2.30× | 2.93× | 1.96× | 2.50× | 3.56× | 3.98× |
| Qwen3-30B-A3B MoE | ||||||||||||
| GQA, BF16 | 2740 | 3602 | 3351 | 3386 | 1914 | 1809 | 1816 | 1899 | 959 | 922 | 954 | 979 |
| GQA, FP8 | 1.11× | 1.14× | 1.55× | 1.42× | 1.18× | 1.60× | 1.46× | 1.42× | 1.60× | 1.50× | 1.45× | 1.45× |
| MLA-512, BF16 | 1.19× | 1.28× | 1.76× | 1.40× | 1.35× | 1.85× | 1.49× | 1.42× | 1.85× | 1.61× | 1.49× | 1.45× |
| MLA-512, FP8 | 1.30× | 1.49× | 2.01× | 2.35× | 1.53× | 2.25× | 2.59× | 2.17× | 2.22× | 2.86× | 2.43× | 2.41× |
| MLA-256, BF16 | 1.23× | 1.37× | 2.07× | 2.48× | 1.53× | 2.25× | 2.86× | 2.12× | 2.38× | 3.14× | 2.38× | 2.37× |
| MLA-256, FP8 | 1.20× | 1.43× | 2.23× | 2.82× | 1.63× | 2.51× | 3.30× | 3.62× | 2.69× | 3.57× | 4.14× | 3.57× |
| MLA-128, BF16 | 1.48× | 1.75× | 2.45× | 2.86× | 1.80× | 2.66× | 3.34× | 3.23× | 2.80× | 3.56× | 3.66× | 3.00× |
| MLA-128, FP8 | 1.53× | 1.87× | 2.79× | 3.31× | 1.85× | 2.88× | 3.80× | 4.45× | 3.07× | 4.35× | 5.33× | 5.35× |
C.2 Multi-Head Latent Attention
MLA (DeepSeek-AI 2024) replaces the full KV cache with a joint low-rank representation and separates positional encoding from latent compression. Omitting head and group indices for clarity, its position-agnostic path is
where the latent dimension is much smaller than the total dimension of the original keys and values. A separate, low-dimensional path retains RoPE (Su et al. 2023):
The attention logit combines the two paths:
For the NoPE term,
Thus, the key up-projection can be absorbed into the query projection, and the value up-projection can likewise be merged with the output projection. Inference only needs to cache and the small RoPE key instead of the full keys and values.
C.3 MHA2MLA
MHA2MLA (Ji et al. 2025) converts a pretrained MHA/GQA model into this MLA form through two steps. First, Partial-RoPE retains RoPE on a small set of query/key frequency subspaces and removes it from the remaining dimensions. The retained subspaces form the position-aware path, while the resulting NoPE dimensions can be absorbed into the latent path. MHA2MLA selects the retained subspaces according to their head-wise 2-norm contribution to the attention logits.
Second, KV-joint low-rank approximation jointly factorizes the NoPE key and value projections:
A truncated SVD initializes these latent projections, after which recovery training compensates for the errors introduced by RoPE removal and rank truncation. The result pre-
Table 11: Absolute output-token throughput (tokens/s) for the BF16 GQA baseline and normalized speedups for MLAfication on a single Ascend 910B NPU. Here, 4K, 8K, and 16K denote equal prompt and output lengths, and C denotes concurrency.
| Configuration | 4K | 8K | 16K | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| C16 | C32 | C64 | C128 | C16 | C32 | C64 | C128 | C16 | C32 | C64 | C128 | |
| Qwen2.5-7B on Ascend 910B | ||||||||||||
| GQA, BF16 | 695.90 | 1040.95 | 1410.60 | 1417.94 | 546.54 | 736.61 | 765.13 | 788.98 | 382.66 | 396.36 | 412.04 | 426.99 |
| MLA-512, BF16 | 0.834× | 0.924× | 1.014× | 1.362× | 0.933× | 1.069× | 1.407× | 1.326× | 1.084× | 1.458× | 1.373× | 1.410× |
| MLA-128, BF16 | 0.982× | 1.170× | 1.400× | 2.124× | 1.195× | 1.544× | 2.323× | 3.244× | 1.574× | 2.520× | 3.556× | 4.033× |
serves the pretrained model's parameters while making its inference-time KV cache compatible with MLA.
D Progressive Compression
Searching compression ratios. Selecting the latent KV dimension is a practical challenge, while independently recovering every candidate is costly. Table 12 presents a progressive strategy that starts from a mildly compressed checkpoint, prunes latent dimensions, and continues recovery from the pruned checkpoint. By reusing earlier recovery, it stays within 0.5 points of independently recovered models at the same target dimension, enabling efficient exploration of the quality–memory frontier.
| Model | Tok. | KV Mem. | CS | LB |
|---|---|---|---|---|
| Qwen2.5-7B | - | 63.36 | 29.12 | |
| 50M | -43.75% | 63.63 | 29.28 | |
| 600M | -68.75% | 62.89 | 28.93 | |
| +550M | 62.55 | 28.71 | ||
| 1.2B | -81.25% | 60.36 | 27.27 | |
| +600M | 59.94 | 27.76 |
Table 12: Progressive search for KV-cache compression ratios on Qwen2.5-7B.
E Ascend Serving Efficiency
Hardware and execution protocol. We additionally evaluate MLAfication on a single Ascend 910B NPU with CANN 9.1. Each serving process exposes exactly one NPU and uses tensor parallel size 1. Although the machine contains eight NPUs, they only run independent benchmark cells in parallel; consequently, the reported measurements contain no tensor-parallel communication. We use graph-mode execution, BF16 model weights and KV cache, a block size of 128, and disable chunked prefill.
Model and workloads. The benchmark uses Qwen2.5-7B dummy weights with the exact tensor shapes of the original model and synthetic token IDs. This setup isolates serving-system efficiency and does not measure language-model quality. We compare MLAfication with against the unmodified Qwen2.5-7B GQA architecture under equal prompt and generation lengths of , , and tokens, and concurrency levels of 16, 32, 64, and 128. Each of the 36 cells contains one timed request batch. Engine initialization and graph capture occur before the timed interval, whereas the measurement includes prefill, decode, scheduling, request queueing, and graph replay. Throughput is normalized by the matched GQA baseline.
Ascend implementation. We use graph-updatable PageAttention metadata, fused query/KV projections, broadcast-mask RoPE, and transpose batch matrix multiplication. CANN accepts the native 28 heads for , whereas requires padding to 32. The unsupported configuration is omitted.
Results. As shown in Table 11, MLA-128 outperforms the baseline in 11 of 12 workloads and achieves a geometric-mean throughput ratio. Its only regression is at and C16. MLA-512 wins 9 of 12 workloads with a geometric mean; at low load, its projection cost and mandatory head padding can outweigh its KV-cache savings. The gains increase as context length and concurrency place more pressure on KV-cache capacity. At C128, MLA-128 achieves throughput across the three sequence lengths, These results show that the serving gains transfer to Ascend, while also exposing the importance of latent-width-specific kernel constraints.