PostScript Inference on a Printer: Running a 270M-Parameter Language Model Under a 14 MB Memory Budget

    A recent case report describes running a 270M-parameter language model inside the PostScript environment of an office laser printer, with peak memory reported at around 14 MB and text generated one token at a time. This article organizes the technical points from that report without verifying the original project, device model, or reproduction code. It covers model weight sizes, layer-by-layer loading, quantization trade-offs, interpreter memory overhead, speed bottlenecks, realistic use cases, and a checklist for anyone considering a similar experiment.

    How Large a Model Can a Printer Run?

    A recent case has drawn developer attention. Someone ran a small language model with 270 million parameters inside the PostScript environment of an office laser printer. The report cites peak memory of about 14 MB and says the model can generate text one token at a time.

    This article summarizes the technical points based on a secondhand account of that case. We have not verified the original project, device model, or reproduction code, so the figures below are attributed to the source or described with their measurement conditions. Readers should treat this as a technical analysis rather than a verified engineering report.

    1. Why PostScript?

    Almost all laser printers include a PostScript interpreter for parsing page description languages. PostScript is Turing complete and supports variables, loops, functions, and arrays, so in principle it can perform arbitrary arithmetic.

    The experiment relies on interpreter functionality already present in the device. It is computation at the language level, requiring no firmware modification and no external compute device. However, device vendors typically restrict the permissions and resource usage available to user programs. Trying this kind of experiment on someone else’s device may violate terms of use and may affect other people’s use of the printer. Testing should be done only on devices you own or have explicit authorization to use.

    2. Model Size and Quantization

    First, consider the size of the model weights themselves. For a 270M-parameter model, the full weight size at different precisions is as follows:

    Precision Bytes per parameter Total weight size
    FP32 4 About 1.08 GB
    FP16 2 About 540 MB
    INT8 1 About 270 MB
    INT4 0.5 About 135 MB

    Even with INT4, the full weights are 135 MB, far above 14 MB. Therefore, the weights in the experiment cannot remain resident in memory. They must be stored on a storage device, and only the layer currently needed is read into memory for each computation.

    The memory footprint of a single layer can be estimated with the following formula:

    Single-layer weight bytes = parameters per layer × bit width ÷ 8

    Peak memory consists of several parts: the current layer’s weights, activation buffers, the interpreter’s own overhead, and tensors that must remain resident, such as positional encodings.

    Here is a calculation example. Assume the model has 12 layers with about 22.5 million parameters per layer. This assumption is set for demonstration and is not data from the original experiment. Under INT4, each layer’s weights are about 22.5M × 4 ÷ 8 = 11.25 MB, already close to the 14 MB limit, leaving almost no room for activations and the interpreter. With INT8, a single layer would reach 22.5 MB and exceed the limit. This shows that the 14 MB figure is sensitive to layer count, bit width, and activation size, and must be recalculated for the actual model.

    One more point deserves attention. Each element in a PostScript array is an interpreter-internal object, which usually occupies more space than a single byte. So even if integer arrays are used to store INT8 or INT4 weights, actual memory usage may be much higher than the theoretical value. The exact overhead depends on the interpreter implementation and must be confirmed by measurement.

    3. How to Design a Quantization Scheme

    Quantization is the process of mapping floating-point weights to lower-bit-width integers. A practical implementation usually needs to decide several options.

    The first is symmetric versus asymmetric quantization. Symmetric quantization fixes the zero point at 0, which is simple to compute and suitable when weight distributions are close to symmetric. Asymmetric quantization uses an additional zero-point parameter, which can better fit skewed distributions but adds computation.

    The second is per-tensor versus per-channel quantization. Per-tensor quantization uses one scale factor for each weight matrix, keeping storage overhead low. Per-channel quantization computes a separate scale factor for each output channel, usually improving accuracy, but it requires storing more scale factors and adds computation steps in the interpreter.

    The third is calibration data. Quantization needs to know the value range of each layer, typically by running a small representative text batch through the model and collecting the minimum, maximum, or percentile values of activations. When calibration data differs substantially from the actual use case, accuracy loss can increase noticeably.

    Lower bit width saves memory but causes greater accuracy loss. INT4 uses half the memory of INT8, but on most language models the drop in output quality is noticeable. The original report does not state which quantization scheme was used or provide accuracy evaluation results, so its output quality cannot be judged.

    4. Speed: Where the Time Goes

    According to the account of the original experiment, the model takes about 60 seconds per generated token on average, so generating a short phrase takes several minutes. The measurement conditions for this figure have not been verified, including the device model, interpreter version, sentence length, and whether weight loading time was included.

    There are three main reasons for the slow speed.

    First, PostScript is an interpreted language. Every instruction must be parsed and dispatched, with no just-in-time compilation acceleration. Matrix multiplication is implemented with nested loops, which involves a large amount of computation and takes a long time.

    Second, weights must be read repeatedly. In batch-size-1 generation, every token requires the model to pass through all layers, so each layer’s weights must be loaded again. Assuming 135 MB of INT4 weights in total, generating 20 tokens would involve about 135 MB × 20 = 2.7 GB of cumulative reads. Even with a KV cache, weight reads do not decrease, because each token still needs to traverse all layers.

    Third, memory copying is expensive. Copying weight arrays from storage into the interpreter’s memory arrays one by one is itself time-consuming.

    The original experiment also used some optimizations, such as keeping reusable tensors like positional encodings resident and lazily computing some inter-layer activations, trading computation time for memory space. These measures can reduce memory pressure, but they cannot change the fundamental speed bottleneck of interpreted execution.

    5. What Can It Be Used For?

    Based on the available data, this kind of approach is only suitable for latency-insensitive tasks. Examples include keyword tagging of existing documents, offline initial screening for sensitive words, or simple classification of short texts. These tasks can tolerate waits of several minutes, and both input and output are short.

    Long-text generation, multi-turn dialogue, and complex reasoning are not suitable. These tasks require many tokens, and the latency per token accumulates, making the actual experience unacceptable.

    If future device main controllers expose vector instructions, matrix operation speed might improve. However, the instruction sets of most embedded chips are not publicly documented, and whether such instructions can be used depends on the technical documentation for the specific model. Without documentation support, such acceleration capability should not be assumed.

    6. What to Check Before Reproducing

    If you plan to try a similar experiment on your own device, confirm the following first:

    • Device model and firmware version, and whether the device permits running custom PostScript programs
    • The PostScript interpreter’s memory limit and how garbage collection is triggered
    • The model’s layer count, parameters per layer, and quantization bit width
    • Measured peak values for single-layer weight bytes and activation buffers, not only theoretical calculations
    • Time per token, and whether the measurement includes weight loading time
    • Output samples before and after quantization, to check accuracy loss

    Security also matters. Test only on devices you own or are authorized to use, and do not bypass device security or authentication mechanisms. Do not run long tasks on a shared office printer, as this can consume resources, disrupt others, or even damage the device.

    7. Conclusion

    This experiment demonstrates a computing approach under resource-constrained conditions. Its speed and output quality are still far from practical application, and the original report does not provide a complete, directly reusable solution.

    However, it clearly shows the relationship between memory budget, quantization bit width, and loading strategy. These judgments apply to any embedded AI project. For developers, learning to calculate how much memory each layer occupies is more valuable than simply pursuing whether a model can run at all.