arXiv:2610.22172cs.DCOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.22172

Efficient KV Cache Migration for Geo-Distributed LLM Inference in Collaborative Edge Computing

Mingjin Zhang, Jiannong Cao, Tao Wu, Xiangchun Chen, Ne Wang

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

Mingjin Zhang§, Jiannong Cao§, Tao Wu†, Xiangchun Chen§, Ne Wang‡

§The Hong Kong Polytechnic University, †National University of Defense Technology, ‡Wuhan University

§{csmzhang, csjcao, csxcchen}@comp.polyu.edu.hk, †wutao20@nudt.edu.cn, ‡ne.wang@whu.edu.cn

Abstract—Large Language Models (LLMs) have shown exceptional capabilities but rely heavily on centralized cloud GPU clusters, leading to high bandwidth costs, latency, and privacy issues. Edge computing offers a solution by deploying LLMs closer to users on edge servers, yet single edge servers often cannot meet LLMs' heavy computational demands. Collaborative Edge Computing (CEC) address this challenge by integrating resources of multiple geo-distributed heterogeneous edge servers, which jointly host small model shards and associated Key-Value (KV) cache for distributed inference. However, edge servers may disconnect or easily become overloaded, making it essential to migrate stateful KV cache to other servers for ensuring continuous service. Existing cloud-based KV cache management methods, such as direct cross-GPUs transmission and recomputation from input tokens are ill-suited for bandwidth-constrained and resource-limited edge environments. In this work, we propose EdgeFlow, a novel hybrid KV cache migration scheme that integrates direct KV cache transmission with activation-based recomputation, leveraging parallel computation and communication to minimize migration time. On this basis, we formulate a multi-node KV migration optimization problem and design a 2-approximation algorithm based on improved linear programming relaxation and bipartite graph techniques. Extensive experiments on a real-world distributed LLM inference platform demonstrate that EdgeFlow reduces migration time by up to 45%, significantly enhancing the robustness and efficiency of distributed LLM inference in collaborative edge environments.

Index Terms—Edge Computing, LLM Inference, KV Cache

I. INTRODUCTION

Large Language Models (LLMs) have demonstrated remarkable capabilities across diverse domains, including natural language processing, creative content generation, and intelligent assistants [1], [2]. Their widespread adoption promises significant societal and economic benefits. However, current LLM inference predominantly relies on centralized cloud infrastructures with powerful, dedicated GPU clusters, leading to high bandwidth cost, long response time, and privacy concerns [3]. Edge computing is a promising solution to address these issues by deploying LLMs at the network edge (e.g., personal workstations, edge servers, community clusters) [4], [5]. However, LLMs are computation-intensive and resource-greedy, while edge servers are usually with limited resources.

To overcome this challenge, collaborative edge computing (CEC) has emerged as a promising paradigm. It integrates geographically distributed, often underutilized computational resources at the network edge (e.g., personal workstations, edge servers, community clusters), enabling efficient distributed processing of complex tasks [6], [7]. As shown

Figure

Fig. 1. CEC-enabled distributed LLM inference. Each edge server in different regions holds a LLM shard and its associated KV cache to perform collaborative inference. KV cache migration is essential when hosting servers are overloaded or plan to exit the edge network.

in Fig. 1, CEC-enable distributed LLM inference involves partitioning the LLM into smaller, manageable shards and distributing these shards across participating edge servers at different geographical regions. Each server executes inference for its assigned shard(s), collaboratively generating the model's output [8]–[11]. This is a new paradigm of LLM inference. This approach offers compelling advantages: leveraging ubiquitous computational resources, reducing reliance on centralized clouds, and potentially lowering latency for geographically dispersed users. Pioneering projects like Petals [12], [13] and PolyLink [14] have connected hundreds of consumer-grade edge GPUs over decentralized networks to allow multiple users to collaboratively perform LLM inference and finetuning, which demonstrated the feasibility of this concept.

Despite potential, CEC-enabled distributed LLM inference introduces new system-level challenges. First, edge servers are heterogeneous and with relatively limited resources. When serving large amount of requests, some servers may easily become overloaded. Second, users may plan to disconnect the server from the network. In such scenarios, the Key-Value (KV) cache hosted on servers must be migrated to other servers to restore and ensure continuous inference service, as it accumulates contextual information during the generation of each token [15]. Managing the KV cache and minimizing the migration time to achieve fast service recovery is essential in

CEC-enabled distributed LLM inference.

This is a novel new problem. Existing solutions for managing KV cache primarily target centralized cloud environments: 1) cross-GPUs transmission, such as Llumnix [16] and Mell [17]. These works directly transfer/copy KV cache among GPUs via high-bandwidth NvLinks or PCIs to achieve workload balance and inference acceleration. 2) KV Offloading. It moves parts of the KV cache from GPU memory to slower storage (e.g., CPU RAM or SSD) to free up GPU resources [18]–[20]. However, these two methods directly transfer large KV cache, which may incur prohibitive communication overhead between edge servers in typical resource-constrained, heterogeneous, and bandwidth-limited edge networks [3]. 3) Token-based Recomputation. Other works [21], [22] tend to recompute KV cache from the original and historical tokens. While this reduces memory footprint, token recomputation involves computation-intensive prefill phase. This approach is often infeasible for consumer-grade GPUs on edge servers, which lack the powerful computational resources for frequent, costly recomputation.

In this paper, we propose an efficient Hybrid KV Cache Migration scheme, named EdgeFlow, to reduce the KV Cache migration time. Rather than directly transmitting the KV Cache, we find that KV Cache can also be re-computed from the smaller intermediate activations of the transformer layer, as shown in Sec. II-B. Compared to direct KV cache transmission, activation-based KV cache recomputation transmits less amount of data, but introduces additional computation overhead. Motivated by this, EdgeFlow tends to enjoy the benefits of both approaches, adaptively deciding the ratio of activation-based KV cache recomputation and the direct KV cache transmission among different LLM transformer layers. EdgeFlow makes full use of computational and communication resources by parallel processing, overlapping the computation and communication pipeline for quick KV Cache migration and distributed LLM inference recovery.

After proving the competitive advantage, we mathematically formulate a Multi-Node hybrid KV Cache Migration (MN-KVM) problem, considering that multiple edge servers may exist in the CEC environment. The problem aims to minimize the migration time of K overloaded edge servers subject to the resource constraints. It has the exponential search space and show great difficulty with coupled variables, which is shown to be NP-Hard. Through problem decomposition and LP relaxation with special modification, we design an 2-approximation ratio algorithm with O(log⁡K+log⁡Tmax)O(\log K + \log T_{max}) computational complexity. Extensive experiments in a real-world geo-distributed LLM inference platform under various situations show that EdgeFlow outperforms baselines and can reduce up to 45% migration time.

The primary contributions of this work are:

  • To the best of our knowledge, this is the first work to propose a hybrid KV cache migration strategy specifically designed for geo-distributed collaborative LLM inference, adapting to heterogeneous computing resources and bandwidth in the edge environment.

Figure

Fig. 2. Transformer architecture and KV cache.

  • After proving the superiority of our scheme, we formulate the optimization problem of multi-node hybrid KV cache migration, to minimize the migration time for quick system recovery. An efficient and effective algorithm is designed based on the LP-relaxation and bipartite graph construction, which ensures the 2-approximation ratio.

  • We implement Edgeflow within a real-world distributed LLM inference platform, which integrates dozen of heterogeneous GPUs from several major universities across a large geographical areas. Extensive experimental results demonstrate that Edgeflow significantly reduces migration time compared to direct KV cache transmission and pure KV recomputation.

References (44)