Skip to content
AI.info

Research

LampQ: Towards Accurate Layer-wise Mixed Precision Quantization for Vision Transformers

Overview Research area: Computer vision / model compression — specifically post-training quantization (PTQ) and mixed-precision quantization (MPQ) for Vision Transformers. Technical level: Advanced. T

LampQ: Towards Accurate Layer-wise Mixed Precision Quantization for Vision Transformers
arXiv
2511.10004
Published
2025-11-13
Authors
Minjun Kim, Jaeri Lee, Jongjin Kim, Jeongin Yun, Yongmo Kwon, U Kang

AI summary

Overview

  • Research area: Computer vision / model compression — specifically post-training quantization (PTQ) and mixed-precision quantization (MPQ) for Vision Transformers.
  • Technical level: Advanced. The paper assumes familiarity with transformer architectures, quantization scaling/offsets, Hessian and Fisher information matrices, and integer linear programming.
  • Scope (one sentence): The paper proposes LampQ, a metric-based mixed-precision PTQ method that assigns bit-widths per linear layer of a ViT using a type-aware Fisher-information metric, an ILP-based initial allocation, and iterative error-based bit updates.

What This Paper Is About

Vision Transformers are accurate but expensive to run on resource-limited hardware, and quantization compresses them into low-bit formats. Most existing PTQ methods use one uniform bit-width for every component, even though different ViT blocks, modules, and layers degrade by very different amounts when quantized; the one prior metric-based MPQ method for ViTs (VT-PTQ) is module-wise, uses an empirically motivated nuclear-norm metric, and relies on a Pareto-frontier search. LampQ's goal is to fix those three weaknesses — granularity, metric, and bit assignment — to get more accuracy out of the same average bit budget.

Key Contributions

  1. Observation. The authors identify three design problems in metric-based MPQ for ViTs, each tied to a specific component: coarse granularity, a mismatch in metric scale across component types, and quantization-unaware bit allocation (supported by Figures 1, 5, and 6).
  2. Method. They propose LampQ, which quantizes at the layer level (treating a ViT with N blocks as 4N layers: N each of qkv, proj, fc1, fc2), scores sensitivity with a type-aware Fisher-based metric, assigns initial bits via integer linear programming, and then refines them iteratively using layer-wise reconstruction error.
  3. Compatibility. LampQ is described as integrable with any PTQ method for ViTs; the authors adopt AdaLog as the baseline quantizer for their main results and PSAQ-ViT as the baseline for zero-shot quantization.
  4. Experiments. The paper reports state-of-the-art results across image classification, object detection, and zero-shot quantization, plus an ablation and a bit-allocation case study.

Main Findings

  • Image classification (ImageNet). Under 4-bit weights/activations with MPQ, LampQ reaches an average accuracy of 77.42% across ViT-S, ViT-B, DeiT-T, DeiT-S, DeiT-B, Swin-S, and Swin-B, compared with 76.07% for VT-PTQ and 75.61% for AdaLog. Under 3-bit MPQ, LampQ averages 51.81% versus 45.94% for VT-PTQ and 42.78% for AdaLog. The paper states this is up to 5.87%p higher average accuracy and notes the gain grows as the bit-width decreases.
  • Full-precision reference points. The unquantized averages reported are 81.17% for classification (individual: ViT-S 81.38, ViT-B 84.53, DeiT-T 72.13, DeiT-S 79.83, DeiT-B 81.80, Swin-S 83.23, Swin-B 85.27).
  • Large gap at 3-bit for other methods. At 3/3 bit, PTQ4ViT averages 0.14% and RepQ-ViT 2.99%, showing how difficult that regime is for uniform-precision approaches.
  • Object detection (MS-COCO). LampQ achieves the best average AP among quantized models at 44.1, versus 43.6 for VT-PTQ and 43.4 for AdaLog; full precision averages 46.3. Individual results span Mask R-CNN with Swin-T (AP-box 39.8, AP-mask 38.4) to Cascade Mask R-CNN with Swin-S (AP-box 51.1, AP-mask 44.5).
  • Zero-shot quantization. Applied to PSAQ-ViT, LampQ improves accuracy across four models at both 4/8 and 8/8 settings, with the paper reporting up to a 0.62%p increase; e.g., DeiT-S rises from 72.04 to 72.71 at 4 MP/8 MP.
  • Ablation. On 3-bit DeiT-S, AdaLog alone gives 24.47%, adding VT-PTQ's MPQ gives 26.37%, adding ideas I1+I2 gives 44.43%, adding I1+I3 gives 27.87%, and the full LampQ gives 45.38%. The type-aware Fisher-based metric (I2) has the strongest impact at 19.96%p.
  • Speed of allocation. The ILP-based allocation is reported to be over 250× faster than building a Pareto frontier.
  • Metric scale mismatch quantified. For VT-PTQ on DeiT-S, metric values for MSA and MLP differ by 10 to 40 times; LampQ's scaled metric is shown to remove that gap (Figure 5).
  • Bit allocation case study. In a 3-bit DeiT-S, LampQ assigns more bits to qkv and fc1 than to proj and fc2, matching the layer-level sensitivity pattern seen when quantizing individual components.
  • Error growth with shrinking bit-width. Table 2 lists the expected reconstruction-loss ratio for Gaussian-distributed activations: 82.74× from 1-bit to 2-bit, then 6.59× (2→3), 4.70×, 4.29×, 4.13×, 4.12×, and 4.03× for each additional bit up to 8 bits.

Methodology in Plain English

The approach has three pieces.

First, granularity. Instead of giving an entire MSA or MLP module one bit-width, LampQ assigns a bit-width to each of the four linear layers per block. The authors argue this is the sweet spot: it captures the sensitivity differences that module-wise methods miss, while anything finer (per-channel, per-weight) would break low-bit kernel efficiency because values within a single matrix would need different precisions.

Second, sensitivity measurement. A metric should say how much accuracy a layer loses when quantized. Prior work used Hessian traces for CNNs, so the authors start there, but computing second derivatives per layer is expensive and ViTs have four different layer types that do not respond equally to the same amount of quantization damage. They substitute the Fisher information matrix for the Hessian (the paper cites an approximation between the expected Hessian and the Fisher matrix), then multiply the trace by a type-specific scaling factor α_t. That factor is estimated cheaply as the ratio between the average accuracy drop and the average Fisher trace, measured on a small number of sampled layers of each type, quantized to a low bit-width.

Third, bit assignment. Given a target average bit-width, LampQ picks bit-widths by minimizing a total error proxy of the form γ^(−B_i)·Ω_i, subject to the parameter-weighted average bit constraint — a problem small enough to solve as an integer linear program. Because quantizing early layers changes how sensitive later layers are, the authors then run iterative updates: each step raises one layer by one bit and lowers another by one bit, keeping the average fixed, choosing the pair based on gain (error reduction from adding a bit) and degradation (error increase from removing one). To avoid recomputing everything, these quantities are approximated with pre-computed expectations of reconstruction-error ratios, assuming Gaussian weights and activations.

Why This Matters

  • Research impact. LampQ shows that the granularity/metric/assignment choices in metric-based MPQ matter a lot for ViTs, and that a theoretically motivated metric (Fisher trace) with type normalization can beat an intuition-driven one (nuclear norm). It also shows a cheap ILP can replace an expensive Pareto search, which lowers the cost of doing MPQ research at all.
  • Real-world applications:
    • Deploying image classifiers on phones, cameras, or embedded boards where ViT memory and compute are otherwise prohibitive.
    • Object detection and instance segmentation on edge devices — the paper reports MS-COCO results for Mask R-CNN and Cascade Mask R-CNN on Swin backbones.
    • Privacy- or data-constrained scenarios where no real calibration data is available, addressed by the zero-shot quantization experiments with PSAQ-ViT.
    • Serving-time cost reduction generally: the paper frames MPQ as a way to cut memory and computation with minimal accuracy loss.
  • Industry relevance. The work is supported by the Mobile eXperience (MX) Business of Samsung Electronics, and the authors release code at https://github.com/snudatalab/LampQ — both signals of deployment-oriented intent.

Future Directions

  • Extending LampQ to vision-language models, which the conclusion names explicitly.
  • Extending it to generation tasks, also named in the conclusion.
  • Testing whether the layer-level granularity choice can be pushed finer without losing the kernel-level acceleration the authors use to justify it.
  • Clarifying how sensitive the results are to the hyperparameters the appendix lists — μ ∈ {1/4 N, 1/2 N, 3/4 N, N}, γ ∈ {2, 4, 6, 8, 10, 15, 20}, β ∈ {1, 2, 3, 4}, and the candidate bit sets 𝔹 — and whether they transfer to new architectures.

Target Audience

Researchers and engineers working on model compression, efficient inference, and transformer deployment — particularly those already familiar with PTQ pipelines. Practitioners who need to decide how to distribute a limited bit budget across a ViT will find the ablation and bit-allocation case study directly useful. A reader without background in quantization or matrix-based sensitivity analysis will need to consult the cited prior work first.

Note on scope: the supplied content is a truncated version of the paper. Details such as the exact calibration set size S, the full competitor descriptions, the complete algorithm listing, and the theoretical derivations referenced as "Theoretical Analysis" and Table 9 are not included here and are therefore not reported above.

Authors’ abstract

How can we accurately quantize a pre-trained Vision Transformer model? Quantization algorithms compress Vision Transformers (ViTs) into low-bit formats, reducing memory and computation demands with minimal accuracy degradation. However, existing methods rely on uniform precision, ignoring the diverse sensitivity of ViT components to quantization. Metric-based Mixed Precision Quantization (MPQ) is a promising alternative, but previous MPQ methods for ViTs suffer from three major limitations: 1) coarse granularity, 2) mismatch in metric scale across component types, and 3) quantization-unaware bit allocation. In this paper, we propose LampQ (Layer-wise Mixed Precision Quantization for Vision Transformers), an accurate metric-based MPQ method for ViTs to overcome these limitations. LampQ performs layer-wise quantization to achieve both fine-grained control and efficient acceleration, incorporating a type-aware Fisher-based metric to measure sensitivity. Then, LampQ assigns bit-widths optimally through integer linear programming and further updates them iteratively. Extensive experiments show that LampQ provides the state-of-the-art performance in quantizing ViTs pre-trained on various tasks such as image classification, object detection, and zero-shot quantization.

Read the original paper