How to Configure MoE Parameters: Quantization and Sparsity Ratios for On-Device Deployment

    This article explains how total and active parameters in Mixture-of-Experts (MoE) models affect cloud and on-device deployment. It covers three tiers of MoE models, the sparsity ratio, 1.58-bit quantization, memory bandwidth limits, and a deployment checklist.

    Large language models keep growing in parameter count, and more parameters make deployment harder. Mixture-of-Experts (MoE) architectures separate “total parameters” from “active parameters.” Total parameters determine how much knowledge the model can store, and active parameters determine how much computation each token requires. The ratio between the two is the sparsity ratio. Understanding this helps you choose suitable configurations for cloud and on-device deployment.

    1. The Three Tiers of MoE Parameters

    The gating network of an MoE model selects a small number of experts for each token, and the remaining experts stay idle. As a result, the computation per inference depends only on active parameters, while the model’s knowledge capacity is set by total parameters.

    1. Ultra-large models: complex reasoning in the cloud

    Take a typical Pro-class model as an example. It has about 1.6 trillion (1.6T) total parameters and activates about 49 billion (about 49B) parameters per inference. At this scale, the model delivers strong multi-step reasoning and code generation, which suits demanding tasks.

    These models also have limitations. The gating network routes each query to a small number of experts, so some rarely seen knowledge may not activate reliably. As a result, on certain world-knowledge question-answering tasks, the model may not outperform a dense model with a similar active parameter count. In engineering practice, teams often use retrieval-augmented generation (RAG) to fill knowledge gaps. RAG retrieves material from object storage or a vector database first, then adds the results to the context. Models of this size usually run on large GPU clusters, either on compute from major cloud providers or in self-built data centers.

    2. Mid-size models: high concurrency and low latency

    The typical configuration for mid-size models (commonly called Flash-class in the industry) is 284 billion total parameters and 13 billion active parameters. Fewer active parameters lower both the time to first token and the per-inference cost.

    This tier works well as the first response layer behind an API gateway, handling everyday conversation, intent recognition, and simple information extraction. When a request is complex, the gateway passes it to a Pro-class model. During traffic peaks, container platforms and autoscaling policies can add instances quickly.

    2. On-Device Deployment: Sparsity Ratio and Quantization

    Phones and other edge devices face limits on memory capacity, peak compute, and power consumption. Three questions need answers before deployment: Can the weights fit in memory? Is memory bandwidth sufficient? Is the power draw acceptable?

    1. Calculating and trading off the sparsity ratio

    The sparsity ratio equals total parameters divided by active parameters. A typical on-device A2B configuration has 30B total parameters and 2B active parameters, giving a sparsity ratio of 15:1. For comparison, a configuration with 26B total and 4B active parameters has a ratio of about 6.5:1, and one with 30B total and 5B active has a ratio of about 6:1.

    A higher sparsity ratio means fewer multiply-accumulate operations per token, which lowers chip power consumption and heat and speeds up generation. Two points need attention, though. First, total parameters still determine the weight size, so a high sparsity ratio does not reduce the weights you must store. Second, attention and embedding layers usually take part in every computation, so the parameters actually used in computation often exceed the nominal active count. Evaluate with measured results.

    2. Quantization: fitting the weights onto a phone

    At FP16 precision, the weights of a 30B model alone need about 60 GB (30B × 16 bits ÷ 8). Ordinary phones cannot hold a model of this size.

    1.58-bit quantization uses ternary weights with values of -1, 0, or 1, averaging about 1.58 bits per parameter. For 30B total parameters, the theoretical weight size is about 30×10⁹ × 1.58 ÷ 8 ≈ 5.9 GB. This figure covers only the weights. It excludes the embedding layers, activations, KV Cache, and runtime overhead.

    There is a key prerequisite. 1.58-bit schemes typically require ternary weights to be used during training. Applying post-training quantization directly to a trained FP16 model often causes a significant drop in accuracy. When selecting a model, confirm that it natively supports this format and request accuracy evaluation results. Do not rely on the size figure alone.

    3. Bandwidth: another bottleneck for autoregressive generation

    Generating each token requires reading the corresponding weights from memory. When bandwidth is insufficient, the compute units sit idle, which shows up as stuttering.

    With 2B active parameters at 1.58-bit, each token reads about 2×10⁹ × 1.58 ÷ 8 ≈ 0.4 GB of weights. If the phone’s usable memory bandwidth is 50 GB/s, the theoretical upper limit is about 125 tokens per second. This ignores computation, KV Cache reads, and system scheduling, so actual speed will be much lower. Still, it shows that a high sparsity ratio reduces memory access per token, which is one reason on-device generation can stay smooth.

    Operator fusion and KV Cache quantization can further reduce memory access and writes of intermediate results. KV Cache quantization causes accuracy loss, which is more noticeable in long-context tasks, and it requires support from the inference framework. Operator fusion depends on specific hardware and compiler versions, so you need to re-validate it after porting to a new device model.

    3. Comparison and Deployment Checklist

    Tier Total / Active Parameters Sparsity Ratio FP16 Weight Size (theoretical) 1.58-bit Weight Size (theoretical) Typical Tasks
    Ultra-large (Pro-class) 1.6T / 49B About 33:1 About 3.2 TB About 316 GB Complex reasoning, code generation
    Mid-size (Flash-class) 284B / 13B About 22:1 About 568 GB About 56 GB High-concurrency chat, intent recognition
    On-device A2B 30B / 2B 15:1 About 60 GB About 5.9 GB (requires native support) Offline Q&A on phones

    Before deployment, check these items:

    • Standardize definitions: Define total parameters, active parameters, and sparsity ratio clearly, and document them.
    • Calculate weight size: Weight size equals total parameters times bits per parameter, divided by 8. Reserve additional space for embedding layers, activations, and KV Cache.
    • Confirm the quantization source: Distinguish between native ternary training and post-training conversion, and request accuracy evaluations.
    • Estimate context overhead: Calculate KV Cache usage for your target context length, and leave ample headroom for long-context scenarios.
    • Measure key metrics: On the target device, record time to first token, generation speed, peak memory, and device temperature.
    • Record the environment: Save the device model, OS version, inference framework version, and quantization parameters to support reproduction and troubleshooting.

    4. Common Mistakes and Selection Advice

    There are four common mistakes. First, treating total parameters as the computation cost and ignoring that active parameters determine per-inference overhead. Second, looking only at model size without calculating runtime memory. Third, using theoretical bandwidth in place of measured speed. Fourth, overlooking KV Cache growth in long-context use.

    When selecting a model, group tasks by tier. Assign complex reasoning and code generation to the ultra-large model. Send frequent, simple requests to the mid-size model to reduce cost and latency. Place offline and privacy-sensitive scenarios on the device. Each tier should define performance metrics first, then verify them with measured results, rather than deciding based on parameter count alone.