On-Device Large Language Models: Architecture Choices and Multimodal Practices

    On-device large language models are shifting AI capabilities from the cloud to phones, edge boxes, and workstations, prioritizing latency, power, privacy, and offline availability over raw benchmark performance. This article walks through the key engineering dimensions: the core value and hard constraints of on-device inference, choosing between Dense and Mixture of Experts (MoE) architectures, sizing parameters to match device tiers, handling native multimodal input across text, image, video, and audio, moving from bolt-on ASR to native audio understanding, evaluating models with a multi-dimensional methodology, and deploying constrained AI agents. Readers will gain a practical framework for making on-device model decisions under limited resources.

    Introduction

    Over the past two years, most of the attention around large language models has focused on cloud-hosted models with enormous parameter counts. But as model compression, quantization, and inference optimization have matured, a clear trend is emerging: more and more capability is moving down from the cloud to end devices such as phones, edge boxes, development boards, and even home workstations.

    These on-device models no longer aim to crush cloud giants on general-purpose benchmarks. Instead, they concentrate on latency, power consumption, privacy, and offline availability. This article systematically covers the key technical points of on-device large models across several dimensions: model architecture, parameter-scale selection, multimodal input, evaluation methods, and real-world deployment.

    1. Core Value and Constraints of On-Device Models

    Cloud inference has a long pipeline, high cost, and a hard dependency on network connectivity, and it requires user data to leave the local device, which raises privacy concerns. On-device inference naturally offers three advantages:

    • Low latency: Data never leaves the device, eliminating the network round trip for more immediate responses.
    • Privacy protection: Sensitive data such as voice and images is processed locally, reducing the risk of leakage.
    • Offline availability: Critical tasks can still be completed without a network connection.

    On-device inference also comes with hard constraints, however: memory, compute, power, and thermal headroom are all extremely limited. The essence of on-device model design is therefore a trade-off problem: maximizing effective capability under constrained resources. This directly determines the architecture and scale choices discussed below.

    2. Mainstream Architectures: Dense Models and Mixture of Experts (MoE)

    Two foundational architectures are common on the device side.

    Dense models: Every parameter is activated on each forward pass. The structure is regular and the inference path is simple, which is friendly to memory and compute scheduling. The advantage is “what you see is what you compute”: behavior is predictable, making deterministic optimization easier on low-end devices. The drawback is that compute grows linearly as the parameter count increases.

    Mixture of Experts (MoE) models: These consist of multiple expert sub-networks plus a gating router, and each token activates only a few of the experts. This means that even with a large total parameter count, the number of parameters actually activated per inference pass can stay small, balancing “capability capacity” against “per-token compute cost.” The advantage of MoE is that it can carry more parameter knowledge at the same compute level; the cost is that memory must hold all expert weights, placing higher demands on memory bandwidth and routing/scheduling.

    For on-device selection, dense models are better suited to memory-constrained devices that prioritize determinism, while MoE is better suited to scenarios with relatively ample memory that want to squeeze more capability out of limited compute.

    3. Parameter Scale and Device Tiering

    On-device models are often designed in multiple parameter tiers to cover different devices, from wearables and phones to desktop workstations:

    • ~2 billion parameters (“2B” tier): Targeted at strongly constrained devices such as phones and smartwatches, emphasizing extremely low memory footprint and acceptable response speed. Suited to lightweight tasks like wake words, intent recognition, and simple Q&A.
    • ~4 billion parameters (“4B” tier): A better balance between capability and resources, able to handle more complex multi-turn dialogue and lightweight task planning.
    • Tens of billions of parameters (around “30B”): Targeted at memory-rich development boards and home workstations, capable of handling more complex, multi-step tasks.

    The core of selection is not “bigger is always better,” but matching model scale to the device’s available memory, compute, and power budget. A common rule of thumb: the quantized weight size plus runtime activation overhead should leave enough headroom to avoid frequent paging, which degrades the user experience.

    4. Multimodal Input: Text, Image, Video, and Audio

    Modern on-device models are trending toward “native multimodality,” where a single model handles multiple input forms uniformly:

    • Text: The foundational interaction modality.
    • Image: Supports variable-resolution input; the model internally adapts to different sizes through dynamic resizing or tiling, avoiding the need to train separately for every resolution.
    • Video: Essentially temporal modeling over image sequences, usable for scene understanding, action recognition, and more.
    • Audio: Directly ingests speech waveforms or spectral features to perform speech understanding.

    The value of multimodality lies in a unified entry point: users do not have to switch between multiple specialized models, since a single on-device model can cover the combined perception of “seeing, hearing, and reading.” The following illustrative pseudocode shows an abstract handling of unified multimodal input (not tied to any specific framework):

    1. def run_on_device_model(inputs):
    2. # inputs can be a mix of text, images, video frame sequences, or audio clips
    3. encoded = []
    4. for item in inputs:
    5. if item.type == "text":
    6. encoded.append(tokenize(item.data))
    7. elif item.type == "image":
    8. # dynamically resize to the model's expected resolution grid
    9. encoded.append(encode_image(resize(item.data)))
    10. elif item.type == "video":
    11. frames = sample_frames(item.data) # sample frames to reduce compute
    12. encoded.append([encode_image(f) for f in frames])
    13. elif item.type == "audio":
    14. # native audio encoding, no external speech recognition needed
    15. encoded.append(encode_audio(item.data))
    16. return model.forward(merge(encoded))

    5. From “Bolt-On ASR” to Native Audio Understanding

    Traditional on-device voice pipelines are often a two-stage flow: speech recognition (ASR) to text, then the text into a language model. A separate model first converts speech into text, which is then handed to the language model for understanding. This pattern introduces an extra model, extra memory usage, and extra latency.

    Once an on-device model natively supports audio input (for example, directly ingesting speech clips up to tens of seconds long), speech understanding can be completed within a single model. The benefits include:

    • Eliminating the memory and compute overhead of a separate ASR model.
    • Shortening the pipeline and reducing end-to-end latency.
    • Preserving paralinguistic information such as tone and pauses in the speech, leading to more natural understanding.

    This is especially critical for scenarios where voice is the primary interaction modality, such as mobile AI assistants, in-car voice systems, and smart home devices.

    6. How to Evaluate On-Device Models Scientifically

    A common pitfall is looking only at public benchmark leaderboards. In real selection, benchmark scores often diverge from actual experience, so multi-dimensional evaluation is needed:

    • Capability dimension: Accuracy on task-specific datasets (not general leaderboards) and instruction-following.
    • Resource dimension: Quantized size, peak memory, time to first token, tokens output per second, power consumption, and heat.
    • Robustness dimension: Coherence across multi-turn dialogue, stability under long context, and performance with multimodal input.

    A practical evaluation flow: first build a small evaluation set from your own real business samples, then measure each resource metric on the target device, and finally compare several candidate models side by side. The cloud can serve as the place for offline batch evaluation and data processing, for example using object storage to hold evaluation corpora, container platforms to run evaluation jobs, and logging and monitoring services to record metrics. This kind of cloud-edge collaboration makes evaluation work more systematic. Platforms such as Baidu AI Cloud typically offer a complete toolchain from training and evaluation to deployment, and can serve as the environment that hosts on-device model engineering.

    7. Key Takeaways for On-Device AI Agents

    Using an on-device model for an AI Agent (an intelligent system that can autonomously complete simple tasks) requires attention to several points:

    1. Clear task boundaries: On-device models are better suited to “simple, closed-loop” tasks such as schedule organization, local information lookup, and device control. Complex reasoning is still best delegated to the cloud.
    2. Tool calling and orchestration: Provide the model with a limited set of local tools (such as system APIs and local data queries), and design reliable invocation and fallback mechanisms.
    3. Resource guarding: Set memory and latency limits for model inference to prevent an agent from occupying resources for long periods and causing the device to lag or overheat.
    4. Privacy first: Prioritize local processing for sensitive data, and upload to the cloud only when necessary, after de-identification.

    Conclusion

    Competition among on-device large models is, at its core, a contest of engineering capability under constrained resources. Understanding the trade-offs between dense and MoE architectures, selecting parameter scale by device tier, leveraging the integration advantages of native multimodality and native audio, evaluating with a rigorous multi-dimensional approach, and constraining AI agent behavior with clear boundaries: connecting all of these pieces is what truly lets large models run stably, efficiently, and reliably on end devices.