GeLU

For more detail, check GeLU.

RMSNorm

In recent settings, RMSNorm is typically placed before a layer, a.k.a pre-norm. One possible explanation is the increase of stability for the training process.

In the original RMSNorm paper, the authors claimed that recentering step in layer norm yields insignificant boost performance, while removing it speeds up the computation noticeably.

GQA

GQA(Grouped Query Attention), is a balance between multi-head attention(MHA) from vanilla transformers and MQA(Multi Query Attention), leveraging the advantages from both sides.

Grouped query attention is somewhat an interpolation of MHA and MQA with the goal of balancing the pros and cons. Tokens are first grouped together according to positions and share key and value vectors within groups.

The following table is a direct comparison between dimensions of query, key, value and output for MHA and MQA. is batch size, is sequence length, is embedding dimension, is number of heads, is query/key/value vector dimension, is the number of key/value heads and is the number of groups.

MHAMQAGQA
Y