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.