One Query, Three Keys

AttentionMedium+20 XP+20

One Query, Three Keys

Inside an attention layer built at width d=4d = 4d=4, one position has produced the query

q=[2−103]q = \begin{bmatrix} 2 & -1 & 0 & 3 \end{bmatrix}q=[2​−1​0​3​]

and the three positions it is attending to have produced the keys

k1=[1211],k2=[0420],k3=[3101]k_1 = \begin{bmatrix} 1 & 2 & 1 & 1 \end{bmatrix}, \qquad k_2 = \begin{bmatrix} 0 & 4 & 2 & 0 \end{bmatrix}, \qquad k_3 = \begin{bmatrix} 3 & 1 & 0 & 1 \end{bmatrix}k1​=[1​2​1​1​],k2​=[0​4​2​0​],k3​=[3​1​0​1​]

What is the row of scaled attention scores (s1, s2, s3)(s_1,\ s_2,\ s_3)(s1​, s2​, s3​) that this query produces — the numbers that go into the softmax?

Hints

Solve it to unlock the solution

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

Select all that apply.