Why are queries, keys, and values produced through learned linear projections rather than using raw token embeddings directly?
Last updated
Raw embeddings give a symmetric score
x_i·x_jwhere each token matches itself most strongly. Projections make relevance a learned, asymmetric bilinear formx_iᵀ W_Q W_Kᵀ x_j.Separate projections decouple roles: what makes a token findable (K) can differ from what it passes on (V).
Per-head
W_Q, W_K, W_Venable multi-head attention, where heads specialize in different relations. They also give the layer learnable parameters.