Berk Bayri

Transformer

The neural network architecture behind almost every large language model. It processes a whole sequence of tokens at once and uses attention to decide which earlier tokens matter for each next prediction.

A transformer is a design for a neural network, introduced by Google researchers in the 2017 paper "Attention Is All You Need". The G-P-T in GPT stands for generative pre-trained transformer, and nearly every large language model in use today is a variation on the same idea.

Earlier language models read text one word after another and carried a compressed memory forward. A transformer looks at the whole input together. Each token is turned into a vector, and a mechanism called attention lets every token weigh every other token when the model works out what comes next. In "the contract was signed by the supplier, but it was later voided", attention is how the model connects "it" to "contract" rather than to "supplier".

Two practical consequences follow from that design.

Comparing every token with every other token gets expensive as the input grows. This is a large part of why the context window has a limit and why long prompts cost more.

The design also parallelizes well on GPUs, which is what made training on internet-scale text practical. The jump in capability since 2017 owes a lot to that fit with hardware.

Attention Is All You Need

arXiv (Vaswani et al., Google) · 2017-06-12

What the label does not tell you

"Transformer-based" describes the skeleton, not the quality. Two transformer models can differ enormously in training data, size, tuning and serving setup. Variants such as mixture of experts change which parts of the network run for each token. When a vendor leads with the architecture, the useful follow-up is about the trained model, the version actually served and how it was evaluated on work like yours.