E2LLM Cuts Edge AI Waiting Time in Half on Messy Real-World Hardware
E2LLM uses genetic algorithms and dynamic programming to run full LLMs across heterogeneous edge devices, cutting wait times by over 50% versus Splitwise
Takeaways
- E2LLM is a new framework for serving LLMs across heterogeneous edge/fog devices that cannot individually host a full model.
- It replicates the full model across multiple device groups, assigning each replica a dedicated PREFILL or DECODE role to exploit their computational differences.
- A Genetic Algorithm forms optimal device clusters, while Dynamic Programming determines the best layer-partition within each cluster.
- Compared to the Splitwise baseline, E2LLM cuts average waiting time by over 50% under high-demand conditions.
- The system handles variable workloads with fluctuating input/output token lengths robustly, unlike static partitioning schemes.
- No code is publicly released yet; the paper is available at arxiv.org/abs/2606.03770.
Running a large language model on a single powerful GPU is the comfortable default. But what happens when you need inference at the edge -- on a hospital floor, a factory line, or a smart city node -- where no single device has enough memory to hold the model? A new paper introduces E2LLM, a serving framework that tackles this exact problem by intelligently distributing LLMs across fleets of heterogeneous, resource-constrained edge and fog devices.
The Two-Phase Problem Nobody Talks About at the Edge
To understand why this is hard, you need to understand how LLM inference actually works. It has two phases: prefill (processing input tokens in parallel to build the KV cache) and decode (generating output tokens one at a time). These two phases have fundamentally different computational personalities.
In prefill, the model processes all prompt tokens in parallel to generate the first output token and is typically compute-bound due to large matrix multiplications. In decode, it generates subsequent tokens sequentially, becoming memory-bandwidth-bound because of smaller matrix multiplications and frequent parameter and KV-cache accesses. Forcing both phases onto the same hardware is an inherent mismatch -- and on edge devices with tight memory and compute budgets, that mismatch is even more painful.
When prefill and decode are co-located on the same GPUs, prefill requests can monopolize GPU execution and delay decode steps, directly inflating both time-to-first-token (TTFT) and time-per-output-token (TPOT). Cloud-scale systems like Splitwise and DistServe have addressed this by disaggregating the two phases onto separate, high-end GPU clusters. But those solutions assume homogeneous, well-provisioned hardware -- an assumption that breaks down completely at the edge.

Edge and Fog: A Different Beast
The core tension is that LLMs are massive and computationally intensive, while edge devices are resource-constrained in terms of power, memory, and processing capabilities. LLMs based on the Transformer architecture are inherently unsuitable for edge computing in their original, full-sized form.
Edge resources differ from cloud resources in several ways: they are resource constrained, meaning they have fewer computational capabilities due to edge devices' smaller processors and lower power budgets; they are heterogeneous, meaning that different processors use different configurations; and their workloads adjustment and applications fight for them. A fog layer sits between these edge nodes and the cloud -- bringing the substantial computational capabilities of central instances closer to consumers in a distributed fashion, lowering latency and optimizing network resources.
Conventional approaches typically assume that an entire model can be hosted on a single device, which does not hold in many real-world scenarios, particularly in Edge and Fog environments where device resources are constrained. Prior work mostly dealt with this by naively splitting a single model across all available devices -- which creates severe bottlenecks when one slow device stalls the entire pipeline.
What E2LLM Actually Does
Rather than simply partitioning a single model across all available devices, E2LLM replicates the full model across multiple groups of devices (replicas) and applies model parallelism within each replica. Each replica is assigned a specialized role -- PREFILL or DECODER -- based on its efficiency in handling input and output tokens. This is the key insight: instead of one big pipeline, you get a fleet of specialized replicas, each optimized for what it does best.
The system has two major algorithmic components working in concert:
- Genetic Algorithm for cluster formation: E2LLM utilizes a Genetic Algorithm to form clusters that maximize system performance. A genetic algorithm (GA) is an optimization technique inspired by natural selection -- it evolves a population of candidate device groupings over many generations, keeping the best-performing configurations and discarding the rest. This is used to figure out which physical devices should form each replica group.
- Dynamic Programming for layer partitioning: Within each cluster, E2LLM applies Dynamic Programming to determine an optimal partitioning strategy that minimizes bottlenecks in model-parallel execution. Dynamic programming (DP) here means exhaustively solving the sub-problem of how to split transformer layers across the devices in a group, guaranteeing the optimal split rather than just a heuristic one.

The combination is deliberate. The GA handles the combinatorially explosive outer problem (which devices go together?) while DP handles the inner problem (how do we partition layers within a group?) exactly. Neither algorithm alone would be sufficient -- GA without DP would produce clusters with poor internal partitioning, and DP without GA would be computationally intractable across all possible device groupings.
How the Pipeline Flows
Here is the step-by-step flow of a request through E2LLM:
- A user request arrives at a load balancer sitting in front of the replica fleet.
- The load balancer routes the request to an available PREFILL replica -- a group of edge/fog devices that has been identified by the GA as well-suited for compute-intensive work.
- The PREFILL replica processes the input prompt in parallel across its devices (model parallelism), building the KV cache. The DP-derived layer partition ensures no single device becomes a bottleneck.
- The KV cache is transferred to a DECODE replica -- a separate group optimized for memory-bandwidth-intensive sequential generation.
- The DECODE replica generates output tokens autoregressively and streams results back to the user.
- Both replica types can serve requests concurrently, so the system scales with load by adding more replicas rather than enlarging a single pipeline.
This separation means PREFILL replicas can be tuned for high compute throughput while DECODE replicas are tuned for low memory latency -- matching the hardware profile of each device type to the phase it handles.
Results and What They Mean
Experimental results demonstrate that the approach adapts robustly to varying workloads, including scenarios with significant variation in input and output token lengths. Compared to the Splitwise baseline, E2LLM reduces average waiting time by over 50% under high-demand conditions.
That 50%+ reduction in wait time is not just a benchmark number -- it is the difference between a usable real-time application and one that frustrates users. Splitwise and DistServe, which were seminal papers on the topic, showed 2-7X throughput improvement by using prefill-decode disaggregation in cloud settings. E2LLM brings that same architectural philosophy down to the edge, where the hardware is far messier and the optimization problem is significantly harder.
The framework also handles workload variability well -- a critical property for real deployments where prompt lengths and output lengths fluctuate wildly. Static partitioning schemes break under this kind of variance; E2LLM's dynamic assignment of replicas to roles absorbs it.
When Should You Use This?
E2LLM is most relevant when:
- You need LLM inference without cloud dependency -- for privacy, latency, or connectivity reasons.
- Your hardware fleet is heterogeneous -- a mix of devices with different CPUs, GPUs, memory sizes, and network speeds.
- No single device can hold the full model in memory, so model parallelism is unavoidable.
- You are operating in smart city, industrial IoT, healthcare, or autonomous systems contexts where data must stay local.
- You expect variable workloads with fluctuating input/output token lengths.
It is less suited for homogeneous cloud GPU clusters where simpler disaggregation frameworks like vLLM or SGLang with built-in PD disaggregation already work well. The GA-based cluster formation also implies a non-trivial setup cost -- you need to run the optimization before deployment, which may be impractical for very dynamic device fleets where nodes join and leave frequently.
The Bigger Picture
The real breakthrough here is not just the 50% latency win -- it is the demonstration that prefill-decode disaggregation, a technique that has proven transformative at cloud scale, can be adapted to the chaotic, heterogeneous world of edge computing. Distributed LLM inference lets large language models run across multiple edge devices like smartphones, IoT sensors, and smart cameras. By splitting the model into smaller parts, each device processes specific sections, reducing the need for cloud-based infrastructure and keeping data local.
No code or model weights are released alongside the paper at this time. The work is a research framework with experimental validation, and practitioners looking to deploy it would need to implement the GA and DP components themselves. That said, the algorithmic approach is clearly described and the concepts map directly to existing distributed inference primitives.
As LLM capabilities continue to be demanded in latency-sensitive, privacy-critical environments, frameworks like E2LLM point toward a future where the edge is not a second-class citizen for AI inference -- it is a first-class deployment target with its own purpose-built serving stack.