← Back to the wire

Implementing GPT-2 Entirely In CSS

AchievementResearchNov 6, 2026

A developer implemented GPT-2 entirely in CSS, with no JavaScript or WASM, achieving inference at roughly 15 seconds per token. The model contains about 124 million parameters, with variable font files used to perform matrix multiplications. Key challenges included CSS's lack of array primitives and its variable-copying behavior, solved via the @property at-rule. The approach required hundreds of experiments, and the full stylesheet was estimated at 3–6 GB for a single token.

Receipt № 27681 source · awaiting confirmation ◐

Evidence

1source· awaiting independent confirmation

No score is assigned. Sources and their independence are shown in the citation chain below.

Citation chain · 1 source

01med
shubhampatil.devBloghttps://shubhampatil.dev/blog/gpt2-cssThis first-person technical write-up details the CSS-specific tricks behind the project, including the variable-copying pitfall solved with @property and the shift to variable fonts for matrix multiplication.
PRIMARY
GPT-2Model
Canonical: https://shubhampatil.dev/blog/gpt2-css