Skip to main content
Take the lift back to the lobby

Floor 4 · 4 exhibits

The Language Lab

How symbols become meaning — and how a machine writes its own code.

Tokenisation, compression, code generation — and a moving picture carried on three symbols per pixel.

The Glyph Compressor

From-scratch LZW, a byte-exact round-trip, a measured ratio.

Type anything. Watch a real compressor shrink it — then prove, byte for byte, that it can put it back together exactly as it was.

How deep would you like to go?

show me · the plain-English story

A real, from-scratch LZW dictionary compressor (Welch, 1984) builds a table of repeated chunks as it reads your text, replacing each repeat with a short code. Decompression rebuilds the same table in reverse — and the demo checks the result matches your original, byte for byte.

Wow — The round-trip check isn't a claim — it's a live byte-for-byte comparison of decompress(compress(text)) against your exact original text, recomputed on every keystroke.

Try this — Paste in a paragraph with lots of repeated words, then a short scramble of random letters — watch the compression ratio flip from a real win to (honestly) barely any gain, or even a little bigger.

What's really happening · An illustrative dictionary compressor in the spirit of GLYPH's “replace what repeats with a short reference” idea — applied here to raw text, not to the semantic AST GLYPH actually compresses. Short or already-dense text may not shrink (sometimes it briefly grows) — that is an honest property of dictionary compression, not hidden.

Read the full lab report

Huffman Softmax

A real Huffman tree over a token distribution — real bits/token vs fixed-width.

Some words show up far more than others. Give the common ones short codes and the rare ones long ones, and the average message really does shrink.

How deep would you like to go?

show me · the plain-English story

A real Huffman tree is built live from ten tokens' frequencies — the two rarest are always merged first. The result: common tokens get short codes, rare tokens get long ones, and the average bits-per-token drops below a fixed-width code, measurably.

Wow — Redraw the sample and watch the measured bits/token converge toward the theoretical average as the sample grows — the law of large numbers, doing real work in front of you.

Try this — Try the Zipfian preset (a few words very common, like real language), then Uniform (every word equally likely) — watch the compression ratio collapse toward 1× because there's nothing lopsided left to exploit.

What's really happening · A real, from-scratch Huffman coder (Huffman, 1952): min-frequency-pair merging builds the tree, then each leaf's path (0 = left, 1 = right) becomes its code. “Avg bits/token (theoretical)” is freq-weighted over the code lengths; “measured on sample” is the real encoded bit length of an actual drawn sample divided by its length — the two converge as the sample grows, which is the law of large numbers doing real work, not a coincidence. This is the same entropy-coding idea behind hierarchical-softmax output layers and modern tokenizer/entropy-coder stacks — illustrative of the principle at a scale you can see, not a training corpus's real tokenizer.

Read the full lab report

Watch an AI Write Code

An AI writes a function on your own GPU; it's run against real unit tests.

Pick a task. Watch a real AI model — running on your own graphics card, not our servers — write a function one token at a time, then watch its own code get tested.

How deep would you like to go?

show me · the plain-English story

A small AI model, downloaded once and run entirely on your own graphics card, streams a JavaScript function for the task you pick. For the four fixed tasks, that exact code is then run in a sandboxed Web Worker against real unit tests — you see genuine ✓/✗ results, not a scripted success.

Wow — For the four fixed tasks, the code it just wrote is actually executed in a sandboxed Web Worker against real unit tests — you see a genuine pass/fail score, never a claim of success.

Try this — Pick “FizzBuzz,” opt in to load the model once (it then works offline), and watch the code stream in live — then watch its own tests run against it, ✓ or ✗ per test.

What's really happening · Pick a task (or type your own). The model streams a JavaScript function, token by token, entirely in this tab — zero cloud. For the four fixed tasks, the code it just wrote is then actually run, in a sandboxed Web Worker, against real unit tests: you see ✓ or ✗ per test, not a claim. Needs a WebGPU browser (Chrome/Edge) and a one-time, explicitly opt-in model download (~880 MB) that then works offline; without WebGPU it shows a clearly labelled, hand-written stand-in with the same real, sandboxed test run underneath it.

Read the full lab report

The Three-Symbol Television

A moving picture carried by just {-1, 0, +1} per pixel — with the quality honestly measured.

Video is the heaviest thing on the internet. Watch a moving picture squeeze through a wire that only carries three different symbols per pixel — and see exactly what that costs.

How deep would you like to go?

show me · the plain-English story

Left is the true animation; right is what a decoder reconstructs when each frame sends only one {-1, 0, +1} symbol per pixel plus one step number. PSNR (picture quality) and bits-per-pixel are measured from the real arrays every frame — nothing is estimated.

Wow — Three symbols per pixel is at most 1.58 bits (log₂ 3) against 8 bits for raw grayscale — a 5× squeeze — and the PSNR meter tells you the real quality price, every single frame.

Try this — Push the keyframe interval up to 96 and drop the step gain low — watch the picture smear, then snap crisp again the instant a keyframe lands. That snap is the codec honestly correcting its own drift.

What's really happening · A real, from-scratch ternary delta codec: residual → real absmean step → round-clip to three symbols → decoder integrates; keyframes are full 8-bit frames charged honestly into the average bitrate. Bits/pixel uses the entropy ceiling of a packed ternary plane, not a bitstream written to disk. A faithful small sibling of the TRIAD codec lab line, not the protected implementation.

Read the full lab report

    We use cookies.

    The Language Lab — The AI Science Museum