rgivhan / minGPT-with-Synthesizer-Attention

minGPT model built in PyTorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

minGPT with Synthesizer Attention

Andrej Kaparthy's minGPT model buit in PyTorch. Two types of attention are available for use in the model: a standard masked multi-headed self attention or a Synthesizer self attention. The attention classes are found in attention.py.

Synthesizer attention: $Y_{i} = softmax(ReLU(XA_{i} + b_{1})B_{i} + b_{2})(XV_{i})$

The synthesizer variant eschews the pairwise dot products and directly computes the ℓ × ℓ matrix of attention scores by mapping each d-dimensional vector of each head for X to an ℓ-dimesional vector of unnormalized attention weights.

About

minGPT model built in PyTorch


Languages

Language:Python 100.0%