Making Models Fit: Quantization for the Edge

On the cloud, quantization is an optimization you reach for to cut costs. On a phone, it's the difference between the model running and not running at all. Nearly every on-device LLM you'll ever ship is quantized, because full-precision weights simply don't fit — so understanding the bit-width trade-off is non-negotiable for edge AI.

The last post established that memory is the tightest edge constraint and named quantization as the primary way to fit within it. This post goes deeper on quantization specifically for on-device — why it’s mandatory rather than optional, what bit-widths mean for a phone, the formats you’ll actually encounter (.task, GGUF, LiteRT), and how to choose. The LLM serving series covered quantization for cloud throughput; here the lens is fitting on the device at all.

Why quantization is mandatory on-device

Recall the memory math: a model’s weight memory is roughly parameters × bytes-per-parameter. In full precision (FP16, 2 bytes), even a “small” model is large:

That roughly 4× reduction is what turns “won’t fit / gets killed by the OS” into “runs smoothly.” And from the edge-constraints post, quantization doesn’t only help memory — smaller weights mean less data to move (faster generation on memory-bound decode), less energy per token (battery), and less heat (thermal). It improves all four edge constraints at once, which is why it’s the first and most important edge decision. On-device, you essentially never ship full-precision weights; the only question is how aggressively you quantize.

The bit-width trade-off, edge edition

The precision-vs-quality trade-off from the serving series applies, but the calculus shifts on-device because your ceiling is lower and your pressure to compress is higher:

The edge-specific reality: you’re often choosing between a more capable model quantized harder versus a smaller model quantized less. A larger model at 4-bit frequently beats a tiny model at 8-bit for the same memory budget — but not always, and it depends on your task. This is a real experiment to run, not a rule to assume: for a given memory budget, compare a few (model size, bit-width) combinations on your actual workload.

Models built for the edge

An important development makes this easier: model families now include variants designed for on-device use rather than just shrunk cloud models. Google’s Gemma family, this series’ focus, includes small open models suited to local deployment, and Google has released variants specifically engineered for efficient on-device and mobile execution (with multimodal capability). Choosing a model that was built and optimized for the edge — rather than aggressively quantizing a model designed for servers — often gives better quality at a given footprint, because the model and its quantization were co-designed. When picking an on-device model, prefer families with explicit edge/mobile variants and official quantized releases.

The formats you’ll actually encounter

On-device quantized models come in specific file formats tied to their runtimes, and knowing them prevents confusion when you go to load one:

The practical point: the model file format is coupled to the runtime that executes it, so you choose them together. For Gemma + Flutter on mobile you’ll typically use a quantized .task model with the MediaPipe engine; the next posts on the runtime and flutter_gemma make this concrete. Get the format wrong for your target platform and the model simply won’t load.

Choosing quantization for your app

Quantization is the enabling technology of on-device AI — without it, phone-sized LLMs wouldn’t exist. With a 4-bit, edge-designed model in the right format, you have something that fits. Next: the runtime that actually executes it on the phone’s hardware.

Key takeaways

Further reading

Sources & References

On-device model formats and inference