Wait or Migrate: Attention-Guided Timing for Proactive Edge Service Migration

When a phone or car uses a nearby edge server (a small data center at a cell tower) and then drives out of range, its running service must move to a new server. Today, most systems move it only after the radio handover to the next tower has already happened. The user then sees a latency spike while the service is copied. Moving it earlier, which the field calls "pre-warming," avoids the spike, but only if the system picks the right destination. Pre-warming the wrong server wastes backhaul bandwidth and capacity. The real decision is therefore about timing as much as destination: at each moment, commit to a destination now, or wait for more of the trajectory. This is the same structure as simultaneous speech translation, where a system must choose between emitting a word now and listening to more audio. In that setting, Attention as a Guide for Simultaneous Speech Translation showed that a model's own attention weights tell it when it has heard enough.

We propose to carry that insight over to mobility. A trajectory model scores the currently reachable edge servers directly. We use a pointer mechanism for this: attention whose weights are read as a probability distribution over a variable set of inputs, as in Pointer Networks. The system migrates when two conditions hold. The pointer must be confident about one server, and the model's attention over the trajectory must not be concentrated on the last few, often noisy, position fixes. The claim to be tested is that this attention guard cuts wasted and late migrations beyond what a plain confidence threshold achieves. The comparison is made on the latency-versus-waste tradeoff curve that the timing decision actually traces.

Core Claim

Proactive migration should be evaluated and designed as a commit-or-wait policy rather than a one-shot prediction. The policy's inputs come from a single trained model. At time $t$, a trajectory encoder attends over the user's recent positions and signal readings, and a pointer head produces $p_t(j)$, the probability that server $j$ is the correct next host. The candidate set of servers $j$ changes size as the user moves, and servers without spare CPU, RAM or bandwidth are masked out. Let $A_t(\lambda)$ be the attention mass the pointer places on the most recent $\lambda$ trajectory steps. The policy commits to $j^\star=\arg\max_j p_t(j)$ when

$$\max_j p_t(j) \ge \tau \quad\text{and}\quad A_t(\lambda) \le \alpha,$$

and otherwise waits for the next observation. Here $\tau$ is a confidence threshold and $\alpha$ an attention-mass threshold. Sweeping the two thresholds traces a curve of migration lead time against wasted pre-warms. This is the analogue of the quality-latency curves in simultaneous translation.

The second condition carries the hypothesis. A confident prediction that rests mostly on the latest GPS or signal-strength fix is exactly the case where urban-canyon noise, multipath fading, or a turn that has just begun make it unreliable. Attention as a Guide for Simultaneous Speech Translation found that heavy attention on the newest frames signals "not ready." It also found that attention maps contain artifacts, a spurious spike on the final frame and strong layer dependence, which had to be filtered. We inherit that caution. Choosing which layer and which window $\lambda$ to read is part of the method, not an afterthought.

Relation to Prior Work

Three systems motivate the work by leaving the timing question open. Coordinated Container Migration and Base Station Handover in Mobile Edge Computing synchronizes container migration with the handover and picks the destination with a multidimensional knapsack solver. It explicitly names trajectory prediction and pre-warming as future work. We reuse its checkpoint-based migration machinery and its capacity constraints, which become our masks, but move the decision earlier. Mobility-aware Seamless Service Migration and Resource Allocation in Multi-edge IoV Systems, or SR-CL, splits the problem into discrete migration choices made by an actor-critic reinforcement learning agent and continuous CPU and bandwidth shares solved in closed form. Its agent sees single-step state vectors with no attention over trajectory history. We keep its closed-form resource step unchanged, so that any difference comes from the migration decision alone. GAPO is the closest use of attention in this area. It uses graph attention over vehicles and roadside units to capture multi-hop congestion for task offloading on a simulated highway. Its attention looks at the current snapshot rather than the trajectory, and it does not model stateful migration. We attend over time rather than over the network graph.

Pointer Networks supplies the output mechanism. It suits a candidate set whose size changes, and it extrapolated well to larger inputs on geometric problems. Its known weakness is that it needs optimal labels, which are intractable to compute for NP-hard problems. That weakness mostly disappears here, because the true next serving server is simply observed in mobility traces, so the model can be trained by plain supervision. Its other weakness, ignorance of hard constraints, is handled by masking servers that lack capacity. This is a design choice the paper itself anticipates.

Research Program

We will build the trajectory encoder and pointer model and train it on next-server labels derived from real traces. We will then study the attention signal before trusting it. That study measures which layer and which window $\lambda$ carry information about prediction errors, and whether a spike on the final step appears regardless of content, as in speech. The policy runs on top of the trained model with no further training, and we sweep $(\tau,\alpha)$ to obtain tradeoff curves. The main analysis asks a narrow question: conditional on pointer confidence, does $A_t(\lambda)$ still predict whether a commit will turn out wrong? If it does not, the attention guard adds nothing. The contribution then reduces to "confidence-timed pointer migration," which we would report as such.

Baselines

The naive reference point is the reactive Nearest policy from Coordinated Container Migration and Base Station Handover in Mobile Edge Computing. It migrates to the nearest server at handover and defines zero lead time. The first strong baseline is that paper's coordinated knapsack method, which reports a 30%–40% reduction in service downtime and a 13%–22% improvement in end-to-end delay over Nearest on its wide-area-network Linux testbed. We will rerun it on the same testbed with the same Openface, Yolo and counter workloads. Beating it means lower downtime at equal or lower backhaul bytes.

The strongest learned competitor is SR-CL (Mobility-aware Seamless Service Migration and Resource Allocation in Multi-edge IoV Systems). It reports a 3.63%–36.15% reduction in total system delay over competing methods, and decision times under 1 ms for 220 vehicles, on the Rome taxi traces in Simu5G. The file gives no absolute downtime or wasted-migration numbers for it, so those must be measured by us. We will retrain it on our trace split with the same number of environment interactions and hyperparameter trials as our model. It will use the same closed-form resource step and the same simulator. Beating it means a curve that dominates its operating point: lower total delay at no more wasted migrations, within its sub-millisecond decision budget.

A predictor baseline replaces our encoder with an LSTM, a recurrent network that compresses the history into a fixed vector, and adds a softmax over masked candidates and the same confidence threshold. We give it the same tuning budget. We also include a constant-velocity extrapolator as the simplest motion model. The key ablation is our own pointer model with the confidence threshold alone, $\alpha=\infty$. The attention guard succeeds only if the full policy dominates this ablation on the tradeoff curve. An oracle that knows the true next server bounds what timing can achieve.

Why not just…?

Why not just keep reactive or greedy migration? Greedy choices are fast: about 1 ms for 1,000 users in Edge User Allocation with Dynamic Quality of Service. But reacting at handover is precisely what produces the downtime that coordinated migration removed (Coordinated Container Migration and Base Station Handover in Mobile Edge Computing). Reactive migration also has zero lead time by construction, so it cannot pre-warm. It stays in the study as the zero point of every curve.

Why not just solve an exact integer program each step? Exact edge-allocation solvers took about 23 seconds for 500 users in Optimal Edge User Allocation in Edge Computing with Variable Sized Vector Bin Packing. More fundamentally, they need the future position as an input, and the timing question is about how uncertain that position still is. We use exact solutions offline only to check that masked pointer choices respect capacity.

Why not just threshold the confidence of any next-cell predictor? This is the real threat, and we treat it as the main ablation rather than argue around it. A calibrated predictor with a confidence threshold may capture most of the benefit. If attention mass adds no information once confidence is known, we will say so. The LSTM-plus-threshold baseline separately tests whether the pointer and attention encoder matter at all. Evidence from Pointer Networks, where recurrent models failed on variable-sized selection, suggests they will, but that evidence comes from geometric toy problems and does not settle the question here.

Why not just let a reinforcement learning agent learn timing implicitly, as SR-CL does? It can, and SR-CL is our strongest competitor. Our bet is that an explicit wait-or-commit rule with two interpretable thresholds gives a tunable tradeoff without retraining and uses cheap supervised labels. An agent that must discover timing from delayed rewards has neither property. The direct comparison on Rome traces decides it.

Proposed Experiments

The primary setting is the Rome taxi dataset (320 taxis over 30 days), replayed in Simu5G/OMNeT++ on the 25-node cellular topology used by SR-CL. Trajectory days are split into disjoint training and test sets. Migrations are replayed on the wide-area-network Linux testbed, with 50–150 ms emulated delays, to measure real container downtime. As a stress test for topology change, we also run the policy on the Melbourne CBD base-station layout, with Rome-style trajectories mapped onto its street area. Because the users are simulated, results there are reported as a robustness check rather than a headline number.

The metrics are service downtime, end-to-end delay, migration lead time, wasted pre-warms and their backhaul bytes, capacity violations, and decision latency, which must stay under 1 ms. We also inject GPS noise to test the attention-guard hypothesis directly. The guard's advantage over the confidence-only ablation should grow as the noise on recent fixes increases. If it does not, the attention signal is not doing the job we claim for it.