Two Vectors, One Number

AttentionEasy+10 XP+10

Two Vectors, One Number

A single attention head is reading the sentence "the cat sat". The head works in dk=5d_k = 5dk​=5 dimensions, and the token "sat" supplies the query:

q=[ 2, −1, 3, 1, 1 ]q = [\,2,\ -1,\ 3,\ 1,\ 1\,]q=[2, −1, 3, 1, 1]

Each of the three tokens supplies a key:

tokenkey
the[ 1, 4, 2, −3, 2 ][\,1,\ 4,\ 2,\ -3,\ 2\,][1, 4, 2, −3, 2]
cat[ 3, 2, −1, 1, 4 ][\,3,\ 2,\ -1,\ 1,\ 4\,][3, 2, −1, 1, 4]
sat[ −2, 0, 1, 5, −3 ][\,-2,\ 0,\ 1,\ 5,\ -3\,][−2, 0, 1, 5, −3]

What is the scaled attention score between the query from "sat" and the key from "cat"?

This is the raw score at the end of the scoring stage — nothing has been turned into a weight yet.

Round your answer to 2 decimal places.

Hints

Solve it to unlock the solution

Once you get it right, the reasoning behind the answer shows up here.