TL;DR
Quant.npu is an integer-only, fully static post-training quantization (PTQ) framework designed specifically to meet the harsh hardware constraints of mobile Neural Processing Units (NPUs). By decoupling the optimization of rotated and unrotated activation distributions and applying an outlier-aware mixed-precision strategy, it eliminates runtime quantization overhead. The result is a boost in on-device LLM inference speed by up to 15.1% with virtually no loss in downstream task accuracy.
What Problem Does This Paper Address?
Deploying Large Language Models (LLMs) directly on mobile devices requires leveraging specialized hardware like NPUs, which offer significantly better throughput and energy efficiency than mobile GPUs. However, NPUs achieve these gains through strict architectural preferences: they favor integer arithmetic, coarse-grained quantization (per-tensor/per-channel), and fully static quantization.
Unlike GPUs, which can easily compute quantization parameters (min/max values) on the fly at runtime (dynamic quantization), NPUs suffer massive latency bottlenecks from these dynamic reduction operations. For instance, a simple vector reduction can disrupt an NPU's systolic array pipeline and waste precious instruction cycles.
Unfortunately, standard static quantization causes LLM accuracy to collapse. LLM activations are notorious for containing extreme, channel-wise outliers. While recent methods use mathematical rotations (like Hadamard transforms) to smooth out these outliers, they still rely on dynamic quantization during optimization or deployment. Forcing these models into a fully static NPU compilation pipeline leads to severe performance degradation.
Methods
Quant.npu bridges the gap between high-accuracy optimization and static NPU deployment through three core techniques:
- Rotation-and-Bit-Width-Aware Initialization: The authors found that the convergence of static quantization parameters is highly sensitive to their starting values. Quant.npu applies Mean-based initialization (clipping extreme values based on mean and variance) to rotated activations, which approximate a smooth Gaussian distribution. Conversely, it uses Max-Min initialization for unrotated, heavy-tailed distributions to preserve their wide dynamic range.
- Distribution-Aware Selective Optimization (Two-Stage Pipeline): Instead of naively optimizing all parameters at once—which causes gradient instability—Quant.npu splits the process. In Stage One, it jointly optimizes learnable rotation matrices and the quantization parameters of smooth, rotated tensors (linear layer inputs and weights). In Stage Two, it locks those parameters and performs a straightforward static calibration on the remaining heavy-tailed, unrotated tensors (like KV caches and non-linear activations).
- Sensitivity-Guided Adaptive Mixed-Precision: To eliminate the 2× computational overhead of online floating-point rotations, Quant.npu removes them entirely for the
down_projlayers. To combat the severe outliers this re-introduces, the framework calculates a relative quantization error metric and selectively promotes only the top 10% most sensitive activation layers from 8-bit to 16-bit precision.
To ensure zero runtime overhead, the remaining rotation matrices ($R_1, R_2$) are fused directly into the model weights offline.
Datasets
The framework was optimized and evaluated using the following datasets:
- Calibration & Optimization: WikiText-2 (used for profiling activation distributions and calculating quantization scales).
- Language Modeling Evaluation: C4 (to measure perplexity).
- Zero-Shot Commonsense Reasoning: PIQA, WinoGrande, HellaSwag, ARC-Easy, ARC-Challenge, and LAMBADA.
- Instruction-Following: AlpacaEval 2.0 (to evaluate conversational quality against an FP16 baseline).
Key Insights and Ideas
- Dynamic Simulation Lies: Simulating dynamic quantization during the optimization phase fails to capture actual static quantization errors. When a dynamically optimized model is converted to static NPU deployment, accuracy collapses (e.g., a 15.6% accuracy drop on SmolLM2).
- More Learnable Parameters $\neq$ Better Performance: Counterintuitively, making every quantization parameter learnable degrades performance. Heavy-tailed, unrotated distributions create a highly polarized loss landscape with numerous local minima, causing backpropagation to destabilize the optimization of the rotation matrices.
- The 10% Rule for Mixed Precision: You don't need to quantize everything to 16-bit to save accuracy. Upgrading just the top 10% most sensitive layers of
down_projactivations to 16-bit recovers almost all accuracy loss caused by removing online rotations, providing an ideal trade-off between latency and perplexity.
Key Results
Quant.npu was benchmarked on real-world mobile hardware (Qualcomm SM8650 and SM8750 NPUs) across multiple LLMs, including LLaMA-3.2-3B-Instruct and Qwen2.5-3B-Instruct.
- Inference Speedup: Quant.npu-W4A8 achieved up to a 15.1% speedup compared to ExecuTorch’s standard W4A16 per-block configuration.
- Accuracy Preservation: Under the challenging W4A8 configuration, Quant.npu reduced LLaMA-3.2-3B perplexity from 28.78 (SpinQuant) down to 19.16, boosting zero-shot accuracy by 12.04%.
- Memory and Power Efficiency: For 3B parameter models, peak memory usage stayed under 2 GB, and energy consumption per run dropped significantly due to shortened high-power execution states during the prefill stage.
Limitations and Future Work
Despite its success, Quant.npu still retains 16-bit precision for a minor subset of operations, such as SiLU activations, to strictly preserve model performance. This prevents a fully low-bit execution pipeline and leaves a minor latency bottleneck on the table. Additionally, the framework currently lacks a dedicated strategy for curating the calibration dataset; because the optimization process is highly sensitive to activation profiles, developing a principled data-selection strategy remains an open direction for future research.
Summary updated