Manuscript Offprint

arXiv:2609.00442

DRLM: Deep Reinforcement Learning-Based LLM Query Orchestration in Edge Environments

Reza Farahani, Zoha Azimi Ourimi, Mario Colosi, Lauri Loven, Christian Timmerer, Schahram Dustdar

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Reza Farahani*, Zoha Azimi Ourimi†, Mario Colosi‡, Lauri Lovén§, Christian Timmerer†, Schahram Dustdar*

  • Distributed Systems Group (DSG), TU Wien, Austria

† Christian Doppler Laboratory ATHENA, Department of Information Technology (ITEC), University of Klagenfurt, Austria

‡ MIFT Department, University of Messina, Italy

§ Center for Ubiquitous Computing, University of Oulu, Finland

Abstract—Large language model (LLM) services increasingly process heterogeneous queries with diverse latency, accuracy, and resource requirements. While edge deployment reduces response time, the heterogeneity of devices and the diversity of model families, parameter scales, and quantization levels make efficient LLM query orchestration challenging. This paper introduces DRLM, a Deep Reinforcement Learning-based LLM query orchestration framework in edge environments. DRLM integrates two lightweight predictors: (i) a class-conditioned quality estimator that maps queries to semantic categories and infers model performance, and (ii) a feature-driven latency predictor that estimates inference time across model-device configurations. These predictions, combined with system state, feed a factorized Proximal Policy Optimization (PPO) agent that performs state-aware orchestration decisions. To enable data-driven orchestration, we construct a large-scale benchmarking dataset with 223 835 measurements spanning 1258 queries, 6 query classes, 8 model families (32 deployed instances), 5 quantization levels, and heterogeneous edge devices. Evaluation on a 64-node edge cluster and comparison with three baselines and two state-of-the-art methods show that DRLM reduces inference latency by up to 51% and queuing delay by up to 67%, while incurring at most 8% accuracy loss. It improves latency under increasing workloads up to 61.4%, demonstrating robust and stable orchestration.

Index Terms—LLM Inference; Edge Computing; Deep Reinforcement Learning; Query Orchestration; Edge Clusters.

I. INTRODUCTION

Large language models (LLMs) power modern AI services like chatbots and code-generation systems, processing queries with diverse structures, reasoning at varying levels of complexity, and meeting varying latency requirements [1]. In edge environments, this challenge is amplified by hardware heterogeneity, where model instances, spanning different families, parameters, and quantizations, show distinct latency-quality-resource trade-offs [2]–[4]. Thus, LLM orchestration becomes a fine-grained, per-query decision problem over model-device-quantization configurations rather than a simple model or device selection task [5], [6]. To quantify these interactions, we evaluate representative configurations on two edge devices: a constrained Raspberry Pi 4 (RP) and a more capable NVIDIA Jetson ORIN AGX (JOA). Each configuration is denoted as (x,y)(x, y), where xx is the model size (in billions of parameters) and yy is the quantization level. Fig. 1 reports average accuracy and response time for Mathematics [7] and TruthfulQA [8] queries, revealing three key observations:

  1. Model-family impact: On JOA (Fig. 1b), Gemma3(12, 4) has the highest accuracy on Mathematics, whereas

Figure

(a) Average accuracy on RP.

Figure

(b) Average accuracy on JOA.

Figure

(c) Average response time on RP.

Figure

(d) Average response time on JOA.

Figure 1: Latency-quality of LLM configurations on RP and JOA edge devices for Mathematics and TruthfulQA queries.

Qwen3(0.6, 4) and (0.6, 16) outperform others on TruthfulQA. This indicates that model architecture, not just size, determines task-specific performance.

  1. Scaling impact: On RP (Fig. 1a), Gemma3(1, 4) improves Mathematics accuracy over (0.27, 4) but degrades performance on TruthfulQA. Similarly, on JOA, Gemma3(12, 4) improves Mathematics but does not consistently dominate across tasks. Thus, scaling benefits are workload-dependent rather than monotonic.

  2. Quantization impact: On RP (Figs. 1a-1c), Gemma3(0.27, 16) improves TruthfulQA accuracy over (0.27, 4) but increases latency. On JOA (Fig. 1d), Qwen3(0.6, 16) incurs higher latency than (0.6, 4) with marginal accuracy gains. These results show that quantization effects are highly configuration- and device-dependent, and must be selected jointly with model and system characteristics rather than assumed to improve latency or accuracy.

Implication: Effective LLM orchestration on edge clusters needs joint, state-aware modeling of query semantics, model configurations, and runtime dynamics, which cannot be captured by static or single-objective policies.

Existing approaches address LLM query orchestration from largely decoupled perspectives. Inference-aware systems such as ExeGPT [9] optimize execution by modeling input/output token lengths to control batching and parallelism, while recent schedulers such as Bullet [10] improve throughput and latency through KV-cache-aware memory management and dynamic prefill-decode co-scheduling. At the infrastructure level, DynamoLLM [11] adapts system parameters such as instance scaling, parallelism, and GPU frequency to meet latency constraints under dynamic workloads. Model selection has been explored via learning and optimization. OptLLM [12] selects models from a Pareto frontier based on predicted performance under fixed constraints. RouteLLM [13] reduces routing to a binary decision between a fixed strong-weak model pair. Recent extensions incorporate system-level realism: RouterWise [14] jointly models query routing and resource allocation, Robust Batch-Level Routing [15] enforces cost and capacity constraints at the batch level, and TRouter [16] improves robustness under cold-start query distributions. Edge-oriented works focus on deployment and resource distribution rather than per-query orchestration. Jang et al. [17] proposes device-level selection strategies to balance load, while EdgeLLM [18] and EdgeShard [19] optimize collaborative inference and model partitioning across devices.

State-of-the-art limitations: Existing solutions either optimize execution for fixed models or perform simplified model selection, treating latency and quality as static. They do not jointly capture query semantics, model configuration (family, scale, quantization), and dynamic system state (utilization, queueing), leading to load-coupled, query-dependent behavior and limiting fine-grained per-query orchestration in heterogeneous edge environments.

This paper introduces DRLM, a Deep Reinforcement Learning-based framework for fine-grained LLM query orchestration in heterogeneous edge clusters. DRLM leverages (i) a query profiler that extracts semantic and structural features, (ii) lightweight predictors that estimate class-conditioned quality and configuration-dependent latency, and (iii) a factorized Proximal Policy Optimization (PPO)-based agent that combines these predictions with runtime system state information (e.g., resource utilization and queue dynamics) to make per-query orchestration decisions. To enable data-driven learning, we construct a large-scale benchmarking dataset with 223 835 measurements over 1258 queries and 6 classes, capturing fine-grained query-model-device interactions. We evaluate DRLM on a realistic Kubernetes-based edge cluster with 64 heterogeneous nodes and 32 LLM instances spanning 8 model families, 11 parameter scales, and 5 quantization levels. Comparison with three baselines and two state-of-the-art methods shows that DRLM reduces inference latency by up to 51% and queuing delay by up to 67%, while incurring at most 8% accuracy loss. Under increasing workload, it further reduces latency by up to 61.4%, showing robust orchestration.

References (21)