DARPAN: Controllability-Aware Residual Filtering for Pretrained Physical Control

Anany Pratap Gupta, Ye Zhou, Qi LiNeurIPS 2026

TL;DR

When AI controllers deployed in physical systems—like building HVAC networks or power grids—encounter unexpected conditions, updating them blindly on raw prediction errors causes them to overreact to uncontrollable events like sudden weather shifts. DARPAN solves this by filtering errors so the controller only learns from actionable problems (like a weakening heater), updating tiny, swappable "adapter" modules while keeping the main pretrained AI safely frozen. It’s a fast, lightweight way to keep physical AI resilient as real-world hardware ages and drifts.

What Problem Does This Paper Address?

Imagine you’re adjusting the thermostat in an old building. If the room isn't warming up as fast as you expect, two very different things could be happening: either the furnace is wearing out, or someone just threw open a window during a blizzard. If it’s a weak furnace, you should adjust your strategy and push it harder. If it’s a freak gust of wind, rewriting your entire mental model of how the furnace works is a terrible idea.

In physical control systems (thermal processes, HVAC, power grids), actions take several time steps to show their effects, and safety limits rule out reckless trial-and-error. Recently, researchers have turned to pretrained sequence models like Decision Transformers—which learn control policies offline from historical logs—to avoid expensive online training from scratch.

However, once deployed, real hardware degrades, sensors drift, and seasons change. Full online fine-tuning of these large models is slow, data-hungry, and risks overwriting valuable pretrained instincts. Even if you freeze the main model and only train a lightweight add-on module, a crucial question remains: what signal should it learn from? Raw prediction error mixes hardware faults with external noise. Without separating the two, an AI controller wastes limited real-world data chasing ghosts it cannot control.

Methods

The authors introduce DARPAN (Drift-Aware Residual Policy Adapter Network), which splits deployment into frozen offline knowledge and surgical online updates.

Figure 1: DARPAN overview: residual filtering and adapter selection. A frozen predictor forms a prediction residual from the expected and observed next states. DARPAN filters the residual to keep action-related residual components, summarizes recent filtered residuals into a drift signature, and uses this signature to select or create a lightweight residual adapter.

Offline, DARPAN trains and freezes three standard-to-novel components:

  1. Base Policy (Standard): A Decision Transformer that looks at recent states, actions, and target returns to output a default control action.
  2. Short-Horizon Predictor: A separate model that predicts the expected next state given the current state and base action.
  3. Controllability Filter (Novel): Trained in simulation via counterfactuals (varying actions while holding external conditions fixed, and vice versa), this filter scores each dimension of a prediction error on how strongly it relates to the controller's actions, masking out exogenous noise.
Figure 2: DARPAN deployment and adapter update. The frozen predictor produces a raw residual between the predicted and observed next state. The controllability filter keeps only the residual dimensions that are useful for control. A short history from t −H + 1 to t is averaged into a drift signature zt. This signature selects an adapter from the adapter set or creates a new one when the pattern persists. The selected MLP adapter is trained through the frozen predictor using replay-buffer samples and then adds a small correction ∆at to the frozen Decision Transformer action.

During live deployment, DARPAN compares predicted vs. observed states to get a raw residual, passes it through the controllability filter, and averages a short history ($H$ steps) of these filtered residuals into a temporal drift signature.

Using cosine similarity, DARPAN checks a library of tiny MLP residual adapters—each paired with a signature—to find a match. If a familiar fault returns, it reuses the matching adapter to add a small correction ($\Delta a_t$) to the base action. Only if an unfamiliar pattern persists for several consecutive steps does it spawn a new adapter, updating only that active adapter using small replay-buffer batches.

Datasets

DARPAN is evaluated on two simulation environments from the SustainGym benchmark suite, augmented with custom deployment-drift protocols designed by the authors:

  • BuildingEnv: HVAC thermal comfort control tested across actuator wear, stuck valves, delays, sensor bias, and external weather/occupancy spikes, including a 60-day continual sequential drift protocol.
  • CogenEnv: Combined heat-and-power energy dispatch tested under gas turbine degradation, sensor drift, wind shifts, and demand shifts.

Key Insights and Ideas

  • Prediction error $\neq$ learning signal: Knowing your model predicted the next state wrong isn't enough; physical adaptation requires knowing whether changing your action can fix that error.
  • Adapters organize by physics, not labels: During complex compound faults (e.g., actuation delay plus a weak actuator), DARPAN often reuses adapters learned during earlier single-fault phases rather than spawning new ones. The library naturally indexes reusable correction patterns in residual space without ever seeing fault names.
  • Memory prevents thrashing: Using a single global adapter fails (dropping recovery from 31.7% to 8.4%) because new faults overwrite old fixes. Conversely, skipping the temporal history causes one-step noise to bloat the adapter library from 9 to 26 modules.

Key Results

  • Superior recovery with tiny footprint: Under deployment drift, DARPAN recovers 31.7 $\pm$ 1.1% of the comfort-penalty gap on BuildingEnv using just 142 online trainable parameters (63% fewer than Online-head DT's 390 parameters at 20.1% recovery, while full online Decision Transformer fine-tuning updates 387,503 parameters and degrades performance by -8.7%). On CogenEnv, DARPAN leads with 28.5 $\pm$ 1.4% recovery using 495 parameters.
  • Immunity to false alarms: In disturbance-only phases (weather, occupancy, and noise shifts with no hardware faults), an unfiltered raw-residual baseline panicked and created 30.60 unnecessary adapters. DARPAN created just 1.20, cutting false creations by 96%.
  • Zero-shot mechanism generalization: In leave-one-mechanism-out tests on CogenEnv, holding out unseen drift mechanisms like wind shifts or turbine degradation barely budged active-fault recovery (38.4% full catalog vs. 37.2% held out), avoiding false updates on over 95% of exogenous timesteps.

Limitations and Future Work

DARPAN relies heavily on having a trustworthy controllability filter. In BuildingEnv, training this filter required resetting a simulator to run clean counterfactuals, while CogenEnv required labeled fault-to-dimension trajectories because its ONNX interface lacked counterfactual reset capabilities. Real-world facilities rarely offer pristine simulators or exhaustive fault catalogs. Future work aims to learn controllability filters directly from logged historical interventions, incorporate uncertainty-aware state predictors, and develop smarter adapter-pruning and management strategies for multi-year deployments.

Summary updated

Abstract

Physical control systems, such as building HVAC systems, thermal processes, and power-grid assets, often involve delayed dynamics, safety constraints, and costly online interaction. Because the effect of a control action may appear after several time steps, effective control often requires reasoning over histories of states, actions, and outcomes. Pretrained sequence controllers, such as Decision Transformers, provide a natural way to model this history-dependent control problem by learning policies from offline trajectories, reducing the need for expensive online retraining. However, their performance can degrade when deployment conditions differ from the training data. In building control, for example, actuator wear, sensor drift, occupancy changes, and weather variation can all affect the observed response of the system to the same control action. Online adaptation is therefore needed, but raw prediction error is not always a reliable signal for updating the controller. The key challenge is to identify which part of the observed mismatch is action-sensitive and should guide policy adaptation. To address this challenge, we propose DARPAN, a Drift-Aware Residual Policy Adapter Network for pretrained physical control. DARPAN keeps the pretrained Decision Transformer frozen and performs online adaptation only through lightweight residual adapters, preserving the offline policy and limiting the number of trainable parameters. Instead of updating from raw prediction error, DARPAN uses a controllability filter trained in simulation to extract the action-sensitive part of the residual and filter out mismatch that is weakly related to the controller's actions. During deployment, a frozen predictor estimates the next state, the controllability filter produces a filtered residual, and a short history of filtered residuals forms a drift signature. This signature is used to select an existing adapter or create a new one when a persistent drift pattern appears. We benchmark DARPAN on SustainGym under actuator faults, sensor drift, delays, and external disturbances. In the building control environment (BuildingEnv), DARPAN reduces drift-induced performance loss by $31.7 \pm 1.1\%$ and uses $63\%$ fewer online parameters than Online-head DT. We release our code and experiment configurations at https://huggingface.co/ananypratap007/DARPAN2026.
BibTeX
@inproceedings{gupta2026darpan,
  author = {Anany Pratap Gupta and Ye Zhou and Qi Li},
  title = {{DARPAN: Controllability-Aware Residual Filtering for Pretrained Physical Control}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=QENhKkAMiO},
}
Figure