Manuscript Offprint
arXiv:2611.01704MatMoE: Matryoshka Mixture-of-Experts with Dynamic Mixed-Precision Quantization for Efficient Inference
Abstract
Mixture-of-Experts (MoE) architecture has been widely adopted in large language models (LLMs) since it reduces the computational cost through sparse expert activation. However, the massive parameter scale of MoE models hinders their deployment on resource-constrained edge devices. Although existing mixed-precision quantization reduces the model size, they are inherently static, fixing the bit-width of each expert across decoding steps. Such static schemes yield suboptimal performance as they overlook the dynamic variation in expert importance during decoding. Furthermore, they fail to adapt to the dynamic latency constraint driven by the fluctuating system utilization. To address these challenges, we propose MatMoE, a dynamic mixed-precision quantization framework for efficient MoE inference. MatMoE features: (1) a Matryoshka MoE PTQ algorithm that enables experts to operate flexibly at multiple precisions within a stringent memory budget; (2) a floor-and-compensation quantization method that eliminates redundant memory accesses in the Matryoshka representation; and (3) a dynamic bit-width allocation strategy that determines the precision for each expert based on their routing scores to satisfy the dynamic latency requirement. We implement our MatMoE system atop llama.cpp for both CPU and GPU platforms. Extensive evaluations across three modern MoE models and challenging benchmarks demonstrate that MatMoE achieves 4.0% ~ 18.3% higher accuracy than state-of-the-art static mixed-precision method. Compared to llama.cpp, MatMoE delivers 1.3× ~ 3.7× speedup on Raspberry Pi 5, and 1.2× ~ 1.3× speedup on NVIDIA RTX 4090 and Jetson AGX Orin.
ACM Reference Format:
Renjie Wei , Haochen Huang , Chuyu Qiu , Jinqi Wen , Dehao Xu , Meng Li . 2026. MatMoE: Matryoshka Mixture-of-Experts with Dynamic Mixed-Precision Quantization for Efficient Inference. In IEEE/ACM International Conference on Computer-Aided Design (ICCAD '26), November 08–12, 2026, San Jose, CA, USA. ACM, New York, NY, USA, 9 pages. https://doi.org/10.1145/3831252.3834128
Corresponding author: meng.li@pku.edu.cn.

This work is licensed under a Creative Commons Attribution 4.0 International License. ICCAD '26, San Jose, CA, USA
© 2026 Copyright held by the owner/author(s).
ACM ISBN 979-8-4007-2873-0/2026/11
https://doi.org/10.1145/3831252.3834128

Figure 1: MoE architecture and the comparison between the static and our proposed dynamic mixed-precision quantization. Static method assigns each expert a fixed bit-width offline, regardless of the input token. In contrast, our method dynamically assigns higher precision to more important activated experts and lower precision to less important ones.
achieve better scalability and performance than dense LLMs with comparable active parameter counts. However, their large model size incurs substantial memory overhead, hindering deployment on resource-constrained edge devices.
Quantization is an effective way to reduce the model size. Compared to uniform bit-width quantization, mixed-precision quantization [5, 6, 34] can achieve better performance under the same memory budget by selectively assigning higher bit-widths to the more critical layers. Recent studies have focused on mixed-precision quantization on MoE models [10, 13–15, 19, 35]. They observe that experts are not equally important and assign different bit-widths to experts according to their importance. However, these methods are static, i.e., determining the bit-width allocation strategy based on a calibration dataset and fixing it throughout the decoding steps. Yet, we observe that the expert importance varies across decoding steps. As shown in Fig. 1, the static mixed-precision quantization cannot adapt to the dynamic importance of experts, resulting in suboptimal performance. How to dynamically allocate different bit-widths according to the varying importance of experts remains an important open-ended question.
Furthermore, static quantization methods inherently fail to accommodate the dynamic latency constraints of edge devices, where fluctuating system utilization dictates variable performance targets [18]. Restricted to a fixed bit-width allocation, these static methods lack runtime adaptability. While multi-scale quantization [18, 25, 26] has emerged as an effective solution for runtime model adaptation by overlaying multiple bit-width variants within a single model, existing works are tailored for dense LLMs and exhibit three critical limitations. First, they adjust the precision at a coarse model-level [26] or layer-level [18, 25], which is suboptimal for MoE models. Second, they either lack an automated mechanism [25, 26] or require an expensive fine-tuning process [18] to
Wei et al.
determine the precision. Third, they introduce severe hardware inefficiencies. Any-Precision LLM [26] and DP-LLM [18] are codebook-based non-uniform quantization methods, incurring significant table-lookup overhead for dequantization during inference. Although Matryoshka Quantization [25] leverages a uniform quantization method, it requires an extra bit for rounding, thereby resulting in redundant memory access.
To tackle these challenges, we propose Matryoshka Mixture-of-Experts (MatMoE), a dynamic mixed-precision quantization framework for efficient MoE inference featuring algorithm-system co-design. First, given a stringent memory budget, we propose the Matryoshka MoE PTQ algorithm, to derive a parent MoE model, which enables experts to operate flexibly at multiple precisions. Second, to address the inefficiency in memory access, we propose the floor-and-compensation quantization method that eliminates the need for an extra rounding bit. Third, during inference, we propose a dynamic bit-width allocation strategy that adaptively assigns different bit-widths to experts at runtime to satisfy the dynamic latency constraint. Finally, we implement our MatMoE system on top of llama.cpp [12] for both CPU and GPU platforms. Extensive experimental results demonstrate that MatMoE achieves a superior accuracy-efficiency trade-off compared to the state-of-the-art (SOTA) static mixed-precision quantization method. Our key contributions are as follows:
- We observe that expert importance is dynamic across decoding steps in MoE models and propose a Matryoshka MoE PTQ algorithm to construct a parent model that inherently supports multi-precision expert execution.
- We propose the floor-and-compensation quantization method to eliminate the redundant memory access in the Matryoshka representation.
- We propose a dynamic bit-width allocation strategy that determines the optimal precisions to individual experts at runtime during inference.
- We implement an efficient MoE inference system for both CPU and GPU platforms. Compared to the llama.cpp baseline, MatMoE delivers 1.3× ~ 3.7× end-to-end speedup on Raspberry Pi 5, and 1.2× ~ 1.3× speedup on NVIDIA RTX 4090 and Jetson AGX Orin.
- We evaluate MatMoE on three modern MoE models across three challenging generative benchmarks. MatMoE achieves 4.0% ~ 18.3% average accuracy improvement compared to the SOTA static mixed-precision quantization method.
2 Background
2.1 Mixture-of-Experts
Mixture-of-Experts (MoE) [4, 8, 16, 20, 21, 31, 33] is widely adopted in modern LLMs. As shown in Fig. 1, an MoE block replaces a single feed-forward network with multiple experts and a router that activates the top- experts for each token. Recent models, such as DeepSeekMoE [4, 20, 21] and QwenMoE [31, 33], employ fine-grained routed experts for specialized knowledge and always-active shared experts for common knowledge. The layer output combines the shared-expert outputs with the routed-expert outputs weighted by their routing scores.
Table 1: Comparison of existing multi-scale quantization works with our proposed method.
| Granularity | Quant. scheme | Efficiency | |
|---|---|---|---|
| Any-Precision LLM[26] | Model | Non-uniform (codebook) | Low |
| DP-LLM[18] | Layer | Non-uniform (codebook) | Low |
| Matryoshka Quant.[25] | Layer | Uniform (extra bit rounding) | Low |
| Ours | Expert | Uniform (floor-and-compensation) | High |
2.2 Quantization for LLM
Post-training quantization (PTQ) reduces the computational and storage costs by converting weights or activations from FP16 to low-bit integer or floating-point representations. For dense LLMs, GPTQ [9] quantizes weights using a Hessian-based error compensation mechanism. OmniQuant [28] introduces learnable weight clipping and learnable equivalent transformation, achieving better performance. For MoE models, MoEQuant [13] incorporates routing scores into GPTQ. EdgeMoE [35], QuantMoE-Bench [19] and PMQ [15] further extend MoE quantization to mixed-precision quantization, achieving better performance. The SOTA method PMQ [15] first assigns different bit-widths to different experts based on their activation frequency and routing score, and then quantizes weights using GPTQ. However, these quantization methods are static, which determine the bit-width allocation based on a calibration dataset and fix it through decoding steps, thus leading to suboptimal performance.
2.3 Multi-Scale Quantization
Multi-scale quantization has recently emerged as a promising paradigm to address varying runtime constraints [18]. It maintains a single quantized model capable of supporting inference at multiple precisions, thereby offering flexible accuracy-efficiency trade-offs. Any-Precision DNN [36] first proposes this concept in convolutional neural networks. Any-Precision LLM [26] introduces multi-scale quantization to LLM, featuring a codebook-based non-uniform quantization and a specialized GPU software engine. DP-LLM [18] further improves Any-Precision LLM by dynamically assigning different bit-widths to layers based on their relative quantization error. However, the codebook-based non-uniform quantization incurs significant table-lookup overhead for weight dequantization. Matryoshka Quantization [25] proposes a uniform multi-scale quantization technique. However, it requires an extra bit for rounding, diminishing the memory bandwidth saving. Moreover, all these methods ignore the dynamic importance of experts in MoE. A comparison of these methods with our MatMoE is presented in Table 1.
3 Motivation
Motivation 1: Dynamic expert importance across decoding steps. Existing mixed-precision quantization methods for MoE models treat expert importance—whether measured by routing scores or activation frequencies [7, 15, 19, 35]—as a static metric, determining it offline using a calibration dataset. However, we find that the expert importance is inherently dynamic, changing significantly across decoding steps. This is because of the specialization of different experts and the varying semantics of input tokens. Notably, the load balancing loss used in MoE training is to guarantee
MatMoE: Matryoshka Mixture-of-Experts with Dynamic Mixed-Precision Quantization for Efficient Inference
ICCAD '26, November 08–12, 2026, San Jose, CA, USA

(a) Qwen: Variations of expert ranking changes across decoding steps.

(b) Qwen: Variation of routing scores for activated experts.
Figure 2: The routing scores and expert ranking variations in a single layer of Qwen1.5-MoE-A2.7B [30] for the first sample in the GSM8K-CoT benchmark [3].
sufficient and balanced parameter optimization across the training corpus, rather than to homogenize expert functionality. Instead, it facilitates the development of highly specialized experts tailored to distinct knowledge domains [23, 33].
As illustrated in Fig. 2a, expert ranking for the same expert varies significantly across decoding steps even within a single sample. The dramatic fluctuations of the routing scores in Fig. 2b further demonstrate the highly dynamic nature of expert importance. Consequently, this motivates a dynamic mixed-precision quantization method that adaptively assigns the optimal bit-width based on the expert importance at run time.
Motivation 2: Stringent memory constraint and dynamic latency constraint on edge devices. Edge devices have limited memory capacity and dynamic runtime latency requirements since the system utilization fluctuates rapidly [18]. Multi-scale quantization has been proposed as an effective solution. However, existing works are designed for dense LLMs, which exhibit the following limitations. First, they adjust the precision at the model-level [26] or layer-level [18, 25], which incurs suboptimal performance for MoE models. Second, they either lack an automated mechanism for determining the precision [25, 26] or require a costly fine-tuning process [18]. Consequently, this motivates us to develop a multi-scale quantization method tailored for MoE models with an efficient precision determination mechanism.
Motivation 3: Redundant memory access in the Matryoshka representation. Although Matryoshka Quantization [25] adopts a uniform quantization scheme to avoid the significant table-lookup overhead in Any-Precision LLM [26] and DP-LLM [18], it has a fundamental limitation that relies on an auxiliary rounding bit, which inadvertently leads to redundant memory accesses. For example, deriving a 2-bit quantized weight from a 4-bit weight requires fetching the 3rd bit to correctly resolve the rounding logic. Consequently, 2-bit inference requires 3-bit memory access, degrading the theoretical speedup from 2× down to 1.33×. Worse still, extracting 3 bits forces a full 4-bit memory access, completely neutralizing any potential throughput improvement. On the other hand, naively truncating the first 2 bits will lead to significant accuracy degradation. This dilemma highlights the urgent need for a novel quantization

Figure 3: Overview of MatMoE.
paradigm that secures accurate inference without the redundant memory access of the extra rounding bit.
4 Method
4.1 Overview
In this paper, we propose MatMoE, a dynamic mixed-precision quantization framework for efficient MoE inference featuring algorithm-system co-design. As shown in Fig. 3, MatMoE consists of a Matryoshka MoE PTQ algorithm that enables experts to operate flexibly at multiple precisions within a strict memory budget (Sec. 4.2), a floor-and-compensation quantization method addressing the redundant memory access in the Matryoshka representation (Sec. 4.3), and a dynamic bit-width allocation strategy that determines the optimal precision for individual experts based on their routing scores at run time (Sec. 4.4). Furthermore, we design efficient MoE compute engines on both CPU and GPU (Sec. 4.5).
4.2 Matryoshka MoE PTQ Algorithm
In order to enable experts to perform well at different precisions under the strict memory budget of edge devices, we propose the Matryoshka MoE PTQ algorithm, which consists of two stages.
Stage 1: Determine the maximum allowable precision for each expert. Given a strict memory budget on edge devices, we first allocate the maximum allowable precision to each expert, aiming to minimize quantization loss while satisfying the memory constraint.
Wei et al.
In contrast to PMQ [15], which relies on a heuristic metric to guide bit-width allocation, we propose a more principled metric derived directly from the MoE layer's output. Specifically, the quantization loss of the MoE layer can be approximated using a second-order Taylor expansion as follows:
where is the number of activated experts, is the weight of the -th expert, is the quantization function, and are the routing score and the Hessian value of the -th expert, respectively. Given the prohibitive memory and computational overhead of computing the exact Hessian matrix, we approximate it using the Fisher Information Matrix following [17] as below:
where g represents the gradient of weights and D is the calibration dataset. Therefore, our proposed metric for each expert, i.e., , can be calculated offline based on a calibration dataset. Based on this metric, we determine the maximum precision allocation leveraging Integer Linear Programming (ILP) optimization, which only takes a few seconds to finish. The ILP problem is formulated as:
where is a binary variable indicating whether the -th expert is quantized to the -th bit-width. is the optional bit-width set, which we set as -bit. is the equivalent bit precision dictated by the memory budget.
Stage 2: PTQ for Matryoshka MoE. In this stage, we aim to obtain a single MoE model that performs well at multiple precisions. Specifically, we leverage OmniQuant [28] to quantize weights and train the quantization parameters in a layer-wise manner, considering all candidate precisions to enable experts to adapt to different bit-widths. The objective function we adopt is defined as:
where is the bit-width set including the maximum precision and the lowest precision of each expert. We set to 2-bit and is derived from Stage 1. is the hyperparameter. is the mean squared error loss. and are the FP16 weights and activations, respectively. is the forward function. is the quantization function quantizing weights to -bit, and are the learnable quantization parameters shared across different bit-widths.
4.3 Floor-and-Compensation Quantization
Within the Matryoshka MoE PTQ algorithm, the quantization function plays a pivotal role, as it directly dictates the performance of the low-precision expert sharing weights with its high-precision counterpart. Different from the original Matryoshka quantization
method [25], we propose the floor-and-compensation quantization for the low precision to address the redundant memory access.
We first illustrate the quantization function for the maximum precision . We adopt the standard OmniQuant [28] scheme, which is defined as follows:
where and denote the original FP16 and -bit quantized weights, respectively. is the scaling factor. is the zero point. and are two learnable quantization parameters.
For the lower precision , we aim to extract the first bits from the -bit weight. However, the Matryoshka quantization [25] requires an extra bit, i.e., the -th bit, for rounding, which is:
This quantization scheme significantly diminishes the memory bandwidth saving. On the other hand, naively truncating the first bits as in Eq. 7, results in significant accuracy degradation. For example, as shown in Table 2, directly truncating the first 2 bits from the original 4-bit weight leads to a performance collapse, reducing accuracy to 0% on all three benchmarks. We find that this degradation is caused by the weight expectation shift. As shown in Table 3, there is an expectation shift of 1.5 between directly truncating the first 2 bits and the original 4-bit weight.
To this end, we propose the floor-and-compensation quantization method. The key insight is that we use a compensation term to compensate the expectation shift caused by the truncation operation. The mathematical derivation is as follows.
Mathematical Derivation of the Compensation Term. Considering truncating the first bits of the -bit weights and let denote the number of truncated bits, the original high-precision weight can be perfectly reconstructed if we keep the remainder as below:
where represents the truncated residual (the discarded lower bits), meaning . Naively truncating the first bits ignores , leading to an expectation shift of the weight values.
For the original model weights which follow the normal distribution, the residual follows a uniform distribution as shown in Fig. 4. Thus, the expectation of the residual is:
To ensure that our truncated low-precision weights remain statistically unbiased, we add this expected error back as a constant compensation term . By introducing , we compensate for the expectation shift caused by the floor operation, resulting in
MatMoE: Matryoshka Mixture-of-Experts with Dynamic Mixed-Precision Quantization for Efficient Inference
ICCAD '26, November 08–12, 2026, San Jose, CA, USA

(a)
(b)
Figure 4: (a) Distribution of the model weights quantized to 4-bit and the truncated 2-bit weights. (b) Distribution of the residual between the 4-bit weights and the 2-bit weights.
Table 2: Accuracy impact of different quantization schemes.
| GSM8K-CoT | HumanEval | MBPP | |
|---|---|---|---|
| Matryoshka Quant. [25] | 21.9 | 14.6 | 17.0 |
| Floor | 0.0 | 0.0 | 0.0 |
| Floor-and-Compensation | 24.5 | 15.2 | 15.8 |
Table 3: Expectation shift of directly truncating the first bits.
| (round) | (floor) | |
|---|---|---|
| 0,1 | 0 | 0 |
| 2,3 | 4 | 0 |
| 4,5 | 4 | 4 |
| 6,7 | 8 | 4 |
| 8,9 | 8 | 8 |
| 10,11 | 12 | 8 |
| 12,13 | 12 | 12 |
| 14,15 | 12 | 12 |
| 7.5 | 7.5 | 6.0 |

Figure 5: Routing score distribution.
our final floor-and-compensation function:
which is applied in both training and inference. Thanks to our floor-and-compensation quantization, we achieve accuracy comparable to, or even surpassing, the original Matryoshka Quantization [25] as shown in Table 2 without requiring any extra rounding bit. Moreover, introducing C does not increase the memory bandwidth overhead, and it only incurs negligible computational cost.
4.4 Dynamic Bit-Width Allocation
To adapt to the dynamic expert importance across the decoding steps, we propose our dynamic bit-width allocation strategy. Prior studies have established that the routing score serves as a highly robust proxy for an expert's contextual importance [13-15]. Leveraging this insight, we propose a lightweight threshold-based mechanism: during inference, activated experts with routing scores exceeding a pre-determined threshold are executed in high precision,
Algorithm 1 Binary Search for Optimal Threshold
Require: Routing score set , Target precision , High precision , Low precision , Tolerance , Max iterations
1: ,
2: for iter = 1 to do
3:
4:
5:
6: if then
7: break
8: else if then
9:
10: else
11:
12: end if
13: end for
14: return
while the remaining experts are executed in low precision. By adjusting the threshold, we can achieve an arbitrary average bit-width, which enables the system to adapt to various latency constraints.
However, determining the optimal threshold to guarantee that the system satisfies strict latency constraints emerges as a critical challenge. We propose a binary search algorithm to search for the optimal threshold for the given latency constraint, which is reflected by the target precision . We apply a binary search algorithm over a routing score set , which is collected on a calibration dataset as shown in Fig. 5 to find the optimal threshold that strictly bounds the expected average bit-width to . The detailed procedure is illustrated in Alg. 1. Notably, the search process is highly efficient, executing with only sub-millisecond latency.
4.5 System Implementation
We design our MatMoE system on both CPU and GPU based on llama.cpp [12], which is the most widely used LLM inference engine for edge devices. The overall system implementation of MatMoE is illustrated in Fig. 6. To facilitate efficient memory access for variable bit-widths, we adopt a bitplane-based representation [26, 32] for the expert weights. During inference, the execution precision of each expert is dynamically dictated by whether its routing score surpasses a pre-determined threshold (Sec. 4.4). At the core of our compute engine, we develop highly optimized GEMV kernels tailored for both CPU and GPU platforms, as detailed below. After the main computation, we apply a lightweight compensation term to the output of the low-precision experts (Sec. 4.3).
On CPU, we develop a LUT-based compute engine. The LUT-based GEMV kernel is first proposed in T-MAC [32] for dense LLM. During inference, it precomputes all possible products between the activation and all binary patterns, constructing a LUT. The binary matrices of weights serve as indices to retrieve the precomputed results from the LUT, which are then accumulated to obtain the final output. However, it does not support MoE computation. To overcome this, we modify the kernel for MoE by introducing fine-grained, expert-level address offset control. Furthermore, we share the LUT between the gate projection and the up projection of
Wei et al.

Figure 6: System implementation of MatMoE.
different experts to avoid redundant precomputation and storage overhead, since they receive identical input.
On GPU, we develop our efficient GPU compute engine. Since table lookup operation incurs severe memory bank conflicts on GPU, we adopt a computation strategy fundamentally distinct from the CPU engine. As illustrated in Fig. 6, our custom GEMV kernel is composed of the following two operations. First, we perform an in-register bit-transpose operation to convert the bit-plane weight layout to the standard weight representation using efficient bitwise logic, i.e., bit-wise masking, shifting and OR operation. The reconstructed weights are cast to INT8 format and densely packed into 32-bit registers, four weights per register. Then, we execute the matrix multiplication against INT8 activations by leveraging NVIDIA's 4-way integer dot-product (dp4a) instructions. Furthermore, we apply kernel fusion techniques to integrate the gate projection, up projection, and SiLU non-linear activation into a single kernel, which completely eliminates the latency of writing intermediate activations back to the global memory.
5 Experiment
5.1 Experimental Setup
Models and Benchmarks. We evaluate MatMoE on three modern MoE models, i.e, Qwen1.5-MoE-A2.7B (Qwen) [30], DeepSeek-V2-Lite-16B (DeepSeek) [20], and OLMoE-1B-7B-Instruct (OLMoE) [24]. Following [18], we evaluate the accuracy using lm-evaluation-harness [11] on the challenging benchmarks, which have sufficient token generation lengths. Specifically, we evaluate on 8-shot GSM8K-CoT [3], 0-shot HumanEval [2] and 3-shot MBPP [1]. GSM8K-CoT aims to evaluate the model's mathematical reasoning capabilities, while HumanEval and MBPP are utilized to measure its performance on code generation and programming tasks. The metric we report is the exact-match and flexible-extract accuracy for GSM8K-CoT, pass@1 accuracy for HumanEval and MBPP.
Quantization Configuration. We quantize the weights with a group size of 128. We quantize all linear layers in the MoE model except for the router, which has a negligible parameter count. We do not quantize the Key-Value projection in the Multi-Head Latent Attention (MLA) of DeepSeek either due to its marginal parameter size. Furthermore, for the linear layers in the self-attention and shared experts, we apply 4-bit quantization, while for the routed
Table 4: Accuracy of FP16 models.
| GSM8K-CoT | HumanEval | MBPP | ||
|---|---|---|---|---|
| Qwen | FP16 | 62.9 | 32.9 | 39.4 |
| DeepSeek | FP16 | 39.4 | 28.0 | 43.2 |
| OLMoE | FP16 | 41.0 | 31.1 | 27.8 |
Table 5: Accuracy comparison under 3-bit memory budget.
| Dataset | GSM8K-CoT | HumanEval | MBPP | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Target Prec. | 2.25 | 2.50 | 2.75 | 2.25 | 2.50 | 2.75 | 2.25 | 2.50 | 2.75 | |
| Qwen | PMQ | 32.2 | 41.6 | 48.8 | 17.7 | 17.1 | 23.8 | 20.0 | 23.2 | 22.0 |
| MatMoE | 50.6 | 51.5 | 52.4 | 26.8 | 28.7 | 28.7 | 30.8 | 30.8 | 31.0 | |
| DeepSeek | PMQ | 18.4 | 25.9 | 31.1 | 10.4 | 12.8 | 17.7 | 25.2 | 24.4 | 27.6 |
| MatMoE | 29.8 | 29.6 | 31.1 | 16.5 | 18.3 | 18.3 | 25.6 | 25.4 | 26.2 | |
| OLMoE | PMQ | 9.9 | 15.6 | 22.8 | 3.7 | 3.0 | 3.7 | 1.4 | 1.6 | 2.6 |
| MatMoE | 11.0 | 18.7 | 22.7 | 12.8 | 14.6 | 14.6 | 11.8 | 12.0 | 12.2 | |
experts, we adopt mixed-precision quantization. The same quantization configuration is applied for both our method and the baselines.
Calibration and Hyperparameters. For our Matryoshka MoE PTQ algorithm, we leverage a calibration dataset consisting of 128 randomly selected 2048-token segments from C4 dataset [27] and train the quantization parameters for 40 epochs using a batch size of 4. We utilize AdamW [22] optimizer with zero weight decay, and set the learning rate to 1e-2. We set in Eq. 4 to 1.0. For evaluation, we use a batch size of 1, considering the edge inference scenario.
Baselines. For accuracy evaluation, we use the SOTA mixed-precision quantization method PMQ [15] as the baseline, testing under both 3-bit and 4-bit memory budgets. For the prefill phase, we use the maximum precision for each expert, since lower precision weights only provide a marginal speed improvement in this compute-bound scenario. For latency evaluation, we compare our MatMoE system with llama.cpp [12], the most widely used LLM inference engine for edge devices on both CPU and GPU. We report the average Time-Per-Output-Token (TPOT).
Hardware Platforms. For CPU evaluation, we choose Raspberry Pi 5 with a quad-core ARM Cortex-A76 processor. For GPU evaluation, our selected hardware platforms include NVIDIA Jetson AGX Orin and NVIDIA RTX 4090.
5.2 Accuracy Evaluation
We first present the accuracy of the FP16 model on three benchmarks in Table 4. We demonstrate the accuracy of PMQ and our MatMoE under 3-bit and 4-bit memory budgets in Table 5 and Table 6, respectively. MatMoE consistently exhibits superior performance over the SOTA method PMQ. Specifically, under 3-bit memory budget, MatMoE achieves 4.0% to 9.8% average accuracy improvement across three models. Under 4-bit memory budget, MatMoE achieves 7.5% to 18.3% average accuracy improvement across three models. The substantial accuracy improvement is attributed to MatMoE's capability to dynamically allocate bit-widths to experts based on their importance. It is also worth noting that PMQ necessitates storing multiple models for different target precisions, whereas our method natively supports these diverse target precisions using only a single model.
MatMoE: Matryoshka Mixture-of-Experts with Dynamic Mixed-Precision Quantization for Efficient Inference
ICCCAD '26, November 08–12, 2026, San Jose, CA, USA
Table 6: Accuracy comparison under 4-bit memory budget.
| Dataset | GSM8K-CoT | HumanEval | MBPP | |||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Target Prec. | 2.25 | 2.50 | 2.75 | 3.00 | 3.25 | 3.50 | 3.75 | 2.25 | 2.50 | 2.75 | 3.00 | 3.25 | 3.50 | 3.75 | 2.25 | 2.50 | 2.75 | 3.00 | 3.25 | 3.50 | 3.75 | |
| Qwen | PMQ | 32.2 | 41.6 | 48.8 | 56.0 | 52.8 | 56.0 | 57.3 | 17.7 | 17.1 | 23.8 | 20.1 | 18.9 | 25.0 | 30.5 | 20.0 | 23.2 | 22.0 | 27.0 | 30.8 | 32.6 | 34.8 |
| MatMoE | 50.6 | 52.1 | 55.3 | 55.7 | 56.5 | 56.9 | 56.9 | 31.1 | 34.2 | 34.2 | 33.5 | 33.5 | 35.4 | 35.4 | 31.4 | 34.2 | 36.0 | 36.2 | 36.4 | 36.4 | 36.6 | |
| DeepSeek | PMQ | 18.4 | 25.9 | 31.2 | 34.7 | 34.8 | 38.9 | 39.3 | 10.4 | 12.8 | 17.7 | 22.6 | 18.9 | 25.0 | 25.6 | 25.2 | 24.4 | 27.6 | 30.6 | 33.4 | 34.4 | 36.4 |
| MatMoE | 32.1 | 36.2 | 36.2 | 36.6 | 36.6 | 36.5 | 36.8 | 25.0 | 26.2 | 26.8 | 26.2 | 26.6 | 26.6 | 25.6 | 39.6 | 41.6 | 42.6 | 41.0 | 42.2 | 41.8 | 42.4 | |
| OLMoE | PMQ | 9.9 | 15.6 | 22.8 | 27.7 | 23.5 | 28.4 | 31.5 | 3.7 | 3.0 | 3.7 | 3.7 | 6.1 | 6.7 | 9.8 | 1.4 | 1.6 | 2.6 | 6.8 | 6.4 | 5.2 | 13.4 |
| MatMoE | 29.1 | 31.5 | 34.8 | 36.5 | 37.1 | 38.9 | 39.5 | 24.4 | 25.0 | 28.1 | 26.8 | 26.8 | 29.9 | 28.1 | 23.4 | 25.6 | 26.6 | 26.2 | 26.8 | 26.8 | 26.8 | |

Figure 7: Latency comparison on Raspberry Pi 5 across three models at different target precisions.
5.3 Latency Evaluation
As illustrated in Fig. 7, MatMoE achieves consistent end-to-end speedup over llama.cpp on the CPU across various target precisions. Under single-thread setting, MatMoE achieves average speedup of , , for Qwen, DeepSeek, and OLMoE, respectively. Under multi-thread setting, MatMoE achieves , , and speedup across three models, respectively. Qwen exhibits a smaller speedup due to the larger proportion of shared experts, for which we use 4-bit quantization. For the latency evaluation on GPU, as shown in Fig. 8, MatMoE demonstrates speedup over llama.cpp on both NVIDIA RTX 4090 and Jetson Orin. The relatively flat TPOT curves on GPU are due to limitations of our current kernel implementation, where low-bit weights are first converted to INT8 before dp4a execution, making different precisions have similar runtime cost. Furthermore, we show the accuracy-efficiency trade-off between the average accuracy and the multi-thread TPOT in Fig. 9. MatMoE achieves a superior accuracy-efficiency trade-off compared to the SOTA static mixed-precision quantization baseline.
5.4 Ablation Study
Effects of individual components. To evaluate the contribution of each component, we compare four configurations in Table 7.
Optimized low-bit kernels. We first replace the original llama.cpp backend of PMQ with our optimized low-bit kernels while retaining its static mixed-precision allocation. PMQ + Our Kernels reduces the average TPOT from 80.3 to 27.4 ms/token, corresponding to a speedup over PMQ + llama.cpp. Meanwhile, the two configurations achieve identical accuracy. These results demonstrate that our optimized kernels substantially improve execution efficiency without affecting the numerical behavior.
Dynamic bit-width allocation. Under the same optimized backend, PMQ + Our Kernels and our MatMoE achieve similar TPOTs. However, MatMoE improves the average accuracy from 22.8% to 35.3%, demonstrating the effectiveness of MatMoE's dynamic allocation strategy, which adapts expert bit-widths to token-level routing importance during decoding.
Floor-and-compensation. To evaluate the contribution of floor-and-compensation, we construct Matryoshka + Dynamic, which combines the original Matryoshka quantization scheme with our dynamic bit-width allocation. Unlike MatMoE, this baseline requires accessing an additional bitplane for rounding. Compared with this baseline, MatMoE reduces the average TPOT from 30.5 to 27.6 ms/token, while slightly improving the average accuracy from 34.4% to 35.3%. This confirms that F&C eliminates redundant rounding-bit accesses without compromising model accuracy.
Offloading efficiency. When a model's parameter size exceeds the available DRAM capacity, a portion of its weights must be offloaded to SSD storage. MatMoE is also effective in this regime because its nested bitplane representation reduces the amount of expert data transferred between SSD and DRAM. To evaluate its offloading efficiency, we conduct experiments on Qwen3-30B-A3B [33] using a least-recently-used (LRU) cache replacement
Wei et al.

Figure 8: Latency comparison on NVIDIA RTX 4090 and Jetson Orin across three models at different target precisions.

Figure 9: Accuracy-efficiency trade-off of MatMoE and the SOTA static mixed-precision quantization method.

Figure 10: Latency comparison of HOBBIT [29] and MatMoE under Qwen3-30B-A3B offloading on Raspberry Pi 5.
Table 7: Latency and accuracy comparison under 4-bit memory budget. We evaluate OLMoE on GSM8k-CoT on Raspberry Pi 5 with 4-thread inference.
| Target precision | 2.25 | 2.50 | 2.75 | 3.00 | 3.25 | 3.50 | 3.75 | |
|---|---|---|---|---|---|---|---|---|
| PMQ + Llama.cpp | TPOT Accuracy | 76.6 9.9 | 77.8 15.6 | 79.1 22.8 | 80.3 27.7 | 81.5 23.5 | 82.7 28.4 | 83.9 31.5 |
| PMQ + Our kernels | TPOT Accuracy | 24.9 9.9 | 25.6 15.6 | 26.6 22.8 | 27.3 27.7 | 28.4 23.5 | 29.2 28.4 | 30.0 31.5 |
| Matryoshka [25] + Dynamic | TPOT Accuracy | 30.1 26.1 | 30.3 31.1 | 30.4 34.9 | 30.5 35.6 | 30.7 37.0 | 30.8 37.5 | 31.0 38.9 |
| Our MatMoE (Matryoshka + F&C +Dynamic) | TPOT Accuracy | 25.0 29.1 | 25.8 31.5 | 26.7 34.8 | 27.6 36.5 | 28.5 37.1 | 29.4 38.9 | 30.2 39.5 |
policy. The cache capacity is set to accommodate all non-expert weights and 25% of the experts at 4-bit precision. We compare MatMoE with HOBBIT [29], a state-of-the-art expert offloading method that stores multiple precision experts and dynamically loads high- or low-precision experts according to their importance. Since HOBBIT does not provide its source code, we implement a simulator to evaluate the end-to-end latency. As shown in Fig. 10, MatMoE achieves substantial end-to-end speedups over HOBBIT
under offloading. Across different target precisions, HOBBIT requires 493.06 ~ 661.23 ms/token on Raspberry Pi 5, whereas MatMoE requires only 243.78 ~ 579.71 ms/token, corresponding to a 1.1× ~ 2.0× speedup. The speedup stems from the reduced SSD-to-DRAM traffic when the required precision of an expert changes across tokens. When an expert switches from 2-bit to 4-bit precision, HOBBIT must load a separate 4-bit copy from SSD, whereas MatMoE loads only the two additional bitplanes. Conversely, when the required precision changes from 4-bit to 2-bit, HOBBIT must load a separate 2-bit copy, whereas MatMoE simply ignores the two unnecessary bitplanes without additional I/O. Therefore, MatMoE directly reduces offloading traffic and thereby improves the end-to-end latency.
6 Conclusion
In this paper, we propose MatMoE, a dynamic mixed-precision quantization framework for efficient MoE inference. MatMoE enables experts to adaptively operate at the optimal precision based on their dynamic importance through our Matryoshka MoE PTQ algorithm and dynamic bit-width allocation, thus achieving better performance. MatMoE also achieves superior inference efficiency due to our floor-and-compensation quantization and efficient system implementation. Compared to llama.cpp, MatMoE delivers end-to-end speedups of on the CPU platform and on the GPU platform. MatMoE demonstrates 4.0% ~ 18.3% higher average accuracy across three modern MoE models compared to SOTA static mixed-precision quantization method.
7 Acknowledgment
This work was supported in part by the Beijing Municipal Science and Technology Program under Grant Z241100004224015, in part by New Generation Artificial Intelligence-National Science and Technology Major Project under Grant 2025ZD0122502, in part by NSFC under Grant 92464104, Grant 62495102, and Grant 62341407, in part by 111 Project under Grant B18001.
MatMoE: Matryoshka Mixture-of-Experts with Dynamic Mixed-Precision Quantization for Efficient Inference
ICCAD '26, November 08–12, 2026, San Jose, CA, USA
References
[1] Jacob Austin, Augustus Odena, Maxwell Nye, Maarten Bosma, Henryk Michalewski, David Dohan, Ellen Jiang, Carrie Cai, Michael Terry, Quoc Le, et al. 2021. Program synthesis with large language models. arXiv preprint arXiv:2108.07732 (2021).
[2] Mark Chen. 2021. Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374 (2021).
[3] Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Jacob Hilton, Reichiro Nakano, Christopher Hesse, and John Schulman. 2021. Training Verifiers to Solve Math Word Problems. arXiv:2110.14168 [cs.LG].
[4] Damai Dai, Chengqi Deng, Chenggang Zhao, RX Xu, Huazuo Gao, Deli Chen, Jiashi Li, Wangding Zeng, Xingkai Yu, Yu Wu, et al. 2024. Deepseekmo: Towards ultimate expert specialization in mixture-of-experts language models. arXiv preprint arXiv:2401.06066 (2024).
[5] Zhen Dong, Zhewei Yao, Daiyaan Arfeen, Amir Gholami, Michael W Mahoney, and Kurt Keutzer. 2020. Hawq-v2: Hessian aware trace-weighted quantization of neural networks. Advances in neural information processing systems 33 (2020), 18518–18529.
[6] Zhen Dong, Zhewei Yao, Amir Gholami, Michael W Mahoney, and Kurt Keutzer. 2019. Hawq: Hessian aware quantization of neural networks with mixed-precision. In Proceedings of the IEEE/CVF international conference on computer vision. 293–302.
[7] Haojie Duannmu, Xiuhong Li, Zhihang Yuan, Size Zheng, Jiangfei Duan, Xingcheng Zhang, and Dahua Lin. 2025. Mxmoe: Mixed-precision quantization for moe with accuracy and performance co-design. arXiv preprint arXiv:2505.05799 (2025).
[8] William Fedus, Barret Zoph, and Noam Shazeer. 2022. Switch transformers: Scaling to trillion parameter models with simple and efficient sparsity. Journal of Machine Learning Research 23, 120 (2022), 1–39.
[9] Elias Frantar, Saleh Ashkboos, Torsten Hoefler, and Dan Alistarh. 2022. Gptq: Accurate post-training quantization for generative pre-trained transformers. arXiv preprint arXiv:2210.17323 (2022).
[10] Zhongqian Fu, Ning Ding, Kai Han, Xianzhi Yu, Xiaosong Li, Xinghao Chen, Yehui Tang, and Yunhe Wang. 2025. EAQuant: Enhancing Post-Training Quantization for MoE Models via Expert-Aware Optimization. arXiv preprint arXiv:2506.13329 (2025).
[11] Leo Gao, Jonathan Tow, Baber Abbasi, Stella Biderman, Sid Black, Anthony DiPofi, Charles Foster, Laurence Golding, Jeffrey Hsu, Alain Le Noac'h, Haonan Li, Kyle McDonell, Niklas Muennighoff, Chris Ociepa, Jason Phang, Laria Reynolds, Hailey Schoelkopf, Aviya Skowron, Lintang Sutawika, Eric Tang, Anish Thite, Ben Wang, Kevin Wang, and Andy Zou. 2024. The Language Model Evaluation Harness. doi:10.5281/zenodo.12608602
[12] ggml-org. 2026. llama.cpp. https://github.com/ggml-org/llama.cpp.
[13] Xing Hu, Zhixuan Chen, Dawei Yang, Zukang Xu, Chen Xu, Zhihang Yuan, Sifan Zhou, and Jiangyong Yu. 2025. MoEQuant: Enhancing Quantization for Mixture-of-Experts Large Language Models via Expert-Balanced Sampling and Affinity Guidance. arXiv preprint arXiv:2505.03804 (2025).
[14] Beichen Huang, Yueming Yuan, Zelei Shao, and Minjia Zhang. 2025. MiLo: Efficient Quantized MoE Inference with Mixture of Low-Rank Compensators. arXiv preprint arXiv:2504.02658 (2025).
[15] Wei Huang, Yue Liao, Jianhui Liu, Ruifei He, Haoru Tan, Shiming Zhang, Hong-sheng Li, Si Liu, and XIAOJUAN QI. 2025. Mixture Compressor for Mixture-of-Experts LLMs Gains More. In The Thirteenth International Conference on Learning Representations.
[16] Albert Q Jiang, Alexandre Sablayrolles, Antoine Roux, Arthur Mensch, Blanche Savary, Chris Bamford, Devendra Singh Chaplot, Diego de las Casas, Emma Bou Hanna, Florian Bressand, et al. 2024. Mixtral of experts. arXiv preprint arXiv:2401.04088 (2024).
[17] Sehoon Kim, Coleman Hooper, Amir Gholami, Zhen Dong, Xiuyu Li, Sheng Shen, Michael W Mahoney, and Kurt Keutzer. 2023. Squeezellm: Dense-and-sparse quantization. arXiv preprint arXiv:2306.07629 (2023).
[18] Sangwoo Kwon, Seong Hoon Seo, Jae W Lee, and Yeonhong Park. 2025. Dp-llm: Runtime model adaptation with dynamic layer-wise precision assignment. arXiv preprint arXiv:2508.06041 (2025).
[19] Pingzhi Li, Xiaolong Jin, Zhen Tan, Yu Cheng, and Tianlong Chen. 2024. QuantMoE-Bench: Examining Post-Training Quantization for Mixture-of-Experts. arXiv preprint arXiv:2406.08155 (2024).
[20] Aixin Liu, Bei Feng, Bin Wang, Bingxuan Wang, Bo Liu, Chenggang Zhao, Chengqi Dengr, Chong Ruan, Damai Dai, Daya Guo, et al. 2024. Deepseek-v2: A strong, economical, and efficient mixture-of-experts language model. arXiv preprint arXiv:2405.04434 (2024).
[21] Aixin Liu, Bei Feng, Bing Xue, Bingxuan Wang, Bochao Wu, Chengda Lu, Chenggang Zhao, Chengqi Deng, Chenyu Zhang, Chong Ruan, et al. 2024. Deepseek-v3 technical report. arXiv preprint arXiv:2412.19437 (2024).
[22] Ilya Loshchilov and Frank Hutter. 2019. Decoupled Weight Decay Regularization. International Conference on Learning Representations (ICLR) (2019).
[23] Siyuan Mu and Sen Lin. 2025. A comprehensive survey of mixture-of-experts: Algorithms, theory, and applications. arXiv preprint arXiv:2503.07137 (2025).
[24] Niklas Muennighoff, Luca Soldaini, Dirk Groeneveld, Kyle Lo, Jacob Morrison, Se-won Min, Weijia Shi, Pete Walsh, Oyvind Tafjord, Nathan Lambert, et al. 2024. Omoe: Open mixture-of-experts language models. arXiv preprint arXiv:2409.02060 (2024).
[25] Pranav Nair, Puranjay Datta, Jeff Dean, Prateek Jain, and Aditya Kusupati. 2025. Matryoshka quantization. arXiv preprint arXiv:2502.06786 (2025).
[26] Yeonhong Park, Jake Hyun, SangLyuil Cho, Bonggeun Sim, and Jae W Lee. 2024. Any-precision llm: Low-cost deployment of multiple, different-sized llms. arXiv preprint arXiv:2402.10517 (2024).
[27] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of machine learning research 21, 140 (2020), 1–67.
[28] Wenqi Shao, Mengzhao Chen, Zhaoyang Zhang, Peng Xu, Lirui Zhao, Zhiqian Li, Kaipeng Zhang, Peng Gao, Yu Qiao, and Ping Luo. 2023. Omniquant: Omni-directionally calibrated quantization for large language models. arXiv preprint arXiv:2308.13137 (2023).
[29] Peng Tang, Jiacheng Liu, Xiaofeng Hou, Yifei Pu, Jing Wang, Pheng-Ann Heng, Chao Li, and Miniyu Guo. 2024. Hobbit: A mixed precision expert offloading system for fast moe inference. arXiv preprint arXiv:2411.01433 (2024).
[30] Qwen Team. 2024. Qwen1.5-MoE-A2.7B. https://huggingface.co/Qwen/Qwen1.5-MoE-A2.7B.
[31] Qwen Team et al. 2024. Qwen2 technical report. arXiv preprint arXiv:2407.106712, 3 (2024).
[32] Jianyu Wei, Shijie Cao, Ting Cao, Lingxiao Ma, Lei Wang, Yanyong Zhang, and Mao Yang. 2025. T-mac: Cpu renaissance via table lookup for low-bit llm deployment on edge. In Proceedings of the Twentieth European Conference on Computer Systems. 278–292.
[33] An Yang, Anfeng Li, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chang Gao, Chengen Huang, Chenxu Lv, et al. 2025. Qwen3 technical report. arXiv preprint arXiv:2505.09388 (2025).
[34] Zhewei Yao, Zhen Dong, Zhangcheng Zheng, Amir Gholami, Jiali Yu, Eric Tan, Leyuan Wang, Qijing Huang, Yida Wang, Michael Mahoney, et al. 2021. Hawq-v3: Dyadic neural network quantization. In International Conference on Machine Learning. PMLR, 11875–11886.
[35] Rongjie Yi, Liwei Guo, Shiyun Wei, Ao Zhou, Shangguang Wang, and Mengwei Xu. 2023. Edgemoe: Fast on-device inference of moe-based large language models. arXiv preprint arXiv:2308.14352 (2023).
[36] Haichao Yu, Haoxiang Li, Humphrey Shi, Thomas S Huang, and Gang Hua. 2021. Any-precision deep neural networks. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 35. 10763–10771.