ADAPTIVE DUAL-MODE TRANSFORMER INFERENCE UNDER MEMORY CONSTRAINTS: A FULL-RAM AND LAYER-STREAMING EXECUTION FRAMEWORK FOR PORTABLE LARGE LANGUAGE MODELS
Deploying Large Language Models (LLMs) on memory-constrained portable and edge devices remains a fundamental challenge, as full in-DRAM residency of model weights is often infeasible on smartphones, embedded systems, and other resource-limited hardware. This paper proposes an Adaptive Dual-Mode Transformer Inference framework that dynamically switches between two execution strategies based on available system memory: a Full-RAM mode, loading the entire model for maximum inference speed when resources permit, and a Layer-Streaming mode, sequentially loading transformer layers from disk or flash storage on demand when memory is insufficient. Unlike static offloading or fixed compression schemes, the framework performs runtime memory-aware mode selection, enabling a single deployment to scale across heterogeneous hardware without separate model variants. We evaluate tradeoffs in memory footprint, disk I/O overhead, and inference latency/throughput across both modes on portable, fully offline devices. The Results show that dual-mode approach sustains usable throughput under memory pressure while reverting to highspeed full-RAM execution when resources allow, offering a practical solution for on-device LLM deployment.
Publication Details
- Journal
- International Research Journal of Modernization in Engineering Technology and Science
- Published
- 2026-12-03
- DOI
- https://doi.org/10.56726/irjmets105204
- Primary Topic
- Advanced Neural Network Applications
- Type
- article
- Field-Weighted Citation Impact
- 0.00