Alterna · learning material

15.2 Why the order of words matters

The same lines of representation do not indicate order per se. Compare what changes when the position is not available.

What this material covers

Content and key concepts

On the previous page, one current passes through one block.
The same lines of representation do not indicate order per se. Compare what changes when the position is not available.
The vector obtains positional information, exchanges information and updates its status separately. Residual amounts maintain the same path. The last table gives estimates of the dictionary.
Для изменения рисунка включитеJavaScript; расчёт и теория доступны далее.
Where the order comes from.
Unpaved Self-attention without position signals reshuffled
Equivalent
: Resets the input lines to the weekend. It is not "invariant" in the sense of the constant of the whole matrix. When the conversion matrix P is performed, Attn(PX)=P Attne(X) is performed if Q/K/V is moved in agreement.
The fixed causal mask itself sets the order limit. So you cannot literally transfer the previous symmetry to it and declare that the masked decoder knows nothing about the sequence. Explicit position encoding still provides an additional mechanism for presenting absolute or relative position.
Sinusoidal L06 adds to embedding:
P
E
p
,
2
j
=
sin
⁡
(
p
/
10000
2
j
/
d
)
,
P
E
p
,
2
j
+
1
=
cos
⁡
(
p
/
10000
2
j
/
d
)
.
PE_{p,2j}=\sin(p/10000^{2j/d}),\qquad
PE_{p,2j+1}=\cos(p/10000^{2j/d}).
P
E
p
,
2
j
​
=
sin
(
p
/1000
0
2
j
/
d
)
,
P
E
p
,
2
j
+
1
​
=
cos
(
p
/1000
0
2
j
/
d
)
.
For p = 0,d = 4 vector[0,0.1]. It coincides with the width of E[t], so addition is allowed. This is not a lighted position table; the number of learning parameters does not increase in this choice.
Research.
Switch sinusoidal/none to constant IDs, architecture and seed. This is a blip of position signal rather than learning. Compare inut embeddings to the sum of E+PE. Do not promise that the sinusroid model automatically works in any length: the quality of the extraction depends on learning and architecture.
from math import sin,cos
p,d=0,4
pe=[f(p/10000**(2*j/d)) for j in range(d//2) for f in (sin,cos)]
assert pe==[0,1,0,1]
The code repeats the operations just taken care of.
Completely checked Python-example Chapter
Available with a separate file; the short piece shown does not replace its implementation.
The change of the input lines changes the weekend; the fixed causal mask changes the conditions.
Position through the turn of the coordinates. How does this question continue with the result?
Python examples of Chapter 15
Academic base

Textbook contents map