Manuscript Offprint

arXiv:2610.33625

RAQ-MLA: Role-Aware Quantization for Multi-Head Latent Attention Caches

Tianqi Chen, Xunchao Li, Linchuan Xie, Guanghua Yu, Jianchen Zhu, Peisong Wang, Jian Cheng

ABSTRACT

Multi-Head Latent Attention (MLA) has been adopted by recent frontier large language models. Instead of per-head keys and values, MLA caches a compressed KV latent that is up-projected into keys and values at decode time, together with a narrow positional key that carries position information into the attention score. Existing KV-cache quantization methods are designed around the keys and values of standard attention and do not account for what MLA actually caches, which costs accuracy at low bit widths. We analyze the MLA cache both in activation distribution and in how quantization error propagates to the attention output, and show that the two cached tensors play different roles: the latent mainly supplies the values, whereas the positional key dominates the attention score. We therefore propose RAQ-MLA (Role-Aware Quantization for Multi-Head Latent Attention Caches), which fits an invertible transform to each cached tensor against the error that tensor delivers to the attention output: attention-weighted value error for the latent and score perturbation for the positional key. Without training, RAQ-MLA quantizes the full MLA cache to about 2.5 bits per element, a 6.5×6.5 \times increase in theoretical KV-cache capacity, while remaining nearly lossless on reasoning and coding tasks across four MLA models.

1 INTRODUCTION

Long-horizon agents have made ultra-long-context inference a mainstream serving workload (Yao et al., 2023; Yang et al., 2024; DeepSeek-AI, 2026). Serving it requires more than efficient long-sequence computation: the key-value (KV) cache must be held for the entire lifetime of a request and grows linearly with both context length and concurrency. At runtime, the cache competes with batch size for HBM capacity (Kwon et al., 2023); when persisted for prefix reuse, it consumes host memory, SSD capacity, and interconnect bandwidth (Qin et al., 2026; Zheng et al., 2024). Both pressures cap serving throughput and raise deployment cost, and both grow as agents run longer and at higher concurrency.

To reduce this footprint, Multi-Head Latent Attention (MLA) (DeepSeek-AI, 2024) compresses each token's key and value into a single low-dimensional latent ctKV\mathbf{c}_t^{\text{KV}}, which is cached and up-projected into keys and values at decode time, alongside a narrow decoupled positional key ktR\mathbf{k}_t^{\text{R}}. MLA has been adopted by recent frontier models, increasingly together with sparse attention (DeepSeek-AI, 2025; GLM, 2026). Sparse attention, however, only selects which cached tokens each query attends to; the full cache is still retained. MLA thus shrinks the cache per token, but neither it nor sparse attention changes its linear growth with context length: at the one-million-token context length of recent models, a single sequence still occupies tens of GiB of cache. Compressing what MLA actually stores therefore remains necessary.

KV-cache quantization is the other line of work that reduces cache size, lowering the average bits per stored element without any training (Hooper et al., 2024; Liu et al., 2024; Zhou et al., 2026; Su et al., 2025). However, most prior methods (Liu et al., 2024; Hooper et al., 2024) design their granularity, precision, and transforms around the keys and values of standard attention. MLA caches neither: it stores the compressed latent ctKV\mathbf{c}_t^{\text{KV}} and the decoupled positional key ktR\mathbf{k}_t^{\text{R}}, and recovers the content key and value from the latent only at use time. Existing MLA cache quantizers (Zhang et al., 2026; Muller et al., 2026) keep the latent at four or more bits and leave kR\mathbf{k}^{\text{R}} in full precision. In this paper, we aim to quantize the full MLA cache, including the positional key, to extremely low bit widths (about 2.5 bits per cached element on average).

We analyze the two cached tensors both in distribution and in how their quantization error propagates through the MLA computation. Fixed-channel outliers appear in the decoupled positional key but not in the compressed latent (Figure 2), and the positional key carries 92.5% of the attention-score attribution, most of it in a few outlier channels. As a result, the two tensors reach the output through different routes. At 4 bits, the latent's 12.3% error in the cache falls to 1.7% at the attention output through the content key but remains 8.3% through the value, whereas the positional key's error rises from 9.1% to 14.7%. The latent therefore mainly plays the value role in MLA, while the tensor that sets the score is the one existing MLA methods exempt from quantization.

Motivated by this, we propose RAQ-MLA (Role-Aware Quantization for Multi-Head Latent Attention Caches). It quantizes the latent per token and the positional key per channel, following the distribution each exhibits, and stores each in an invertible basis fitted against the error that tensor delivers to the attention output. Both bases are fitted under a single objective, a quadratic form weighted per token by a role metric built from how attention consumes the tensor: for the latent, the value up-projection weighted by how strongly each token is attended; for the positional key, the directions of the queries that read it. We solve it by alternating minimization, requiring neither gradients through the model nor fine-tuning. Both transforms stay inside the compact spaces MLA already works in, 512×512512 \times 512 for the latent and 64×6464 \times 64 for the positional key, so RAQ-MLA improves low-bit accuracy at negligible extra computation.

Figure

Figure 1: Cache capacity against accuracy on GLM-4.7-Flash.

Our contributions are:

• Role analysis of the MLA cache. We show that the two cached tensors play different roles in attention: error in the compressed latent reaches the output mainly through the value readout, whereas the decoupled positional key dominates the attention score and amplifies its own quantization error (Section 3).

• Role-aware quantization. We propose RAQ-MLA, a training-free quantization method designed for the MLA cache. It pairs per-token quantization with a value-aware transform for the latent, and per-channel quantization with a score-aware transform for the positional key. Both transforms are fitted under a single role-aware objective by alternating minimization (Section 4).

• Full-cache quantization at about 2.5 bits. On four MLA models from the GLM, DeepSeek, and Moonlight families, RAQ-MLA quantizes both cached tensors to about 2.5 bits per element, a 6.5×6.5 \times increase in theoretical KV-cache capacity, while staying within 0.5 points of BF16 on reasoning and coding (Figure 1).

References (48)