Overview

Transformer最早提出自Attention Is All You Need这篇论文,是一种完全基于Attention的模型结构,在此之前Attention通常和RNN一起使用。

Transformers是后续大模型的骨架,BERTGPT底层都是Transformer。

Architecture

Attention without RNN

Self-Attention

Multi-Head Attention

Transformer Encoder-Decoder Architecture

Positional Encoding

Example on MT