All projects

Integer & embedded · Completed

int-llm PostScript

Integer-only MicroGPT inference and training in PostScript, checked byte-for-byte against the C reference.

At a glance

Evidence and scope

Repository measurements and recorded project results. Test and benchmark claims were inspected, not rerun during this catalog refresh. Physical line counts use the stated file scopes.

Inference agreement
20/20 samplesThe wide path reproduces the C oracle's complete 485-byte transcript across 122 forward passes.
Training agreement
5,000 stepsEvery recorded loss line, sampled name, and wide checkpoint byte matched the C oracle.
Checkpoint identity
115,576 bytesBoth the wide and F12 MGW files have this size; F12 here uses the ordinary int64 container, not packed int16.
Stored-weight paths
Wide + F12Both use Q16.48 compute; training applies F12 rounding only at export.
Reviewed sources · 2026-10-15 · e52a14d64da3

12 tracked files · 1 documentation files · 0 workflow files. Inventory includes data and vendored or generated files; workflow presence does not establish a passing run.

Download inventory and line-count file scopes

Executive summary

int-llm-postscript expresses MicroGPT inference and training in PostScript, the language commonly associated with printing. The model has one transformer layer, a 32-dimensional residual stream, and four attention heads. Its arithmetic is integer-only Q16.48, including nonlinear functions, sampling, gradients, and optimizer updates. Ghostscript executes the program, while the sibling C implementation supplies an independent comparison target. The repository records byte-identical inference transcripts and complete training checkpoints, making this a compact demonstration of reproducing a numerical contract in another language.

How it works

Limb arithmetic keeps multiplication intermediates within signed 64-bit range, preventing PostScript from promoting an overflowing integer to a real number. The program parses the MGW checkpoint directly, runs attention and feed-forward layers, and samples with the same deterministic random stream as C.

Two small wrappers select uniform-F12 storage for the shared inference and training cores. F12 changes the values stored in the ordinary int64 MGW container; it does not reduce that container's size or change the compute format.

Evidence and validation

The wide inference gate compares the complete 485-byte output, including the integer Pi banner and 20 generated names. The recorded Ghostscript 10.04.0 training gate matches 5,000 loss lines, 20 samples, and a 115,576-byte checkpoint. The F12 training gate separately checks the export against its pinned checkpoint. Reported full verification times are about 62 and 45 minutes respectively; these are project measurements, not fresh timings from this review.

Boundaries

The result covers the committed small model, not general Llama checkpoints. Ghostscript must provide 64-bit integers. The documented commands use -dNOSAFER for local file access, so they require trusted source and model files. Checkpoint parsing is not a hostile-input boundary.

Repository map and first run

With a compatible Ghostscript installed, check the committed transcript:

make verify-ps

microgpt_infer.ps and microgpt_train.ps hold the shared cores. C-backed verification expects the sibling ../int-llm checkout; full training also needs the separately downloaded names dataset.