Here are some good guides on Transformers [1] and attention/ multi headed attention [2], as well as the paper that proposed the transformer model "Attention is all you need" [3]. GPT-2 heavily relies upon the advancements that transformers brought [4]
[1] http://jalammar.github.io/illustrated-transformer/
[2] https://towardsdatascience.com/attention-for-time-series-cla...
[3] Attention is all you need. https://arxiv.org/abs/1706.03762