arXiv:2610.26171cs.DCOct 2026

Manuscript Offprint

arXiv:2610.26171

CEMA-Router: Infrastructure-Aware Batch Routing for LLM Inference in Cloud-Edge Systems

Xijia Wang, TianZhang He, Mohammad Goudarzi

Xijia Wang, TianZhang He, Mohammad Goudarzi ∗^{*}

Faculty of Information Technology, Monash University, Melbourne, Australia

Abstract—Large language models (LLM) are increasingly integrated into pervasive applications spanning heterogeneous cloud and edge resources. These heterogeneous resources differ in computational capacity, energy efficiency, network conditions, and deployed model quality, creating trade-offs among response quality, monetary cost, energy consumption, and batch completion time when routing inference requests. Existing LLM routers typically make per-query routing decisions based primarily on model quality and token cost, whereas cloud-edge schedulers often overlook quality differences among deployed models. Consequently, these objectives remain insufficiently coordinated. We present CEMA-Router, an infrastructure-aware batch router for LLM inference in pervasive cloud-edge systems. CEMA-Router formulates batch routing as a multi-objective assignment problem that jointly minimizes model-quality loss, monetary cost, energy consumption, and straggler-dominated batch completion time. To efficiently explore the assignment space, it employs a routing-specific memetic algorithm that combines largest-request-first, load-aware seeding with probabilistic, evaluator-guided Lamarckian repair. Routing decisions are informed by deployment-specific node profiles, dynamic backlog estimates, and model-quality signals. We further implement CEMA-Router as an end-to-end system comprising a request manager, routing service, and profiler, supporting both real cloud-edge deployment and trace-driven simulation. We evaluate the system using RouterBench traces and GSM8K and MMLU workloads on a heterogeneous six-node cloud-edge testbed. Compared with state-of-the-art baselines, CEMA-Router reduces the weighted infrastructure-aware objective by up to 86.3% for GSM8K and 80.5% for MMLU, while reducing energy consumption by up to 33.8% and 19.5% and batch completion time by up to 27.1% and 30.1%, respectively. Quality-oriented baselines remain useful reference points for raw response quality, while CEMA-Router explicitly exposes the stronger deployment policy by jointly accounting for quality, cost, energy, and batch completion time.

Index Terms—LLM inference, cloud-edge system, pervasive systems, routing, memetic algorithm, energy-aware scheduling

I. INTRODUCTION

LLM-backed applications are rapidly transitioning from centralized interactive services toward pervasive deployments that span high-performance cloud GPUs and resource-constrained edge nodes close to users. While this shift offers benefits in wide-area latency reduction and data privacy, it introduces a highly complex routing problem. Existing LLM routers typically focus on model-level quality and token cost.

Figure

Fig. 1. Quality-metric routing vs. multiple-metric routing in the existing six-node deployment. Values are normalized within each metric for readability.

in isolation, abstracting away the real infrastructure. Consequently, they fail to account for critical deployment constraints such as hardware resource utilization, node-level queuing delay, network bandwidth, and energy consumption.

To address this gap, this paper introduces CEMA-Router, an infrastructure-aware LLM request routing system formulated as a batch-level assignment problem. Rather than making myopic, per-query decisions, CEMA-Router jointly routes short batches of requests. It optimizes a comprehensive multi-objective function encompassing profiled quality loss, explicit monetary cost, energy consumption, and batch completion time. To solve this NP-hard assignment efficiently online, we design a customized Memetic Algorithm (MA) equipped with continuous-batching queue models and a lightweight Retrieval-Augmented Generation (RAG) quality predictor.

The term infrastructure-aware captures the vital interaction between model capability and node capacity: the most accurate model becomes the wrong target if its hosting node is a bottleneck, or if another endpoint provides a superior latency-energy trade-off. A multiple-metric objective significantly improves the overall operational efficiency, whereas conventional quality-metric routing incurs latency and energy penalties to achieve only marginal raw quality gains (Fig. 1).

Also, to mitigate inference contention, Fig. 2 reports a micro-benchmark validating our batch-level intuition. When requests are routed independently, multiple queries often crowd the same locally attractive endpoint, causing severe queuing delays. However, joint batch routing orchestrates globally and jointly assigns query batches and reduces average makespan by 57.3%.

We ask whether a deployable LLM router can leverage dynamic node states and RAG-based quality profiles to produce superior cloud-edge assignments while maintaining sub-second decision overhead. To answer this, we evalu-

∗^{*}Corresponding author

Emails: wangxijia99@gmail.com, tianzhang.he@monash.edu, mohammad.goudarzi@monash.edu.

Figure

Fig. 2. Per query vs batch LLM routing.

ate CEMA-Router through a synthesis of controlled Router-Bench [1] traces and a real six-node cloud-edge testbed running GSM8K [2] and MMLU [3] workloads. This methodology isolates algorithmic performance while validating the end-to-end request management and profiling paths.

The main contributions are:

• We formulate the LLM inference routing problem as a multi-objective optimization problem that jointly considers inference quality, monetary cost, energy consumption, and response latency, incorporating a FIFO queuing model to capture realistic request scheduling delays in cloud-edge environments.

• We design a customized Memetic Algorithm-based routing framework that modifies the MA pipeline for cloud-edge LLM serving through routing-aware chromosome encoding, mixed heuristic-random initialization, analytical multi-objective fitness evaluation, probabilistic Lamarckian crossover, and domain-specific local search operators including worst-gene repair and 2-opt swap.

• We develop a RAG-based quality prediction module that estimates request-model quality from similar historical prompts using sentence-transformer embeddings and FAISS indexing, avoiding trial inference or task-specific predictor training during routing, allowing quality to be combined with real-time infrastructure metrics.

• An evaluation using RouterBench traces and real GSM8K/MMLU workloads on a six-node cloud-edge deployment, showing that CEMA-Router reduces the weighted infrastructure-aware objective relative to UniRoute and simple deployment policies while exposing the quality–infrastructure trade-off.

References (38)