AI GLOSSARY

Queries, Keys, and Values

Queries ask what matters, keys describe what is available, and values carry the information to combine.

Simple explanation

Each token is projected into query, key, and value vectors. Query-key similarity produces attention scores; those scores weight the value vectors that are combined into the output representation.

Technical explanation

Each token is projected into query, key, and value vectors. Query-key similarity produces attention scores; those scores weight the value vectors that are combined into the output representation.

Example

Trace how Q + K becomes Weighted V through attention weights.

Related lesson

Queries, Keys, and Values: visual lesson →

Browse all glossary terms →