Gemma 4 vs Qwen 3.5: How to Choose Small LLMs for Local Deployment
Benchmark rankings don't automatically translate into a good choice for local deployment. This guide lays out a reusable framework for selecting small open-source language models for on-device use. It breaks "strong" into six capability dimensions, shows how to estimate VRAM and generation speed from model weights, KV cache, and memory bandwidth, compares dense and mixture-of-experts (MoE) architectures on both text and vision tasks, and provides scenario-based selection advice, a reproducible visual-evaluation method, and practical tuning tips for quantization, context length, and prompting.
Introduction: Strong Benchmarks Don’t Guarantee a Good Fit for Local Deployment
Small open-source models — typically models small enough to run on their own on consumer hardware, in the range of a few billion to tens of billions of parameters — keep iterating at a fast pace. After each release, leaderboards and benchmark scores quickly become the center of community discussion, and some new models even overtake the previous generation’s popular models. But there is often a gap between benchmark performance and real-world experience, for three main reasons:
- Benchmark tasks differ from real tasks: Scores measure standardized questions, while you face real problems in your own domain.
- Inference speed doesn’t equal generation quality: Local deployment is also constrained by VRAM capacity, memory bandwidth, quantization format, context length, and other factors, so the same model can behave very differently on different machines.
- General capability doesn’t equal vision capability: A model that excels at text reasoning may not be equally strong at image understanding.
So there is no single answer to “which is stronger.” The more useful questions are: How do you define “strong”? How do you measure it? And under your own hardware and task constraints, how do you make a reasonable choice? This article offers a reusable approach to selecting small local models across five areas: capability dimensions, hardware constraints, scenario selection, evaluation methods, and deployment tuning. For clarity, the article uses as examples 4B–8B-class dense models, an MoE model with roughly 26 billion total parameters and about 4 billion active per token, and an MoE model with both total and active parameters around 4 billion. Specific results in the conclusions should always be confirmed with your own testing.
1. Capability Layers: Define “Strong” Before Choosing
“Strong” is not a single metric. At minimum, it breaks down into six dimensions:
- General language ability: Instruction following, multi-turn dialogue, summarization, translation, and structured output (such as JSON).
- Math and logic reasoning: Arithmetic, algebra, logic puzzles, multi-step reasoning, and generalization to unfamiliar problem types.
- Code and tool calling: Code generation and explanation, function calling, and argument construction — these determine whether a model can plug into automated workflows.
- Multilingual and domain knowledge: Whether Chinese reads naturally, and how well the model understands industry terminology and professional context.
- Visual understanding: Recognizing image details, parsing documents and charts, describing scenes, and so on. This depends on the quality of joint training between the vision encoder and the language model, and it does not always track text capability.
- Engineering properties: Generation speed (tokens/s), time to first token, memory usage, quantization compatibility, and output stability. This dimension determines whether a model can run smoothly and reliably on your hardware.
A common pattern shows up across many local deployment experiences:
- Dense models in the 4B–30B range and MoE models with similar active-parameter counts perform closely on math and logic reasoning, and everyday problems are generally not a challenge. For daily use, the differences are often smaller than the effect of sampling parameters, prompt phrasing, and how you organize context.
- On visual tasks such as image understanding, however, the gaps between models widen noticeably, and the ranking can even diverge from their text-capability ranking.
So the first step in selection is not asking “which has the higher score,” but listing your core scenarios, defining a minimum acceptable standard for each dimension, and then making trade-offs based on your hardware.
2. Deployment Constraints: Estimating VRAM, Bandwidth, and Speed
2.1 VRAM/memory needs: weights, KV cache, and runtime overhead
Local inference memory needs can be roughly broken into three parts:
Total requirement ≈ model weights + KV cache + runtime overhead
Model weight size depends on parameter count and quantization precision:
- Under FP16, each parameter takes about 2 bytes;
- Under 8-bit quantization, about 1 byte;
- Common 4-bit levels (such as Q4_K_M) run to roughly 0.5–0.6 bytes per parameter in practice, due to mixed-precision design choices.
From this, some rough estimates follow:
- A 7B–9B-class dense model has weights of about 4–5.5 GB after 4-bit quantization;
- An MoE model with about 26 billion total parameters — even if only about 4 billion are active per token — must keep all weights resident in memory, at roughly 14–17 GB;
- An MoE model with both total and active parameters around 4 billion has weights of about 2–3 GB.
The KV cache stores the attention keys and values for historical tokens, and its size is roughly proportional to sequence length. Per-token usage can be estimated with:
Per-token KV ≈ 2 × num_layers × num_kv_heads × head_dim × bytes_per_elementTotal KV = per-token KV × sequence length
Taking “32 layers, 8 KV heads, head dimension 128, FP16” as an example, each token needs about 128 KB, and an 8K context needs about 1 GB. Push the context further, or feed in multiple high-resolution images at once (vision models often encode an image into hundreds or even thousands of visual tokens), and this usage climbs quickly. Some models use grouped-query attention (GQA), sliding-window attention, or low-precision KV caching to shrink the overhead; rely on the chosen model’s technical documentation for actual numbers.
2.2 Generation speed: mainly bounded by memory bandwidth
Token-by-token generation is a classic memory-bound workload. For every token generated, the inference process reads the participating weights once more, so the upper bound on generation speed is roughly:
tokens/s ≈ effective memory bandwidth ÷ bytes actually read per token
This rule leads to a few practical takeaways:
- Bandwidth sets the ceiling: On discrete GPUs or unified-memory devices with about 200–500 GB/s of bandwidth, a 4-bit-quantized 7B–9B model typically generates at around 15–40 tokens/s, enough for smooth interactive dialogue.
- Large MoE models read less, but are still bandwidth-bound: With only a few billion active parameters, a 4-bit-quantized model reads about 2–3 GB per token in practice. Combined with unified memory, a 30B-class (total-parameter) MoE model can also reach an acceptable generation speed. Actual read volume, however, depends on expert routing and quantization format, while capacity requirements are always based on total parameters.
- Time to first token depends on compute: The “prefill” stage must process the entire input in parallel and is dominated by GPU compute. With long inputs, or several images sent at once, the wait for the first token grows noticeably.
- Two GPUs don’t scale linearly: Splitting across cards (tensor parallelism) can reduce per-token read volume and boost speed, but inter-card communication itself consumes bandwidth. Interconnect bandwidth between consumer GPUs is limited, so gains often fall short of expectations. For inference-only scenarios, a device with large unified memory is usually the better value.
2.3 Comparing two typical hardware setups
Assume both devices run 4-bit-quantized candidate models:
- Device A: A discrete GPU with 8 GB VRAM paired with about 24 GB of RAM, with VRAM and memory connected over the PCIe bus;
- Device B: Large unified memory (about 24 GB or more), but lower memory bandwidth than the discrete GPU.
Each has its trade-offs:
- A 4B-class model fits entirely in Device A’s VRAM, giving the smallest per-token read volume and the smoothest interaction. Longer contexts and visual inputs can be offloaded to memory, but at the cost of speed.
- Device A’s VRAM cannot fully hold an MoE model with 26 billion total parameters. If you force layered offloading to spread weights into memory, every token has to move data over PCIe, and speed may end up slower than Device B.
- Device B can hold all the weights of such a large MoE model at once, with speed determined by memory bandwidth and active-parameter count. But against a 9B-class dense model, it may actually fall behind Device A, because more data is read per token.
The lesson: there is no “better-configured device,” only a “device that better matches the model architecture.” Dense models favor high-bandwidth VRAM, while MoE models with few active parameters are more capacity-hungry.
3. Visual Recognition: The Dividing Line for Small-Model Selection
3.1 Why professional image recognition is especially hard for small models
This section uses a museum scenario as an example: testing several small models’ image-understanding ability with personal photos of stone inscriptions, stone carvings, paleontological fossils, pottery, and bronze ware. This task is representative:
- Fine-grained targets: You need to identify ornamentation types, vessel shapes, materials, and even inscription content. This is fine-grained recognition, entirely different from coarse classification like “cat vs. dog.”
- Challenging imaging conditions: Display-case glass reflections, dim lighting, oblique angles, and cluttered backgrounds are all harsher than standard datasets.
- Dense terminology: Correct answers require domain knowledge, and vague or fabricated descriptions are easy to spot.
What drives performance is not so much how strong the language model is, but rather:
- The vision encoder’s resolution and tiling strategy: Inscriptions and small ornaments can only be recognized at a sufficiently high effective resolution;
- The quality of vision-language alignment data: How rich the covered professional images are determines whether the model can correctly translate “what it sees” into “what it says”;
- The language model’s own knowledge base: This affects terminology usage and depth of description.
3.2 How different architectures differ on vision tasks
In these tests, a common pattern emerges:
- MoE models with larger total parameters usually clearly outperform small dense models with similar active-parameter counts at visual recognition;
- 4B-class dense models and MoE models with both total and active parameters around 4 billion trade wins and losses on vision;
- 8B–9B-class dense models often lead in recognition accuracy and level of descriptive detail.
The reason is not hard to understand: a single token can only activate part of the experts, so the model must call on all the knowledge relevant to the current task in one forward pass. An MoE model with larger total parameters has a larger “reserve” of callable knowledge. But this rule is not ironclad — vision-language alignment quality, input resolution, and prompt wording can all shift the ranking, so real testing is still required.
3.3 An actionable vision evaluation method
① Build a small custom evaluation set: For each object category, prepare 20–30 personally taken photos covering front, side, and close-up views under different lighting conditions, and have someone familiar with the domain annotate a “standard description” as a reference baseline.
② Score across multiple dimensions: Give each response a five-level score on the following:
- Whether the main subject is correctly identified;
- Whether details such as ornamentation and inscriptions are recognized;
- Whether terminology is used properly;
- Whether the description is reasonable and detailed;
- Whether fabricated content (hallucination) appears.
③ Unify conditions: Have all models use the same set of images, the same prompts, and similar sampling parameters. Repeat each sample 2–3 times and average, and have multiple raters score independently to reduce subjective bias.
④ Reference example prompt:
You are a museum artifact interpretation expert. Look carefully at the exhibit in the image and respond as follows:1. Identify the category of the artifact and its likely date range;2. Describe its shape, decoration, material, and craftsmanship features;3. If any inscription is legible, transcribe it as best you can; for parts you cannot make out, clearly state "unable to identify" rather than guessing.Answer only based on information visible in the image.
The “clearly state when unsure” instruction is especially important — it significantly reduces the model’s tendency to fabricate inscriptions.
⑤ Add an assisted check: You can bring in a larger model as a “judge” to help verify the consistency between candidate answers and the standard descriptions, improving scoring efficiency. But note that the judge model can also make mistakes, so the final result should still rest on human judgment.
Once evaluation is done, organize the results into a comparison table that clearly shows each model’s strengths and weaknesses across dimensions:
| Evaluation dimension | 4B-class dense | MoE (~4B total / ~4B active) | 8B–9B-class dense | MoE (~26B total / ~4B active) |
|---|---|---|---|---|
| Math & logic reasoning | Solid on everyday tasks | Solid on everyday tasks | Solid on everyday tasks | Solid on everyday tasks |
| Professional image recognition accuracy | Trades wins with 4B-class MoE | Trades wins with 4B-class dense | Usually ahead of 4B-class dense | Usually ahead of small models with similar active params |
| Image description detail | Depends on vision alignment quality | Depends on vision alignment quality | Depends on vision alignment quality | Usually richer |
| Hallucination control | Needs explicit “say so when unsure” instruction | Same | Same | Same |
| VRAM/memory usage (4-bit) | ~2–3 GB | ~2–3 GB | ~4.5–5.5 GB | ~14–17 GB |
| Deployment fit | Fits fully in 8 GB VRAM, smooth speed | Runs on a range of devices | Fits fully in 8 GB VRAM, smooth speed | Needs a large-memory device to hold weights |
4. Scenario-Based Selection: From General Capability to Specific Tasks
Beyond the general patterns above, different scenarios place different demands on model capability. Use the following table to narrow the candidate pool:
| Typical scenario | Core requirement | Selection advice | Tuning tips |
|---|---|---|---|
| Document QA, knowledge base retrieval | Long context, faithfulness to source, low hallucination | 8B-class and above is safer; set context as needed | Control retrieved chunk length; require citations in prompts |
| Code assistance & script generation | Code correctness, tool-calling ability | Prefer models that stand out in code-specific evaluations | Keep code block formatting; enable structured output constraints |
| Math & logic tutoring | Multi-step reasoning stability, clear explanation | 4B–9B-class models are usually enough | Lower randomness; require step-by-step derivations |
| Image understanding (relics, receipts, charts, etc.) | Recognition accuracy, detail description, terminology | Choose larger models within VRAM limits | Increase input resolution; provide examples and a domain glossary |
| Long-document summarization & translation | Long context, multilingual ability | For large context needs, prefer large-memory devices | Summarize in segments, then combine; specify output length |
| Offline / edge devices | Low power, low latency, small footprint | 4B-class and smaller dense models | Use lower-bit quantization; cap max output length |
5. Deployment Tuning: Getting More Out of the Same Model
① Don’t over-quantize: 4-bit quantization usually strikes a good balance between quality and size. For tasks sensitive to numerical precision such as math and code, compare higher-bit quantization levels; for tasks like intent recognition and simple classification, low-bit quantization is often enough.
② Set context length correctly: Bigger is not always better. The KV cache grows linearly with length, and overly long contexts not only crowd out VRAM but can also dilute the model’s attention. For long conversations, combine rolling summaries to compress history while preserving key information.
③ Use layered offloading wisely, and watch time to first token: When VRAM is insufficient, you can run some layers on memory or the CPU. Layer boundaries should align with hardware bandwidth characteristics, otherwise speed drops noticeably. If interactive responsiveness matters, consider inference frameworks that support acceleration schemes such as speculative decoding.
④ Fix prompts and sampling parameters:
- Check whether the chat template matches the model;
- For fact-sensitive tasks, lower randomness parameters such as temperature;
- For creative tasks, raise them appropriately to increase variety.
⑤ Establish a performance baseline: Use a fixed set of samples to record each model configuration’s generation speed, time to first token, and peak memory, so you can compare when swapping models or adjusting quantization later.
Example code:
import timefrom statistics import mean# Custom evaluation set: each item has a task type, input (with image path), and reference answer or rubricCASES = [{"id": "math_01", "type": "math", "input": "...", "reference": "..."},{"id": "vision_01", "type": "vision", "image": "relic_01.jpg", "rubric": "..."},# ...]def evaluate(engine, cases, repeats=3):"""engine wraps the local inference interface and supports at least chat() and stats()"""results = []for case in cases:latencies, speeds = [], []for _ in range(repeats):start = time.perf_counter()answer = engine.chat(messages=[{"role": "user", "content": case["input"]}],image=case.get("image"), # empty for text-only taskstemperature=0.2, # fixed sampling params to keep conditions identical across models)elapsed = time.perf_counter() - startlatencies.append(elapsed)stats = engine.stats() # returns prompt_tokens, completion_tokens, etc.speeds.append(stats["completion_tokens"] / elapsed)results.append({"id": case["id"],"type": case["type"],"answer": answer,"avg_latency_s": round(mean(latencies), 2),"avg_speed_tps": round(mean(speeds), 1),"peak_memory_gb": engine.stats()["peak_memory_gb"],})# Next: score answers with human raters or a judge model, then aggregate scores per dimensionreturn results
6. Common Pitfalls
- Ranking-only thinking: Public leaderboards test relatively fixed tasks that may not cover your business scenarios.
- Parameter-count-only thinking: A large-total-parameter MoE model isn’t necessarily more usable than a comparable dense model; active parameters, vision alignment quality, and quantization method all matter.
- Overlooking vision-capability differences: Models that perform similarly on text reasoning can pull clearly apart on visual recognition.
- Blindly extending context: Longer context does not mean the model uses more information.
- Treating subjective impressions as conclusions: An impression drawn from a single photo and one test is not enough to support a procurement or technology-selection decision.
7. Conclusion: Return to Scenarios and Real Testing
Facing the frequent release of new-generation open-source small models, instead of asking “which is strongest,” build a stable selection method:
- Define core scenarios and hard constraints: Include hardware specs, response-time requirements, and data-compliance requirements;
- Break capability into scenario-specific dimensions: Set a weight and a passing threshold for each dimension;
- Estimate memory usage and generation speed: Use the estimation methods in this article to quickly filter out unsuitable candidates;
- Test with a small custom evaluation set: Validate repeatedly on core scenarios and track results with regression testing;
- Continuously optimize the deployment configuration: Adjust quantization, context, and prompts so the model’s potential is fully realized.
When local devices cannot meet the needs of concurrency, multi-user access, or large-scale batch processing, you can use a cloud container platform to host the inference service, combined with common capabilities such as elastic scaling, object storage, logging, and monitoring/alerting (cloud providers such as Baidu AI Cloud offer these capabilities), to smoothly scale a model validated locally into an online service.
Ultimately, the strongest model is the one that performs most stably and delivers the smoothest experience under your own scenario and hardware conditions.
