Skip to main content

Chapter 3.1 Normal Positional Embeddings

Normal Positional Embeddings are Simple. Take token Embeddings, add a Learned Matrix which gets better by training called Positional Matrix, add each element by each element and you are done.

Token Embeddings​

[0.430.150.890.550.870.660.570.850.640.220.580.330.770.250.10]\begin{bmatrix} 0.43 & 0.15 & 0.89 \\ 0.55 & 0.87 & 0.66 \\ 0.57 & 0.85 & 0.64 \\ 0.22 & 0.58 & 0.33 \\ 0.77 & 0.25 & 0.10 \end{bmatrix}

Positional Embeddings​

[0.100.200.300.200.300.400.300.400.500.400.500.600.500.600.70]\begin{bmatrix} 0.10 & 0.20 & 0.30 \\ 0.20 & 0.30 & 0.40 \\ 0.30 & 0.40 & 0.50 \\ 0.40 & 0.50 & 0.60 \\ 0.50 & 0.60 & 0.70 \end{bmatrix}

Token + Positional Embeddings​

[0.430.150.890.550.870.660.570.850.640.220.580.330.770.250.10]+[0.100.200.300.200.300.400.300.400.500.400.500.600.500.600.70]=[0.530.351.190.751.171.060.871.251.140.621.080.931.270.850.80]\begin{bmatrix} 0.43 & 0.15 & 0.89 \\ 0.55 & 0.87 & 0.66 \\ 0.57 & 0.85 & 0.64 \\ 0.22 & 0.58 & 0.33 \\ 0.77 & 0.25 & 0.10 \end{bmatrix} + \begin{bmatrix} 0.10 & 0.20 & 0.30 \\ 0.20 & 0.30 & 0.40 \\ 0.30 & 0.40 & 0.50 \\ 0.40 & 0.50 & 0.60 \\ 0.50 & 0.60 & 0.70 \end{bmatrix} = \begin{bmatrix} 0.53 & 0.35 & 1.19 \\ 0.75 & 1.17 & 1.06 \\ 0.87 & 1.25 & 1.14 \\ 0.62 & 1.08 & 0.93 \\ 1.27 & 0.85 & 0.80 \end{bmatrix}

simple.