Skip to content
HN On Hacker News ↗

Do Transformers Need Three Projections? Systematic Study of QKV Variants

▲ 225 points 47 comments by Anon84 3mo ago HN discussion ↗

Pangram verdict · v3.3

We believe that this document is fully human-written

8 %

AI likelihood · overall

Human
100% human-written 0% AI-generated
SEGMENTS · HUMAN 2 of 2
SEGMENTS · AI 0 of 2
WORD COUNT 294
PEAK AI % 8% · §1
Analyzed
Jun 4
backend: pangram/v3.3
Segments scanned
2 windows
avg 147 words each
Distribution
100 / 0%
human / AI fraction
Verdict
Human
Pangram v3.3

Article text · 294 words · 2 segments analyzed

Human AI-generated
§1 Human · 8%

View PDF HTML (experimental) Abstract:Transformers have become the standard solution for various AI tasks, with the query, key, and value (QKV) attention formulation playing a central role. However, the individual contribution of these three projections and the impact of omitting some remain poorly understood. We systematically evaluate three projection sharing constraints: a) Q-K=V (shared key-value), b) Q=K-V (shared query-key), and c) Q=K=V (single projection). The last two variants produce symmetric attention maps; to address this, we also explore asymmetric attention via 2D positional encodings. Through experiments spanning synthetic tasks, vision (MNIST, CIFAR, TinyImageNet, anomaly), and language modeling (300M and 1.2B parameter models on 10B tokens), we discovered that our transformers perform on par or occasionally better than the QKV transformer. In language modeling, Q-K=V projection sharing achieves 50% KV cache reduction with only 3.1% perplexity degradation. Crucially, projection sharing is complementary to head sharing (GQA/MQA): combining Q-K=V with GQA-4 yields 87.5% cache reduction, while Q-K=V + MQA achieves 96.9%, enabling practical on-device inference. We show that Q-K=V preserves quality because keys and values can occupy similar representational spaces and attention operates in a low-rank regime, whereas Q=K-V breaks attention directionality. Our results systematically characterize projection sharing as an underexplored instance of weight tying in attention, with direct, quantifiable inference memory benefits, particularly valuable for edge deployment. The code is publicly available at this https URL

Comments: Accepted at ICML 2026 (PMLR vol. 306). 26 pages, 12 figures, 16 tables. Code: this https URL

Subjects: Machine Learning (cs.LG); Artificial Intelligence (cs.AI); Computation and Language (cs.

§2 Human · 8%

CL); Performance (cs.PF) ACM classes: I.2.6; I.2.7; I.2.10

Cite as: arXiv:2606.04032 [cs.LG]   (or arXiv:2606.04032v1 [cs.LG] for this version)   https://doi.org/10.48550/arXiv.2606.04032 arXiv-issued DOI via DataCite Submission history From: Anusha Madan Gopal [view email] [v1] Mon, 1 Jun 2026 20:59:05 UTC (2,017 KB)