Introduction: The Mobile Memory Wall
Deploying state-of-the-art Large Language Models (LLMs) on mobile devices is currently hindered by a significant hardware bottleneck known as the "memory wall." While mobile Neural Processing Units (NPUs) have seen exponential growth in compute speed, DRAM bandwidth and capacity have only increased linearly. This disparity creates a situation where the processor spends most of its time waiting for model weights to be fetched from memory, rather than performing computations.
As illustrated in Figure 2, the growth of model parameters far outpaces the expansion of available mobile memory. Modern LLMs like Llama 3 or Phi-3 utilize SwiGLU activation functions, which lack the "natural sparsity" found in older ReLU-based models. In ReLU models, many activations are zero, allowing systems to skip loading corresponding weights. In SwiGLU models, activation patterns are dense and difficult to predict using traditional neural network-based "predictors," making efficient inference on memory-constrained devices a daunting task.
Proposed Methodology
To address these challenges, this work introduces a two-part framework: Dynamic Input Pruning (DIP) and Cache-Aware Masking (DIP-CA). These methods aim to reduce memory traffic without the need for expensive model retraining or complex, compute-heavy predictors.
Dynamic Input Pruning (DIP)
DIP moves away from learned predictors, which often become a bottleneck themselves. Instead, it leverages the magnitude of input activations to perform pruning on-the-fly. By retaining only the "top-K" largest activations, the system prunes the Up and Gate matrices in the MLP layers. The resulting intermediate GLU activations then guide the pruning of the Down matrix. To mitigate any potential loss in model accuracy due to this aggressive pruning, the authors employ lightweight LoRA adapters. These adapters are fused into the main weights, ensuring they contribute to accuracy recovery without adding inference overhead.
Cache-Aware Masking (DIP-CA)
The core innovation for system-level efficiency is Cache-Aware Masking (DIP-CA). In mobile environments, model weights are typically stored in slow Flash memory and paged into a limited DRAM cache as needed. Standard pruning techniques are "cache-blind," often selecting weights that are not currently in DRAM, thus triggering slow Flash-to-DRAM transfers.
As shown in Figure 1, DIP-CA introduces a "system-aware" selection process. It applies a penalty to the activation scores of neurons whose weights are not present in the DRAM cache. By biasing the selection toward cached weights, DIP-CA significantly increases the cache hit rate. This approach represents a paradigm shift: a mathematically "suboptimal" sparsity mask can be "system-optimal" if it avoids the latency of a Flash memory read.
Experimental Evaluation
The proposed methods were evaluated across several popular LLM architectures, including Phi-3-Medium/Mini, Llama-3 8B, and Mistral 7B. The researchers utilized a diverse set of benchmarks to ensure robust performance:
- Language Modeling: WikiText-2 (Perplexity).
- Reasoning & Knowledge: MMLU, ARC (Easy/Challenge), BoolQ, HellaSwag, PIQA, and Winogrande.
- Multilingual Reasoning: MGSM.
- Calibration: SlimPajama was used for threshold calibration and LoRA training.
Key Results and Insights
The experimental results demonstrate that DIP and DIP-CA provide substantial efficiency gains with negligible impact on model quality.
- Memory and Throughput: On the Phi-3-Medium model, the framework achieved a 46% reduction in memory footprint and a 40% increase in throughput. These gains were achieved with a perplexity increase of less than 0.1 compared to the dense baseline.
- Superiority over Baselines: DIP consistently outperformed both static pruning methods (e.g., SparseGPT) and existing dynamic methods (e.g., DejaVu, CATS) across various sparsity levels.
- Dynamic Cache Adaptation: Interestingly, DIP-CA combined with a simple Least Frequently Used (LFU) policy outperformed the theoretical "Belady's Oracle" caching strategy. This is because DIP-CA does not just manage the cache; it actively modifies the model's execution path (the pruning mask) to align with the current cache state.
Conclusion and Future Work
This research highlights the importance of hardware-software co-design in the era of large-scale AI. By shifting from purely mathematical optimization to system-aware sparsity, DIP-CA enables high-performance LLM inference on commodity mobile hardware.
While highly effective, the benefits of DIP-CA are most pronounced when DRAM is significantly smaller than the model size. Future work will explore more granular, non-uniform cache allocations and investigate how these techniques scale as mobile NPU architectures continue to evolve. The shift toward system-optimal sparsity opens new avenues for running increasingly capable AI models on the edge.
Summary updated