Architecture Design and Application Practice of On-Device Small Multimodal Models

    This article explains how on-device small multimodal models are designed and deployed. It compares dense, Mixture-of-Experts, and small-parameter model tiers and their memory and compute trade-offs. It also covers native audio input and variable-resolution vision, hybrid attention with different RoPE configurations for local and global layers, and per-layer embeddings. Finally, it gives practical deployment guidance on memory budgeting, context length, quantization, preprocessing, and power use.

    1. Background: Why On-Device Multimodal Models Are Gaining Attention

    Large model deployment is moving from cloud data centers to phones, embedded devices, and home appliances. Running a model on the device has clear benefits. Data does not need to leave the device, network latency is low, and the model keeps working offline. However, on-device memory, power, and compute are limited, so model design requires explicit trade-offs between capability and size.

    A recent group of open-source multimodal models divides its product specifications into several tiers, each targeting different devices and tasks. Understanding this tiered approach is more useful than simply comparing scores on a single leaderboard.

    2. Specification Tiers: Dense Models, Mixture-of-Experts Models, and Small-Parameter Models

    2.1 Large Dense Models

    A dense model activates all of its parameters in every forward pass. Its inference path is simple and its output quality is stable. This makes it a good general-purpose base for home workstations or servers, and it is easy to fine-tune. The drawbacks are high memory usage, and inference latency grows with parameter count.

    2.2 Mixture-of-Experts Models

    A Mixture of Experts (MoE) architecture splits the feed-forward network into multiple expert sub-networks. A router selects a small number of experts for each token. The total parameter count can be very large, but only a few parameters are activated per step. As a result, throughput and compute cost are usually better than those of a dense model with the same total parameter count. Note that the weights of all experts must still be loaded into memory, so the memory capacity requirement remains high.

    2.3 Small-Parameter On-Device Models

    Models for phones and embedded devices typically have a few billion parameters or fewer. They rely on architectural optimization, parameter sharing, and training strategies so that limited parameters can handle more functions. When selecting a model, start from the memory available on the device to determine the feasible model size. Then evaluate capability metrics. Do not start with the capability metrics and work backward.

    3. Multimodal Input: From External Recognition to Native Audio

    A typical early on-device voice assistant pipeline works as follows. A microphone captures audio, a separate speech recognition module converts it to text, and a language model processes the text. This pipeline has three problems. First, the two models each occupy memory. Second, recognition errors propagate downstream, and the language model cannot correct misrecognized or dropped words from the front end. Third, latencies add up, which slows down interaction.

    If the language model can accept audio input directly, the pipeline shortens to a single step: audio features enter the model, and the model outputs text or actions directly. This reduces the number of modules and makes end-to-end optimization easier. There are, however, limits to observe. The length of a single audio input is capped. The related documentation mentions a limit of about 30 seconds. Longer audio must be split into segments, and context continuity between segments must be handled.

    For vision, variable-resolution input allows the number of visual tokens to be adjusted based on image content. Detail-rich images can be assigned more tokens, while simple images save compute. Videos are typically sampled at fixed intervals into frames, and the frames are fed to the model as an image sequence.

    4. Positional Encoding: Why Local and Global Layers Use Different Configurations

    Positional encoding allows the model to distinguish the order of tokens. Rotary Position Embedding (RoPE) applies a position-dependent rotation to query and key vectors, so attention scores naturally depend on relative distance. RoPE is widely used in long-context scenarios. However, when it is extrapolated directly to sequences far longer than the training length, performance typically degrades.

    These models often use a hybrid attention structure. Most layers use sliding window attention, which attends only to a nearby span of tokens and keeps the cache footprint small. A few layers use global attention, which can see the full context and aggregates information across long distances. The two layer types also use different positional encodings. Sliding window layers use standard RoPE, while global attention layers use a proportionally scaled RoPE variant. For very long contexts, the positional encoding of the global layers determines whether long-distance information can be located reliably.

    The following illustrative configuration shows the difference between the two layer types:

    1. layer_configs = [
    2. {"type": "sliding_window", "window": 512, "rope": "standard"},
    3. {"type": "sliding_window", "window": 512, "rope": "standard"},
    4. {"type": "sliding_window", "window": 512, "rope": "standard"},
    5. {"type": "global", "rope": "proportional"}, # Proportionally scaled RoPE variant
    6. ]

    5. Per-Layer Embedding: Delivering Information to Each Layer on Demand

    A standard Transformer generates only one embedding vector per token at the input. This vector must carry information such as word meaning and grammar, and it is transformed repeatedly in later layers. If all information is packed in once at the input, the details that deeper layers need may already be diluted.

    Per-Layer Embedding (PLE) adds a parallel, low-dimensional pathway alongside the main pathway. For each token, it generates a dedicated small vector for every decoder layer. This small vector fuses two signals. One is the token’s own identity. The other is a perceptual signal computed from the current context. As a result, each layer can obtain the token-specific information relevant to it while processing.

    This design has two benefits. First, the input embedding does not need to carry all deep-layer requirements in advance, which reduces its burden. Second, the low-dimensional pathway has a small parameter count, which makes it easier to combine with quantization and chunked loading on resource-constrained devices.

    The data flow is illustrated below:

    1. token_emb = embed(token_ids) # Main pathway: standard input embedding
    2. ident = low_dim_lookup(token_ids) # Low-dimensional pathway: token identity signal
    3. ctx = project(token_emb) # Low-dimensional pathway: context-aware signal
    4. h = token_emb
    5. for i, layer in enumerate(layers):
    6. cond = combine(ident[i], ctx[i]) # Dedicated conditioning vector for each layer
    7. h = layer(h, cond)

    6. Engineering Essentials for On-Device Deployment

    6.1 Estimating the Memory Budget

    Weight memory can be roughly estimated as parameter count × bytes per parameter. For example, a 4-billion-parameter model quantized to 4 bits needs about 4 billion × 0.5 bytes, or 2 GB. Besides the weights, account for the KV cache, activations, and runtime overhead.

    6.2 Controlling Context Length

    KV cache size grows with context length. Sliding window layers limit their own cache size, but global layers still grow with length. Long-text scenarios therefore need separate measurement.

    6.3 Balancing Quantization Precision

    Quantization can significantly reduce memory and bandwidth pressure. However, low-bit settings may hurt performance on complex reasoning and numerically sensitive tasks. Test several precisions on your own tasks, and choose the lowest precision that is acceptable.

    6.4 Preprocessing Strategy

    Image resolution and audio segment length directly determine compute cost. Excessively high resolution wastes compute, while segments that are too short lose context. Set limits based on the use case, and record preprocessing parameters so results can be reproduced.

    6.5 Power and Thermal Management

    Sustained inference causes heat and power drain. For always-on scenarios such as voice, you can reduce average power consumption by triggering on a wake word and loading the model on demand.