---
title: Key-Value Low-Rank Adaptation
url: https://www.emergentmind.com/topics/key-value-low-rank-adaptation
type: topic
---

# Key-Value Low-Rank Adaptation

Key-Value Low-Rank Adaptation denotes a family of transformer adaptation techniques that modify the key and value projections with low-rank structure rather than full dense updates. In the standard LoRA-style PEFT setting, a frozen attention weight is replaced by \(W' = W + \Delta W\), with \(\Delta W\) parameterized as a low-rank product; in this usage, “Key-Value Low-Rank Adaptation” usually means adding such adapters to the key and value matrices \(W_k\) and \(W_v\) in each layer independently [2407.09946]. The same label is also used more broadly for methods that vary rank across layers or modules, share low-rank components across depth or across \(Q/K/V\), use tensorized or routed compositions, reparameterize updates spectrally, or alter the K/V parameterization itself during pretraining to reduce KV-cache cost [2601.11471].

## 1. Canonical formulation and transformer placement

The canonical formulation inherits directly from LoRA. For a linear weight matrix \(\mathbf{W} \in \mathbb{R}^{m \times n}\), the adapted weight is written as
\[
\mathbf{W}_\text{eff} = \mathbf{W} + \mathbf{BA},
\]
with \(\mathbf{A} \in \mathbb{R}^{r \times n}\), \(\mathbf{B} \in \mathbb{R}^{m \times r}\), and \(\mathrm{rank}(\mathbf{BA}) \le r\). An equivalent notation writes
\[
W' = W + \Delta W, \qquad \Delta W = P_L P_H,
\]
with \(P_L \in \mathbb{R}^{a \times d}\) and \(P_H \in \mathbb{R}^{d \times b}\), where \(d \ll \min(a,b)\) [2407.09946]. In both notations, the central constraint is that the task-specific update lives in a low-dimensional subspace.

Within attention, the standard decomposition is
\[
Q = XW_Q,\qquad K = XW_K,\qquad V = XW_V.
\]
Under standard K/V low-rank adaptation, one replaces \(W_K\) and \(W_V\) by \(W_K + \Delta W_K\) and \(W_V + \Delta W_V\), with each \(\Delta W\) low rank. The standard LoRA interpretation is per-layer and per-projection: each layer \(\ell\) has its own low-rank pair, and the LP/HP or \(A/B\) factors for that layer are paired only with the features of that layer [2407.09946].

Placement conventions are not uniform across the literature. One line of work follows what it calls “the standard setting in LoRA” and inserts LoRA only on the query and value projection layers of each multi-head attention module; in that setting, keys and output projections remain frozen, giving 24 LoRA layers for RoBERTa-base and GPT2-medium and 48 for RoBERTa-large [2403.09113]. Another line applies adapters to all attention and MLP projections—query, key, value, output, plus gate, up, and down—throughout the backbone, while not adapting the final output head [2606.04325]. A comprehensive account of Key-Value Low-Rank Adaptation therefore has to distinguish the core concept—low-rank modification of \(W_K\) and \(W_V\)—from the broader design choice of which additional projections are co-adapted.

## 2. Module-specific behavior in attention blocks

A recurrent result is that attention projections do not exhibit a uniform preference for rank or placement. Methods that explicitly allocate rank across modules report different patterns depending on the task, model, and scoring rule.

ALoRA treats a LLaMA-2-style transformer block as seven distinct modules—Query, Key, Value, Output, Gate, Up, and Down—and reallocates LoRA rank among them under a fixed global budget. Its visualization on E2E reports that more LoRA rank budgets are put to adapt the query and key modules, while the value and output modules in the self-attention are less emphasized; it also reports that the feed-forward layer requires fewer LoRA ranks [2403.16187]. By contrast, GoRA allocates ranks from gradient-derived importance scores and, on LLaMA3.1-8B fine-tuned for MetaMathQA, reports that most ranks are allocated to the \(W_v\) layers, while the \(W_q\) layers receive the fewest rank allocations [2502.12171].

This divergence is not merely anecdotal. It indicates that key and value adaptation cannot be reduced to a single universal heuristic such as “values matter most” or “keys matter most.” A plausible implication is that K/V low-rank adaptation is intrinsically task-dependent: for some objectives, adapting attention geometry through \(Q/K\) is prioritized, whereas for others, modifying content transport through \(V\) dominates. The literature therefore increasingly replaces uniform per-matrix rank choices with allocation mechanisms that respond to validation loss, stable-rank priors, or gradient statistics.

A second module-level observation concerns the sufficiency of K/V-only or attention-only tuning. In LR-LoRA’s component ablation on Qwen2, “Q,K,V Only” is explicitly listed as a configuration and yields accuracy \(\sim 67.4\) versus 67.8 for the “no adaptation LoRA-equivalent baseline” in that table, whereas “All Components” reaches 71.4 [2606.04325]. This does not negate the utility of K/V adaptation, but it does show that K/V-only designs can leave performance on the table when output projections or MLP blocks are also strongly task-relevant.

## 3. Rank, effective capacity, and adaptive allocation

The most persistent criticism of standard LoRA in this area is not merely that the nominal rank \(r\) is small, but that a fixed \(r\) imposes a fixed low-rank inductive bias on all adapter layers and modules. The literature distinguishes at least three quantities: the algebraic adapter rank \(r\), the realized rank of the update matrix, and the stable rank
\[
\mathcal{S}(\mathbf{M}) = \frac{\|\mathbf{M}\|_F^2}{\|\mathbf{M}\|_2^2},
\]
which acts as a continuous proxy for effective dimensionality [2606.04325].

"Learnable Rank LoRA" replaces the fixed-rank update \(\mathbf{BA}\) by \(\phi(\mathbf{BA})\), where \(\phi\) is a learned elementwise nonlinearity expressed as a sum of shifted sinc basis functions. Because \(\phi(\mathbf{BA})\) is not itself constrained to factor as \(UV\), its stable rank can differ substantially from the nominal factorization rank. On Qwen2-0.5B at nominal \(r=32\), it reports stable rank \(4.8 \pm 1.1\) for LoRA attention updates and \(9.4 \pm 3.8\) for LR-LoRA attention updates, with analogous increases for MLP layers [2606.04325]. The same paper also shows depth-dependent stable-rank profiles in which early layers tend to lower stable rank and later layers higher, while attention and MLP layers exhibit distinct depth profiles.

AutoLoRA attacks the same problem by decomposing each low-rank update into explicit rank-1 terms,
\[
\Delta_l = \sum_{j=1}^{k_l} \alpha_l^j \Delta_l^j,
\]
with \(\alpha_l^j\) obtained by a softmax over trainable variables \(\beta_l^j\). The effective rank of layer \(l\) is then determined by thresholding the learned \(\alpha_l^j\) at \(\lambda = 1/k_l\), after a bi-level meta-learning loop that updates LoRA weights on training loss and selection variables on validation loss [2403.09113]. In its experiments, this machinery is applied to query and value LoRA modules, and Figure 3 shows that different transformer layers receive different ranks and that Q and V layers need not share the same rank profile.

SR-LoRA substitutes a model prior for explicit search. It computes the stable rank of each pretrained weight,
\[
\operatorname{srank}(\mathbf{W}) = \frac{\|\mathbf{W}\|_F^2}{\|\mathbf{W}\|_2^2},
\]
and allocates adapter rank from that quantity, arguing that stable rank reflects the intrinsic dimensionality of the pretrained transformation. In its ViT-based experiments, this stable-rank-guided allocation outperforms fixed-rank LoRA and several adaptive baselines in few-shot, large-gap regimes; for MedFM 1-shot mean AUC, SR-LoRA reports 72.47 versus 64.09 for LoRA [2507.00327]. Although its reported placements are \(W_q\), \(W_v\), and \(W_o\), the construction applies equally to \(W_k\).

PoLAR exposes a more severe issue: the nominal rank supplied to LoRA can be largely unused. On Llama-2-7B with nominal rank \(r=32\), it reports many learned LoRA updates with stable rank near 1, in some cases as low as \(1.06\), and interprets the resulting geometry as directional diversity collapse [2506.03133]. This result is important for K/V adaptation because it shows that the effective expressiveness of a K/V adapter can be far below its algebraic rank unless the parameterization or optimizer actively prevents collapse.

## 4. Cross-layer, cross-projection, and shared K/V structures

Beyond per-layer independent adapters, a substantial body of work introduces structured sharing across layers, across \(Q/K/V\), or across heads.

| Method | K/V structure | Representative result |
|---|---|---|
| Lily | Local LPs \(P_L^{(\ell)}\), global HP experts \(P_H^i\), soft router \(W_R=\mathrm{softmax}(x'R^\top)\) | On ViT-B/16, Lily (kvffn) reaches 77.3 on VTAB-1K with 0.76M params, versus LoRA 76.4 with 1.17M |
| TensLoRA | Tucker factorization of QKV or QKV\_Depth tensors | Under isorank, QKV uses 33.7% of LoRA parameters on ViT and achieves \(98.30 \pm 0.15\) on EuroSAT versus \(98.06 \pm 0.14\) for Att |
| LRKV | Shared full-rank \(W_{\mathrm{shared}}^{K,V}\) plus head-specific low-rank residuals \(U_h^{K,V}(B_h^{K,V})^\top\) | At 2.5B, LRKV with \(r=64\) uses 52.6% KV cache and reaches equivalent model quality with up to 20–25% less training compute |

Lily generalizes LoRA across depth by keeping layer-specific low-dimension projectors \(P_L^{(\ell)}\) while sharing a pool of high-dimension projector experts \(P_H^i\) across all layers. A router maps the low-dimensional features to expert weights, producing a combined high-dimension projector
\[
P_H' = \sum_{i=1}^{N_e} W_R^i \cdot P_H^i.
\]
When applied to attention, this yields interconnected K/V updates in which the HP side is shared across layers and recombined through data-dependent routing rather than learned independently per layer [2407.09946]. The paper explicitly identifies “Lily (kvffn)” as the configuration most closely aligned with Key-Value Low-Rank Adaptation.

TensLoRA moves from matrices to tensors. It stacks LoRA updates into tensors such as \(\mathcal{W}_\Delta \in \mathbb{R}^{d \times d \times 3}\) for \(Q/K/V\) within one layer or \(\mathcal{W}_\Delta \in \mathbb{R}^{d \times d \times 3 \times L}\) for QKV across depth, and then constrains this tensor to a Tucker low-rank manifold [2509.19391]. The QKV mode factor \(U^{(\text{QKV})}\) explicitly couples Q, K, and V, while the depth factor \(U^{(L)}\) couples layers. This replaces independent per-projection adapters with a shared projection-type subspace and a shared depth subspace.

LRKV uses the phrase “low-rank KV adaptation” in a different but related sense. It is not a PEFT method over a frozen backbone but a replacement for standard multi-head attention during pretraining. Each head’s key and value projections are decomposed as
\[
\mathbf{W}_h^K = \mathbf{W}_{\mathrm{shared}}^K + \mathbf{U}_h^K {\mathbf{B}_h^K}^{\top},\qquad
\mathbf{W}_h^V = \mathbf{W}_{\mathrm{shared}}^V + \mathbf{U}_h^V {\mathbf{B}_h^V}^{\top},
\]
with a shared full-rank base and head-specific low-rank residuals [2601.11471]. This gives a continuous trade-off between complete sharing (\(r=0\), equivalent to MQA) and fully independent heads, while reducing KV-cache memory by exploiting redundancy across heads.

A more indirect extension is MoR. Its experiments replace only FFN linear layers with a mixture of transformed low-rank directions, but the formulation is generic:
\[
o \approx W x + \sum_{i=1}^{N} \mathcal{G}_i(x)\frac{\alpha}{r}\Lambda_B^{(i)}B_s\Lambda_A^{(i)}A_s x.
\]
The paper states that the same machinery could be applied to \(W_K\) and \(W_V\), yielding a task- and input-dependent mixture of low-rank key/value adapters [2410.13408]. This extends the broader trend from fixed per-layer K/V updates toward shared bases and routed combinations.

## 5. Spectral, geometric, and optimizer-aware parameterizations

Another major axis of development reparameterizes the low-rank update itself rather than merely reallocating rank. These methods are especially relevant for K/V matrices because they target stability, spectrum preservation, or closer emulation of full fine-tuning.

DuDe combines magnitude–direction decomposition with SVD-based initialization. For a pretrained weight \(W_0 = U\Sigma V^\top\), it extracts the top-\(r\) singular component \(U_r\Sigma_rV_r^\top\), freezes the residual \(W_f = W_0 - U_r\Sigma_rV_r^\top\), initializes
\[
B = U_r\sqrt{\Sigma_r}, \qquad A = \sqrt{\Sigma_r}V_r^\top,
\]
and adapts
\[
W' = m \,\frac{W_f + BA}{\|W_f + BA\|_c}.
\]
Its main instantiation is on \(W_q\) and \(W_v\), with a combined \(W_{qkv}\) case for Phi-4 small; on LLaMA2-13B, it reports average commonsense accuracy 63.74 versus 61.51 for LoRA and a HellaSwag improvement of +11.76 points [2505.14367]. Although the core experiments are query/value rather than key/value, the paper presents the construction as directly transferable to \(W_K\) and \(W_V\).

SALT operates in the singular-value basis. It performs SVD once per frozen weight, adapts the top \(r\) singular values through trainable scale and shift, and applies a low-rank correction in the residual singular-value subspace:
\[
\Sigma_r' = \alpha \odot \Sigma_r + \beta,\qquad
\Sigma_{r'}' = \Sigma_{r'} + XY.
\]
The updated matrix is then reconstructed as
\[
\widetilde{W} = U[\mathrm{ReLU}(\Sigma')]V^\top.
\]
On the SAM encoder, SALT rank-256 uses 3.9% trainable parameters and reports average Dice 0.74, compared with 0.70 for LoRA rank-256 at 14.08% trainable parameters [2503.16055]. The paper explicitly proposes a SALT-style adaptation for \(W_K\) and \(W_V\) in transformers.

PoLAR replaces the standard LoRA update \(\Delta W = Z_1Z_2^\top\) by
\[
\Delta W = X\Theta Y^\top,
\]
with \(X\in St(m,r)\), \(Y\in St(n,r)\), and unconstrained \(\Theta\in\mathbb{R}^{r\times r}\), thereby separating orthonormal direction bases from scale and mixing [2506.03133]. The paper argues that this counters LoRA’s low stable-rank pathology and proves an exponentially faster convergence rate on a canonical low-rank adaptation problem. On Llama-2-7B, PoLAR at rank 32 reports average commonsense accuracy 73.71 versus 72.18 for LoRA and 72.47 for DoRA.

LoFT keeps the conventional low-rank parameterization \(W = W_0 + UV^\top\) but changes the optimizer geometry. It alternates updates of \(U\) and \(V\), scales gradients by \((V^\top V)^{-1}\) or \((U^\top U)^{-1}\), and calibrates Adam’s first and second moments so that low-rank updates track full-model AdamW updates projected into the same subspace. The resulting projected gradient step is
\[
W^+ = W - \eta\, \nabla_W f(W)\, V(V^\top V)^{-1}V^\top.
\]
Applied to transformer attention \(Q/K/V\) and FFN matrices, LoFT reports, on LLaMA-7B at rank 16, average commonsense accuracy 76.08 versus 73.57 for LoRA [2505.21289]. Its relevance to K/V adaptation is direct: one may adapt only \(W_K\) and \(W_V\) while preserving optimizer dynamics closer to full fine-tuning within the chosen low-rank subspaces.

## 6. Empirical regularities, misconceptions, and open problems

Several empirical regularities recur across these papers. First, key/value low-rank adaptation is effective, but it is not a guarantee that K/V-only placement is sufficient. LR-LoRA’s single-seed ablation shows that “Q,K,V Only” yields only a marginal change relative to the LoRA-equivalent baseline in that restricted setup, whereas “All Components” gives the best result; at the same time, its broader experiments show that adapting attention projections can improve structured tasks more than FFN-only adaptation [2606.04325]. The literature therefore supports K/V adaptation as an important component, not as a universally complete substitute for broader attention or MLP adaptation.

Second, nominal rank and useful rank should not be conflated. PoLAR’s stable-rank analysis shows that a nominal rank-32 LoRA update can behave almost like a rank-1 perturbation [2506.03133]. This undercuts the common assumption that simply increasing \(r\) reliably increases functional capacity. A related architectural result appears in LRKV: reducing K/V redundancy across heads need not degrade quality if the parameterization preserves enough head diversity; the paper’s operator-space analysis finds that LRKV with \(r=64\) preserves nearly all functional head diversity relative to standard multi-head attention [2601.11471].

Third, the term itself is overloaded. In PEFT, Key-Value Low-Rank Adaptation usually denotes low-rank updates attached to pretrained \(W_K\) and \(W_V\). In LRKV, it denotes a pretraining-time attention mechanism with a shared full-rank K/V basis and low-rank head-specific residuals [2601.11471]. The conceptual overlap is real—both exploit low-rank structure in key/value projections—but the training regimes, objectives, and systems consequences differ.

Open questions remain substantial. Lily does not provide an explicit rank-theoretic analysis of how shared HP experts, layer-varying LPs, and routing change the span of achievable \(\Delta W\) for K/V, and it leaves language-model scaling to future work [2407.09946]. LR-LoRA reports attention-level stable-rank profiles but does not provide separate stable-rank curves for Q, K, V, and O [2606.04325]. LRKV identifies adaptive rank allocation across layers or heads, long-context behavior, and combinations with GQA or FlashAttention-3 as future directions [2601.11471]. Across the broader literature, a consistent unresolved issue is how to allocate K/V rank across depth, projection type, and heads without turning PEFT into an expensive search procedure.

Taken together, the field has moved from the original per-layer, independent low-rank perturbation of \(W_K\) and \(W_V\) toward a richer design space. Contemporary Key-Value Low-Rank Adaptation now encompasses fixed-rank adapters, learned effective rank, stable-rank-guided allocation, cross-layer expert sharing, tensor factorization across \(Q/K/V\) and depth, spectral parameterizations, geometry-aware updates, and pretraining-time K/V reparameterizations for KV-cache efficiency. The unifying premise is unchanged: transformer attention contains substantial low-dimensional structure in the key and value pathways, but exploiting that structure well requires careful choices about where low rank is imposed, how rank is distributed, and what notion of rank is actually being optimized.

Source: https://www.emergentmind.com/topics/key-value-low-rank-adaptation