Can On-Device Multimodal Models Actually Run? Memory, Bandwidth, and Benchmarking Methods

    This article examines the feasibility of deploying multimodal large language models on mobile devices. It provides a technical framework for estimating memory footprint, calculating theoretical decoding speed limits, and stress-testing models in a reproducible way. Aimed at developers integrating multimodal capabilities into mobile apps, the piece separates total parameter count from active parameters, explains the role of bandwidth as a bottleneck, and outlines failure modes in on-device infrastructure. It also presents a device evaluation checklist and discusses when cloud-based processing remains necessary.

    Why On-Device Intelligence Is Worth Pursuing Now

    For over a decade, computing resources have trended from centralized toward distributed. Early on, only a few institutions could afford the compute now packed into every personal phone. In the early days of large language models (LLMs), almost all user-facing intelligence ran in cloud data centers; the terminal only captured input and displayed results.

    Today, multimodal models with general visual understanding, OCR, chart parsing, and mathematical reasoning capabilities are beginning to run on mobile devices. Whether they can run stably depends on three factors: whether the model can perform inference with small active parameter counts, whether the hardware provides sufficient memory capacity and bandwidth, and whether the runtime software can execute reliably across various chips. Only when all three are met does the capability truly reach the edge.

    This article is written for developers who want to bring multimodal capabilities into mobile apps. It begins by explaining how to estimate memory usage, then derives the upper bound of decoding speed, presents a reproducible benchmarking method, provides a checklist for evaluating target devices, and finally discusses failure modes in on-device engineering, the rationale for device-cloud tiering, and assumptions that need validation over the next two years.

    Estimating On-Device Model Memory: Weights First, Then Sparsity

    Many discussions directly compare “total parameter count” with “phone memory,” and the conclusions are often wrong. Sparse activation only reduces the number of parameters involved in computing each token; it does not reduce the model’s storage footprint.

    The bare weight footprint can be approximated with this formula:

    1. Weight footprint ≈ Total parameters × Bits per parameter / 8

    Resident memory also includes runtime overhead and KV Cache:

    1. Resident memory ≈ Weight footprint × (1 + Runtime overhead ratio) + KV Cache + Vision encoder footprint (if resident)

    Runtime overhead includes activations, framework internal buffers, and similar items. A conservative estimate is 10% to 30%, but the actual value must be measured. If the vision encoder is loaded when the session starts and stays in memory, its weights count toward resident memory. If it is loaded only when processing images, it counts toward peak memory. Either way, the assumption must be stated explicitly—otherwise readers may underestimate the feasibility of running the model.

    KV Cache grows linearly with context length:

    1. KV Cache ≈ 2 × Layers × KV heads × Head dimension × Context length × Bytes per element

    This formula assumes a batch size of 1 (single user, single session). In batched scenarios, KV Cache scales with concurrency.

    Take a model with 32 layers, 8 KV heads (grouped-query attention), and a head dimension of 128. At a context length of 8192 tokens, KV in FP16 requires roughly 1 GiB; switching to 8-bit storage reduces it to about 0.5 GiB. Extending the context to 32K, the same configuration needs about 4 GiB of FP16 KV Cache.

    Images also consume KV Cache. Every vision token is written to the KV Cache just like a text token, so the incremental cost is:

    1. Vision token increment ≈ KV Cache footprint per token × Number of vision tokens

    Using the 8-bit KV example from above, one token occupies about 64 KiB. If an image is split into 12 slices with 256 vision tokens per slice—3072 vision tokens total—the increment is about 0.19 GiB.

    The table below shows the bare weight footprint computed from the formula. It excludes runtime overhead, KV Cache, and the vision encoder.

    Total Parameters 16-bit 8-bit 4-bit 3-bit
    10B 20 GB 10 GB 5 GB 3.75 GB
    35B 70 GB 35 GB 17.5 GB 13.1 GB
    100B 200 GB 100 GB 50 GB 37.5 GB

    Even with 4-bit quantization, a model with 35 billion total parameters requires roughly 17.5 GB of weights—far exceeding the available memory on most phones. To run such models within smaller memory budgets, the following techniques are commonly used:

    • Expert weight sharding: place infrequently used experts on flash storage and load them into memory on demand.
    • Expert caching: higher hit rates reduce added read latency.
    • Streaming loading or mmap mapping: combined with prefetching to reduce wait time.

    These methods lower resident memory but increase read latency. The cost of expert cache misses can be estimated:

    1. Extra read latency per token ≈ Layers × Active experts per layer × Miss rate × Time to read one expert

    Suppose a model has 32 layers, activates 2 experts per layer, has a 20% miss rate, and reading one expert from flash takes 40 ms. The added latency per token is roughly 512 ms, which would make decoding noticeably stutter. These numbers are illustrative, but they show that even with sufficient memory, a model can become unusable when cache hit rates are low. When selecting a model, always report total parameters, bit width, context length, and expert cache capacity—never just a vague “it can run” conclusion.

    Sparse Activation: Reducing Compute and Read Volume

    Mixture-of-Experts (MoE) architecture splits the feed-forward network into multiple experts, and a router selects a few experts for each token. This allows a model to have a large total parameter count while keeping active parameters small.

    Total parameters determine how much knowledge the model stores and how much storage the weights require. Active parameters determine the per-token compute cost and the weight volume that must be read from memory during decoding. Judging a model requires evaluating these two separately.

    The simplified decoding loop below shows where data flows:

    1. def decode_step(x, state, layers, router, experts, lm_head):
    2. h = embed(x.token)
    3. for i, layer in enumerate(layers):
    4. h = layer.attention(h, state.kv_cache[i]) # read and update KV Cache incrementally
    5. scores = router(i, h) # per-layer routing distribution
    6. idx = topk(scores, k=2) # activate only 2 experts
    7. h = layer.moe(h, [experts[i][j] for j in idx])
    8. return lm_head(h), state

    This code omits the vision encoder, normalization, and sampling for clarity; it exists only to illustrate routing and caching. A real implementation must also handle load balancing and expert caching.

    Computing Decoding Speed: Bandwidth Sets the Ceiling

    On mobile devices, the decoding phase is mostly memory-bound rather than compute-bound. For each token generated, the system reads activated weights and the current KV Cache from memory.

    The upper bound for decoding throughput can be approximated as:

    1. Decoding throughput ceiling ≈ Effective memory bandwidth / Bytes read per token

    Bytes read per token equals activated weight bytes plus KV Cache read bytes. With 3B active parameters at 4-bit weights, the weight volume per token is roughly 1.5 GB. At an 8K context with 8-bit KV storage, the KV Cache is about 0.5 GiB, or roughly 0.54 GB. Combined, the system reads about 2.04 GB per token. With an effective bandwidth of 50 GB/s, the theoretical ceiling is about 24 tokens per second.

    If only weights were counted, the result would be 33 tokens per second. That figure represents the weight-read ceiling; actual speed cannot exceed 24 tokens/s. Longer KV Caches increase per-token read volume and reduce the ceiling. These numbers assume the same 32-layer KV configuration described earlier.

    Real-world speed will be even lower due to scheduling overhead, cache misses, and thermal throttling. These are calculated values, not measurements—replace them with actual device data.

    When evaluating on-device models, track the following five metrics. Relying solely on parameter count or benchmark scores can lead to misjudgment.

    Metric Meaning Common Pitfall
    Resident memory Weight + KV Cache + vision encoder + runtime overhead Counting only weights, ignoring KV Cache growth with context
    Decoding throughput Tokens generated per second Using batch-mode figures to estimate single-user scenarios
    Time to first token (TTFT) Time from input to first token output Ignoring image encoding and preprocessing time
    Energy consumption and temperature rise Energy per token and sustained throughput Watching only short-term peaks, ignoring throttling in long sessions
    Accuracy retention Precision difference between quantized and baseline on target tasks Looking only at general benchmarks, missing long-tail tasks like OCR, math, and chart QA

    Accuracy retention requires a specific evaluation set. Public OCR datasets, math problem sets, and chart QA collections are viable options; you can also build a custom set based on your business use cases. The acceptable loss threshold is a business decision—for example, using FP16 as the baseline and allowing an absolute drop of no more than 2 percentage points. That number is only a starting point.

    Metric thresholds should be set per device tier. For instance, you may cap resident memory at one-third of the device’s available memory and define a maximum acceptable TTFT for your team.

    Stress Testing: A Reproducible Approach

    The goal of stress testing is to produce results that can be repeated on another machine. Every test run should record the device model and OS version, the hash of the model file, quantization settings, context length, prompt and output length, ambient temperature, charging status, and whether airplane mode is enabled.

    Below is a basic benchmark function. generate is provided by the caller and returns the generated text plus the actual number of tokens generated. energy_meter returns cumulative energy consumption in millijoules since the test started, implemented via the platform API.

    1. import time
    2. def bench(generate, energy_meter, prompt, max_new=256, warmup=16, timeout_s=120):
    3. # generate(prompt, max_new) -> (text, n_tokens)
    4. # energy_meter() -> cumulative energy in mJ
    5. try:
    6. for _ in range(warmup):
    7. generate(prompt, max_new=8) # warm up to eliminate first-load and cache effects
    8. e0 = energy_meter()
    9. t0 = time.perf_counter()
    10. text, n = generate(prompt, max_new=max_new)
    11. dt = time.perf_counter() - t0
    12. de = energy_meter() - e0
    13. except Exception as exc:
    14. return {"valid": False, "error": repr(exc)}
    15. if n <= 0 or dt <= 0:
    16. return {"valid": False, "error": "generated 0 tokens; result invalid"}
    17. if dt > timeout_s:
    18. return {"valid": False, "error": f"took {dt:.1f}s, exceeded {timeout_s}s"}
    19. return {"valid": True, "tok_per_s": n / dt, "mJ_per_tok": de / n, "text": text}

    Synchronous calls cannot be interrupted externally, so timeouts are only detected after the call returns. If a hard timeout is required, run the generation in a child process and have the parent process enforce the deadline.

    A single measurement cannot reveal thermal throttling. Long-running tests should record throughput in consecutive time slices:

    1. def sustained(generate, prompt, minutes=10, max_new=256):
    2. t_end = time.perf_counter() + minutes * 60
    3. samples, errors = [], [] # samples are (start_time, tok/s) pairs
    4. while time.perf_counter() < t_end:
    5. t0 = time.perf_counter()
    6. try:
    7. _, n = generate(prompt, max_new=max_new)
    8. except Exception as exc:
    9. errors.append((t0, repr(exc)))
    10. break
    11. dt = time.perf_counter() - t0
    12. if n > 0 and dt > 0:
    13. samples.append((t0, n / dt))
    14. return samples, errors

    After the test, compare the median throughput of the first minute with that of the last minute to calculate the degradation ratio: decay = 1 − median(last segment) / median(first segment). Record the temperature curve as well; this helps determine whether the decay stems from heat dissipation.

    Data sources for measurements should be stated explicitly:

    • Bandwidth: Vendor specifications are theoretical peaks and cannot be used directly for calculations. Effective bandwidth should be measured on the target device using a memory read/write benchmark, with the test method and thread count noted.
    • Energy: On Android, BatteryManager can expose energy counters, but availability and precision depend on the device. iOS does not provide an equally precise public API; an external power meter can be used instead. An external power meter measures whole-device power, not just the model process, and this limitation must be stated in the report.
    • Temperature and charging: Physical device temperature affects throttling. Record ambient temperature and keep it as consistent as possible. Charging introduces extra heat and changes both power delivery and throttling policies—any comparison must use the same charging state.

    Safety and data notes: Airplane mode disables cellular connectivity. Use a dedicated test device and ensure it can be restored to network access after testing, or arrange an alternative way to reach the tester. Logs must not contain user raw inputs; use public or synthetic prompts for stress testing. Reported metrics must be sanitized before leaving the device.

    Four Engineering Points and Failure Modes in On-Device Infrastructure

    1. Operator and Backend Adaptation

    Design: Use a unified operator abstraction layer that covers CPU, GPU, and NPU, avoiding per-chip inference graph rewrites.

    Failure mode: An operator unsupported by the NPU causes the framework to silently fall back to CPU. Throughput drops suddenly, and it only reproduces on specific device models.

    Debugging action: Track the backend allocation per layer, list the operators that fell back, and calculate the fallback overhead as a proportion of total time.

    2. Memory Lifecycle Management

    Design: Weights reside in memory via mmap, KV Cache is reused through paging, and the vision encoder is loaded on demand.

    Failure mode: After multiple multimodal input switches, page fragmentation pushes peak memory beyond the limit. Repeated vision encoder loading causes UI jank.

    Debugging action: Plot memory curves per session, record the allocator’s peak usage and fragmentation rate, and check whether the encoder is being loaded repeatedly.

    3. Multimodal Preprocessing Pipeline

    Design: Image resizing, slicing, and slice scheduling must be coordinated with the model’s resolution strategy.

    Failure mode: High-resolution images are cut into too many slices, and visual tokens consume all available memory before decoding begins, triggering an out-of-memory (OOM) condition.