One Sublayer, Then the Reset

TransformersMedium+20 XP+20

One Sublayer, Then the Reset

One position's vector is passing through the first of a transformer block's two add & norm steps. The block's width is a toy d=4d = 4d=4.

vectorvalue
what arrived at the block for this position, xxx[ 4, −2, 2, 0 ][\,4,\ -2,\ 2,\ 0\,][4, −2, 2, 0]
what the self-attention sublayer produced for this position, sss[ 5, 5, 1, 1 ][\,5,\ 5,\ 1,\ 1\,][5, 5, 1, 1]

Layer normalization here is

norm(v)i=vi−μσ,μ=14∑jvj,σ=14∑j(vj−μ)2\text{norm}(v)_i = \frac{v_i - \mu}{\sigma}, \qquad \mu = \frac{1}{4}\sum_{j} v_j, \qquad \sigma = \sqrt{\frac{1}{4}\sum_{j} (v_j - \mu)^2}norm(v)i​=σvi​−μ​,μ=41​∑j​vj​,σ=41​∑j​(vj​−μ)2​

with the mean and the spread taken across the four slots of the one vector (dividing by 444). This layer's two learned numbers are a scale γ=3\gamma = 3γ=3 and a shift β=1\beta = 1β=1.

Which vector leaves this add & norm step?

8.0
2.0
14.0
4.0
6.0
12.0
mean 7.7spread 4.2

Subtract the mean, divide by the spread. The pattern of which slots are big and small survives; only the scale changes.

Hints

Solve it to unlock the solution

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

Select all that apply.