Joint Optimization of Secure and Energy Efficient Retrieval Augmented Generation for Mobile Edge Computing
Authors: Chang Liu, Liangxin Qian, Chaitanya Dhananjay Jadhav, Jun Zhao
Abstract
Retrieval Augmented Generation (RAG) greatly mitigates hallucinations in large language models by grounding responses in external documents, yet its adoption on mobile devices is hindered by two intertwined concerns: (i) security, because poisoned passages cached by adversaries can drive the model to generate harmful outputs, and (ii) efficiency, because deeper retrieval and wider uplinks consume limited battery and spectrum. Existing RAG security studies overlook bandwidth and power budgets, whereas mobile edge offloading literature assumes benign knowledge bases. Bridging this gap, in this paper we introduce the Security Cost Ratio (SCR) as a unified metric that rewards lower attack-success rate per joule expended, and we design an optimization problem to jointly control retrieval depth, bandwidth and transmit power in the mobile edge computing environment. To tackle the non-convex optimization problem, we derive closed-form KKT conditions and an epigraph transformation that attain the global optimum for retrieval depth. We then utilize a quadratic-transform fractional programming technique in an alternating framework that converges for bandwidth and transmit power allocation. Simulations across various system parameters and environmental settings demonstrate that the proposed algorithm achieves up to 1.8× higher SCR and 50% lower attack success rate, while maintaining rapid convergence.