Papers
Topics
Authors
Recent
Search
2000 character limit reached

Compression with Dead-Zone Quantizer (CoDeQ)

Updated 22 December 2025
  • Compression with Dead-zone Quantizer (CoDeQ) is a unified methodology that integrates dead-zone scalar quantization to perform both magnitude pruning and uniform quantization in a single, differentiable operator.
  • It enables explicit rate-distortion and sparsity control by tuning quantizer parameters such as step size, offset, and dead-zone width, thereby optimizing performance across image and model compression tasks.
  • Empirical results show that CoDeQ matches the rate-distortion performance of state-of-the-art codecs and achieves competitive neural network accuracies with reduced bit operations and enhanced sparsity.

Compression with Dead-zone Quantizer (CoDeQ) represents a unified methodology for signal and model compression that leverages the properties of dead-zone scalar quantization. Dead-zone quantizers introduce adjustable regions around zero where all values are mapped to zero, effecting both quantization and magnitude pruning in a single operator. This principle enables efficient image compression and supports highly sparse, low-precision neural networks in a fully differentiable, end-to-end optimization procedure. CoDeQ, as formalized in (Zhou et al., 2020) and further generalized for model compression in (Wenshøj et al., 15 Dec 2025), provides explicit control over rate-distortion tradeoffs and network sparsity by varying quantizer parameters, with provable near-optimal performance across a spectrum of applications.

1. Dead-Zone Quantizer: Formulation and Properties

The dead-zone quantizer is a variant of the uniform scalar quantizer that incorporates a widened zero bin. For a bb-bit quantizer with step size Δ\Delta, the classical form maps an input xx as

xˉ=clip(⌊x/Δ⌉, −Qb, Qb),Qb=2b−1−1,\bar{x} = \mathrm{clip}\Bigl(\lfloor x/\Delta \rceil,\,-Q_b,\,Q_b\Bigr), \quad Q_b = 2^{b-1}-1,

assigning values within ∣x∣≤Δ/2|x| \leq \Delta/2 to zero, thereby pruning small coefficients.

CoDeQ generalizes this with an explicit dead-zone width d≥Δd \geq \Delta:

q~(x;Δ,d)={0,∣x∣≤d/2, sign(x) (d/2+Δ clip(⌊∣x∣−d/2Δ⌉,−Qb,Qb))),∣x∣>d/2.\tilde{q}(x;\Delta,d) = \begin{cases} 0, & |x| \leq d/2, \ \mathrm{sign}(x)\,\left(d/2 + \Delta\, \mathrm{clip}\left(\left\lfloor \frac{|x| - d/2}{\Delta} \rceil, -Q_b, Q_b\right)\right) \right), & |x| > d/2. \end{cases}

This scheme is equivalent to magnitude pruning with threshold τ=d/2\tau = d/2, combined with uniform quantization above the threshold. For deep learning compression, this mapping is fully differentiable via straight-through estimators, enabling its use in joint pruning–quantization settings (Wenshøj et al., 15 Dec 2025).

The dead-zone quantizer for image latent coefficients is similarly parameterized by step size QQ and offset δ\delta:

Δ\Delta0

where Δ\Delta1 tunes the symmetry and width of the dead zone. In practice, Δ\Delta2 provides optimal rate-distortion performance for learned codecs (Zhou et al., 2020).

2. Network Architectures and Training Protocols

CoDeQ-based image compression methods employ autoencoder architectures in the tradition of Ballé et al. (2017). The encoder Δ\Delta3 consists of three strided convolutions with GDN nonlinearities, mapping Δ\Delta4 patches to Δ\Delta5 latent representations. The decoder Δ\Delta6 features three transposed convolutions with inverse GDN. Bottleneck dimensionality is fixed at 128 coefficients per patch; models are trained over 1 million steps with batch size 8 and learning rate Δ\Delta7 (Zhou et al., 2020).

Training is performed using the RaDOGAGA (Rate-Distortion Optimization Guided Autoencoder for Isometric Embedding in Euclidean Latent Space) framework. RaDOGAGA adds distortion-driven orthogonality regularization in latent space:

  • Primary distortion: Δ\Delta8 (MSE or MS-SSIM),
  • Jacobian orthogonality: Δ\Delta9 with xx0 and xx1,
  • Log-rate penalty via a learned CDF prior xx2.

The total loss is

xx3

with metric-specific (xx4, xx5, xx6) settings for MSE and MS-SSIM. The induced latent space becomes isometric to the selected fidelity metric, ensuring rate-distortion optimality over subsequent quantization (Zhou et al., 2020).

In the context of model compression, the dead-zone widths xx7 and optional bit-widths xx8 are parameterized and learned end-to-end via unconstrained scalars xx9 and xˉ=clip(⌊x/Δ⌉, −Qb, Qb),Qb=2b−1−1,\bar{x} = \mathrm{clip}\Bigl(\lfloor x/\Delta \rceil,\,-Q_b,\,Q_b\Bigr), \quad Q_b = 2^{b-1}-1,0, using formulas:

xˉ=clip(⌊x/Δ⌉, −Qb, Qb),Qb=2b−1−1,\bar{x} = \mathrm{clip}\Bigl(\lfloor x/\Delta \rceil,\,-Q_b,\,Q_b\Bigr), \quad Q_b = 2^{b-1}-1,1

xˉ=clip(⌊x/Δ⌉, −Qb, Qb),Qb=2b−1−1,\bar{x} = \mathrm{clip}\Bigl(\lfloor x/\Delta \rceil,\,-Q_b,\,Q_b\Bigr), \quad Q_b = 2^{b-1}-1,2

and quantization step

xˉ=clip(⌊x/Δ⌉, −Qb, Qb),Qb=2b−1−1,\bar{x} = \mathrm{clip}\Bigl(\lfloor x/\Delta \rceil,\,-Q_b,\,Q_b\Bigr), \quad Q_b = 2^{b-1}-1,3

The optimization objective is

xˉ=clip(⌊x/Δ⌉, −Qb, Qb),Qb=2b−1−1,\bar{x} = \mathrm{clip}\Bigl(\lfloor x/\Delta \rceil,\,-Q_b,\,Q_b\Bigr), \quad Q_b = 2^{b-1}-1,4

with xˉ=clip(⌊x/Δ⌉, −Qb, Qb),Qb=2b−1−1,\bar{x} = \mathrm{clip}\Bigl(\lfloor x/\Delta \rceil,\,-Q_b,\,Q_b\Bigr), \quad Q_b = 2^{b-1}-1,5 typically the cross-entropy over quantized weights (Wenshøj et al., 15 Dec 2025).

3. Rate-Distortion Optimization and Sparsity Control

CoDeQ enables explicit, tunable rate-distortion control by modulating the quantizer step size xˉ=clip(⌊x/Δ⌉, −Qb, Qb),Qb=2b−1−1,\bar{x} = \mathrm{clip}\Bigl(\lfloor x/\Delta \rceil,\,-Q_b,\,Q_b\Bigr), \quad Q_b = 2^{b-1}-1,6 and offset xˉ=clip(⌊x/Δ⌉, −Qb, Qb),Qb=2b−1−1,\bar{x} = \mathrm{clip}\Bigl(\lfloor x/\Delta \rceil,\,-Q_b,\,Q_b\Bigr), \quad Q_b = 2^{b-1}-1,7 (for image compression) or the dead-zone widths xˉ=clip(⌊x/Δ⌉, −Qb, Qb),Qb=2b−1−1,\bar{x} = \mathrm{clip}\Bigl(\lfloor x/\Delta \rceil,\,-Q_b,\,Q_b\Bigr), \quad Q_b = 2^{b-1}-1,8 (for model compression). In the classical image codec setting, rate xˉ=clip(⌊x/Δ⌉, −Qb, Qb),Qb=2b−1−1,\bar{x} = \mathrm{clip}\Bigl(\lfloor x/\Delta \rceil,\,-Q_b,\,Q_b\Bigr), \quad Q_b = 2^{b-1}-1,9 and distortion ∣x∣≤Δ/2|x| \leq \Delta/20 are jointly optimized with a Lagrange multiplier ∣x∣≤Δ/2|x| \leq \Delta/21, tracing the rate-distortion curve via selection of operating points.

Under RaDOGAGA’s loss, the latent space becomes orthonormal and metric-isometric, enabling the dead-zone quantizer to function equivalently to a learned KLT/DCT transform followed by scalar quantization. Experimentally, sweeping ∣x∣≤Δ/2|x| \leq \Delta/22 achieves bitrates from ∣x∣≤Δ/2|x| \leq \Delta/23 to ∣x∣≤Δ/2|x| \leq \Delta/24, matching RD performance of individually tuned models (Zhou et al., 2020).

For model compression, varying ∣x∣≤Δ/2|x| \leq \Delta/25 at runtime directly adjusts layer sparsity, decoupled from quantization bit-width. Regularization via ∣x∣≤Δ/2|x| \leq \Delta/26 controls global sparsity, and ∣x∣≤Δ/2|x| \leq \Delta/27 encourages low precision. The optimization is differentiable and performed end-to-end; all pruning and quantization decisions are learned jointly (Wenshøj et al., 15 Dec 2025).

4. Algorithmic Pipeline and Inference Procedure

Image compression with CoDeQ is realized by the following inference steps:

  • Input: ∣x∣≤Δ/2|x| \leq \Delta/28,
  • Analysis transform: ∣x∣≤Δ/2|x| \leq \Delta/29,
  • Dead-zone quantization: d≥Δd \geq \Delta0,
  • Entropy coding: Bits via arithmetic encoding with d≥Δd \geq \Delta1 from d≥Δd \geq \Delta2,
  • Dequantization: d≥Δd \geq \Delta3,
  • Synthesis transform: d≥Δd \geq \Delta4.

Model compression follows a fully differentiable QAT loop:

  • Initialize weights and parameters,
  • For each layer, compute d≥Δd \geq \Delta5, d≥Δd \geq \Delta6, d≥Δd \geq \Delta7, d≥Δd \geq \Delta8,
  • Quantize/prune: d≥Δd \geq \Delta9,
  • Compute task loss and q~(x;Δ,d)={0,∣x∣≤d/2, sign(x) (d/2+Δ clip(⌊∣x∣−d/2Δ⌉,−Qb,Qb))),∣x∣>d/2.\tilde{q}(x;\Delta,d) = \begin{cases} 0, & |x| \leq d/2, \ \mathrm{sign}(x)\,\left(d/2 + \Delta\, \mathrm{clip}\left(\left\lfloor \frac{|x| - d/2}{\Delta} \rceil, -Q_b, Q_b\right)\right) \right), & |x| > d/2. \end{cases}0 regularizers,
  • Backpropagate using STE for non-differentiable components,
  • Update parameters via gradient descent (Wenshøj et al., 15 Dec 2025).

5. Empirical Results and Rate-Sparsity Benchmarks

On Kodak images, CoDeQ’s variable-rate method matches the rate-distortion envelope of independently trained Ballé et al. (2017) models for both PSNR and MS-SSIM criteria:

  • PSNR: CoDeQ deviates by q~(x;Δ,d)={0,∣x∣≤d/2, sign(x) (d/2+Δ clip(⌊∣x∣−d/2Δ⌉,−Qb,Qb))),∣x∣>d/2.\tilde{q}(x;\Delta,d) = \begin{cases} 0, & |x| \leq d/2, \ \mathrm{sign}(x)\,\left(d/2 + \Delta\, \mathrm{clip}\left(\left\lfloor \frac{|x| - d/2}{\Delta} \rceil, -Q_b, Q_b\right)\right) \right), & |x| > d/2. \end{cases}1 dB from multi-model baseline,
  • MS-SSIM: deviation within q~(x;Δ,d)={0,∣x∣≤d/2, sign(x) (d/2+Δ clip(⌊∣x∣−d/2Δ⌉,−Qb,Qb))),∣x∣>d/2.\tilde{q}(x;\Delta,d) = \begin{cases} 0, & |x| \leq d/2, \ \mathrm{sign}(x)\,\left(d/2 + \Delta\, \mathrm{clip}\left(\left\lfloor \frac{|x| - d/2}{\Delta} \rceil, -Q_b, Q_b\right)\right) \right), & |x| > d/2. \end{cases}2 dB,
  • Best results for dead-zone offset q~(x;Δ,d)={0,∣x∣≤d/2, sign(x) (d/2+Δ clip(⌊∣x∣−d/2Δ⌉,−Qb,Qb))),∣x∣>d/2.\tilde{q}(x;\Delta,d) = \begin{cases} 0, & |x| \leq d/2, \ \mathrm{sign}(x)\,\left(d/2 + \Delta\, \mathrm{clip}\left(\left\lfloor \frac{|x| - d/2}{\Delta} \rceil, -Q_b, Q_b\right)\right) \right), & |x| > d/2. \end{cases}3 (Zhou et al., 2020).

Visual inspection indicates superior retention of fine textures at low bitrates compared to non–CoDeQ baselines, with minor edge artifacts attributed to scalar uniform quantization. At high bitrate, reconstructions are nearly identical.

For ImageNet/ResNet-18 model compression:

  • Full precision baseline: q~(x;Δ,d)={0,∣x∣≤d/2, sign(x) (d/2+Δ clip(⌊∣x∣−d/2Δ⌉,−Qb,Qb))),∣x∣>d/2.\tilde{q}(x;\Delta,d) = \begin{cases} 0, & |x| \leq d/2, \ \mathrm{sign}(x)\,\left(d/2 + \Delta\, \mathrm{clip}\left(\left\lfloor \frac{|x| - d/2}{\Delta} \rceil, -Q_b, Q_b\right)\right) \right), & |x| > d/2. \end{cases}4 Top-1, q~(x;Δ,d)={0,∣x∣≤d/2, sign(x) (d/2+Δ clip(⌊∣x∣−d/2Δ⌉,−Qb,Qb))),∣x∣>d/2.\tilde{q}(x;\Delta,d) = \begin{cases} 0, & |x| \leq d/2, \ \mathrm{sign}(x)\,\left(d/2 + \Delta\, \mathrm{clip}\left(\left\lfloor \frac{|x| - d/2}{\Delta} \rceil, -Q_b, Q_b\right)\right) \right), & |x| > d/2. \end{cases}5 BOPs,
  • SQL (joint ADMM): q~(x;Δ,d)={0,∣x∣≤d/2, sign(x) (d/2+Δ clip(⌊∣x∣−d/2Δ⌉,−Qb,Qb))),∣x∣>d/2.\tilde{q}(x;\Delta,d) = \begin{cases} 0, & |x| \leq d/2, \ \mathrm{sign}(x)\,\left(d/2 + \Delta\, \mathrm{clip}\left(\left\lfloor \frac{|x| - d/2}{\Delta} \rceil, -Q_b, Q_b\right)\right) \right), & |x| > d/2. \end{cases}6, q~(x;Δ,d)={0,∣x∣≤d/2, sign(x) (d/2+Δ clip(⌊∣x∣−d/2Δ⌉,−Qb,Qb))),∣x∣>d/2.\tilde{q}(x;\Delta,d) = \begin{cases} 0, & |x| \leq d/2, \ \mathrm{sign}(x)\,\left(d/2 + \Delta\, \mathrm{clip}\left(\left\lfloor \frac{|x| - d/2}{\Delta} \rceil, -Q_b, Q_b\right)\right) \right), & |x| > d/2. \end{cases}7 BOPs,
  • QST-B: q~(x;Δ,d)={0,∣x∣≤d/2, sign(x) (d/2+Δ clip(⌊∣x∣−d/2Δ⌉,−Qb,Qb))),∣x∣>d/2.\tilde{q}(x;\Delta,d) = \begin{cases} 0, & |x| \leq d/2, \ \mathrm{sign}(x)\,\left(d/2 + \Delta\, \mathrm{clip}\left(\left\lfloor \frac{|x| - d/2}{\Delta} \rceil, -Q_b, Q_b\right)\right) \right), & |x| > d/2. \end{cases}8, q~(x;Δ,d)={0,∣x∣≤d/2, sign(x) (d/2+Δ clip(⌊∣x∣−d/2Δ⌉,−Qb,Qb))),∣x∣>d/2.\tilde{q}(x;\Delta,d) = \begin{cases} 0, & |x| \leq d/2, \ \mathrm{sign}(x)\,\left(d/2 + \Delta\, \mathrm{clip}\left(\left\lfloor \frac{|x| - d/2}{\Delta} \rceil, -Q_b, Q_b\right)\right) \right), & |x| > d/2. \end{cases}9 BOPs,
  • CoDeQ (fixed 4-bit + learned sparsity): Ï„=d/2\tau = d/20, Ï„=d/2\tau = d/21 BOPs,
  • CoDeQ (mixed precision + learned sparsity): Ï„=d/2\tau = d/22, Ï„=d/2\tau = d/23 BOPs.

Layer-wise analysis shows CoDeQ assigns higher bit-width/lower sparsity to first/last layers and lower bit-width/higher sparsity to middle layers, matching canonical heuristic allocations but discovered automatically in the end-to-end process (Wenshøj et al., 15 Dec 2025).

6. Discussion: Implementation, Limitations, and Extensions

CoDeQ offers several operational advantages:

  • Eliminates the need for auxiliary search phases or parameter selection procedures outside the training loop,
  • Pruning and quantization are unified, architecture-agnostic, and controlled by global regularization,
  • Fixed 4-bit variant matches mixed-precision performance, favoring hardware compatibility.

Limitations include the use of layer-wise granularity for quantization and pruning; finer granularity (channel-, group-, or block-wise) and structured sparsity remain open for future development. The current scale factors utilize absmax statistics; direct learning of scale could further decrease quantization error.

Potential extensions of the CoDeQ framework are:

  • Per-channel/group dead-zone control for sparsity granularity,
  • Joint scale learning with regularization,
  • Structured dead-zone quantization for hardware exploitation,
  • Integration with post-training coding (e.g., Huffman, distillation) for maximal compression.

CoDeQ bridges magnitude pruning and uniform quantization, leveraging dead-zone properties for efficient compression in both data and model domains, with strong empirical performance and minimal operational complexity (Zhou et al., 2020, Wenshøj et al., 15 Dec 2025).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Compression with Dead-zone Quantizer (CoDeQ).