Prefetching Specialist Policies Ahead of Environmental Drift

A robot whose environment slowly changes (a heavier payload, a gust of wind, a slicker floor) often does best when it switches to a controller specialized for the new conditions. On real edge hardware, though, switching is not free. The specialist's weights must be read from storage, copied into accelerator memory and prepared before they can run. On embedded GPUs this "cold start" can be one to two orders of magnitude slower than a normal forward pass. Research on adapting to changing environments ignores this cost and treats a policy switch as instantaneous. Research on model loading hides the cost by predicting which model will be needed next, but it predicts from request logs and hand-written rules, not from the physics the agent is experiencing.

This note proposes to join the two using a signal that adaptive agents already compute. Many agents facing changing dynamics infer a small latent "context" vector that summarizes the current conditions from the last few observations. We propose to forecast where that vector is heading and use the forecast to decide which specialist to load into memory, and when, early enough that it is ready by the time conditions arrive. A small, always-resident generalist keeps acting while the load happens, so the control loop never stalls. In two sentences: the agent's own estimate of changing physics tells the memory system what to fetch next, and a resident fallback turns the loading delay from a freeze into a short stretch of slightly worse control. The research question is when this beats the obvious alternatives, and the design is built so that a negative answer is informative.

Core Claim

The claim has two parts. The first is that a learned, forecast latent context is a better prefetch signal for control than the signals used in systems work. ScaleSim prefetches agents' private adapters using an "invocation distance" that developers must hand-define. WarmServe prewarms models using a seasonal predictor of request bursts. Neither signal exists for physical drift that has no calendar, such as an Ornstein–Uhlenbeck mass process (a random drift that wanders but is pulled back toward a mean). The second part is quantitative: prefetching only helps when the forecast horizon and the time the environment stays in a regime both exceed the specialist's load latency. This predicts a crossover that we can measure. Below it, a single generalist or on-demand loading should be just as good. Above it, the gap should grow with load latency.

For a specialist $k$ with measured load latency $L_k$, the controller scores

$$ s_k(t) = \Pr\big(\hat{c}_{t+L_k} \in \mathcal{C}_k\big)\,\hat{\Delta}_k - \kappa\, e_k(t), $$

where $\hat{c}_{t+L_k}$ is the forecast latent context at the moment the load would finish, and $\mathcal{C}_k$ is the region of context space where specialist $k$ outperforms the generalist. $\hat{\Delta}_k$ is that specialist's estimated per-step return advantage over the generalist. $e_k(t)$ is the expected loss from evicting whatever specialist the load would displace, and $\kappa$ trades the two off. Loading is asynchronous and happens under a fixed memory budget. The resident generalist acts until the specialist is ready, so a mistaken load costs memory and bandwidth, never a frozen actuator.

Research Program

The system has four pieces, and each one reuses an existing technique.

The context encoder follows Ada-Diffuser. That work infers time-varying latent environment factors from short observation windows, proves identifiability from four consecutive observations, and reports linear-probe $R^2$ of 0.86 to 0.93 against ground-truth factors. Ada-Diffuser keeps one planner permanently in memory and never forecasts the latent. We add a small forecaster over the latent trajectory, trained on the same rollouts, which outputs a distribution over $\hat{c}_{t+h}$ for horizons matched to measured load latencies.

The specialist library takes its storage idea from parameter isolation. Continual World found that PackNet, which isolates a separate sub-network per task, reached the best average success, 0.80, but needed task IDs at evaluation. Here the context forecaster supplies the "task ID" implicitly. Specialists are generalist-plus-adapter models fine-tuned on regions of context space. We vary adapter size from small low-rank modules up to full diffusion-policy copies, which lets us map how the benefit depends on load latency rather than assume a single operating point.

The loader reuses cold-start engineering from NNV12. That system caches weights after their layout transformation and pipelines reading with transformation on edge devices. Using it means our latency numbers reflect a well-engineered loader, not a naive one. The controller implements the score above under a memory budget.

The generalist fallback is the context-conditioned policy itself. This matters because Balancing Plasticity and Stability with Fast and Slow Successor Features shows that under gradual drift, keeping the policy stable matters more than making it easy to change. It also shows that resetting weights for plasticity collapses on severe Humanoid mass drift. Our design never retrains the resident network online. All adaptation happens by selecting specialists, which is consistent with that finding.

Hardware is an embedded GPU of the Jetson class and a mobile CPU, the platforms on which NNV12 measured cold inference 1.5× to 443× slower than warm. We also run a scaled-latency emulation mode that injects measured latency profiles. This lets us sweep $L_k$ beyond what the physical hardware produces.

Baselines

The naive reference is on-demand loading: the agent detects a change, stops, loads the matching specialist, and resumes. Following STAR, a change is detected when accumulated prediction error crosses a threshold. STAR matched the scores of constant re-learning with 94% fewer model operations, but only in tabular Rock-Paper-Scissors, where loading costs nothing. We run it with the same library, loader and memory budget as our method, and tune its surprise threshold with the same number of trials as our $\kappa$. We also run a variant that keeps the generalist acting during the load, so that the only difference from our method is detection after the fact versus forecasting.

The strongest competitor on the adaptation side is a single, well-tuned, context-conditioned generalist with no library. This is Ada-Diffuser itself, which reports a Cheetah-Wind reward of −68.9 versus −120.4 for a vanilla Diffuser (Ada-Diffuser). It is the strongest competitor because it avoids switching entirely and already adapts to wind through its latent. It gets the full memory budget, which lets it be larger than our resident generalist, and the same training compute as our generalist plus all specialists combined. Beating it means higher return on drift schedules that leave its training range, with no loss inside that range.

The strongest competitor on the systems side is a prefetcher that has the same library and memory but different signals. We test three: a WarmServe-style seasonal predictor fit to the context history; a ScaleSim-style hand-crafted distance (Euclidean distance from the current inferred context to each specialist's region, with no forecast); and least-recently-used eviction. For reference, WarmServe reports an 82% prewarming hit ratio with 92.7% burst-prediction accuracy on Azure LLM traces, and ScaleSim reports up to 1.74× speedup over SGLang. These results come from text-serving domains and do not transfer as numbers, only as designs. Beating these baselines means a higher prefetch hit ratio and higher return at equal memory.

The upper bound is an oracle that knows future ground-truth contexts, together with an all-resident configuration whenever the library fits in memory.

The ablation that isolates the key ingredient keeps our full system but replaces the forecast $\hat{c}_{t+L_k}$ with the current $\hat{c}_t$. If this ablation matches the full system, forecasting adds nothing and the contribution reduces to "use the latent as a distance," which is only a modest step beyond ScaleSim.

Why not just…?

Why not just keep every specialist resident in GPU memory? For small MLP policies on MuJoCo this is the right answer, and we say so: load latency is negligible there and the proposal has nothing to add. The idea only matters when specialists are large relative to memory, for example diffusion planners or manipulation policies on embedded boards. In that setting, WarmServe found that static sharing chokes capacity (2.5× the throughput of MuxServe). The experiments report the memory-to-library-size ratio at which all-resident stops being feasible. Results are only claimed beyond that ratio.

Why not just train one context-conditioned policy and never switch? This is the most serious threat. In the parametric drift used by Ada-Diffuser, one policy may well suffice. The evidence against it concerns breadth and extrapolation. Multi-headed SAC falls from 85% on MT10 to 40% on MT50 (Meta-World), and context-conditioned agents in CARL crash when gravity goes out of range. We therefore test drift schedules that stay inside and that leave the generalist's training range, separately. If the generalist wins inside the range and loses outside it, the library is justified only for out-of-range regimes, and we will report it that way.

Why not just use tiny adapters so loading is instant? If small adapters recover most of the specialists' advantage, the loading problem disappears and a simple on-demand policy wins. The adapter-size sweep tests exactly this. It measures return advantage $\hat{\Delta}_k$ against load latency $L_k$ across sizes. A clear result that small adapters suffice would be a useful negative finding, and would redirect the work toward adapter design.

Why not just react to surprise, the way STAR does? Reacting after the fact is optimal when regimes are abrupt and cannot be forecast, because there is nothing to anticipate. Forecasting can only win under gradual drift. The drift-type comparison below is designed to show where each approach wins.

Proposed Experiments

The environments are the non-stationary DeepMind Control mass-drift tasks from Fast and Slow Successor Features, with sine, non-periodic and Ornstein–Uhlenbeck drift at mild, moderate and severe levels. That paper reports no scalar reward for its strongest configuration, so no reported result was found on Lacuna for Humanoid severe drift. We add Ada-Diffuser's Cheetah-Wind and LIBERO-10 settings, with larger diffusion policies so that load latency is real, and CARL tasks run under scheduled context trajectories, including out-of-range segments. Metrics are episode return, the fraction of control steps in which a suitable specialist was active, prefetch hit ratio, bytes moved, peak memory, and control-deadline misses. The last metric is mainly there to verify that the fallback removes stalls entirely.

Three decisive checks follow. The first is a sweep of $L_k$ against the time spent in each regime. The prediction is that the gap between our method and reactive loading is zero while $L_k$ is small relative to both the forecast horizon and the regime dwell time, and grows beyond that point. A flat curve would falsify the core claim. The second is the drift-type split. Under sine drift, the seasonal predictor should roughly match our forecaster. Under OU and non-periodic drift, our forecaster should beat it, and the forecast-versus-current ablation should show that the gain comes from looking ahead. The third is the out-of-range test against the single generalist, which decides whether a specialist library is worth having at all.