TL;DR
PolyQ is an end-to-end quantization and compiler co-design framework that makes fine-grained, fractional-bit mixed-precision LLM inference practical on edge CPUs. By pairing an activation-aware channel-wise bit allocation scheme with compile-time layout regularization, PolyQ hits strict memory budgets precisely while boosting model accuracy and eliminating runtime data-shuffling overheads.
What Problem Does This Paper Address?
Running Large Language Models (LLMs) on edge devices is heavily bottlenecked by memory bandwidth and storage capacity. While standard Post-Training Quantization (PTQ) compresses models to uniform integer bit-widths (like 3-bit or 4-bit), these steps are too coarse to fit tight, fragmented memory budgets perfectly (e.g., trying to fit a model into exactly 3.9 GB of remaining RAM).
Existing intra-layer mixed-precision methods offer finer control by varying bit-widths within a layer, but they create a nightmare for CPU execution. They introduce irregular memory layouts that break SIMD (Single Instruction, Multiple Data) parallelism and require expensive runtime data reordering (shuffling) between layers, erasing any performance gains.
Methods
PolyQ solves this dilemma through a hardware-software co-design consisting of two main components:
- CPU-Aligned Quantization Pipeline: Instead of using arbitrary bit-widths, PolyQ restricts channel choices to a CPU-friendly palette:
{2, 3, 4, 8, 16}bits. It uses a greedy waterfilling algorithm to allocate bits to channels based on an activation-aware error proxy—protecting highly salient "outlier" channels with higher precision while aggressively compressing the rest. An ISA-aware quanta matching step then rounds channel counts to match hardware-backed SIMD/LUT block sizes (e.g., multiples of 32) and re-optimizes channel membership to minimize error. - Model Compiler Architecture: The PolyQ compiler permutes and clusters irregular channel bit assignments into contiguous, bit-homogeneous execution blocks at compile time. Crucially, it propagates these permutations across the full operator directed acyclic graph (DAG). Because non-linear activations (like ReLU/GELU) commute with channel permutations, the compiler can absorb data-shuffling overheads into static weight layouts rather than executing them at runtime.
Datasets
- Calibration & Perplexity Evaluation: WikiText-2.
- Downstream Task Evaluation: MMLU, WinoGrande, ARC-Easy, ARC-Challenge, and HellaSwag.
- Models Evaluated: Falcon-H1-3B, Llama2-13B, Llama3-8B, and Qwen3-32B.
Key Insights and Ideas
- The Quantization-Compiler Co-design Imperative: Low-bit LLM efficiency on CPUs cannot be solved by quantization math alone. It requires a compiler that understands hardware constraints (like SIMD lane uniformity) to structure the data layout statically.
- Saliency is Sparse: Only a tiny fraction of channels dominate activation energy. Allocating 8 or 16 bits to just these critical channels while dropping the rest to 2 or 3 bits yields massive accuracy gains without bloating the memory footprint.
- Zero-Cost Permutations: Shuffling data at runtime ruins CPU performance. However, by analyzing the model graph globally, the compiler can ensure that the output channel basis of an upstream layer matches the expected input basis of a downstream layer, making layout regularization completely free at runtime.
Key Results
- Better Accuracy: At a strict 3-bit target, PolyQ improves perplexity by 2.4% to 32.1% compared to prior uniform and mixed-precision methods.
- Precise Budget Fitting: PolyQ hits fractional bit targets exceptionally closely, staying within 0.045 bits of the user-specified average bit budget.
- Massive Shuffling Reduction: Compile-time layout regularization slashes runtime activation reorder traffic by up to 70.8% compared to localized fusion policies.
- High Efficiency: Prefill latency and decode throughput scale almost perfectly linearly with the configured bit budget across workstation, laptop, and mobile CPUs, while keeping energy-per-token overhead under 2% compared to an optimized uniform lookup-table (LUT) backend.
Limitations and Future Work
- Backend Dependency: The current implementation heavily relies on specific low-bit execution backends (like T-MAC for LUT-based operations and OpenBLAS for SIMD).
- Hardware Scope: While the abstraction supports ARM NEON/SVE, the primary evaluation was demonstrated on x86 architectures (AMD Ryzen and Intel).
- Future Directions: The authors suggest that extending this co-design to dynamic runtime activation quantization or adapting it to edge NPUs (Neural Processing Units) are promising next steps.
Summary updated