# Selecting Small On-Device Models: A Scenario- and Compute-Aware Evaluation Framework
Benchmark scores are rarely the deciding factor when you deploy small models on-device. This article lays out a reproducible selection method: decompose "model size" into five independent dimensions, estimate memory footprint in three parts (weights, KV Cache, runtime overhead), assign explicit capability weights per scenario, and validate candidates with a 30–100 case in-house eval set that includes questions the candidates actually fail. It also covers why fine-grained visual recognition is the task most often misread by public leaderboards, and how to turn the results into a tiered edge/cloud routing design with continuous regression monitoring.
1. Where the problem starts: strong benchmark numbers, still hard to choose
The value of deploying small models locally is well established: data never leaves the machine, latency stays predictable, there is no per-call marginal cost, and the app keeps working offline. But once the candidate pool holds several models with “similar parameter counts, similar activation counts, close public scores,” selection quickly degrades into a subjective voting exercise among your own hands-on impressions — which is the least reliable thing you can do in engineering.
Take a typical local experiment. On a thin-and-light laptop with a discrete GPU (8 GB VRAM), an integrated GPU, and 24 GB of unified memory, four candidates were loaded with 4-bit medium-precision group quantization: a dense 4B, a sparse-activation model (roughly 26B total parameters, about 4B activated per forward pass), a dense 9B, and one “efficiency-tier” small model. On math and logic problems, the four were essentially indistinguishable in practice. On fine-grained visual recognition of museum artifacts, the ranking was clear: dense 9B best, the sparse 26B and dense 4B trading places, the efficiency-tier model weakest.
The value of this observation is not the ranking itself. It is what it reveals about the real structure of model selection: language-side capability has already converged in the small-size range, and almost all differentiation now lives in long-tail tasks and fine-grained visual perception. So the right approach is not to find the “strongest model.” It is to quantify constraints first, define scenario weights second, and validate with your own eval set third.
2. Decompose “small model” into measurable variables
Before selecting anything, break the vague notion of “model size” into five independent dimensions. Their cost/benefit curves are completely different:
- Total parameter count: determines weight footprint and on-disk size; the main driver of memory usage.
- Activated parameters per forward pass: sparse-activation architectures trade larger total parameters for more knowledge capacity while activating only a small subset, so compute cost stays close to that of a much smaller model. The price is that memory bandwidth and VRAM usage scale with total parameters.
- Quantization precision: weight bit-width affects footprint roughly linearly, but tasks differ enormously in how sensitive they are to the resulting quality loss.
- Context length: the most frequently ignored hidden cost. KV Cache grows linearly with context, and in long-document scenarios it can consume more memory than the weights themselves.
- Vision input budget: multimodal models encode images into a sequence of visual tokens that gets prepended to the language context. A single high-resolution image can contribute anywhere from hundreds to thousands of tokens, directly squeezing usable text context and inflating time-to-first-token.
Laid out this way, dense 4B, sparse-activation 26B, and dense 9B have no monotonic ordering. They simply sit at different points on the footprint–capability plane.
3. The deployment side: memory footprint is the first constraint
Don’t estimate footprint from a single rule of thumb. Compute it in three parts and reserve room for runtime overhead.
def estimate_memory(params_b, bits_per_weight=4.5,layers=32, kv_heads=8, head_dim=128,ctx=8192, batch=1, kv_bits=16, vision_tokens=1024):"""Rough estimate of resident memory for local inference, in GB."""# 1) Weight footprintweights = params_b * 1e9 * bits_per_weight / 8 / (1024 ** 3)# 2) KV Cache: 2 (K and V) * layers * KV heads * head dim * seq len * batch * bytes per elementkv_bytes = 2 * layers * kv_heads * head_dim * (ctx + vision_tokens) * batch * kv_bits / 8kv = kv_bytes / (1024 ** 3)# 3) Runtime overhead: activations, operator workspaces, intermediate image-encoder tensors, 10%-20% empiricallyoverhead = (weights + kv) * 0.15return round(weights, 2), round(kv, 2), round(weights + kv + overhead, 2)
A few practical conclusions:
- 4-bit group quantization usually costs only a slight quality loss and is a sensible default starting point for local deployment. For long contexts, high-precision numerics, or code completion, however, A/B test 5–6 bit instead. Measured differences often explain far more than leaderboard positions.
- KV Cache can be quantized separately (for example to 8-bit). The payoff is significant in long-document scenarios, but a few models show stability issues, so regression testing is mandatory.
- Put a hard cap on the maximum number of visual tokens per image. For multi-image conversations or PDF-to-image pipelines, an uncapped budget will exhaust the context within a dozen or so turns.
- On laptops with mixed discrete and integrated GPUs, distinguish “it loads” from “it interacts smoothly.” Once weights spill into unified memory, latency degrades from a few hundred milliseconds to seconds.
4. The scenario side: task type determines capability weights
Different scenarios weight capabilities completely differently. Making those weights explicit turns selection from a feeling into a weighted score:
| Scenario | Key capability | Main constraint | Selection tendency |
|---|---|---|---|
| Logic / math reasoning | Reasoning depth, instruction following | Moderate context | A small dense model is enough; parameter scale is not the lever |
| Structured extraction (invoices, forms) | Format stability, low hallucination | Output parseability | Prioritize format compliance and retryability |
| Long-document summarization / QA | Effective use of long context | Memory + time-to-first-token | Watch KV Cache behavior and “lost in the middle” performance |
| Fine-grained visual recognition | Texture, ornamentation, material detail | Image resolution and vision token budget | Vision encoder quality > language-side parameters |
| Real-time interaction / on-device assistant | Low latency, offline availability | On-device compute and power | Small activation count + short context |
| Batch offline processing | Throughput, unit cost | No latency requirement | Can move to cloud; select on throughput, not latency |
One caveat deserves emphasis. On language reasoning and math tasks, differences in the small-size range are often masked by insufficient task difficulty. If every candidate scores above 90% on your eval set, the set has lost its discriminating power. An eval set must contain questions the candidates get wrong, otherwise you are measuring luck rather than capability.
5. Why fine-grained visual recognition is the most easily misread
Fine-grained visual recognition — carved inscriptions on steles, chisel technique in stone sculpture, skeletal structure in fossils, cord-marking on pottery, patina and mold-seam lines on bronze — is a fundamentally different difficulty class from generic image captioning. The former requires verifiable judgments on local texture; the latter only requires globally plausible semantics. Success here is usually not determined by language-side parameter count, but by the following:
- Input resolution and tiling strategy: fine details of small targets are already destroyed by low-resolution preprocessing, and no model can recover them. For text- or ornament-heavy images, tiling and then running inference tile by tile before aggregating typically beats swapping in a larger model.
- Vision token budget: more tiles linearly amplify token consumption, which has to be traded off against the context window.
- Hallucination tendency: models tend to “fill in” attributes they consider plausible — inventing inscriptions, fabricating era marks. In high-reliability scenarios, abstaining is more valuable than guessing, so “don’t say what you shouldn’t” belongs in the rubric.
- Prompt structure: asking the model to state visible evidence first and only then a conclusion, with explicit permission to answer “uncertain,” measurably reduces fabrication.
6. Build your own eval set and scorer
This is the core of the whole method. It does not need to be large — 30 to 100 cases covering the long tail is enough — but the structure has to be rigorous.
{"case_id": "v-0142","task": "fine_grained_visual_caption","input": {"image_uri": "<artifact image URI in object storage>","prompt": "Describe vessel shape, material, and ornamentation; state only evidence visible in the image; indicate uncertainty where you cannot determine an attribute."},"reference": {"entities": ["everted rim", "cord mark", "gray pottery"],"attributes": {"material": "pottery", "ornamentation": "cord mark", "vessel_type": "jar"},"must_not_claim": ["inscription", "era mark"]}}
The scorer decomposes a subjective description into four computable components:
def score(case, pred, pred_attr, detail_rubric):ref = case["reference"]entity_hit = hit_ratio(pred, ref["entities"]) # recall of key elementsattr_hit = mean([pred_attr(k) == v for k, v in ref["attributes"].items()])detail = detail_rubric(pred, dims=["material", "ornamentation", "vessel_type", "condition", "observation_basis"]) # 1-5over_claim = 1.0 if any(x in pred for x in ref["must_not_claim"]) else 0.0return 0.3 * entity_hit + 0.3 * attr_hit + 0.2 * (detail / 5) + 0.2 * (1 - over_claim)
On the client side, route every call through the standard HTTP API exposed by your local inference runtime. That way the same eval code can run against both local and cloud candidates:
import json, urllib.requestdef chat(base_url, model, messages, max_tokens=1024, temperature=0.0):body = json.dumps({"model": model, "messages": messages,"max_tokens": max_tokens, "temperature": temperature}).encode()req = urllib.request.Request(base_url.rstrip("/") + "/v1/chat/completions", data=body,headers={"Content-Type": "application/json"})with urllib.request.urlopen(req, timeout=120) as r:return json.loads(r.read())["choices"][0]["message"]["content"]
Three pieces of engineering discipline go with this. Set temperature to 0 and fix the random seed so results are reproducible. Repeat each case three times and take the majority, to surface the jitter of recognition models on boundary samples. Score fine-grained visual cases with two-person blind review or a judge model, and keep the raw outputs for attribution analysis.
7. Turning conclusions into engineering: tiered routing and edge/cloud cooperation
The output of model selection should not be “pick one.” It should be layered:
- On-device primary: covers high-frequency, privacy-sensitive, low-latency tasks. The model spec is derived backward from the memory ceiling (for example, 24 GB unified memory that must hold both weights and an 8K context — the actual affordable total parameter count and quantization bit-width follow the formula in Section 3).
- Cloud fallback: long-tail and high-precision tasks (complex multi-image comparison, cross-chapter reasoning over long documents, formal customer-facing copy) go to the cloud. These needs are usually met by composing general cloud building blocks: a model service platform for unified access and routing, object storage to hold the eval image set and its versions, a container platform to run batch inference jobs, and logging plus monitoring with alerts to observe call quality. On a general-purpose cloud such as Baidu AI Cloud, these capabilities — model service platform, object storage, container platform, logging and monitoring — can be combined in the standard way and require no customization of any specific API.
- Routing policy: decide whether to escalate to the cloud based on task type plus confidence signals (the model declaring uncertainty, missing structured fields, low recall of visual elements). Routing everything to the cloud erases the cost advantage.
8. Observability after launch
Model selection is not a one-time action. After launch, keep tracking: task success rate and human rewrite rate; recall of key elements and over-claim rate; P95 latency to first token and throughput; cost per task; and the regression delta before and after a quantization change. Bind these metrics to the eval set version, and you can tell — when you swap models, swap quantization, or swap hardware — whether things actually got better or the eval set simply stopped working.
9. Conclusion: the right selection order
Back to the original question. The reproducible selection order is four fixed steps: filter by memory and latency constraints to find physically viable candidates; make capability requirements explicit using scenario weights; run blind scoring with your own eval set, including questions the candidates get wrong; then design a tiered edge/cloud routing policy and wire it into monitoring for continuous regression.
Inside this framework, “which model is stronger” stops being a question a leaderboard can answer. It decomposes into several measurable sub-questions. Language reasoning and math have already become largely homogeneous in the small-size range. Real differentiation happens in fine-grained visual perception, effective use of long context, and output reliability — and those are exactly the three things public benchmarks cover least well.
