Organizations: Computer Science and Engineering Vellore Institute of Technology Vellore, India · Electronics and Communication Engineering Vellore Institute of Technology Vellore, India · Department of Analytics Vellore Institute of Technology Vellore, India · Department of Computational Intelligence Vellore Institute of Technology Vellore, India · Department of Sensor and Biomedical Technology Vellore Institute of Technology Vellore, India
In on-device NLP tasks, limited resources of embedded hardware, such as the Raspberry Pi 5, require efficient inference strategies. This paper introduces FrugalSOT (Frugal Search Over The Models), a resource-aware model selection architecture for on-device NLP inference. FrugalSOT estimates each request's complexity by extracting features such as prompt length, named entity density, and syntactic complexity. The request is first made to the least complex model that is likely to pass a relevance threshold. If the output of that model falls short of the threshold, the request is made to a more complex model. It is important to note that the relevance threshold undergoes continuous updates in the background. using past validation outcomes in an adaptation process using a low-pass filtering mechanism, thus imparting adaptation to changing input patterns. Experimental results achieved on a Raspberry Pi 5 show that FrugalSOT reduces average inference time and overall computational resource use to a significant extent compared to a single-model baseline approach, without compromising output relevance to the same extent as the most sophisticated model. These results confirm that adaptive model selection can enable efficient, high-quality natural language processing inference on limited devices.
Figures & tables
Fig. 1: Prompt Complexity Classification
Complexity Level
Memory (GB) < 8
Memory (GB) > 8
Low
TinyLlama (1.1B)
LlaMA2 7b
Medium
TinyDolphin (1.1B)
Mistral 7b
High
Gemma2 2b
LlaMA3.2 3b
Fallback
Phi 2.7b
LlaMA2 13b
TABLE I: Model Selection Based on Complexity and Available Memory
Complexity Level
Threshold Value
Low
0.4441
Medium
0.6537
High
0.6934
TABLE II: Adaptive Complexity Thresholds for Real-Time System Tuning