QSpec: Speculative Decoding with Complementary Quantization Schemes

## Abstract

Abstract Quantization has been substantially adopted to accelerate inference and reduce memory consumption of large language models (LLMs).
While activation-weight joint quantization speeds up the inference process through low-precision kernels, we demonstrate that it suffers severe performance degradation on multi-step reasoning tasks, rendering it ineffective.
We propose a novel quantization paradigm called QSpec , which seamlessly integrates two complementary quantization schemes for speculative decoding.
Leveraging nearly cost-free execution switching, QSpec drafts tokens with low-precision, fast activation-weight quantization, and verifies them with high-precision weight-only quantization,
effectively combines the strengths of both quantization schemes.
Compared to high-precision quantization methods, QSpec empirically boosts token generation throughput by up to 1.80 × 1.80\times 1.80 × without any quality compromise, distinguishing it from other low-precision quantization approaches.
This enhancement is also consistent across various serving tasks, model sizes, quantization methods, and batch sizes.
Unlike existing speculative decoding techniques, our approach reuses weights and the KV cache, avoiding additional memory overhead. Furthermore, QSpec offers a plug-and-play advantage without requiring any training.
We believe that QSpec demonstrates unique strengths for future deployment of high-fidelity quantization schemes, particularly in memory-constrained scenarios ( e.g. , edge devices).

## 1 Introduction

Large language models (LLMs) have demonstrated remarkable abilities across various domains, including mathematics, coding, and planning (Shao et al., ; Guo et al., ; Huang et al., ).
Nonetheless, their immense scales pose substantial challenges for deployment due to high memory and computational demands, especially in resource-limited scenarios (e.g., inference on edge devices). Quantization has been an effective compression technique to facilitate LLM inference with limited resources (Lin et al., ; Ashkboos et al., ; Zhao et al., ; Lin et al., ).
By converting high-precision values (e.g., FP16) into their lower-precision counterparts (e.g., INT4), quantization effectively lowers memory and computational requirements, allowing for larger serving batches and model sizes. Furthermore, the reduced memory footprint boosts token generation throughput by accelerating the typically memory-bound autoregressive decoding process (Zhao et al., ).

Based on the quantized objects, recent quantization algorithms can be broadly classified into two categories: weight-only and WXAX: (1) Weight-only quantization, represented by W4A16 (Lin et al., ), quantizes model weights to low precision (e.g., 4-bit) for storage, and then dequantizes them to a higher precision (i.e., FP16) during inference;
(2) WXAX methods, such as W4A4 (Ashkboos et al., ; Zhao et al., ) and W8A8 (Xiao et al., ), simultaneously quantize both weights and activations, and leverage low-precision hardware support for faster execution without dequantizing them to higher precision. Nevertheless, WXAX schemes generally suffer model performance degradation due to more low-precision activations used (as verified in Sec. 2). This poses a tough trade-off between efficacy and efficiency, raising the question:

*“Is there a quantization solution that boosts efficiency while avoiding performance degradation?”*.

Considering the comparable performance claims on recent W4A4 methods (Zhao et al., ; Ashkboos et al., ), we first contend that their conclusions are biased due to limited evaluation tasks, and W4A4 still experiences significant performance drops when compared to their higher-precision activation counterparts.
Specifically, while W4A4 schemes such as Atom (Zhao et al., ) and QuaRot (Ashkboos et al., ) perform well on general tasks, such as PIQA (Bisk et al., ), Winogrande (Sakaguchi et al., ) and ARC Clark et al. (), they demonstrate notable performance declines in multi-step reasoning, particularly on mathematical and coding benchmarks (Xiong et al., ; Guo et al., ) (shown in Table 1).
This raises concerns about the comprehensiveness of evaluation and emphasizes the necessity of incorporating multi-step reasoning tasks into quantization assessment.

Figure: Figure 1: Diagrams of different 4-bit quantization schemes. Left: W4A16 uses 4-bit weight and 16-bit activation for inference. Middle: W4A4 further adopts 4-bit activation to utilize low-precision W4A4 kernels. Right: QSpec accelerates W4A16 by drafting tokens with W4A4 and verifying them with W4A16, and applies KV cache overwriting for consistent memory consumption.
Refer to caption: x1.png

Then to answer the above question, we draw inspiration from Speculative Decoding (Leviathan et al., ; Chen et al., ), which combines rapid drafting of a small model with high-quality token generation of a larger model to boost throughput (i.e., efficiency) without compromising performance (i.e., efficacy).
We propose a novel paradigm called QSpec, which combines mixed-precision quantization execution to tackle the trade-off between efficiency and efficacy while maintaining the memory usage of high-precision quantization.
Our key insight is that a single weight-quantized model can efficiently toggle two parallel quantization schemes: one with quantized activations and the other without, which we further empirically verify to produce highly similar tokens (Sec. 2.2). This observation unveils the potential for a synergistic approach combining both schemes.
As illustrated in Figure 1, for a 4-bit weight-quantized model, we can leverage the faster yet lower-quality execution flow (i.e., W4A4) to draft tokens, while verifying these drafted tokens with the higher-quality quantization flow (i.e., W4A16) with negligible switching costs.
Similar to speculative decoding, this ‘draft-verify’ mode with mixed quantization execution ensures high fidelity with the verifying flow.
Differently, our approach re-utilizes the weights and high-precision KV cache, maintaining the memory overhead equivalent to that of the high-precision scheme alone, rather than the sum of both schemes in speculative decoding.

We evaluate the generation quality and end-to-end serving throughput of QSpec against W4A4 and W4A16 schemes across multiple datasets, model sizes, quantization methods, and batch sizes.
Empirically, QSpec preserves memory consumption and generation quality compared to W4A16, while offering a high acceptance rate and up to $1.80\times$ higher token generation throughput, thereby mitigating the efficiency-efficacy trade-off of existing quantization methods. Notably, for multi-step reasoning tasks such as MATH (Hendrycks et al., ), QSpec fully compensates for an up to 51.11% decline in generation quality observed with existing W4A4 methods. Furthermore, QSpec provides plug-and-play compatibility without any training requirements, and can be seamlessly applied to any existing models, delivering superior performance with minimal effort.

In summary, our main contributions are as follows:

- •
We demonstrate that
multi-step reasoning tasks
can better capture the performance variations of
quantization schemes than
current evaluation protocols,
and advocate for their incorporation for more comprehensive assessment.
- •
We validate and instantiate the feasibility of switching between two quantization schemes of a shared weight-quantized model, as well as their high token-level similarities, illuminating future development of quantization schemes.
- •
We propose QSpec,
synergizing two complementary weight-shared quantization schemes with speculative decoding, alleviating the efficiency-efficacy trade-off of quantization.
- •
Our empirical results reveal up to $1.80\times$ acceleration without any quality sacrifice across diverse settings. Alongside consistent memory usage, these advantages promise QSpec for high-fidelity quantization deployment, especially in memory-constrained scenarios.

## 2 Motivation

### 2.1 Compromised Performance of Activation Quantization

**Table 1: Performance of Atom-based quantization schemes with different weight and activation precision across diverse tasks. “Acc”, “PPL” and “EM” stand for accuracy, perplexity, and exact match, respectively, with arrows indicating their positive trends.**
| Task | Metric | W16A16 | Quantization |  |
| --- | --- | --- | --- | --- |
| Atom (W4A16) | Atom (W4A4) |  |  |  |
| WikiText-2 | PPL $\downarrow$ | 8.70 | 7.87 (+9.20%) | 8.58 (+1.15%) |
| PIQA (10-shot) | EM $\uparrow$ | 78.6 | 77.5 (-1.40%) | 75.6 (-3.81%) |
| MBPP (0-shot) | EM $\uparrow$ | 42.0 | 41.5 (-1.19%) | 30.5 (-27.38%) |
| GSM8K (8-shot) | EM $\uparrow$ | 79.0 | 73.4 (-7.09%) | 54.2 (-31.39%) |

State-of-the-art (SOTA) activation-weight joint quantization methods, like Atom (Zhao et al., ) and QuaRot (Ashkboos et al., ),
achieve notable speed-ups with negligible performance loss compared to weight-only ones. However, we argue that this conclusion is skewed by the limited evaluation benchmarks, which fail to capture the negative impacts of activation quantization.

To substantiate this claim, we conduct experiments on Llama-3-8B-Instruct models (Dubey et al., ) quantized with W16A16, W4A16, and W4A4 methods across four task datasets: PIQA (Bisk et al., ), WikiText-2 (Merity et al., ), GSM8K (Cobbe et al., ), and MBPP (Austin et al., ).
PIQA is a two-choice commonsense reasoning benchmark for physical knowledge, evaluated using classification accuracy, while WikiText-2 comprises a collection of high-quality Wikipedia articles, assessed for language fluency via perplexity (Jelinek et al., ). Both are commonly adopted in current quantization evaluations.
GSM8K includes diverse grade school mathematical problems, evaluated by “exact match” metrics; MBPP focuses on crowd-sourced Python programming challenges, assessed by accuracy.
Unlike the former two benchmarks, both GSM8K and MBPP necessitate auto-regressive multi-step reasoning abilities. While these critical abilities are propelled by the rapid advancement in LLMs recently, they have not yet been integrated into mainstream quantization evaluation. As shown in Table 1,
Atom-based quantization schemes show comparable (and even superior sometimes) performance to W16A16 across commonly adopted tasks such as on PIQA and WikiText-2, aligning with the claims in Zhao et al. ().
However, W4A4 suffers a nearly 30% average performance decline on complex reasoning tasks (i.e., on MBPP and GSM8K), whereas W4A16 only experiences about 4%.
This indicates that activation quantization leads to several times more performance degradation on multi-step reasoning tasks, despite the improved efficiency.
Besides, the performance trend observed on multi-step reasoning tasks shows a stronger correlation with quantization precision than perplexity does, validating their adequacy in assessing quantization performance.

In summary, activation quantization still incurs significant performance loss on more advanced multi-step reasoning tasks. This necessitates the inclusion of reasoning tasks in quantization evaluation for a more comprehensive assessment. On the other hand, this also underscores the demand for a quality-preserving yet efficient quantization paradigm.

### 2.2 High-Similarity Token Predictions

Figure: Figure 2: Scatter plot of token prediction probabilities for Atom-based W4A4 and W4A16 on GSM8K test set, along with their two-dimensional and marginal probability distributions. A striking similarity between the two quantization schemes is observed, laying the foundation of QSpec.
Refer to caption: extracted/5924778/figs/token_prediction.png

Despite the notable performance decline caused by activation quantization, we observe, more microscopically, high similarity in top-1 token predictions between quantization schemes with high and low precision activations.
Specifically, we first employ Atom-based W4A16 greedy sampling to generate the golden token sequences for the GSM8K test set, obtaining the prediction probabilities for each top-1 answer token. Subsequently, we perform one Atom-based W4A4 forward pass (i.e., prefill) on the concatenated input of each question and its corresponding golden answer to acquire the token probabilities as well. This allows us to assess the prediction discrepancy between W4A4 and W4A16.
As illustrated in Figure 2, we observe that
(1) the majority of token prediction probabilities of both W4A4 and W4A16 exceed 80%, and most of the tokens associated with high probabilities are accepted.
(2) Compared to accepted tokens, the number of rejected ones is negligible, underscoring the high similarity between the two quantization methods.
Combined with the analysis in Sec. 2.1, this can be interpreted that a small set of salient token variations can trigger a snowball effect of errors, especially on multi-step reasoning tasks where the subsequent steps are closely conditioned on the previous ones, akin to findings in Zhang et al. (), thus impairing the performance of the low-precision activation scheme.
Prior studies indicate that low similarity leads to frequent token rejections, thereby diminishing the efficiency of speculative decoding (Leviathan et al., ).
The observed high token-level similarity suggests that we could potentially restore the generation quality by detecting and correcting a limited number of generation errors incurred by activation quantization. This insight motivates us to propose a quantization-specific speculative decoding framework.

## 3 Method

Targeting an efficient quantization scheme without sacrificing performance or increasing memory consumption, we propose a new quantization paradigm called speculative decoding with complementary quantization execution (QSpec).
As shown in Figure 1, QSpec employs and-verpipeline for next-token prediction with varying activation precisions and shared low-precision quantized weights, instead of a constantsingleaquantization scheme.
The details are elaborated below, adhering to the core component breakdown of regular speculative decoding (Leviathan et al., ).

### 3.1 QSpec

Figure: Figure 3: A mini-sample of QSpec, where green, red, and purple tokens represent draft tokens, rejected tokens, and tokens generated directly by W4A16, respectively.
Refer to caption: x2.png

#### Draft Phase.

Current LLMs typically utilize an autoregressive process for next-token prediction, where a new token is drawn from a probability distribution conditioned on all previously generated tokens. This process can be formulated as:

$$ $t_{i+1}\sim p_{i+1}(t)\coloneqq\mathcal{M}(t_{i+1}|T_{\leq i}),$ (1) $$

where $\mathcal{M}$ denotes the model including the weight and activation configurations,
while $t_{i+1}$ and $T_{\leq i}$ represent the next predicted token and the preceding token sequence $(t_{0},t_{1},\ldots,t_{i})$, respectively.

Compared with previous research (Leviathan et al., ; Chen et al., ), on one hand, we employ a weight-shared quantization scheme with low-precision activations, rather than one standalone small-sized model, to speculate the next $\gamma$ tokens $\hat{T}_{i+1:i+\gamma}$ and their associated distributions $\hat{p}_{i+1:i+\gamma}(t)$. In $\hat{T}_{i+1:i+\gamma}$, each token $\hat{t}_{j}$ is sampled from $\mathcal{M}_{l}(\hat{t}_{j}|T_{\leq i},\hat{T}_{i+1:j-1})$, where $j\in[i+1,i+\gamma]$ and $\mathcal{M}_{l}$ represent our quantized model executed with low-precision activation.
On the other hand, our low-precision quantization scheme shares similar attributes as the draft model in Leviathan et al. (), as both can generate tokens rapidly, though with reduced quality.

#### Verify Phase.

To compensate for the performance decline incurred by excessive quantization, we employ a high-precision weight-only quantization scheme to verify the proposed draft token sequence. This ensures that the final generation quality aligns with that of a high-precision activation quantization scheme. All drafted tokens are verified in parallel for higher efficiency.

Formally, the high-precision quantization scheme $\mathcal{M}_{h}$ receives as input the concatenation of $T_{\leq i}$ and $\hat{T}_{i+1:i+\gamma}$, producing high-quality prediction probabilities ${p}_{i+1:i+\gamma+1}(t)$ through a single forward pass. Following this, an acceptance policy $\mathcal{A}$, which will be detailed later, is applied to rectify each drafted token sequentially.
Once a token $\hat{t}_{i+j}$ is rejected, all subsequent tokens are discarded, and token ${t}_{i+j}$ is resampled according to the distribution $p_{i+j}(t)$.
In the optimal scenario, all drafted tokens from the low-precision quantized model are accepted by the high-precision model. Subsequently, an additional token $t_{i+\gamma+1}$ is sampled from $p_{i+\gamma+1}(t)$. From this point, a new draft-verify cycle commences, persisting until the sequence is finalized.

#### Acceptance Policy.

To maintain high reproducibility, both low-precision and high-precision activation quantization schemes utilize greedy decoding throughout the generation process. This means that one drafted tokens $\hat{t}_{i+j}$ is accepted as ${t}_{i+j}$ only when the top-1 tokens from ${p}_{i+j}$ and $\hat{p}_{i+j}$ coincide; otherwise, this token is rejected.
Nonetheless, we claim that alternative strategies, as outlined in Leviathan et al. (), can be directly applied to our method due to the similarities in the framework.
Figure 3 illustrates a mini-sample of this cycle with the draft token length $\gamma=4$. The model initially speculates four tokens using W4A4 scheme. Subsequently, adhering to a predefined acceptance policy, it accepts all drafted tokens after verifying them through the W4A16 scheme. In the second loop, however, only the first two tokens are accepted. A new token “is” is directly derived from the prediction probability of W4A16 scheme, and another draft-verify cycle will commence from the ninth token.

#### KV Cache Overwriting.

To further reduce memory consumption, QSpec overwrites KV caches of low-precision activation quantization with those of high-precision method.
Specifically,
compared to W4A4, W4A16 is expected to yield a higher quality FP16 KV cache due to higher activation precision.
Alongside the shared weights, this naturally allows overwriting the low-quality KV caches generated by W4A4 with those from W4A16 for accepted tokens after each validation phase.
This enables W4A4 to condition on high-quality KV caches for subsequent autoregressive generation,
and saves the memory occupation of W4A4 KV caches, despite requiring negligible buffer space for temporarily storing.
To some extent, this operation aligns with the settings of attention kernels in prior works (Zhao et al., ; Shao et al., ; Ashkboos et al., ), where INT4 KV caches are typically dequantized to FP16 before or during precision-sensitive attention operations to ensure accurate computations.

### 3.2 Advantage Analysis

**Table 2: Comparison of individual quantization schemes, regular speculative decoding, and QSpec across memory, computation, and generation aspects.**
| Method | Memory | Computation | Generation |  |  |  |
| --- | --- | --- | --- | --- | --- | --- |
| Draft Weight | Draft KV | W4A4 Kernel | Draft-Verify | High Acceptance Rate | High Fidelity |  |
| W4A16 | ✗ | ✗ | ✗ | ✗ | - | ✓ |
| W4A4 | ✗ | ✗ | ✓ | ✗ | - | ✗ |
| Speculative Decoding | ✓ | ✓ | ? | ✓ | ? | ✓ |
| QSpec | ✗ | ✗ | ✓ | ✓ | ✓ | ✓ |

As shown in Table 2, we compare QSpec with individual quantization schemes (i.e., W4A4 and W4A16) as well as speculative decoding across the dimensions of memory, computation, and generation.
QSpec offers several key advantages over these methods, detailed as follows:

- •
Memory-efficient.
Quantization is often motivated by memory constraints, rendering regular speculative decoding unsuitable due to the additional memory allocation for the weights and KV caches of the draft model. However, QSpec addresses these memory overheads by sharing weights and overwriting KV caches, aligning with the costs associated with standalone high-precision activation quantization.
- •
No efficiency-efficacy trade-off.
Leveraging the speculative decoding framework, QSpec achieves efficiency gains without any quality sacrifice, thereby avoiding the trade-off between efficiency and efficacy. In contrast, individual quantization methods either endure significant performance degradation or accept reduced inference speed.
- •
High acceptance rate.
The shared weights inherently enable a strong similarity between the two quantization methods. Besides, the KV cache overwriting further enhances the consistency of subsequent predictions. Both factors collectively contribute to a high token acceptance rate of QSpec.
- •
Plug-and-play compatibility.
Compared to individual quantization schemes, QSpec simply integrates an acceptance policy and a KV cache overwriting operation. This allows QSpec to be swiftly implemented based on existing quantization codes without extensive modifications. Furthermore, QSpec operates without additional training or classifiers, enabling its direct application to any existing model for enhanced inference efficiency.

## 4 Experiments

Our evaluation answers three key questions:

- Q1:
Does QSpec serve as a general solution without compromising quality compared to high-precision weight-only quantization methods? (Sec. 4.2)
- Q2:
Does QSpec consistently accelerate high-precision weight-only quantization methods? (Sec. 4.3)
- Q3:
What is the common acceptance rate of QSpec, and how does the length of draft tokens affect it? (Sec. 5)

### 4.1 General Setup

Benchmarks.
We assess QSpec with two primary criteria: (1) generation fidelity and (2) end-to-end serving speedup. For fidelity evaluation, we adopt not only traditional tasks, including PIQA (500, 10-shot) (Bisk et al., ), WinoGrande (500, 5-shot) (Sakaguchi et al., ), and WikiText2 (Merity et al., ), but also challenging multi-step reasoning tasks such as GSM8K (All, 8-shot) (Cobbe et al., ), MATH (All, 4-shot) (Hendrycks et al., ), MBPP (200, 0-shot) (Austin et al., ), and HumanEval (All, 0-shot) (Chen et al., ). To measure the acceleration, we use all the above reasoning tasks and two additional chatbot datasets, namely ShareGPT (RyokoAI, ) and LMsys-1K (Zheng et al., ). Following the setup of Atom (Zhao et al., ), we randomly sampled the dataset for the request prompts to reduce the workload. Due to memory limitations, we vary the batch size from 8 to 32 and serve all requests in a first-come, first-served (FCFS) manner. Once any request is finished, we refill the batch, adhering to the continuous batching approach of ORCA (Yu et al., ). We use greedy sampling for token generation.

Base Models.
To assess the effectiveness and scalability of our approach, we conduct experiments using multiple models from the Llama family (Dubey et al., )(^1^11[https://www.huggingface.co/meta-llama](https://www.huggingface.co/meta-llama)) with varying scales and capacities:
Llama3.2-3b, Llama2-7b, Llama3-8b-instruct, and Llama2-13b.

#### Implementation.

All experiments are performed on a node equipped with four NVIDIA A100 GPUs (40GB HBM each) running CUDA 12.5.
To demonstrate the versatility of QSpec, we implement two SOTA 4-bit quantization methods, namely Atom (Zhao et al., ) and QuaRot (Ashkboos et al., ). For W4A16 configurations, we incorporate AWQ-style (Lin et al., ) weight dequantization logic for runtime inference. We select Atom to showcase the acceleration of QSpec. We use these Group-wise quantization schemes with a group size of 128.
With the draft token length $\gamma$ as 3, we simulate the performance of QSpec by initially employing fake quantization to fully emulate the execution flow, encompassing both the draft and verify stages of QSpec. Subsequently, we replay the collected traces with real kernel execution to accurately reproduce the latency.(^2^22Atom’s kernel only supports shape-specific models. We modify the model structure to meet requirements while maintaining the original model size.)

### 4.2 Fidelity Evaluation

**Table 3: Performance of different quantization methods across multiple general and reasoning benchmarks: PIQA, WinoGrande, GSM8K, MATH, MBPP, and HumanEval. The quality degradation ratio is calculated by $1-\frac{W4A4}{W4A16}$.**
| Method | Quantization | WikiText-2(^5^5footnotemark: 5) | PIQA | WinoGrande | GSM8K | MATH | MBPP | HumanEval |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| PPL $\downarrow$ | EM (%) $\uparrow$ | EM (%) $\uparrow$ | EM (%) $\uparrow$ | EM (%) $\uparrow$ | Pass@1 (%) $\uparrow$ | Pass@1 (%) $\uparrow$ |  |  |
| Atom | W4A16 | 7.87 | 74.8 | 62.0 | 73.4 | 24.3 | 41.5 | 52.4 |
| QSpec | 7.87 | 75.0 | 62.0 | 73.4 | 24.3 | 39.0 | 52.4 |  |
| W4A4 | 8.6 (-9.58%) | 65.8 (-12.03%) | 56.2 (-9.35%) | 54.7 (-25.47%) | 15.5 (-36.21%) | 30.5 (-26.50%) | 31.7 (-39.50%) |  |
| QuaRot | W4A16 | 8.58 | 74.2 | 59.4 | 70.5 | 25.1 | 40.0 | 45.7 |
| QSpec | 8.58 | 74.4 | 59.2 | 71.0 | 24.7 | 40.5 | 47.6 |  |
| W4A4 | 10.2 (-19.24%) | 62.6 (-15.63%) | 53.8 (-9.43%) | 42.0 (-40.43%) | 12.3 (-51.11%) | 28.5 (-28.75%) | 28.0 (-38.73%) |  |

QSpec effectively maintains the generation quality of W4A16, whereas W4A4 does not. As listed in Table 3,
with the draft verification of W4A16, QSpec exhibits only minimal performance fluctuations compared to W4A16. This negligible variation may stem from the nondeterministic algorithms of PyTorch(^3^33[https://pytorch.org/docs/stable/notes/randomness.html](https://pytorch.org/docs/stable/notes/randomness.html)) or occasional cases where two tokens have the same maximum prediction probability.
In contrast, W4A4 experiences a substantial performance decline exceeding 10% across most tasks, with the reduction becoming more pronounced as task difficulty increases. For instance, compared to GSM8K and MBPP, the performance drop for W4A4 is much greater on the more challenging MATH and HumanEval tasks, showing declines of 51.11% and 38.73%, respectively.
On the other hand, this also highlights the higher sensitivity of multi-step reasoning tasks to the negative effects of quantization compared to regular tasks, such as WikiText-2(^4^44To measure perplexity, only a single prefill stage is necessary, bypassing the verify stage.) and WinoGrande.
This observation aligns with our earlier analysis in Sec. 2, encouraging incorporating multi-step reasoning tasks into quantization evaluation.

### 4.3 Acceleration Evaluation

**Table 4: Comparison of token generation throughput across different model sizes, quantization configurations, and batch sizes for various datasets. All values are measured in token/s. “Avg.” denotes the average speedup ratio for the corresponding row or column.**
| Model | Method | Batch | GSM8K | MATH | MBPP | HumanEval | ShareGPT | LMsys-1k | Avg. |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 3B(^1^1footnotemark: 1) | W4A16 | 8 | 326.1 | 360.2 | 429.0 | 392.4 | 434.7 | 401.7 | – |
| 16 | 529.1 | 653.8 | 820.3 | 673.2 | 882.2 | 772.9 | – |  |  |
| 32 | 679.2 | 906.8 | 1261.4 | 848.4 | 1439.3 | 1103.6 | – |  |  |
| QSpec | 8 | 501.5 (1.54$\times$) | 537.2 (1.49$\times$) | 640.4 (1.49$\times$) | 593.1 (1.51$\times$) | 646.6. (1.49$\times$) | 592.7 (1.48$\times$) | 1.50$\times$ |  |
| 16 | 731.9 (1.38$\times$) | 837.8 (1.28$\times$) | 863.2 (1.17$\times$) | 875.9 (1.30$\times$) | 1081.4 (1.23$\times$) | 945.0 (1.22$\times$) | 1.24$\times$ |  |  |
| 32 | 950.3 (1.40$\times$) | 1175.8 (1.30$\times$) | 1371.0 (1.09$\times$) | 1052.3 (1.24$\times$) | 1645.9 (1.14$\times$) | 1347.6 (1.22$\times$) | 1.23$\times$ |  |  |
| Avg. | 1.44$\times$ | 1.36$\times$ | 1.25$\times$ | 1.35$\times$ | 1.29$\times$ | 1.31$\times$ | 1.33$\times$ |  |  |
| 7B | W4A16 | 8 | 126.8 | 144.1 | 165.0 | 170.4 | 177.1 | 157.0 | – |
| 16 | 213.1 | 267.2 | 314.9 | 344.6 | 358.6 | 300.8 | – |  |  |
| 32 | 257.6 | 347.1 | 409.7 | 478.9 | 509.1 | 402.0 | – |  |  |
| QSpec | 8 | 203.7 (1.61$\times$) | 239.9 (1.66$\times$) | 234.8 (1.42$\times$) | 281.5 (1.65$\times$) | 274.4 (1.55$\times$) | 241.4 (1.54$\times$) | 1.57$\times$ |  |
| 16 | 312.3 (1.47$\times$) | 377.6 (1.41$\times$) | 380.1 (1.21$\times$) | 459.6 (1.33$\times$) | 455.2 (1.27$\times$) | 379.5 (1.26$\times$) | 1.33$\times$ |  |  |
| 32 | 496.2 (1.54$\times$) | 488.5 (1.41$\times$) | 473.4 (1.16$\times$) | 620.2 (1.30$\times$) | 633.1 (1.24$\times$) | 498.3 (1.24$\times$) | 1.31$\times$ |  |  |
| Avg. | 1.54$\times$ | 1.50$\times$ | 1.26$\times$ | 1.43$\times$ | 1.35$\times$ | 1.35$\times$ | 1.40$\times$ |  |  |
| 8B | W4A16 | 8 | 121.8 | 131.2 | 155.2 | 153.4 | 163.8 | 152.4 | – |
| 16 | 210.3 | 247.0 | 300.7 | 293.5 | 365.6 | 311.2 | – |  |  |
| 32 | 277.1 | 355.3 | 425.1 | 398.7 | 619.1 | 486.5 | – |  |  |
| QSpec | 8 | 191.7 (1.57$\times$) | 200.4 (1.53$\times$) | 214.4 (1.38$\times$) | 230.1 (1.50$\times$) | 241.0 (1.47$\times$) | 220.6 (1.45$\times$) | 1.48$\times$ |  |
| 16 | 294.2 (1.40$\times$) | 333.4 (1.35$\times$) | 334.1 (1.11$\times$) | 373.0 (1.27$\times$) | 431.7 (1.18$\times$) | 373.4 (1.20$\times$) | 1.25$\times$ |  |  |
| 32 | 368.8 (1.33$\times$) | 447.5 (1.26$\times$) | 478.1 (1.12$\times$) | 484.2 (1.21$\times$) | 687.3 (1.11$\times$) | 564.1 (1.16$\times$) | 1.20$\times$ |  |  |
| Avg. | 1.43$\times$ | 1.38$\times$ | 1.21$\times$ | 1.33$\times$ | 1.25$\times$ | 1.27$\times$ | 1.31$\times$ |  |  |
| 13B(^1^1footnotemark: 1) | W4A16 | 8 | 74.0 | 85.1 | 103.7 | 100.5 | 104.1 | 92.3 | – |
| 16 | 128.6 | 163.0 | 185.8 | 177.7 | 222.8 | 173.1 | – |  |  |
| 32 | 195.1 | 206.9 | 323.7 | 327.8 | 330.1 | 241.6 | – |  |  |
| QSpec | 8 | 127.8 (1.73$\times$) | 148.6 (1.75$\times$) | 173.4 (1.67$\times$) | 180.8 (1.80$\times$) | 173.5 (1.68$\times$) | 150.2 (1.63$\times$) | 1.71$\times$ |  |
| 16 | 194.7 (1.51$\times$) | 235.4 (1.44$\times$) | 285.9 (1.54$\times$) | 292.5 (1.65$\times$) | 288.7 (1.30$\times$) | 222.9 (1.29$\times$) | 1.45$\times$ |  |  |
| 32 | 247.1 (1.27$\times$) | 307.4 (1.49$\times$) | 399.9 (1.24$\times$) | 435.3 (1.33$\times$) | 407.1 (1.23$\times$) | 323.3 (1.34$\times$) | 1.31$\times$ |  |  |
| Avg. | 1.50$\times$ | 1.56$\times$ | 1.48$\times$ | 1.59$\times$ | 1.40$\times$ | 1.42$\times$ | 1.49$\times$ |  |  |

QSpec exhibits a substantial efficiency boost compared to W4A16.
In Table 4, we present the token generation throughput for both QSpec and W4A16 across different model sizes, quantization configurations, and batch sizes on diverse datasets. On average, QSpec achieves a throughput increase of $1.38\times$ over W4A16 across all settings, with a peak improvement of $1.80\times$.

Speedup does not show an evident correlation with task difficulty.
As shown at the bottom of Table 4, we calculate the average acceleration ratios across all configurations for each dataset. When comparing on simpler dialogue datasets (i.e., ShareGPT and LMsys-1k), QSpec exhibits negligible throughput variation on multi-step reasoning tasks, particularly on coding tasks, despite a more pronounced performance decline of W4A4.
Even on GSM8K and MATH tasks, a higher throughput is observed, due to the application of 8-shot and 4-shot prompts, respectively.
This finding supports our observations in Sec. 2, where we attribute the reduction in multi-step reasoning capabilities to a few token changes that cause a worsening snowball effect, rather than numerous token prediction errors.

Larger models tend to yield better speedup ratios.
We compare the average acceleration on all datasets across different models, and find a gradually-increasing acceleration as the base model scales up(^5^55It is noteworthy that Llama2-7B shows higher speedup than Llama3-8B. This stems from the size difference primarily related to vocabulary, coupled with the introduction of Group-Query Attention (Ainslie et al., ), reducing the non-attention computation workload.).
This overall upward trend indicates a promising outlook for our approach with larger models, although further experiments are needed for confirmation. Due to resource limitations, this will be addressed in future work.

Figure: Figure 4: Per-valid-token latency comparison of QSpec and W4A16 across different models and batch sizes. The latency of QSpec is further decomposed into draft and verify categories.
Refer to caption: x3.png

Latency Composition.
As illustrated in Figure 4, we compute the per-valid-token latency by dividing the total latency by only the number of accepted tokens before averaged on all evaluation datasets. Notably, QSpec achieves remarkable latency savings ranging from 35.2% to 50.2%.
Besides, the per-token latency is further decomposed into two components: draft and verify latency.
Clearly, the primary gains of QSpec arise from the rapid drafting capability and the reduced latency achieved through the parallel verification of multiple tokens.

Figure: (a) Llama3.2-3b
Refer to caption: extracted/5924778/figs/Llama_3B_throughput_accept_rate.png

Ablation on Draft Token Length.
To assess parameter sensitivity, we vary the draft token lengths $\gamma$, the sole hyper-parameter of QSpec, from 2 to 7 across all the benchmarks using Llama3-8b-instruct and Llama3.2-3b models.
As depicted in Figure 5,
an increase in $\gamma$ leads to a gradual decline in the token acceptance rate, since all subsequent tokens are discarded once a token is rejected.
Nevertheless, even at $\gamma=7$, the token acceptance rate remains relatively high, approximately $70\%$, compared to $28\sim 58\%$ in 160m-7b draft-target model pair under $\gamma=5$ in conventional speculative decoding (Liu et al., ).
Additionally, a consistent improvement in throughput is observed compared to W4A16, indicating the robustness of QSpec with respect to $\gamma$.

## 5 Related work

Quantization is a common technique for deploying LLMs on resource-limited scenarios.
Broadly, recent quantization algorithms can be classified into two categories: weight-only W4A16 and weight-activation joint W4A4.
Notably, AWQ (W4A16) (Lin et al., ) redistributes the quantization burden by scaling salient weight channels to protect them from degradation. In contrast, W4A4 aggressively quantizes activations to leverage low-precision hardware for improved speed at the cost of model quality degradation. To address this challenge, Atom (Zhao et al., ) proposes reordering outlier channels in the activation through offline profiling. Similarly, QuaRot (Ashkboos et al., ) employs Hadamard matrices to apply computational invariance on weights. Despite these advancements, our observations indicate that W4A4 methods still exhibit substantial degradation compared to weight-only quantization approaches across multi-step reasoning tasks.
On the other hand, adaptive quantization aims to optimize the trade-off between quantization-induced quality degradation and computational acceleration by mixed precision. LLM-PQ (Zhao et al., ) proposes an adaptive layer-wise bitwidth selection approach, while QAQ (Dong et al., ) focuses on KV-cache bitwidth optimization. Other works operate at finer granularity to address outliers (Lee et al., ). However, these methods cannot fully recover the generation quality of higher precision.

Speculative Decoding leverages a draft model to generate candidate tokens, which are then validated by a target model (Leviathan et al., ). Recent research has primarily focused on improving the acceptance rate and generation speed of candidate tokens. SpecInfer (Miao et al., ) introduces a boost-tuned small language model to generate candidate tokens in tree structures, enabling single-pass verification. In contrast, EAGLE (Li et al., ) adopts an aggressive pruning strategy for the draft model’s architecture, allowing penultimate layer feature prediction with minimal computational overhead. Self-speculative decoding, a subset of this technique, employs a single model for both draft generation and verification. LayerSkip (Elhoushi et al., ) introduces a training methodology for early exit with layer drop, subsequently verifying partially generated tokens through full model inference. Medusa (Cai et al., ) constructs a generation tree of multiple candidate continuations by augmenting the original LLM with additional heads atop the final hidden state while relaxing the acceptance policy. However, these approaches inevitably require retraining of the original model, which can be computationally expensive and time-consuming.

#### Parameter Sharing

has been extensively applied for various purposes in previous research.
Targeting parameter savings, Universal Transformer (Dehghani et al., ) shares all layers within a transformer model,
while Subformer (Reid et al., ) shares its middle layers without sacrificing performance.
Similarly, DictFormer (Lou et al., ) reparameterizes the model using a shared dictionary alongside unshared coefficients and indices, achieving reduced parameter redundancy and faster computations.
Pires et al. () enhances both accuracy and latency by implementing a single, larger shared feed-forward network across the encoder.
In a different domain, Wang et al. (; ) and Kopiczko et al. () leverage parameter sharing in low-rank adaptation (LoRA) (Hu et al., ) to improve parameter efficiency.
Unlike these methods, our focus is on sharing low-precision weights from two quantization schemes to maintain memory overhead.

## 6 Conclusion

In this paper, we begin by validating that multi-step reasoning tasks can capture performance degradation incurred by activation quantization more sensitively and consistently than current evaluation protocols, advocating for their incorporation for a more comprehensive assessment.
With nearly cost-free execution switching and high token-level similarities, we introduce QSpec, a novel quantization paradigm that seamlessly synergizes two complementary weight-shared quantization schemes with speculative decoding.
Empirically, QSpec achieve up to $1.80\times$ acceleration without any quality sacrifice across diverse settings. Alongside consistent memory consumption and a plug-and-play property, these advantages distinguish QSpec from any existing solution, promising it for high-fidelity quantization deployment, particularly in memory-constrained scenarios.

## Appendix A Evaluation Datasets

We utilize the following datasets for evaluation:

### A.1 Language Modeling and Commonsense Reasoning

- •
WikiText-2 (Merity et al., ): A language modeling dataset comprising over 100 million tokens extracted from high-quality Wikipedia articles.
- •
PIQA (Bisk et al., ): A benchmark for physical commonsense reasoning, focusing on questions about everyday physical interactions.
- •
Winogrande (Sakaguchi et al., ): A dataset of 44,000 problems inspired by the Winograd Schema Challenge, designed to test commonsense reasoning with reduced linguistic biases.

### A.2 Mathematical Reasoning

- •
GSM8K (Cobbe et al., ): A collection of 8,500 linguistically diverse grade school math problems that require multi-step reasoning using basic arithmetic operations.
- •
MATH (Hendrycks et al., ): A dataset of 12,500 challenging competition-level math problems, each accompanied by detailed step-by-step solutions.

### A.3 Programming Problems

- •
MBPP (Austin et al., ): A benchmark of approximately 1,000 beginner-level Python programming problems, each with a task description, solution code, and automated test cases.
- •
HumanEval (Chen et al., ): An evaluation set of 164 original programming problems used to assess functional correctness in code synthesis from docstrings.

### A.4 Chatbot Datasets

- •
ShareGPT52K (RyokoAI, ): This dataset comprises approximately 52,000 conversations collected via the ShareGPT API before it was discontinued. The dataset captures both user prompts and the corresponding responses from OpenAI’s ChatGPT, providing insights into human-AI dialogue dynamics.
- •
LMsys-chat-1M-1K Zheng et al. (): Gathering one million authentic conversations with 25 leading large language models (LLMs), this dataset was sourced from over 210,000 unique IP addresses interacting with the Vicuna demo and Chatbot Arena websites.

## Appendix B Datasets Sampling

To construct our test sets, we randomly sampled from the original datasets using torch.sample with a fixed seed of 42, and constructed them as prompt instructions following the Open-Instruct templates (Wang et al., ). The sample sizes for each dataset are as follows:

- •
Fidelity Evaluation:
–
WikiText-2: All samples
–
PIQA: 500 samples
–
Winogrande: 500 samples
–
GSM8K: 200 samples
–
MATH: 700 samples, balanced by selecting 100 questions from each of the seven distinct question types
–
MBPP: 200 samples
–
HumanEval: All samples
- •
Acceleration Evaluation: 100 samples from each dataset, maximum output length set to 200 tokens.

## Appendix C Recommended Applications

We further analyze the best practice for efficiently deploying QSpec based on our empirical results:

#### Higher Matrix Multiplication Cost.

The primary advantage of low-precision quantization over weight-only quantization lies in their ability to better utilize non-attention compute kernels for speedup. However, certain architectural choices, such as Group-Query Attention (Ainslie et al., ) reduce the general matrix multiplication (GEMM) cost in the QKV (query, key, value) computations, which in turn diminishes the overall speedup of Llama3-8b compared to Llama2-7b.

#### Appropriate Batch Size.

The optimal performance of QSpec requires an appropriately sized batch. Specifically, the batch size should be neither too large nor too small. Excessively large batch sizes can cause the performance W4A16 verify to degrade as it scales proportionally with $\gamma$. Conversely, very small batch sizes are also suboptimal because low-precision kernels are most effective when computations are compute-bound; only memory footprint reductions offer benefits if computations are memory-bound. Moreover, excessive small batch size may not meet the tensor shape requirements necessary to exploit tensor cores (Zhao et al., ) fully.

Additionally, in our experiments, we observed that some requests fail to generate the correct termination token and instead continue generating until they are truncated at the maximum generation length. As batch size increases, these excessively long requests are redundantly computed up to their maximum sequence length within the computing batch due to the first-in, first-out mechanism. This negative impact is magnified with larger batch sizes and draft-verify mechanism, reducing overall pipeline efficiency. This effect is particularly pronounced for the MBPP and HumanEval datasets, where the ratio of maximum length to average generation length is relatively large. Consequently, pipeline efficiency decreases further, leading to significant performance degradation with larger batches. Implementing appropriate early exit criteria would address this issue.

These observations suggest that QSpec is particularly well-suited for applications involving, non-attention compute-intensive and moderate batch sizes, where its advantages can be fully leveraged for optimal performance.

## Peer Reviews

confidence: 5
contribution: 2
initial_rating: 5
presentation: 3
questions: Why does the speedup ratio relative to W4A16 decline as the batch size increases, as depicted in Table 4? I'm intrigued by the overall inference latency difference between the W4A16 and W4A4 models. Could you provide the latency of W4A4 and W4A16 at both the generation and prefilling stages?
soundness: 3
strengths: 1. The authors highlight that quantized models perform worse on generation tasks (e.g., code and math) compared to multiple-choice tasks, particularly when using 4-bit quantized activations. This is a significant issue that the community should address.

2. To my knowledge, this paper is the first to combine quantization and speculative decoding. The authors analyze their compatibility, focusing on token prediction similarity, acceptance rate, shared weights, and key-value caches.
summary: This paper introduces a new method called QSPEC, which seamlessly integrates two complementary quantization schemes for speculative decoding. QSPEC utilizes W4A4 quantized LLMs to draft tokens and verifies these drafted tokens with W4A16 quantized LLMs, achieving results comparable to those of W4A16 quantized LLMs in generation tasks.
weaknesses: 1. The novelty of this paper is limited. While the combination of speculative decoding and quantization is an interesting topic, the authors do not introduce any new methods. I suggest that the authors explore ways to enhance quantization methods in speculative decoding. For instance, do different quantization techniques, such as Atom and QuaRot, result in varying acceptance rates?

2. It is recommended to make more comparisons with previous speculative decoding methods in order to better demonstrate the benefits of integrating quantization into speculative decoding in Table 4. Due to the shared weights and key - value cache, the memory consumption might be one of the advantages of this method, and this aspect can also be added to Table 4.

3. The speedup ratio compared with previous speculative decoding methods such as Medusa and EAGLE is weak.

---

confidence: 4
contribution: 2
initial_rating: 5
presentation: 3
questions: 1) How would your method compare in speedup to other lossless speculative decoding methods, namely Eagle2, Medusa2 (with top speedups), BiTA (with negligible VRAM overhead).

2) How would your method performs with tree-based speculation?

3) Is the method good for batched generation? What is its performance vs batch size?

4) please report your observed acceptance rates
soundness: 2
strengths: It is an elegant idea to use faster 4b quantized activations for drafting, and use full 16b activations for decoding - it saves the memory for weights and helps to align draft / target distributions.
summary: The paper brings an elegant idea to use faster 4b quantized activations for drafting, and use full 16b activations for decoding.

There are significant weaknesses in completeness of the analysis, specifically lack of comparison with other quantization methods in terms of speedup.
weaknesses: 1) The paper does not reported acceptance rates

2) The paper no comparison to other lossless speculative decoding methods, namely Eagle2, Medusa2 with top speedups, BiTA with negligible VRAM overhead.

3) table 1: WikiText-2 PPL # 8.70 7.87 (+9.20%) 8.58 (+1.15%) - why ppl is lower for W4 methods? 

4) table 4: 7B W4A16 HumanEval seems too fast (300+ vs other methods)

5) the paper fails to notice that W4A4 is more memory efficient - need to compare using same memory budget

6) the abstract should mention average improvement, not peak

7) Since this is a lossless method, tests should mostly focus on speed, not on quality. So please add speedup comparisons vs other quantization methods, not just to W4A16 baseline.

8) Llama family should refer to L2 paper, not just L3

9) Table4 - add model names

---

confidence: 3
contribution: 2
initial_rating: 5
presentation: 3
questions: - Could the authors provide the accuracy of the FP16 models in Tables 1 and 3?
- Could the authors provide the throughput of the FP16 and W4A4 models in Table 4 as well as in Figures 4 and 5?
- Could the authors include a figure illustrating the throughput and accuracy trade-offs for the proposed framework compared to all baselines?
soundness: 2
strengths: The paper presents an interesting observation that claims of "lossless" performance in many quantization studies are often skewed by limited evaluation benchmarks, which overlook the negative impacts of activation quantization. To address this issue, the authors propose a weight-sharing mixed-precision speculative decoding framework. Unlike conventional heterogeneous speculative decoding, which uses a small model for drafting and a significantly larger model for verification, the authors argue that homogeneous speculative decoding with weight-sharing is more suitable for edge scenarios. Although the framework may appear similar to conventional speculative decoding, experiments demonstrate its advantages in both accuracy and throughput.
summary: The authors propose a weight-sharing speculative decoding framework for quantized models with varying activation precisions. The core insight of this work is that aggressive weight-activation quantization methods, such as W4A4, often result in performance degradation on complex multi-step reasoning tasks. To address this performance gap while retaining the efficiency of low bit-width models, the framework employs W4A4 to draft the output and W4A16 to verify it, sharing 4-bit weights but producing outputs at different precisions. The KV-cache is subsequently updated by the high-precision model, enhancing the framework with a high-quality KV-cache. Experiments demonstrate that the framework achieves comparable performance to full W4A16 models, while delivering higher throughput with W4A4-based drafting.
weaknesses: While the observation and intuition behind this work are compelling, some experiments seem to be missing, which weakens the support for the authors' claims. For instance, Tables 1 and 3 lack comparisons with FP16 models. Demonstrating the performance differences between FP16 and W4A16 on complex multi-step reasoning tasks would help the community better understand the true performance gaps between FP16 models and their quantized counterparts. Additionally, Table 4 lacks throughput evaluations for W4A4. Including a latency and accuracy trade-off comparison between the framework and FP16, W4A16, and W4A4 models would provide valuable insights. The absence of these experiments may mislead readers and hinder a full assessment of the proposed framework. I am willing to raise my score if authors address aforementioned issues.

---

confidence: 3
contribution: 2
initial_rating: 5
presentation: 3
questions: Have you considered the scenario where a draft model is significantly smaller than the verification model and fine-tuned specifically to maximize acceptance rates? Are the memory benefits from weight sharing still large enough to warrant using QSpec over such an approach?
soundness: 3
strengths: Improving the HW performance of multi-step reasoning is a relevant and impactful problem. The authors provide a very insightful analysis into both the impact of quantization on multi-step reasoning and the impact of activation quantization on token prediction probabilities, both of which are novel insights to my knowledge.
summary: The authors investigate the impact of LLM quantization on multi-step reasoning tasks and find that current methods are insufficient in some cases. They introduce a system design for speculative decoding where activation quantization is disabled during the verification stage. They find that this can improve HW performance without degrading model quality.
weaknesses: While the results are promising, the benchmarking may be incomplete. As an alternative to this approach, one could just use a smaller draft model without weight sharing assuming memory is not a constraint. Often the significantly smaller draft model is tuned to the verification model to improve acceptance rates. There is no comparison against this dual-model architecture to establish a concrete baseline. As such, it is unclear which approach one should take.

Meta-review: This paper introduces QSPEC, a method that combines low-precision (W4A4) and high-precision (W4A16) quantization schemes to improve token generation throughput in large language models (LLMs) through speculative decoding. The method drafts tokens with low-precision quantization and verifies them with high-precision quantization, offering up to 1.78x throughput improvement without sacrificing output quality. The approach is claimed to be memory-efficient, leveraging shared weights and key-value caches, and does not require retraining, making it suitable for memory-constrained environments.

The paper demonstrates clear performance gains in token generation throughput, making it a relevant contribution for improving the efficiency of LLMs. The empirical results are promising, showing improvements across various tasks, model sizes, and batch sizes. Additionally, the method avoids increasing memory consumption by reusing weights and key-value caches, which is beneficial for deployment in resource-limited scenarios. The fact that the method does not require retraining is another practical advantage, facilitating easy adoption.

Reviewers raised concerns about the limited novelty of the paper, as it primarily integrates existing quantization techniques (W4A4 and W4A16) with speculative decoding. They also requested more robust comparisons, particularly with other low-bitwidth quantization methods like EAGLE and W4A4, and more detailed performance metrics (e.g., speedup vs. batch size vs. quality). Although the authors provided a detailed rebuttal and made some revisions, these concerns were not fully addressed.

The paper lacks significant novelty, relying on existing quantization techniques and speculative decoding without introducing fundamentally new methods. While the empirical results are promising, the comparisons with other methods remain insufficient, and the revisions did not fully address the key concerns raised by the reviewers. Given the highly competitive nature of the review process this year and the unresolved issues, the paper does not meet the acceptance criteria and is therefore rejected.

Decision: Reject