Extreme Compression: 1.58-bit Quantization Shrinks Vision Transformer to 668KB for Browser

Any_Tie_1861 · reddit · 2026-07-31

A developer applied BitNet-style ternary quantization (1.58-bit), typically used for LLMs, to a vision transformer (Swin2SR lightweight super-resolution model). With every weight quantized to -1, 0, or +1, the entire model is compressed to just 668 KB gzipped—smaller than most images it upscales.

The model runs entirely client-side via ONNX Runtime Web with zero data uploads, and is also available in safetensors format. On the Set5 ×2 dataset, it achieves an RGB PSNR of 34.44 dB, a 2.66 dB improvement over bicubic interpolation.

The author honestly notes its limitations: it only supports clean ×2 upscaling, won't rescue heavily JPEG'd images, is non-generative (sharpens existing detail rather than inventing it), and trades some peak fidelity for the drastically smaller footprint.

Original post →

More from Multimodal

Multimodal channel →