12B Open-Source Model Selection and Speculative Decoding in Practice
A new ~12B open-source dense model has filled a gap in the Gemma lineup, but the questions that matter now are engineering ones. This article compares mid-sized dense models with 26B-class MoE models across memory, compute, and bandwidth; explains why multi-token prediction (MTP) speculative decoding can reach an acceptance rate of about 0.7 yet still deliver only 0.87x decoding speed (and even slow some tasks down); walks through a reproducible benchmarking methodology; and lays out a data-driven path from measurements to model selection and cloud deployment. It is written for developers who need to choose and accelerate open-source LLMs on real hardware.
Introduction: Once the 12B Tier Is Filled, the Real Questions Begin
An open-source model family recently rounded out its lineup with a mid-sized dense model of roughly 12B parameters. It fills a capability gap in the Gemma series: stronger than the small models built for edge devices, yet lighter than the 26B-class mixture-of-experts (MoE) model, which activates only about 4B parameters per token on its inference path. Community discussion quickly shifted from “how good is it” to engineering questions: multi-token prediction (MTP) speculative decoding in local inference frameworks reaches an acceptance rate of about 0.7 on the 12B model, yet the overall decoding speed is only 0.87x of the baseline. On unified-memory devices, the 26B-class MoE model actually performs better.
These seemingly contradictory observations point to a single conclusion: in the mid-sized tier, both model selection and acceleration are no longer black and white, and you have to go back to the basic constraints of memory, bandwidth, and compute to reason about them. This article first clarifies the architectural differences, then explains why speculative decoding “fails,” and finally offers an evaluation methodology and a practical checklist.
1. The Capability Gap That Mid-Sized Dense Models Fill
From an engineering perspective, open-source models fall into roughly three tiers:
- Edge / small models: on the order of hundreds of millions to a few billion parameters. Low memory footprint, can run offline on-device, but limited in complex reasoning and long-instruction following.
- Mid-sized dense models: on the order of ten-plus billion parameters. Every token activates all parameters, striking a balance between quality and cost. Consumer hardware can host them after quantization, and a single data-center-class GPU can run them at relatively high precision.
- Large MoE models: large total parameter counts, with only a few experts activated per token. High quality ceiling and small per-token compute, but all experts must stay resident in VRAM or memory.
What mid-sized dense models fill is precisely the gap between “edge models that aren’t good enough” and “large models you can’t afford.” Their value isn’t that they lead on any single capability, but that they offer a default option whose cost, quality, and deployment complexity are all reasonably under control. Whether you pick one ultimately depends on two kinds of data: quality evaluations on your task set, and stress-test results on your target hardware.
2. Dense vs. MoE: Parameter Count Is Not Resource Cost
Understanding the difference between the two architectures is a prerequisite for analyzing MoE’s performance:
- VRAM: MoE’s VRAM footprint is determined by total parameters. You load all 26B, not just the 4B that are activated.
- Compute: Compute per token depends only on the activated parameters. About 4B activated means very fast prefill, and an advantage when batches are large and compute-bound.
- Bandwidth: Autoregressive decoding reads all weights for every token generated, so per-token latency is roughly “bytes that must be read ÷ memory bandwidth.” MoE reads only the routed experts per token, so bandwidth pressure is far smaller than for a dense model with the same total parameters.
So whether MoE pays off depends on two cases:
- Ample VRAM, large batches, compute-bound: MoE has a clear advantage.
- Tight memory, partial offloading needed, or running on a device where CPU and GPU share memory: the experts that aren’t activated still occupy memory. Swapping them in and out repeatedly not only competes for the already-tight memory bandwidth but also adds scheduling and synchronization overhead. Total cost of ownership isn’t necessarily lower.
The community feedback that “MoE is better on unified-memory devices” falls into the latter case. This also shows that model selection can’t rest on parameter count alone — it should be based on real measurements in the target deployment environment.
3. Speculative Decoding and MTP: Where the Gains Come From and Where They Stop
The basic idea of speculative decoding is “draft first, verify later”: a lightweight draft source proposes several candidate tokens in a row, and the target model verifies them all in a single forward pass. Accepted tokens are taken directly, and everything from the first mismatch onward is discarded. This does not reduce output quality, because the verification logic guarantees the final distribution matches what the target model would produce on its own; all that changes is “trading one expensive weight read for several tokens.”
MTP-based implementations build the drafting ability into the model: one or more lightweight prediction heads are trained alongside the backbone, and at inference time they are unrolled autoregressively to produce the draft. Compared with bolting on a separate small model as the draft, this has three advantages:
- No need to load a separate draft model’s weights, so no extra VRAM footprint;
- The draft shares context representations with the backbone, so draft quality is usually higher;
- Simpler deployment.
But the MTP module must be trained to be useful, and its quality clearly depends on whether training was sufficient and whether inference-framework support is mature.
A simplified model makes the boundaries of the gains clear:
E(α, γ) = (1 - α^(γ+1)) / (1 - α) # expected tokens produced per verification stepS = E / (γ·d + v + o) # relative speedup; time normalized to one target-model token decodewhere:α: probability a draft token is accepted at a single positionγ: draft lengthd: per-step draft cost; usually small when MTP ships its own draft headv: extra cost of verifying γ+1 positions; larger when batches are small / more compute-boundo: fixed overhead for sampling, KV management, scheduling, etc.
Plugging in measured data: an acceptance rate of about 0.64 and a draft length of 2 give an expected 1.90 tokens per step; the measured decoding speedup is 1/(1.90/0.87) ≈ 0.46. In other words, the extra overhead from drafting and verification alone amounts to more than 0.7 of a target-model decode.
This also explains why speedups diverge noticeably across tasks even when acceptance rates are similar:
- Code tasks reach an acceptance rate of 0.76 and get a 1.18x speedup — only there does the output surplus offset the extra overhead.
- General Q&A holds an acceptance rate on par with the overall figure (0.65), yet the speedup is only 0.87.
- Among these, role-play tasks produce long, open-distribution output, and latency is amplified to 1.24x.
So the acceptance rate is a necessary condition, not a sufficient one; you also have to look at draft length, draft cost, and output length, and in the end you must judge by end-to-end latency. Two points also deserve attention:
- The acceptance probability at each position is not constant; it fluctuates with context.
- The longer the output, the more thoroughly the relative impact of per-step overhead is amortized.
The tasks in the table are category aggregates; whether a single long response benefits equally depends on the distribution of response lengths.
A few more things are easy to overlook:
- Effect of sampling temperature: MTP heads are usually matched to a specific training configuration, and the acceptance rate drifts noticeably once you change sampling temperature and other parameters.
- Relationship to other acceleration techniques: Speculative decoding acts on the decoding stage and barely improves prefill. Once a model is compressed by quantization, graph optimization, and similar means, the decoding stage is already fast, so speculative decoding’s marginal gain shrinks accordingly.
- Trade-offs in high-concurrency scenarios: When server-side concurrency is high, the batch itself provides throughput, and the extra draft and verification computation becomes a burden instead. Speculative decoding suits low-concurrency scenarios that pursue single-request latency.
- Bugs during debugging: For example, a multi-branch draft tree needs a dedicated branch attention mask to keep the branches from interfering with each other, and implementation defects directly lower the acceptance rate.
So changing “on by default” to “enabled adaptively by scenario and task” is the safer strategy. A sketch implementation:
# Illustrates only the adaptive-control idea; parameters must be calibrated with real measurementsALPHA_MIN = 0.65 # if acceptance falls below this, try shortening the draftMAX_DRAFT = 4def draft_len(accept_history, current=2):alpha = sum(accept_history) / len(accept_history)if alpha < ALPHA_MIN and current > 1:return current - 1 # low acceptance: shorten the draft to cut wasted draft costif alpha > 0.85 and current < MAX_DRAFT:return current + 1 # high acceptance: lengthen moderately to amortize fixed overheadreturn current
4. Getting Evaluation Right: A Reproducible Benchmarking Method
All the conclusions above depend on evaluation data, and whether the evaluation itself is reliable determines whether the conclusions are trustworthy. Aim for at least the following:
- Hold variables fixed: Except for the item under test, keep sampling parameters, quantization, context length, and concurrency consistent. If model precision or quantization format differs, you can’t compare directly across them.
- Warm up and repeat: The first run carries loading, compilation, and caching overhead. After sufficient warm-up, take the median or a specified percentile to avoid letting a single fluctuation dominate the conclusion.
- Percentiles and phase-split timing: Report time-to-first-token, average per-token time, and end-to-end P90/P99 together, and separate the prefill and decode phases.
- Evaluate by task: Measure acceptance rate and speedup separately across code, math, writing, multilingual, and other dimensions, so averages don’t hide the differences.
- Cover multiple hardware and concurrency tiers: Measure on-device, workstation, and server, and across different concurrency levels, because the conclusions may reverse.
- Use business datasets: Business outputs differ in length distribution and degree of structure; public benchmarks are only a starting point.
The comparison framework for stress-test results can be written as:
python3 bench.py --compare \--base 12b_draft0.json \--spec 12b_draft2.json# columns to watch: task category | predicted tokens per request | decode speedup | average latency | latency speedup | acceptance rate
A report should state at least: hardware model, quantization precision, inference engine and version, draft length, sampling parameters, task set, and sample count.
5. Selection and Deployment: From Measured Data to Decisions
5.1 Memory and VRAM budget: do the math before selecting
Beyond the weights, the KV cache and the draft module also consume resources. The KV cache can be estimated with:
KV bytes ≈ 2 × num_layers × num_kv_heads × head_dim × seq_len × concurrency × bytes_per_element
The num_kv_heads term in this formula matters a lot. Models that use grouped-query attention (GQA) and similar techniques have far fewer KV heads than attention heads, which significantly reduces KV cache overhead even for long contexts.
Decide in the following order:
- Given that it’s usable, prefer the model with stronger capabilities and a more mature ecosystem.
- When resources are tight, choose the candidate that produces more per unit of resource, for example whether it can hold quality stably after low-bit quantization.
- When precision drops or throughput falls short, then consider sparse architectures like MoE, and validate their total cost in the target environment with real measurements.
- Treat speculative decoding only as a nice-to-have, and judge by end-to-end P90 latency, not by acceptance rate.
5.2 Engineering points for cloud deployment
- Unified service interface: Wrap model serving through a “model-as-a-service” hosted capability that stays compatible with mainstream API protocols, letting applications switch transparently between models of different sizes. Baidu AI Cloud products also emphasize this kind of compatibility.
- Auto-scaling: Scale elastically based on request volume or queue length to avoid reserving too many resources for peaks.
- Canary and rollback: Roll out a new model or decoding configuration to a small traffic slice first, using time-to-first-token, P99 latency, cost per request, and spot-checked quality as rollback criteria.
- Observability: Use log services and a monitoring and alerting system to bring acceptance rate, draft length, prediction rate, and similar metrics into monitoring, rather than only glancing at them during offline stress tests.
- Tiered routing: Edge and local devices handle privacy-sensitive or low-complexity requests, while the cloud handles high-complexity and long-context requests. For finer granularity, decide whether to enable speculative decoding based on whether the output is structured (for example, code or JSON).
Conclusion
The arrival of 12B-class open-source models gives developers a more balanced choice beyond edge small models and large MoE models. The community feedback is a reminder that an acceptance rate of 0.7 does not simply invert into the 0.87x figure, and it certainly doesn’t mean a speedup. Whether speculative decoding delivers gains comes down to a competition between “expected accepted length” and “extra overhead.” The smaller the target model, the more open the output, and the higher the concurrency, the more the balance tips toward the overhead side.
The reliable approach is always the same: get the evaluation solid first, then let data drive selection. On Baidu AI Cloud, this kind of practice can be carried out by combining model hosting services, auto-scaling, and monitoring and alerting capabilities, so that every model iteration rests on evidence.
