Deploying LLMs on Edge Devices: Compute, Precision, and Hardware Architecture Challenges

    This article explains why running large language models on phones and tablets is hard. It covers the compute cost of advanced decoding methods, how quantization granularity depends on mobile NPU operator support, why non-matrix operations slow inference, and how the SIMD and VLIW design of typical mobile NPUs affects deployment choices.

    1. Background: Why Large Language Models Are Moving to Phones

    As large language models mature, more applications want to run models directly on phones, tablets, and other end devices. On-device deployment has clear advantages. User data stays on the device, so privacy is inherently better. Inference does not depend on a network connection, so latency is lower and the feature works offline. Over the long run, it can also reduce cloud inference server costs. The idea is appealing, but on-device deployment in practice faces serious challenges. This article analyzes four layers: compute strategy, quantization accuracy, execution efficiency, and hardware architecture.

    2. Compute Cost: Complex Decoding Methods Are Hard to Sustain On-Device

    To improve generation quality, the industry has developed several enhanced decoding methods in the cloud. Examples include scoring candidate sequences in parallel, sampling multiple times and selecting the best result, and speculative verification-style decoding. These methods share a common trait: they multiply the forward-pass compute in exchange for better generation quality or lower per-step latency.

    In cloud servers, this strategy of trading compute for quality is feasible, because cloud GPU and accelerator resources are abundant and can be scaled out horizontally. On phones, however, memory bandwidth, peak compute, and power consumption are all tightly constrained:

    • Low compute ceiling: The sustained inference compute of mobile SoCs is far below that of data center accelerators. Any method that doubles the amount of computation will directly slow down response time.
    • Power and thermal limits: Phones are constrained by heat dissipation. Long periods of high-load inference inevitably trigger frequency throttling, which further reduces performance.
    • Tight memory capacity: On-device memory is typically only a few GB. Model weights, KV cache, and activations must be managed carefully. The extra memory overhead from complex decoding is often unacceptable.

    Therefore, compute-intensive enhancement methods are usually used only in the cloud. On-device scenarios need other approaches. One option is to accelerate decoding with a smaller draft model paired with a verification model. Another is to extract more performance from each forward pass through better quantization and compilation optimization.

    3. Precision: Quantization Support Sets the Floor for Model Quality

    Quantization is a must-have for on-device deployment. Compressing FP16 weights to INT8 or even INT4 can shrink model size and memory traffic several times over, which makes it the primary optimization for on-device inference. However, the actual effect of quantization depends heavily on the operator support of the underlying hardware.

    Quantization granularity is a typical example. Common industry approaches include:

    • Per-channel quantization: Scaling factors are computed for each output channel of the weight matrix. This approach is simple and hardware-friendly, but its granularity is coarse.
    • Block-wise group quantization: Weights are split into smaller groups, for example one group per 64 or 128 elements. Each group computes its own scaling factor. This describes the weight distribution more precisely and significantly reduces quantization error. It matters most for low-bit (INT4) quantization.

    Some mobile NPUs currently support only per-channel quantization natively and do not support block-wise group quantization. As a result, even when a model is carefully compressed with group quantization, the hardware must fall back to coarse-grained mode during execution. Alternatively, extra dequantization and restoration steps are needed before computation. Either way, accuracy drops noticeably, and generation quality can become unacceptable.

    This shows that the accuracy bottleneck of on-device deployment often lies in the native operator support of the hardware, not in the algorithm. When selecting a target platform, developers must check the chip’s support matrix for quantization schemes. They cannot assume that a quantization method that works algorithmically will also run efficiently on the hardware.

    4. Efficiency: Non-GEMM Computation Becomes a Hidden Bottleneck

    A common misconception is that the main cost of LLM inference is matrix multiplication (GEMM), and that performance is fine as long as the matrix units are powerful enough. In reality, this is not the case.

    The LLM inference pipeline contains a large amount of non-GEMM computation, including:

    • Activation functions: Element-wise nonlinear operations such as GELU and SiLU.
    • Normalization: Operations such as LayerNorm and RMSNorm.
    • Softmax: The exponential and normalization computations in the attention mechanism.
    • KV cache reads, writes, and rearrangement: These involve heavy memory access and vector-level data movement.

    These operations are mainly vector-level and scalar-level computations. They are memory-intensive, and their parallelism and shapes differ greatly from those of matrix multiplication. Current mainstream mobile NPUs excel at matrix computation, but their vector units have relatively low compute capability and memory bandwidth, and their scalar processing is even more limited. As a result, matrix multiplication runs very fast, but the small operations around it slow down the whole pipeline. These operations become the real bottleneck of on-device model inference.

    On-device inference optimization therefore cannot focus only on GEMM efficiency. It also needs dedicated optimization for non-GEMM operators. Examples include operator fusion, which merges activations and normalization into adjacent computations to reduce memory access. Other examples are reducing unnecessary intermediate tensor writes to memory and using compiler optimizations to improve vector unit utilization.

    5. Architecture Perspective: NPU Compute Paradigms and Unit Organization

    Understanding the root causes of these efficiency bottlenecks requires looking at the NPU architecture.

    5.1 SIMD vs. SIMT: Two Compute Paradigms

    GPUs use the SIMT (Single Instruction, Multiple Threads) paradigm. Multiple threads execute the same instruction at the same time, each operating on its own data. This suits graphics rendering and general-purpose parallel computing and offers good programming flexibility.

    Mobile NPUs commonly use the SIMD (Single Instruction, Multiple Data) paradigm. A single thread performs the same operation on multiple vectorized data elements at once. SIMD does not require many parallel threads, so the circuit design is simpler, computing efficiency per unit area is higher, and power control is better.

    The cost of SIMD is reduced programming flexibility and ease of use. Developers need to organize computation around vectorized thinking, which lowers development efficiency. This is also why the barrier to developing and tuning operators in on-device inference frameworks is generally high.

    5.2 Compute Unit Breakdown of a Typical Mobile NPU

    A typical mobile NPU architecture usually divides its compute units into three categories:

    • Scalar units: Usually 6 to 8 units. They handle scalar operations and logic control, and they also dispatch instructions for the entire NPU. All instructions for the vector and matrix units are issued from several instruction slots in the very long instruction word (VLIW) structure of the scalar units.
    • Vector units (HVX-class): Usually 4 to 6 units. Each unit contains dozens of vector registers, with a total width of up to 1024 bits. They handle non-GEMM operations such as activation functions and normalization.
    • Matrix units (HMX-class): Usually 1 or 2 units. They are the most powerful compute units in the NPU, designed specifically for matrix multiplication and convolution. They carry most of the floating-point and integer multiply-accumulate workload in model inference.

    This combination of scalar control, vector support, and matrix-led computation is a heterogeneous design aimed at neural network workloads. Matrix units handle the heavy work, vector units fill in the remaining operations, and scalar units coordinate scheduling.

    5.3 How Architectural Constraints Shape Deployment Strategy

    From a deployment perspective, this architecture has two direct implications:

    1. Instruction issue bandwidth is limited. The number of VLIW slots is fixed. If operators are split too finely and the instruction count grows, instruction issue becomes a bottleneck. Use large, fused operators whenever possible.
    2. Matrix and vector unit workloads must be balanced. If vector operations such as normalization and activation account for a large share of the model, the matrix units sit idle while they wait. During model selection and graph optimization, evaluate the proportion of non-GEMM operators. When necessary, reduce their overhead through operator fusion or equivalent rewrites.

    6. Conclusion and Outlook

    Deploying large language models on phones is a system-level problem. Compute, precision, efficiency, and hardware architecture all impose constraints at once:

    • Compute: Complex decoding methods that work well in the cloud are limited on-device. Lighter alternative strategies are needed.
    • Precision: Native hardware support for quantization granularity directly sets the quality floor after model compression.
    • Efficiency: Relatively weak vector and scalar compute makes non-GEMM operations an inference bottleneck.
    • Architecture: The SIMD paradigm and VLIW instruction issue mechanism require developers to adapt through operator fusion, large-grained scheduling, and similar techniques that match hardware characteristics.

    For developers, understanding these low-level constraints is a prerequisite for effective on-device inference optimization. In practice, quantization, compilation, and validation can be carried out with the model compression and deployment toolchains that mainstream cloud machine learning platforms provide. Fine-grained tuning for the target chip can follow. As hardware keeps evolving, with stronger vector units, more flexible quantization support, and more efficient operator compilation, the barrier to deploying large models on devices is gradually lowering. The mobile AI experiences ahead are worth looking forward to.