Scaled-dot product attention compares each query with every key using a dot product, divides scores by √dₖ, normalizes them with softmax, and combines the value vectors using the resulting weights. section 12.3.2
The compact equation shows the complete operation: similarity scores become normalized attention weights, which produce a weighted value representation. section 12.3.2
A distant cysteine partner
For residue 1, q₁ = [1, 0] gives raw scores 1.0, 0.0, and 0.9 against three keys. Scaling by √2 and applying softmax produces weights of about 0.41, 0.20, and 0.38, so the new representation strongly incorporates residue 3 despite its sequence distance. section 12.3.2





