\[
\text{Enc}(pos, i) = \frac{pos}{\theta^{\frac{2i}{d}}} \\
\text{PE}(pos, i) =
\begin{cases}
\sin \text{Enc}(pos, i) & \text{if } index \text{ is even}, \\
\cos \text{Enc}(pos, i) & \text{if } index \text{ is odd}.
\end{cases}
\]
\[
\text{Attention}(Q,K,V) = \text{softmax}\left(\frac{QK^T}{\sqrt{d_k}}\right)V
\]