Running an LLM on a Printer: Peak Memory of Just 14.1 MB

    A large language model was run entirely on an office printer's interpreter, reaching a peak RAM usage of only 14.1 MB. This article breaks down the experiment's key numbers, the compiler, streaming layer-by-layer weight loading, and low-bit quantization techniques behind it, examines the performance data with a consistent timing methodology, and discusses what this means for edge AI — along with its real risks and limitations.

    1. First, Separate Three Numbers

    The “14.1 MB” in the experiment report refers to peak memory (RAM) usage during inference — not the size of the model file. The model file size is a different figure. Based on the quantization precision, the original report estimated it at roughly 100 to 200 MB, stored on the printer’s storage medium and read on demand during inference.

    Confusing these two numbers is the most common mistake when reading reports like this. A model file can be far larger than available RAM, because inference only needs a small portion of it resident at any time.

    The second number to separate is performance. The report’s “roughly 60 seconds per token” sits alongside “184 seconds of prefill” and “0.1 seconds per decoding step,” which looks contradictory at first glance. As Section 4 explains, these figures only align when the timing methodology is consistent — and the report never specifies one.

    The third is quantization precision. The report did not disclose the bit width; it only estimated it. Section 3 tests that estimate against the report’s own numbers.

    2. Background: Why a Printer Is a Special Target

    An LLM’s parameter count is roughly proportional to its memory requirements. Even with low-bit quantization, the weights of a 270-million-parameter model are typically in the hundreds of megabytes. An office printer’s available RAM is usually only tens of megabytes, its firmware is closed, and the system offers no Python, C, or general-purpose driver environment.

    A printer’s externally accessible compute capability comes mainly from its page description language interpreter. These languages are designed for layout and output, but they can process data and execute loops and conditionals. PostScript itself is Turing-complete, meaning it can in principle express arbitrary computation.

    The experiment’s starting point was exactly this: reuse the parsing capability the device already has. The report does not mention modifying firmware or swapping hardware.

    3. Three Core Techniques

    1. Compilation: Turning Weights into a Print Script

    The experiment used a compiler to convert a model trained in PyTorch into a script the interpreter could execute. The compiler does three main things: reads the model architecture (layer count, number of attention heads, hidden dimensions) and the weights; translates matrix multiplications, activation functions, and layer normalization line by line into interpreter instructions; and writes the quantized integer weights as hexadecimal strings embedded in the script’s data section.

    In hexadecimal text, each byte occupies two ASCII characters, so the same weights are about twice as large in text form as in binary. This overhead must be included in the storage budget.

    The compiled output is a .ps file. It is both a print job and an inference program.

    2. Streaming Layer-by-Layer Loading: Trading Time for Space

    The weights of the 18 Transformer layers were split into independent data blocks and numbered sequentially. During inference, the interpreter does not load the entire file at once; instead, it reads sequentially using a file handle. After finishing the current layer, it frees that layer’s memory and reads in the next layer’s weights.

    At any moment, memory holds only the current layer’s weights, the intermediate activations, and a compressed slice of the token embedding matrix. From this, the report derives a peak usage of roughly 14.1 MB. The measurement method for this figure is not specified.

    This approach resembles an operating system’s paging mechanism, but the printer has no memory management unit (MMU), so all scheduling must be handled by the interpreter script itself.

    The cost is equally obvious. For every token generated, all layer weights must be read from storage once. Memory usage drops, but read counts grow with the length of the generated output. This also explains why the performance bottleneck lies in data reading and interpreted execution rather than the matrix math itself.

    3. Low-Bit Quantization: Precision Undisclosed

    The report did not state the quantization bit width. Based on size and parameter count, it estimated “roughly 4-bit or ternary weights.” That estimate can be checked against the report’s own numbers.

    The theoretical file sizes for 270 million parameters at different bit widths:

    • 8-bit: ~270 MB
    • 4-bit: ~135 MB
    • Ternary (~1.58 bits): ~53 MB

    The reported size range of 100 to 200 MB is closest to 4-bit. Ternary weights would be noticeably smaller. So 4-bit is the more likely option, but it remains an estimate until the experimenters publish the quantization configuration.

    These estimates count only the weights themselves, excluding scale factors, the embedding layer, and overhead from the script format. The report also claims low-bit computation can be “approximated with integer addition and subtraction” — a simplification it never validated.

    4. Performance Data: First, Align the Methodology

    The report’s figures:

    Item Reported value Notes
    Prefill (input: “Read the fine”) 184 seconds Processes all input tokens
    Single decoding step 0.1 seconds Completes autoregressive generation of one token
    Average per token ~60 seconds Calculation method unspecified

    The first token’s latency can be estimated as 184 + 0.1 seconds, or about 184.1 seconds. An average of 60 seconds per token is compatible with this only if it means “total time divided by generated token count,” with the total including prefill. For example, generating 10 tokens in 600 seconds total, of which 184 seconds is prefill, leaves roughly 46 seconds on average for each of the other 9 tokens. In that case, 0.1 seconds is only a small fraction of the pure compute and cannot represent each token’s actual latency.

    The report gives no generated token count, timing start and end points, or number of repetitions, so 0.1 seconds cannot be directly compared with 60 seconds.

    To remove ambiguity, latency should be split into two categories:

    • First-token latency = prefill + first decoding step + first layer loading and result output
    • Subsequent per-token latency = one decoding step + streaming all layer weights + result output

    If every token is printed, paper feed and print engine time should also count toward the second category.

    The 184-second prefill is worth noting. The prompt “Read the fine” is very short, yet it took 184 seconds — suggesting the time may come mainly from data reads and interpreter overhead rather than matrix computation. This is only a hypothesis and needs itemized timing to verify: measure reading, computation, and printing separately, run comparisons with prompts of different lengths, and report the median across multiple runs.

    5. How It Compares to Conventional Edge Deployment

    The report compares this experiment with TensorFlow Lite Micro and ONNX Runtime deployments on MCUs, claiming the latter can reach tens of tokens per second, while the former is 3 to 4 orders of magnitude slower.

    At 60 seconds per token, throughput is about 0.017 tokens per second. Against “tens of tokens per second,” the gap is indeed around three orders of magnitude. But the report does not specify the comparison hardware models, model sizes, quantization methods, or test conditions, and the two differ in hardware, model, and precision — so any specific multiple should not be taken at face value.

    One thing is certain: an interpreted runtime, the lack of vector instructions, and frequent data reads compound each other and drag speed down dramatically. This shows that the software environment’s impact on edge AI may be as significant as raw chip performance.

    6. Lessons and Risks for Edge AI

    The experiment offers three points of reference:

    1. Idle compute in existing devices has untapped potential. Office equipment stays powered year-round, and its CPUs have basic compute capability.
    2. The compiler can be improved. Reducing repeated parsing and nested loops in the interpreter could significantly boost speed — a direction worth exploring.
    3. It suits offline batch processing. For example, running document classification or keyword extraction on a batch of files overnight.

    There are also several risks that cannot be ignored:

    • Security is the biggest one. The interpreter executes code inside print jobs, so anyone who can send a job to the printer could run arbitrary scripts. This turns the printer into an attack surface. Such experiments should only be run on isolated test devices; production printers require vendor permission.
    • Efficiency and usability are limited. At 60 seconds per token, generating 100 tokens takes about 100 minutes. This latency only suits non-real-time scenarios.
    • Output quality is unknown. The report provides no accuracy, perplexity, or human evaluation results. Without quality data, there is no way to judge whether the model’s output is usable.
    • Energy and maintenance. Sustained full-load operation increases power draw and heat, and may affect the device’s lifespan and warranty.
    • Poor reproducibility. The setup depends on a specific printer model and interpreter version; it may not run on a different device.

    7. How Readers Can Evaluate Experiments Like This

    When you encounter a similar edge AI experiment report, check the following:

    • Is the memory figure peak RAM, model file size, or storage footprint? Keep the three distinct.
    • Where does latency timing start and end? Does it include prefill, I/O, and output?
    • How many tokens were generated? How many repetitions were run? Is the reported figure a mean or a median?
    • Are the hardware model, interpreter version, and prompt length all documented?
    • Are output quality metrics provided? If not, conclusions can only stay at the feasibility level.
    • Is the quantization configuration explicit? If it is only an estimate, treat it as a hypothesis.

    The experiment proves one thing: on extremely resource-constrained devices, streaming loading and aggressive compression can make a large model run. What it does not prove is that the results are fast enough, accurate enough, or safe enough. Only by evaluating these three points separately can its real value be judged.