Semester projectETH Zürich, Integrated Systems Laboratory

Softmax Quantization for Transformers

A small language model in your browser, with only a few bits for its attention.

Bits

Floating point

3 bits

3 bits, shifted

Step by step
Head

Live model. A GPT with 2.2 million parameters, trained on children's stories. Only the scores going into the softmax are quantized.

z′=z−z¯s=max|z′|2b−1−1z^=sround(z′s)