A developer has demonstrated GPT-2 Small running inside a webpage without JavaScript or WebAssembly, using CSS calculations and specially prepared variable fonts to perform the model's arithmetic. The project is an engineering experiment rather than a practical replacement for conventional machine-learning software: it generates roughly one token every 15 seconds under favorable conditions.
The implementation began with a much smaller transformer whose vocabulary contained seven characters. Modern CSS provides arithmetic through `calc()` and functions needed for operations such as normalization and softmax. A Python script generated the stylesheet before deployment, but no Python executes when a visitor opens the page.
A central obstacle was the way browsers evaluate custom CSS properties. Untyped variables can expand into increasingly large nested expressions instead of acting like stored numerical values. Registering each variable with the `@property` rule forced the browser to calculate typed values, allowing the small test model to return the same character sequence as a reference Python implementation.
That direct approach could not scale to GPT-2's approximately 124 million parameters. Writing every multiplication into CSS would have produced a stylesheet measured in gigabytes for a single generated token, overwhelming normal browser resources. The project instead used variable-font internals as an unconventional matrix processor.
Variable fonts normally interpolate characteristics such as glyph weight or width. Their HVAR table can associate a glyph's advance width with changes along multiple design axes. When the browser calculates that width, it multiplies axis values by stored deltas and adds the results. Mathematically, that resembles the dot products used throughout neural networks. Encoding model values in those font tables therefore moved a large part of the work into the browser's font-rendering engine.
CSS remains responsible for coordinating the calculations and choosing outputs. The technique exploits standards intended for page layout and typography, so performance is far below purpose-built inference frameworks and compatibility depends on recent browser features. It also requires substantial preprocessing to translate trained weights into stylesheets and fonts.
The browser still has to load the generated assets and carry out each inference locally. That makes the demonstration a stress test of web-platform capabilities, not a shortcut around the computing cost embedded in the model. It also gives developers a concrete way to examine how browsers resolve typed properties and variable-font calculations under an extreme workload.
The result is valuable chiefly as a demonstration of what declarative web technologies can express. It shows that a browser's styling and typography systems contain enough arithmetic machinery to execute a real transformer, even though they were never designed as a general machine-learning runtime. The experiment also exposes the practical boundary between making a computation technically possible and making it efficient enough for everyday use.



