Wrote an essay on what Q, K, and V matrices

Arpit Bhayani

Arpit Bhayani

Nov 27, 2025 • 1 min read


Wrote an essay on what Q, K, and V matrices are and the roles they play in LLMs. Since I’m on a spree to understand LLMs, I dug deeper into the nuances and put together this distilled yet detailed version. This essay also supplements my How LLM Inference Works write-up.

I’m no expert, but if you’re looking for a starting point with LLMs, this would help. Give it a read.

Arpit Bhayani

Principal Engineer II at Razorpay - building Agent Studio, Ex-staff engg at GCP Memorystore & Dataproc, Creator of DiceDB, ex-Amazon Fast Data, ex-Director of Engg. SRE and Data Engineering at Unacademy. I spark engineering curiosity through my no-fluff engineering videos on YouTube and my courses